3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc so you may fetch it yourself from your nearest
18 # archive site. Check with Archie if you don't know where that can be.)
21 # $Id: Head.U,v 3.0.1.6 1994/10/29 15:54:19 ram Exp $
23 # Generated on Tue Jan 24 16:22:48 EST 1995 [metaconfig 3.0 PL48]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
60 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
61 paths=$paths:'/usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin'
62 paths=$paths:'/sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb'
63 paths=$paths:'/bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin'
64 paths=$paths:'/etc /usr/lib /usr/ucblib /lib /usr/ccs/lib'
65 paths=$paths:'/sbin /usr/sbin /usr/libexec'
71 *) test -d $p && PATH=$PATH:$p ;;
80 echo "Say 'sh $me', not 'sh <$me'"
84 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
85 if test -f /hp-ux -a -f /bin/ksh; then
86 if (PATH=.; alias -x) >/dev/null 2>&1; then
87 : already under /bin/ksh
90 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
96 : Warn them if they use ksh on other systems
97 (PATH=.; alias -x) >/dev/null 2>&1 && \
99 (I see you are using the Korn shell. Some ksh's blow up on $me,
100 especially on exotic machines. If yours does, try the Bourne shell instead.)
104 : Configure runs within the UU subdirectory
105 test -d UU || mkdir UU
527 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
530 : We must find out about Eunice early
532 if test -f /etc/unixtovms; then
533 eunicefix=/etc/unixtovms
535 if test -f /etc/unixtovms.exe; then
536 eunicefix=/etc/unixtovms.exe
539 : list of known cpp symbols, sorted alphabetically
540 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
541 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
542 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
543 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
544 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
545 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
546 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
547 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
548 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
549 al="$al VMS Xenix286"
550 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
551 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
552 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
553 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
554 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
555 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
556 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
557 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
558 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
559 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
560 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
561 al="$al __SVR4_2__ __UMAXV__"
562 al="$al ____386BSD____ __alpha __alpha__ __amiga"
563 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
564 al="$al __host_mips__"
565 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
566 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
567 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
568 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
569 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
570 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
571 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
572 al="$al __mc88100 __mc88100__ __mips __mips__"
573 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
574 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
575 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
576 al="$al _host_mips _mips _unix"
577 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
578 al="$al apollo ardent att386 att3b"
579 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
580 al="$al cadmus clipper concurrent convex cray ctix"
581 al="$al dmert encore gcos gcx gimpel gould"
582 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
583 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
584 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
585 al="$al i186 i286 i386 i486 i8086"
586 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
587 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
588 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
589 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
590 al="$al mc88000 mc88100 merlin mert mips mvs n16"
591 al="$al ncl_el ncl_mr"
592 al="$al news1500 news1700 news1800 news1900 news3700"
593 al="$al news700 news800 news900 ns16000 ns32000"
594 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
595 al="$al parisc pc532 pdp11 plexus posix pyr"
596 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
597 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
598 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
599 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
600 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
601 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
607 : change the next line if compiling for Xenix/286 on Xenix/386
608 xlibpth='/usr/lib/386 /lib/386'
610 : general looking path for locating libraries
611 glibpth="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
612 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
613 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
615 : Private path used by Configure to find libraries. Its value
616 : is prepended to libpth. This variable takes care of special
617 : machines, like the mips. Usually, it should be empty.
620 : default library list
622 : full support for void wanted by default
625 : set useposix=false in your hint file to disable the POSIX extension.
627 : no include file wanted by default
630 : List of libraries we want.
631 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
632 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
633 libswanted="$libswanted ucb bsd BSD PW x"
634 : We want to search /usr/shlib before most other libraries.
635 : This is only used by ext/util/extliblist
636 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
637 glibpth="/usr/shlib $glibpth"
638 : Do not use vfork unless overridden by a hint file.
641 : script used to extract .SH files with variable substitutions
644 echo "Doing variable substitutions on .SH files..."
645 if test -f MANIFEST; then
646 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
647 : Pick up possible extension manifests.
648 for dir in ext/* ; do
649 if test -f $dir/MANIFEST; then
650 xxx=`awk '{print $1}' < $dir/MANIFEST |
651 sed -n "/\.SH$/ s@^@$dir/@p"`
652 shlist="$shlist $xxx"
657 echo "(Looking for .SH files under the current directory.)"
658 set x `find . -name "*.SH" -print`
662 0) set x *.SH; shift;;
664 if test ! -f $1; then
670 dir=`expr X$file : 'X\(.*\)/'`
671 file=`expr X$file : 'X.*/\(.*\)'`
672 (cd $dir && . ./$file)
679 if test -f config_h.SH; then
680 if test ! -f config.h; then
681 : oops, they left it out of MANIFEST, probably, so do it anyway.
687 : produce awk script to parse command line options
688 cat >options.awk <<'EOF'
690 optstr = "dD:eEf:hOrsSU:V"; # getopt-style specification
692 len = length(optstr);
693 for (i = 1; i <= len; i++) {
694 c = substr(optstr, i, 1);
695 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
706 if (substr(str, 1, 1) != "-") {
707 printf("'%s'\n", str);
711 for (i = 2; i <= len; i++) {
712 c = substr(str, i, 1);
714 printf("-%s\n", substr(str, i));
720 printf("'%s'\n", substr(str, i + 1));
733 : process the command line options
734 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
739 : set up default values
752 while test $# -gt 0; do
754 -d) shift; fastread=yes;;
755 -e) shift; alldone=cont;;
759 if test -r "$1"; then
762 echo "$me: cannot read config file $1." >&2
767 -h) shift; error=true;;
768 -r) shift; reuseval=true;;
769 -s) shift; silent=true;;
770 -E) shift; alldone=exit;;
771 -O) shift; override=true;;
772 -S) shift; extractsh=true;;
777 echo "$me: use '-U symbol=', not '-D symbol='." >&2
778 echo "$me: ignoring -D $1" >&2
781 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> $optdef;;
782 *) echo "$1='define'" >> $optdef;;
789 *=) echo "$1" >> $optdef;;
791 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
792 echo "$me: ignoring -U $1" >&2
794 *) echo "$1='undef'" >> $optdef;;
798 -V) echo "$me generated by metaconfig 3.0 PL48." >&2
801 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
809 Usage: $me [-dehrEOSV] [-f config.sh] [-D symbol] [-D symbol=value]
810 [-U symbol] [-U symbol=]
811 -d : use defaults for all answers.
812 -e : go on without questioning past the production of config.sh.
813 -f : specify an alternate default configuration file.
814 -h : print this help message and exit (with an error status).
815 -r : reuse C symbols value if possible (skips costly nm extraction).
816 -s : silent mode, only echoes questions and essential information.
817 -D : define symbol to have some value:
818 -D symbol symbol gets the value 'define'
819 -D symbol=value symbol gets the value 'value'
820 -E : stop at the end of questions, after having produced config.sh.
821 -O : let -D and -U override definitions from loaded configuration file.
822 -S : perform variable substitutions on all .SH files (can mix with -f)
823 -U : undefine symbol:
824 -U symbol symbol gets the value 'undef'
825 -U symbol= symbol gets completely empty
826 -V : print version number and exit (with a zero status).
834 true) exec 1>/dev/null;;
837 : run the defines and the undefines, if any, but leave the file out there...
844 '') config_sh='config.sh'; config='./config.sh';;
845 /*) config="$config_sh";;
846 *) config="./$config_sh";;
849 echo "Fetching answers from $config_sh..."
852 test "$override" && . ./$optdef
864 : Eunice requires " " instead of "", can you believe it
867 echo "Beginning of configuration questions for $package."
869 trap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15
871 : Some greps do not return status, grrr.
872 echo "grimblepritz" >grimble
873 if grep blurfldyick grimble >/dev/null 2>&1 ; then
875 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
881 : the following should work in any shell
885 echo "AGH! Grep doesn't return a status. Attempting remedial action."
886 cat >contains <<'EOSS'
887 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
892 : first determine how to suppress newline on echo command
894 echo "Checking echo to see how to suppress newlines..."
895 (echo "hi there\c" ; echo " ") >.echotmp
896 if $contains c .echotmp >/dev/null 2>&1 ; then
907 echo $n "The star should be here-->$c"
911 : Now test for existence of everything in MANIFEST
913 if test -f ../MANIFEST; then
914 echo "First let's make sure your kit is complete. Checking..." >&4
915 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
917 for filelist in x??; do
918 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
920 if test -s missing; then
924 THIS PACKAGE SEEMS TO BE INCOMPLETE.
926 You have the option of continuing the configuration process, despite the
927 distinct possibility that your kit is damaged, by typing 'y'es. If you
928 do, don't blame me if something goes wrong. I advise you to type 'n'o
929 and contact the author (lwall@netlabs.com).
932 echo $n "Continue? [n] $c" >&4
936 echo "Continuing..." >&4
940 echo "ABORTING..." >&4
945 echo "Looks good..." >&4
948 echo "There is no MANIFEST file. I hope your kit is complete !"
952 : compute the number of columns on the terminal for proper question formatting
957 : set up the echo used in my read
958 myecho="case \"\$xxxm\" in
959 '') echo $n \"\$rp $c\" >&4;;
961 '') echo $n \"[\$xxxm] $c\";;
963 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
965 echo $n \"[\$xxxm] $c\" >&4
967 echo $n \"\$rp [\$xxxm] $c\" >&4
973 : now set up to do reads with possible shell escape and default assignment
979 yes) case "\$dflt" in
982 case "\$silent-\$rp" in
987 *) case "\$silent" in
993 while expr "X\$ans" : "X!" >/dev/null; do
997 aok=''; eval "ans=\"\$answ\"" && aok=y
1002 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1007 echo "(OK, I'll run with -d after this question.)"
1010 echo "*** Sorry, \$1 not supported yet."
1022 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1032 echo "*** Substitution done -- please confirm."
1034 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1039 echo "*** Error -- try again."
1046 case "\$ans\$xxxm\$nostick" in
1058 : create .config dir to save info across Configure sessions
1059 test -d ../.config || mkdir ../.config
1060 cat >../.config/README <<EOF
1061 This directory created by Configure to save information that should
1062 persist across sessions.
1064 You may safely delete it if you wish.
1067 : general instructions
1070 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1071 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1074 rp='Would you like to see the instructions?'
1085 This installation shell script will examine your system and ask you questions
1086 to determine how the perl5 package should be installed. If you get
1087 stuck on a question, you may use a ! shell escape to start a subshell or
1088 execute a command. Many of the questions will have default answers in square
1089 brackets; typing carriage return will give you the default.
1091 On some of the questions which ask for file or directory names you are allowed
1092 to use the ~name construct to specify the login directory belonging to "name",
1093 even if you don't have a shell which knows about that. Questions where this is
1094 allowed will be marked "(~name ok)".
1098 dflt='Type carriage return to continue'
1102 The prompter used in this script allows you to use shell variables and
1103 backticks in your answers. You may use $1, $2, etc... to refer to the words
1104 in the default answer, as if the default line was a set of arguments given to a
1105 script shell. This means you may also use $* to repeat the whole default line,
1106 so you do not have to re-type everything to add something to the default.
1108 Everytime there is a substitution, you will have to confirm. If there is an
1109 error (e.g. an unmatched backtick), the default answer will remain unchanged
1110 and you will be prompted again.
1112 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1113 the questions and use the computed defaults (or the previous answers if there
1114 was already a config.sh file). Type 'Configure -h' for a list of options.
1115 You may also start interactively and then answer '& -d' at any prompt to turn
1116 on the non-interactive behaviour for the remaining of the execution.
1122 Much effort has been expended to ensure that this shell script will run on any
1123 Unix system. If despite that it blows up on yours, your best bet is to edit
1124 Configure and run it again. Also, let me (lwall@netlabs.com)
1125 know how I blew it. If you can't run Configure for some reason, you'll have to
1126 generate a config.sh file by hand.
1128 This installation script affects things in two ways:
1130 1) it may do direct variable substitutions on some of the files included
1132 2) it builds a config.h file for inclusion in C programs. You may edit
1133 any of these files as the need arises after running this script.
1135 If you make a mistake on a question, there is no easy way to back up to it
1136 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1137 files. Configure will offer to let you do this before it runs the SH files.
1140 dflt='Type carriage return to continue'
1142 case "$firsttime" in
1143 true) echo $user >>../.config/instruct;;
1147 : see if sh knows # comments
1149 echo "Checking your sh to see if it knows about # comments..." >&4
1150 if `sh -c '#' >/dev/null 2>&1`; then
1151 echo "Your sh handles # comments correctly."
1155 echo "Okay, let's see if #! works on this system..."
1157 test -f $xcat || xcat=/usr/bin/cat
1162 if test -s today; then
1166 echo "#! $xcat" > try
1170 if test -s today; then
1174 echo "It's just a comment."
1179 echo "Your sh doesn't grok # comments--I will strip them later on."
1182 echo "exec grep -v '^[ ]*#'" >spitshell
1184 $eunicefix spitshell
1185 spitshell=`pwd`/spitshell
1187 echo "I presume that if # doesn't work, #! won't work either!"
1192 : figure out how to guarantee sh startup
1194 echo "Checking out how to guarantee sh startup..." >&4
1196 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1197 *) startsh=$sharpbang'/bin/sh';;
1199 echo "Let's see if '$startsh' works..."
1209 echo "Yup, it does."
1211 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1215 : find out where common programs are
1217 echo "Locating common programs..." >&4
1230 if test -d \$dir/\$thing; then
1236 for thisthing in \$dir/\$thing; do
1237 : just loop through to pick last item
1239 if test -f \$thisthing; then
1242 elif test -f \$dir/\$thing.exe; then
1243 : on Eunice apparently
1287 pth=`echo $PATH | sed -e 's/:/ /g'`
1288 pth="$pth /lib /usr/lib"
1289 for file in $loclist; do
1290 xxx=`./loc $file $file $pth`
1295 echo $file is in $xxx.
1298 echo "I don't know where $file is. I hope it's in everyone's PATH."
1303 echo "Don't worry if any of the following aren't found..."
1305 for file in $trylist; do
1306 xxx=`./loc $file $file $pth`
1311 echo $file is in $xxx.
1314 echo "I don't see $file out there, $say."
1321 echo "Substituting grep for egrep."
1327 echo "Hopefully test is built into your sh."
1330 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1331 echo "Using the test built into your sh."
1339 echo "Hopefully echo is built into your sh."
1344 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1345 $echo $n "hi there$c" >foo1
1346 echo $n "hi there$c" >foo2
1347 if cmp foo1 foo2 >/dev/null 2>&1; then
1348 echo "They are compatible. In fact, they may be identical."
1355 They are not compatible! You are probably running ksh on a non-USG system.
1356 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1357 have echo built in and we may have to run some Bourne shell scripts. That
1358 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1361 $echo $n "The star should be here-->$c"
1368 : determine whether symbolic links are supported
1371 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1372 echo "Symbolic links are supported." >&4
1375 echo "Symbolic links are NOT supported." >&4
1380 : see whether [:lower:] and [:upper:] are supported character classes
1384 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1386 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1391 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1394 : set up the translation script tr, must be called with ./tr of course
1398 '[A-Z][a-z]') exec $tr '$up' '$low';;
1399 '[a-z][A-Z]') exec $tr '$low' '$up';;
1406 : Try to determine whether config.sh was made on this system
1407 case "$config_sh" in
1409 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1410 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1411 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1413 if test "$fastread" = yes; then
1415 elif test -f ../config.sh; then
1417 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1418 eval "old`grep myuname= ../config.sh`"
1420 if test "X$myuname" = "X$oldmyuname"; then
1425 : Get old answers from old config file if Configure was run on the
1426 : same system, otherwise use the hints.
1429 if test -f config.sh; then
1431 rp="I see a config.sh file. Shall I use it to set the defaults?"
1434 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1435 *) echo "Fetching default answers from your old config.sh file..." >&4
1439 test "$override" && . UU/$optdef
1447 if test ! -f config.sh; then
1450 First time through, eh? I have some defaults handy for the following systems:
1453 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1455 : Half the following guesses are probably wrong... If you have better
1456 : tests or hints, please send them to lwall@netlabs.com
1457 : The metaconfig authors would also appreciate a copy...
1458 $test -f /irix && osname=irix
1459 $test -f /xenix && osname=sco_xenix
1460 $test -f /dynix && osname=dynix
1461 $test -f /dnix && osname=dnix
1462 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1463 $test -f /bin/mips && /bin/mips && osname=mips
1464 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1465 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1466 $test -d /usr/apollo/bin && osname=apollo
1467 $test -f /etc/saf/_sactab && osname=svr4
1468 $test -d /usr/include/minix && osname=minix
1469 if $test -f $uname; then
1477 umips) osname=umips ;;
1480 [23]100) osname=mips ;;
1481 next*) osname=next ;;
1482 news*) osname=news ;;
1484 if $test -f /etc/kconfig; then
1486 if test "$lns" = "ln -s"; then
1488 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1490 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1499 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1501 'not found') osvers=3.2.0 ;;
1502 '<3240'|'<>3240') osvers=3.2.0 ;;
1503 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1504 '=3250'|'>3250') osvers=3.2.5 ;;
1511 domainos) osname=apollo
1517 freebsd) osname=freebsd
1519 genix) osname=genix ;;
1524 *.10.*) osvers=10 ;;
1541 netbsd*) osname=netbsd
1544 bsd386) osname=bsd386
1547 next*) osname=next ;;
1548 solaris) osname=solaris
1550 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1557 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1561 titanos) osname=titanos
1570 ultrix) osname=ultrix
1574 alpha) osname=dec_osf
1576 [vt]1\.*) osvers=1 ;;
1577 [vt]2\.*) osvers=2 ;;
1578 [vt]3\.*) osvers=3 ;;
1581 hp*) osname=hp_osf1 ;;
1582 mips) osname=mips_osf1 ;;
1588 $2) case "$osname" in
1592 : svr4.x or possibly later
1602 if test -f /stand/boot ; then
1603 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1604 if test -n "$INITPROG" -a -f "$INITPROG"; then
1605 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1606 if test -n "$isesix"; then
1614 *) if test -f /etc/systemid; then
1616 set `echo $3 | $sed 's/\./ /g'` $4
1617 if $test -f sco_$1_$2_$3.sh; then
1619 elif $test -f sco_$1_$2.sh; then
1621 elif $test -f sco_$1.sh; then
1626 '') : Still unknown. Probably a generic Sys V.
1635 *) case "$osname" in
1636 '') : Still unknown. Probably a generic BSD.
1644 if test -f /vmunix -a -f news_os.sh; then
1645 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1646 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1649 $rm -f ../UU/kernel.what
1653 : Now look for a hint file osname_osvers, unless one has been
1654 : specified already.
1657 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1658 : Also try without trailing minor version numbers.
1659 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1660 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1661 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1662 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1665 *) case "$osvers" in
1668 *) if $test -f $file.sh ; then
1670 elif $test -f $xfile.sh ; then
1672 elif $test -f $xxfile.sh ; then
1674 elif $test -f $xxxfile.sh ; then
1676 elif $test -f $xxxxfile.sh ; then
1678 elif $test -f "${osname}.sh" ; then
1689 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1695 You may give one or more space-separated answers, or "none" if appropriate.
1696 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1699 rp="Which of these apply, if any?"
1702 for file in $tans; do
1703 if $test -f $file.sh; then
1705 $cat $file.sh >> ../UU/config.sh
1706 elif $test X$tans = X -o X$tans = Xnone ; then
1709 : Give one chance to correct a possible typo.
1710 echo "$file.sh does not exist"
1712 rp="hint to use instead?"
1714 for file in $ans; do
1715 if $test -f "$file.sh"; then
1717 $cat $file.sh >> ../UU/config.sh
1718 elif $test X$ans = X -o X$ans = Xnone ; then
1721 echo "$file.sh does not exist -- ignored."
1728 : Remember our hint file for later.
1729 if $test -f "$file.sh" ; then
1741 echo "Fetching default answers from $config_sh..." >&4
1745 cp $config_sh config.sh 2>/dev/null
1748 test "$override" && . ./$optdef
1756 : Restore computed paths
1757 for file in $loclist $trylist; do
1758 eval $file="\$_$file"
1763 Configure uses the operating system name and version to set some defaults.
1764 The default value is probably right if the name rings a bell. Otherwise,
1765 since spelling matters for me, either accept the default or answer "none"
1772 ''|' '|none) dflt=none ;;
1773 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1776 *) dflt="$osname" ;;
1778 rp="Operating system name?"
1782 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1784 : who configured the system
1785 cf_time=`$date 2>&1`
1786 (logname > .temp) >/dev/null 2>&1
1787 $test -s .temp || (whoami > .temp) >/dev/null 2>&1
1788 $test -s .temp || echo unknown > .temp
1792 : determine where manual pages are on this system
1796 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1797 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1798 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1799 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1800 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1801 sysman=`./loc . /usr/man/man1 $syspath`
1804 if $test -d "$sysman"; then
1805 echo "System manual is in $sysman." >&4
1807 echo "Could not find manual pages in source form." >&4
1810 : see what memory models we can support
1813 $cat >pdp11.c <<'EOP'
1822 cc -o pdp11 pdp11.c >/dev/null 2>&1
1823 if ./pdp11 2>/dev/null; then
1824 dflt='unsplit split'
1826 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1829 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1834 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1837 if $test -d /lib/large || $test -d /usr/lib/large; then
1840 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1849 Some systems have different model sizes. On most systems they are called
1850 small, medium, large, and huge. On the PDP11 they are called unsplit and
1851 split. If your system doesn't support different memory models, say "none".
1852 If you wish to force everything to one memory model, say "none" here and
1853 put the appropriate flags later when it asks you for other cc and ld flags.
1854 Venix systems may wish to put "none" and let the compiler figure things out.
1855 (In the following question multiple model names should be space separated.)
1858 rp="Which memory models are supported?"
1873 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
1874 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
1881 rp="What flag indicates separate I and D space?"
1889 *large*|*small*|*medium*|*huge*)
1896 rp="What flag indicates large model?"
1906 *huge*) case "$huge" in
1910 rp="What flag indicates huge model?"
1920 *medium*) case "$medium" in
1924 rp="What flag indicates medium model?"
1931 *) medium="$large";;
1934 *small*) case "$small" in
1938 rp="What flag indicates small model?"
1949 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
1953 : make some quick guesses about what we are up against
1955 $echo $n "Hmm... $c"
1964 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1965 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
1967 echo "Looks kind of like an OSF/1 system, but we'll see..."
1969 elif test `echo abc | tr a-z A-Z` = Abc ; then
1970 xxx=`./loc addbib blurfl $pth`
1971 if $test -f $xxx; then
1972 echo "Looks kind of like a USG system with BSD features, but we'll see..."
1976 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
1977 echo "Looks kind of like an extended USG system, but we'll see..."
1979 echo "Looks kind of like a USG system, but we'll see..."
1983 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
1984 echo "Looks kind of like a BSD system, but we'll see..."
1988 echo "Looks kind of like a Version 7 system, but we'll see..."
1991 case "$eunicefix" in
1994 There is, however, a strange, musty smell in the air that reminds me of
1995 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1999 : it so happens the Eunice I know will not run shell scripts in Unix format
2003 echo "Congratulations. You aren't running Eunice."
2007 if test -f /xenix; then
2008 echo "Actually, this looks more like a XENIX system..."
2013 echo "It's not Xenix..."
2018 if test -f /venix; then
2019 echo "Actually, this looks more like a VENIX system..."
2026 echo "Nor is it Venix..."
2029 chmod +x bsd usg v7 osf1 eunice xenix venix
2030 $eunicefix bsd usg v7 osf1 eunice xenix venix
2033 : see if we need a special compiler
2041 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2042 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2055 On some systems the default C compiler will not resolve multiple global
2056 references that happen to have the same name. On some such systems the "Mcc"
2057 command may be used to force these to be resolved. On other systems a "cc -M"
2058 command is required. (Note that the -M flag on other systems indicates a
2059 memory model to use!) If you have the Gnu C compiler, you might wish to use
2063 rp="What command will force resolution on this system?"
2071 rp="Use which C compiler?"
2076 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2077 $cat >gccvers.c <<EOM
2082 printf("%s\n", __VERSION__);
2084 printf("%s\n", "1");
2090 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
2091 gccversion=`./gccvers`
2092 case "$gccversion" in
2093 '') echo "You are not using GNU cc." ;;
2094 *) echo "You are using GNU cc $gccversion." ;;
2097 echo "I can't compile the test program -- Assuming it isn't GNU cc."
2100 case "$gccversion" in
2101 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2104 : decide how portable to be
2105 case "$d_portable" in
2111 I can set things up so that your shell scripts and binaries are more portable,
2112 at what may be a noticable cost in performance. In particular, if you
2113 ask to be portable, the following happens:
2115 1) Shell scripts will rely on the PATH variable rather than using
2116 the paths derived above.
2117 2) ~username interpretations will be done at run time rather than
2121 rp="Do you expect to run these scripts and binaries on multiple machines?"
2124 y*) d_portable="$define"
2126 *) d_portable="$undef" ;;
2129 : set up shell script to do ~ expansion
2135 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2138 if $test -f /bin/csh; then
2139 /bin/csh -f -c "glob \$1"
2144 name=\`$expr x\$1 : '..\([^/]*\)'\`
2145 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2146 if $test ! -d "\$dir"; then
2148 echo "\$me: can't locate home directory for: \$name" >&2
2153 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2169 : now set up to get a file name
2170 cat <<'EOSC' >getfile
2183 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2184 fn=`echo $fn | sed 's/(.*)//'`
2190 loc_file=`expr $fn : '.*:\(.*\)'`
2191 fn=`expr $fn : '\(.*\):.*'`
2199 */*) fullpath=true;;
2208 *e*) exp_file=true;;
2211 *p*) nopath_ok=true;;
2216 *d*) type='Directory';;
2217 *l*) type='Locate';;
2222 Locate) what='File';;
2227 case "$d_portable" in
2235 while test "$type"; do
2240 true) rp="$rp (~name ok)";;
2243 if test -f UU/getfile.ok && \
2244 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2263 value=`UU/filexp $ans`
2266 if test "$ans" != "$value"; then
2267 echo "(That expands to $value on this system.)"
2281 /*) value="$ansexp" ;;
2286 echo "I shall only accept a full path name, as in /bin/ls." >&4
2287 echo "Use a ! shell escape if you wish to check pathnames." >&4
2290 echo "Please give a full path name, starting with slash." >&4
2293 echo "Note that using ~name is ok provided it expands well." >&4
2306 if test -f "$ansexp"; then
2308 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2310 echo "($value is not a plain file, but that's ok.)"
2315 if test -d "$ansexp"; then
2320 if test -d "$value"; then
2321 echo "(Looking for $loc_file in directory $value.)"
2322 value="$value/$loc_file"
2324 if test -f "$value"; then
2327 case "$nopath_ok" in
2328 true) case "$value" in
2330 *) echo "Assuming $value will be in people's path."
2346 if test "$fastread" = yes; then
2351 rp="$what $value doesn't exist. Use that name anyway?"
2372 : What should the include directory be ?
2374 $echo $n "Hmm... $c"
2378 if $test -f /bin/mips && /bin/mips; then
2379 echo "Looks like a MIPS system..."
2380 $cat >usr.c <<'EOCP'
2381 #ifdef SYSTYPE_BSD43
2385 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2386 dflt='/bsd43/usr/include'
2390 mips_type='System V'
2392 $rm -f usr.c usr.out
2393 echo "and you're compiling with the $mips_type compiler and libraries."
2395 echo "Doesn't look like a MIPS system."
2406 rp='Where are the include files you want to use?'
2410 : see how we invoke the C preprocessor
2412 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2413 cat <<'EOT' >testcpp.c
2419 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2421 wrapper=`pwd`/cppstdin
2425 if $test "X$cppstdin" != "X" && \
2426 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2427 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2429 echo "You used to use $cppstdin $cppminus so we'll use that again."
2431 '') echo "But let's see if we can live without a wrapper..." ;;
2433 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2434 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2436 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2439 echo "(However, $cpprun $cpplast does not work, let's see...)"
2447 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2454 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2455 $cc -E <testcpp.c >testcpp.out 2>&1; \
2456 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2457 echo "Yup, it does."
2460 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2461 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2462 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2463 echo "Yup, it does."
2466 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2467 $cc -P <testcpp.c >testcpp.out 2>&1; \
2468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2469 echo "Yipee, that works!"
2472 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2473 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2475 echo "At long last!"
2478 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2479 $cpp <testcpp.c >testcpp.out 2>&1; \
2480 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2484 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2485 $cpp - <testcpp.c >testcpp.out 2>&1; \
2486 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2487 echo "Hooray, it works! I was beginning to wonder."
2490 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2491 $wrapper <testcpp.c >testcpp.out 2>&1; \
2492 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2498 rp="No dice. I can't find a C preprocessor. Name one:"
2502 $x_cpp <testcpp.c >testcpp.out 2>&1
2503 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2504 echo "OK, that will do." >&4
2506 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2521 echo "Perhaps can we force $cc -E using a wrapper..."
2522 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2523 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2529 echo "Nope, we'll have to live without it..."
2544 *) $rm -f $wrapper;;
2546 $rm -f testcpp.c testcpp.out
2548 : determine optimize, if desired, or use for debug flag also
2552 *) dflt="$optimize";;
2556 Some C compilers have problems with their optimizers, by default, $package
2557 compiles with the -O flag to use the optimizer. Alternately, you might want
2558 to use the symbolic debugger, which uses the -g flag (on traditional Unix
2559 systems). Either flag can be specified here. To use neither flag, specify
2563 rp="What optimizer/debugger flag should be used?"
2567 'none') optimize=" ";;
2573 case "$gccversion" in
2574 1*) dflt='-fpcc-struct-return' ;;
2577 *-g*) dflt="$dflt -DDEBUGGING";;
2579 case "$gccversion" in
2580 2*) if test -d /etc/conf/kconfig.d &&
2581 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2590 case "$mips_type" in
2593 *) inclwanted="$inclwanted $usrinc/bsd";;
2595 for thisincl in $inclwanted; do
2596 if $test -d $thisincl; then
2597 if $test x$thisincl != x$usrinc; then
2600 *) dflt="$dflt -I$thisincl";;
2606 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2608 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2616 *) dflt="$dflt -D$2";;
2621 set signal.h __LANGUAGE_C__; eval $inctest
2623 set signal.h LANGUAGE_C; eval $inctest
2625 set signal.h NO_PROTOTYPE; eval $inctest
2626 set signal.h _NO_PROTO; eval $inctest
2633 *) dflt="$ccflags";;
2637 Your C compiler may want other flags. For this question you should include
2638 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
2639 but you should NOT include libraries or ld flags like -lwhatever. If you
2640 want $package to honor its debug switch, you should include -DDEBUGGING here.
2641 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
2642 -DHIDEMYMALLOC or -DCRIPPLED_CC.
2644 To use no flags, specify the word "none".
2650 rp="Any additional cc flags?"
2657 : the following weeds options from ccflags that are of no interest to cpp
2659 case "$gccversion" in
2660 1*) cppflags="$cppflags -D__GNUC__"
2662 case "$mips_type" in
2664 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2670 echo "Let me guess what the preprocessor flags are..." >&4
2684 *) ftry="$previous $flag";;
2686 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
2687 >cpp1.out 2>/dev/null && \
2688 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
2689 >cpp2.out 2>/dev/null && \
2690 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
2691 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
2693 cppflags="$cppflags $ftry"
2703 *-*) echo "They appear to be: $cppflags";;
2705 $rm -f cpp.c cpp?.out
2709 : flags used in final linking phase
2711 '') if ./venix; then
2717 *-posix*) dflt="$dflt -posix" ;;
2723 *) dflt="$ldflags";;
2726 rp="Any additional ld flags (NOT including libraries)?"
2732 rmlist="$rmlist pdp11"
2734 : Set private lib path
2737 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2742 '') dlist="$plibpth $glibpth";;
2743 *) dlist="$libpth";;
2746 : Now check and see which directories actually exist, avoiding duplicates
2750 if $test -d $xxx; then
2753 *) libpth="$libpth $xxx";;
2759 Some systems have incompatible or broken versions of libraries. Among
2760 the directories listed in the question below, please remove any you
2761 know not to be holding relevant libraries, and add any that are needed.
2762 Say "none" for none.
2773 rp="Directories to use for library searches?"
2780 : compute shared library extension
2783 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2793 On some systems, shared libraries may be available. Answer 'none' if
2794 you want to suppress searching of shared libraries for the remaining
2795 of this configuration.
2798 rp='What is the file extension used for shared libraries?'
2802 : Looking for optional libraries
2804 echo "Checking for optional libraries..." >&4
2809 case "$libswanted" in
2810 '') libswanted='c_s';;
2812 for thislib in $libswanted; do
2814 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2815 echo "Found -l$thislib (shared)."
2818 *) dflt="$dflt -l$thislib";;
2820 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2821 echo "Found -l$thislib (shared)."
2824 *) dflt="$dflt -l$thislib";;
2826 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
2827 echo "Found -l$thislib."
2830 *) dflt="$dflt -l$thislib";;
2832 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
2833 echo "Found -l${thislib}_s."
2836 *) dflt="$dflt -l${thislib}_s";;
2838 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
2839 echo "Found -l$thislib."
2842 *) dflt="$dflt -l$thislib";;
2845 echo "No -l$thislib."
2856 ' '|'') dflt='none';;
2861 Some versions of Unix support shared libraries, which make executables smaller
2862 but make load time slightly longer.
2864 On some systems, mostly newer Unix System V's, the shared library is included
2865 by putting the option "-lc_s" as the last thing on the cc command line when
2866 linking. Other systems use shared libraries by default. There may be other
2867 libraries needed to compile $package on your machine as well. If your system
2868 needs the "-lc_s" option, include it here. Include any other special libraries
2869 here as well. Say "none" for none.
2873 rp="Any additional libraries?"
2880 : see if nm is to be used to determine whether a symbol is defined or not
2883 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2884 if $test $dflt -gt 20; then
2899 I can use 'nm' to extract the symbols from your C libraries. This is a time
2900 consuming task which may generate huge output on the disk (up to 3 megabytes)
2901 but that should make the symbols extraction faster. The alternative is to skip
2902 the 'nm' extraction part and to compile a small test program instead to
2903 determine whether each symbol is present. If you have a fast C compiler and/or
2904 if your 'nm' output cannot be parsed, this may be the best solution.
2907 rp='Shall I use nm to extract C symbols from the libraries?'
2919 : nm options which may be necessary
2921 '') if $test -f /mach_boot; then
2923 elif $test -d /usr/ccs/lib; then
2925 elif $test -f /dgux; then
2934 : get list of predefined functions in a handy place
2939 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
2946 *) for thislib in $libs; do
2949 : Handle C library specially below.
2952 thislib=`echo $thislib | $sed -e 's/^-l//'`
2953 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
2955 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
2957 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
2959 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
2961 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
2963 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
2968 libnames="$libnames $try"
2970 *) libnames="$libnames $thislib" ;;
2978 set /usr/ccs/lib/libc.$so
2979 $test -r $1 || set /usr/lib/libc.$so
2980 $test -r $1 || set /usr/shlib/libc.$so
2981 $test -r $1 || set /usr/lib/libc.$so.[0-9]*
2982 $test -r $1 || set /lib/libc.$so
2983 $test -r $1 || set /lib/libsys_s.a
2990 if $test -r "$1"; then
2991 echo "Your (shared) C library seems to be in $1."
2993 elif $test -r /lib/libc && $test -r /lib/clib; then
2994 echo "Your C library seems to be in both /lib/clib and /lib/libc."
2996 libc='/lib/clib /lib/libc'
2997 if $test -r /lib/syslib; then
2998 echo "(Your math library is in /lib/syslib.)"
2999 libc="$libc /lib/syslib"
3001 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3002 echo "Your C library seems to be in $libc, as you said before."
3003 elif $test -r $incpath/usr/lib/libc.a; then
3004 libc=$incpath/usr/lib/libc.a;
3005 echo "Your C library seems to be in $libc. That's fine."
3006 elif $test -r /lib/libc.a; then
3008 echo "Your C library seems to be in $libc. You're normal."
3010 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
3012 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3013 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3014 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3016 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3018 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3021 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
3023 if $test -r "$tans"; then
3024 echo "Your C library seems to be in $tans, of all places."
3030 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3034 If the guess above is wrong (which it might be if you're using a strange
3035 compiler, or your machine supports multiple models), you can override it here.
3040 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3042 I can't seem to find your C library. I've looked in the following places:
3045 $sed 's/^/ /' libpath
3048 None of these seems to contain your C library. I need to get its name...
3053 rp='Where is your C library?'
3058 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3059 set X `cat libnames`
3062 case $# in 1) xxx=file; esac
3063 echo "Extracting names from the following $xxx for later perusal:" >&4
3065 $sed 's/^/ /' libnames >&4
3067 $echo $n "This may take a while...$c" >&4
3069 nm $nm_opt $* 2>/dev/null >libc.tmp
3071 $grep fprintf libc.tmp > libc.ptf
3072 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3073 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3074 if com="$sed -n -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
3076 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3078 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3080 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3082 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3084 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3086 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3088 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3090 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3092 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3094 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3096 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3098 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3099 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3101 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3103 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3105 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3107 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3109 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3111 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3113 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3116 nm -p $* 2>/dev/null >libc.tmp
3117 com="$sed -n -e 's/^.* [ADTS] *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
3118 eval "<libc.tmp $com >libc.list"
3119 if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3124 echo "nm didn't seem to work right. Trying ar instead..." >&4
3126 if ar t $libc > libc.tmp; then
3127 for thisname in $libnames; do
3128 ar t $thisname >>libc.tmp
3130 $sed -e 's/\.o$//' < libc.tmp > libc.list
3133 echo "ar didn't seem to work right." >&4
3134 echo "Maybe this is a Cray...trying bld instead..." >&4
3135 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
3136 for thisname in $libnames; do
3138 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
3139 ar t $thisname >>libc.tmp
3143 echo "That didn't work either. Giving up." >&4
3150 if $test -f /lib/syscalls.exp; then
3152 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3153 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3157 $rm -f libnames libpath
3159 : is a C symbol defined?
3162 -v) tf=libc.tmp; tc=""; tdc="";;
3163 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
3164 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3167 case "$reuseval-$4" in
3169 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3175 if $contains $tlook $tf >/dev/null 2>&1;
3180 echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
3181 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
3189 $define) tval=true;;
3195 : set up the script used to warn in case of inconsistency
3199 echo "*** WHOA THERE!!! ***" >&4
3200 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3201 rp=" Keep the $hint value?"
3204 y) td=$was; tu=$was;;
3208 : define an is-in-libc? function
3209 inlibc='echo " "; td=$define; tu=$undef;
3210 sym=$1; var=$2; eval "was=\$$2";
3212 case "$reuseval$was" in
3222 echo "$sym() found." >&4;
3223 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3225 echo "$sym() NOT found." >&4;
3226 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3230 $define) echo "$sym() found." >&4;;
3231 *) echo "$sym() NOT found." >&4;;
3235 : see if gconvert exists
3236 set gconvert d_gconvert
3239 case "$d_gconvert" in
3241 echo "We'll use it to convert floats into a string then." >&4
3242 d_Gconvert="gconvert((x),(n),(t),(b))"
3245 : Maybe we can emulate it with gcvt.
3251 : Test whether gcvt drops a trailing decimal point
3256 if (buf[0] != '1' || buf[1] != '\0')
3259 if (buf[0] != '0' || buf[1] != '\0')
3262 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
3267 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
3269 echo "Good, your gcvt() drops a trailing decimal point."
3270 echo "We'll use it to convert floats into a string." >&4
3271 d_Gconvert="gcvt((x),(n),(b))"
3273 echo "But your gcvt() keeps a trailing decimal point".
3277 echo "Hmm. I can't compile the gcvt test program."
3283 case "$d_Gconvert" in
3285 echo "I'll use sprintf instead to convert floats into a string." >&4
3286 d_Gconvert='sprintf((b),"%.*g",(n),(x))'
3291 : Initialize h_fcntl
3294 : Initialize h_sysfile
3297 : determine filename position in cpp output
3299 echo "Computing filename position in cpp output for #include directives..." >&4
3300 echo '#include <stdio.h>' > foo.c
3303 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3304 $grep '^[ ]*#.*stdio\.h' | \
3305 while read cline; do
3308 while $test \$# -gt 0; do
3309 if $test -r \`echo \$1 | $tr -d '"'\`; then
3314 pos=\`expr \$pos + 1\`
3326 *) pos="${fieldn}th";;
3328 echo "Your cpp writes the filename in the $pos field of the line."
3330 : locate header file
3335 if test -f $usrinc/\$wanted; then
3336 echo "$usrinc/\$wanted"
3339 awkprg='{ print \$$fieldn }'
3340 echo "#include <\$wanted>" > foo\$\$.c
3341 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3342 $grep "^[ ]*#.*\$wanted" | \
3343 while read cline; do
3344 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3346 */\$wanted) echo "\$name"; exit 0;;
3357 : access call always available on UNIX
3361 : locate the flags for 'access()'
3365 $cat >access.c <<'EOCP'
3366 #include <sys/types.h>
3371 #include <sys/file.h>
3380 : check sys/file.h first, no particular reason here
3381 if $test `./findhdr sys/file.h` && \
3382 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
3384 echo "<sys/file.h> defines the *_OK access constants." >&4
3385 elif $test `./findhdr fcntl.h` && \
3386 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
3388 echo "<fcntl.h> defines the *_OK access constants." >&4
3389 elif $test `./findhdr unistd.h` && \
3390 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
3391 echo "<unistd.h> defines the *_OK access constants." >&4
3393 echo "I can't find the four *_OK access constants--I'll use mine." >&4
3399 : see if alarm exists
3405 if test -d /afs; then
3406 echo "AFS may be running... I'll be extra cautious then..." >&4
3409 echo "AFS does not seem to be running..." >&4
3413 : determine root of directory hierarchy where package will be installed.
3416 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3424 By default, $package will be installed in $dflt/bin, manual
3425 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3426 all installation directories. Typically set to /usr/local, but you
3427 may choose /usr if you wish to install $package among your system
3428 binaries. If you wish to have binaries under /bin but manual pages
3429 under /usr/local/man, that's ok: you will be prompted separately
3430 for each of the installation directories, the prefix being only used
3435 rp='Installation prefix to use?'
3439 : determine where private executables go
3442 dflt=$prefix/lib/$package
3449 There are some auxiliary files for $package that need to be put into a
3450 private library directory that is accessible by everyone.
3454 rp='Pathname where private library files will reside?'
3457 privlibexp="$ansexp"
3461 Since you are running AFS, I need to distinguish the directory in which
3462 private files reside from the directory in which they are installed (and from
3463 which they are presumably copied to the former directory by occult means).
3466 case "$installprivlib" in
3467 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3468 *) dflt="$installprivlib";;
3471 rp='Where will private files be installed?'
3473 installprivlib="$ans"
3475 installprivlib="$privlibexp"
3478 : determine where public architecture dependent libraries go
3480 '') tpath=`echo $PATH | sed -e 's/:/ /g'`
3481 if xxx=`./loc arch blurfl $tpath`; test -f "$xxx"; then
3483 archname="${tarchname}-$osname"
3484 elif xxx=`./loc uname blurfl $tpath`; test -f "$xxx" ; then
3485 if uname -m > tmparch 2>&1 ; then
3486 tarchname=`cat tmparch`
3487 archname="${tarchname}-$osname"
3498 '') dflt=`./loc . "." $prefix/lib /usr/local/lib /usr/lib /lib`;;
3499 *) dflt="$privlib/$archname";;
3502 *) dflt="$archlib";;
3506 $package contains architecture-dependent library files. If you are
3507 sharing libraries in a heterogeneous environment, you might store
3508 these files in a separate location. Otherwise, you can just include
3509 them with the rest of the public library files.
3513 rp='Where do you want to put the public architecture-dependent libraries?'
3516 archlibexp="$ansexp"
3521 Since you are running AFS, I need to distinguish the directory in which
3522 private files reside from the directory in which they are installed (and from
3523 which they are presumably copied to the former directory by occult means).
3526 case "$installarchlib" in
3527 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3528 *) dflt="$installarchlib";;
3531 rp='Where will architecture-dependent library files be installed?'
3533 installarchlib="$ans"
3535 installarchlib="$archlibexp"
3537 if $test X"$archlib" = X"$privlib"; then
3543 : function used to set $1 to $val
3544 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3546 $define$undef) . ./whoa; eval "$var=\$td";;
3547 $undef$define) . ./whoa; eval "$var=\$tu";;
3548 *) eval "$var=$val";;
3551 : Look for GNU-cc style attribute checking
3553 echo "Checking whether your compiler can handle __attribute__ ..." >&4
3554 $cat >attrib.c <<'EOCP'
3555 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
3557 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
3558 if $contains 'warning' attrib.out >/dev/null 2>&1; then
3559 echo "Your C compiler doesn't fully support __attribute__."
3562 echo "Your C compiler supports __attribute__."
3566 echo "Your C compiler doesn't seem to understand __attribute__ at all."
3573 : see if bcmp exists
3577 : see if bcopy exists
3581 : see if setpgrp exists
3582 set setpgrp d_setpgrp
3585 : see which flavor of setpgrp is in use
3586 case "$d_setpgrp" in
3592 if (getuid() == 0) {
3593 printf("(I see you are running Configure as super-user...)\n");
3596 if (-1 == setpgrp(1, 1))
3601 if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
3604 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
3606 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
3611 xxx="USG one, i.e. you use setpgrp()."
3614 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
3617 echo "Assuming your setpgrp is a $xxx" >&4
3626 : see if bzero exists
3630 : check for length of integer
3634 echo "Checking to see how big your integers are..." >&4
3635 $cat >try.c <<'EOCP'
3639 printf("%d\n", sizeof(int));
3642 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
3646 echo "(I can't seem to compile the test program. Guessing...)"
3653 rp="What is the size of an integer (in bytes)?"
3658 : see if signal is declared as pointer to function returning int or void
3660 xxx=`./findhdr signal.h`
3661 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
3662 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3663 echo "You have int (*signal())() instead of void." >&4
3665 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3666 echo "You have void (*signal())() instead of int." >&4
3668 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3669 echo "You have int (*signal())() instead of void." >&4
3672 case "$d_voidsig" in
3674 echo "I can't determine whether signal handler returns void or int..." >&4
3676 rp="What type does your signal handler return?"
3683 echo "As you already told me, signal handler returns void." >&4;;
3685 echo "As you already told me, signal handler returns int." >&4;;
3690 case "$d_voidsig" in
3691 "$define") signal_t="void";;
3696 : check for ability to cast large floats to 32-bit ints.
3698 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
3699 if $test "$intsize" -eq 4; then
3705 #include <sys/types.h>
3707 $signal_t blech() { exit(3); }
3713 signal(SIGFPE, blech);
3715 f = (double) 0x7fffffff;
3719 if (i32 != ($xxx) f)
3724 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3728 echo "(I can't seem to compile the test program--assuming it can't)"
3736 echo "Nope, it can't."
3743 : check for ability to cast negative floats to unsigned
3745 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
3747 #include <sys/types.h>
3749 $signal_t blech() { exit(3); }
3753 unsigned long along;
3755 unsigned short ashort;
3758 signal(SIGFPE, blech);
3759 along = (unsigned long)f;
3760 aint = (unsigned int)f;
3761 ashort = (unsigned short)f;
3762 if (along != (unsigned long)-123)
3764 if (aint != (unsigned int)-123)
3766 if (ashort != (unsigned short)-123)
3768 f = (double)0x40000000;
3771 along = (unsigned long)f;
3772 if (along != 0x80000000)
3776 along = (unsigned long)f;
3777 if (along != 0x7fffffff)
3781 along = (unsigned long)f;
3782 if (along != 0x80000001)
3788 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3792 echo "(I can't seem to compile the test program--assuming it can't)"
3795 case "$castflags" in
3800 echo "Nope, it can't."
3807 : see if vprintf exists
3809 if set vprintf val -f d_vprintf; eval $csym; $val; then
3810 echo 'vprintf() found.' >&4
3812 $cat >vprintf.c <<'EOF'
3813 #include <varargs.h>
3815 main() { xxx("foo"); }
3824 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
3827 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
3828 echo "Your vsprintf() returns (int)." >&4
3831 echo "Your vsprintf() returns (char*)." >&4
3835 echo 'vprintf() NOT found.' >&4
3845 : see if chown exists
3849 : see if chroot exists
3853 : see if chsize exists
3857 : check for const keyword
3859 echo 'Checking to see if your C compiler knows about "const"...' >&4
3860 $cat >const.c <<'EOCP'
3861 typedef struct spug { int drokk; } spug;
3868 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
3870 echo "Yup, it does."
3873 echo "Nope, it doesn't."
3878 : see if crypt exists
3880 if set crypt val -f d_crypt; eval $csym; $val; then
3881 echo 'crypt() found.' >&4
3885 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
3886 if $test -z "$cryptlib"; then
3887 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
3891 if $test -z "$cryptlib"; then
3892 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
3896 if $test -z "$cryptlib"; then
3897 cryptlib=`./loc libcrypt.a "" $libpth`
3901 if $test -z "$cryptlib"; then
3902 echo 'crypt() NOT found.' >&4
3911 : get csh whereabouts
3913 'csh') val="$undef" ;;
3919 : see if cuserid exists
3920 set cuserid d_cuserid
3923 : define an alternate in-header-list? function
3924 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
3925 cont=true; xxf="echo \"<\$1> found.\" >&4";
3926 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
3927 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
3929 case $# in 4) instead=instead;; *) instead="at last";; esac;
3930 while $test "$cont"; do
3932 var=$2; eval "was=\$$2";
3933 if $test "$xxx" && $test -r "$xxx";
3935 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
3938 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
3939 set $yyy; shift; shift; yyy=$@;
3940 case $# in 0) cont="";;
3941 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
3942 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
3943 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
3944 xxnf="echo \"there is no <\$1>, ...\" >&4";;
3948 do set $yyy; var=$2; eval "was=\$$2";
3949 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
3950 set $yyy; shift; shift; yyy=$@;
3953 : see if this is a limits.h system
3954 set limits.h i_limits
3957 : see if this is a float.h system
3961 : See if number of significant digits in a double precision number is known
3963 $cat >dbl_dig.c <<EOM
3973 printf("Contains DBL_DIG");
3976 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
3977 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
3978 echo "DBL_DIG found." >&4
3981 echo "DBL_DIG NOT found." >&4
3988 : see if difftime exists
3989 set difftime d_difftime
3992 : see if this is a dirent system
3994 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
3996 echo "<dirent.h> found." >&4
3999 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
4000 echo "<sys/dir.h> found." >&4
4003 xinc=`./findhdr sys/ndir.h`
4005 echo "<dirent.h> NOT found." >&4
4010 : Look for type of directory structure.
4012 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4014 case "$direntrytype" in
4017 $define) guess1='struct dirent' ;;
4018 *) guess1='struct direct' ;;
4021 *) guess1="$direntrytype"
4026 'struct dirent') guess2='struct direct' ;;
4027 *) guess2='struct dirent' ;;
4030 if $contains "$guess1" try.c >/dev/null 2>&1; then
4031 direntrytype="$guess1"
4032 echo "Your directory entries are $direntrytype." >&4
4033 elif $contains "$guess2" try.c >/dev/null 2>&1; then
4034 direntrytype="$guess2"
4035 echo "Your directory entries seem to be $direntrytype." >&4
4037 echo "I don't recognize your system's directory entries." >&4
4038 rp="What type is used for directory entries on this system?"
4046 : see if the directory entry stores field length
4048 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4049 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
4050 echo "Good, your directory entry keeps length information in d_namlen." >&4
4053 echo "Your directory entry does not know about the d_namlen field." >&4
4060 : see if dlerror exists
4061 set dlerror d_dlerror
4064 : see if dld is available
4068 : see if dlopen exists
4072 : determine which dynamic loading, if any, to compile in
4074 dldir="ext/DynaLoader"
4087 $define) dflt='y' ;;
4090 $define) dflt='y' ;;
4092 : Does a dl_xxx.xs file exist for this operating system
4093 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4096 rp="Do you wish to use dynamic loading?"
4103 if $test -f ../$dldir/dl_${osname}.xs ; then
4104 dflt="$dldir/dl_${osname}.xs"
4105 elif $test "$d_dlopen" = "$define" ; then
4106 dflt="$dldir/dl_dlopen.xs"
4107 elif $test "$i_dld" = "$define" ; then
4108 dflt="$dldir/dl_dld.xs"
4113 *) dflt="$dldir/$dlsrc"
4116 echo "The following dynamic loading files are available:"
4117 : Can not go over to $dldir because getfile has path hard-coded in.
4118 cd ..; ls -C $dldir/dl*.xs; cd UU
4119 rp="Source file to use for dynamic loading"
4124 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4127 Some systems may require passing special flags to $cc -c to
4128 compile modules that will be used to create a shared library.
4129 To use no flags, say "none".
4132 case "$cccdlflags" in
4133 ''|' ') case "$cc" in
4134 *gcc*) dflt='-fpic' ;;
4135 *) case "$osname" in
4137 next) dflt='none' ;;
4138 solaris) dflt='-K pic' ;;
4139 sunos) dflt='-pic' ;;
4140 svr4*|esix*) dflt='-Kpic' ;;
4144 *) dflt="$cccdlflags" ;;
4146 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4149 none) cccdlflags='' ;;
4150 *) cccdlflags="$ans" ;;
4155 Some systems may require passing special flags to ld to create a
4156 library that can be dynamically loaded. If your ld flags include
4157 -L/other/path options to locate libraries outside your loader's normal
4158 search path, you may need to specify those -L options here as well. To
4159 use no flags, say "none".
4162 case "$lddlflags" in
4163 ''|' ') case "$osname" in
4165 next) dflt='none' ;;
4166 solaris) dflt='-G' ;;
4167 sunos) dflt='-assert nodefinitions' ;;
4168 svr4*|esix*) dflt="-G $ldflags" ;;
4172 *) dflt="$lddlflags" ;;
4174 rp="Any special flags to pass to ld to create a dynamically loaded library?"
4177 none) lddlflags='' ;;
4178 *) lddlflags="$ans" ;;
4183 Some systems may require passing special flags to $cc to indicate that
4184 the resulting executable will use dynamic linking. To use no flags,
4188 case "$ccdlflags" in
4189 ''|' ') case "$osname" in
4190 hpux) dflt='none' ;;
4191 next) dflt='none' ;;
4192 sunos) dflt='none' ;;
4195 *) dflt="$ccdlflags" ;;
4197 rp="Any special flags to pass to $cc to use dynamic loading?"
4200 none) ccdlflags='' ;;
4201 *) ccdlflags="$ans" ;;
4218 System V Release 4 systems can support dynamic loading
4219 only if libperl is created as a shared library.
4226 set d_shrplib; eval $setvar
4227 case "$d_shrplib" in
4231 Be sure to add the perl source directory to the LD_LIBRARY_PATH
4232 environment variable before running make:
4233 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
4235 setenv LD_LIBRARY_PATH `cd ..;pwd`
4240 case "$d_shrplib" in
4243 "") dflt="$archlib/CORE";;
4244 *) dflt="$shrpdir";;
4246 rp="What directory should we install the shared libperl into?"
4255 : see if dlfcn is available
4263 On a few systems, the dynamically loaded modules that perl generates and uses
4264 will need a different extension then shared libs. The default will probably
4272 rp='What is the extension of dynamically loaded modules'
4281 : Check if dlsym need a leading underscore
4287 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
4288 $cat >dyna.c <<'EOM'
4297 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
4299 #include <sys/types.h>
4313 int mode = RTLD_LAZY ;
4315 handle = dlopen("./dyna.$dlext", mode) ;
4316 if (handle == NULL) {
4320 symbol = dlsym(handle, "fred") ;
4321 if (symbol == NULL) {
4322 /* try putting a leading underscore */
4323 symbol = dlsym(handle, "_fred") ;
4324 if (symbol == NULL) {
4335 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
4336 ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
4337 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
4340 1) echo "Test program failed using dlopen." >&4
4341 echo "Perhaps you should not use dynamic loading." >&4;;
4342 2) echo "Test program failed using dlsym." >&4
4343 echo "Perhaps you should not use dynamic loading." >&4;;
4344 3) echo "dlsym needs a leading underscore" >&4
4346 4) echo "dlsym doesn't need a leading underscore." >&4;;
4349 echo "I can't compile and run the test program." >&4
4354 $rm -f fred fred.? dyna.$dlext dyna.?
4359 : see if setuid scripts can be secure
4362 Some kernels have a bug that prevents setuid #! scripts from being
4363 secure. Some sites have disabled setuid #! scripts because of this.
4365 First let's decide if your kernel supports secure setuid #! scripts.
4366 (If setuid #! scripts would be secure but have been disabled anyway,
4367 don't say that they are secure if asked.)
4372 if $test -d /dev/fd; then
4373 echo "#!$ls" >reflect
4374 chmod +x,u+s reflect
4375 ./reflect >flect 2>&1
4376 if $contains "/dev/fd" flect >/dev/null; then
4377 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4381 If you are not sure if they are secure, I can check but I'll need a
4382 username and password different from the one you are using right now.
4383 If you don't have such a username or don't want me to test, simply
4387 rp='Other username to test security of setuid scripts with?'
4392 case "$d_suidsafe" in
4393 '') echo "I'll assume setuid scripts are *not* secure." >&4
4396 echo "Well, the $hint value is *not* secure." >&4
4398 *) echo "Well, the $hint value *is* secure." >&4
4403 $rm -f reflect flect
4404 echo "#!$ls" >reflect
4405 chmod +x,u+s reflect
4408 echo '"su" will (probably) prompt you for '"$ans's password."
4409 su $ans -c './reflect >flect'
4410 if $contains "/dev/fd" flect >/dev/null; then
4411 echo "Okay, it looks like setuid scripts are secure." >&4
4414 echo "I don't think setuid scripts are secure." >&4
4419 rp='Does your kernel have *secure* setuid scripts?'
4422 [yY]*) val="$define";;
4427 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4433 $rm -f reflect flect
4435 : now see if they want to do setuid emulation
4438 case "$d_suidsafe" in
4441 echo "No need to emulate SUID scripts since they are secure here." >& 4
4445 Some systems have disabled setuid scripts, especially systems where
4446 setuid scripts cannot be secure. On systems where setuid scripts have
4447 been disabled, the setuid/setgid bits on scripts are currently
4448 useless. It is possible for $package to detect those bits and emulate
4449 setuid/setgid in a secure fashion. This emulation will only work if
4450 setuid scripts have been disabled in your kernel.
4454 "$define") dflt=y ;;
4457 rp="Do you want to do setuid/setgid emulation?"
4460 [yY]*) val="$define";;
4468 : see if drem exists
4472 : see if dup2 exists
4476 : see if fchmod exists
4480 : see if fchown exists
4484 : see if this is an fcntl system
4488 : see if fgetpos exists
4489 set fgetpos d_fgetpos
4492 : see if we can have long filenames
4494 rmlist="$rmlist /tmp/cf$$"
4495 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
4496 first=123456789abcdef
4497 second=/tmp/cf$$/$first
4498 $rm -f $first $second
4499 if (echo hi >$first) 2>/dev/null; then
4500 if $test -f 123456789abcde; then
4501 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
4504 if (echo hi >$second) 2>/dev/null; then
4505 if $test -f /tmp/cf$$/123456789abcde; then
4507 That's peculiar... You can have filenames longer than 14 characters, but only
4508 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
4509 I shall consider your system cannot support long filenames at all.
4513 echo 'You can have filenames longer than 14 characters.' >&4
4518 How confusing! Some of your filesystems are sane enough to allow filenames
4519 longer than 14 characters but some others like /tmp can't even think about them.
4520 So, for now on, I shall assume your kernel does not allow them at all.
4527 You can't have filenames longer than 14 chars. You can't even think about them!
4533 $rm -rf /tmp/cf$$ 123456789abcde*
4535 : see if flock exists
4539 : see if fmod exists
4543 : see if fork exists
4547 : see if pathconf exists
4548 set pathconf d_pathconf
4551 : see if fpathconf exists
4552 set fpathconf d_fpathconf
4555 : see if fsetpos exists
4556 set fsetpos d_fsetpos
4559 : see if gethostent exists
4560 set gethostent d_gethent
4563 : see if getlogin exists
4564 set getlogin d_getlogin
4567 : see if getpgrp exists
4568 set getpgrp d_getpgrp
4571 : see if getpgrp2 exists
4572 set getpgrp2 d_getpgrp2
4575 : see if getppid exists
4576 set getppid d_getppid
4579 : see if getpriority exists
4580 set getpriority d_getprior
4583 : see if group exists
4587 : see if this is a netinet/in.h or sys/in.h system
4588 set netinet/in.h i_niin sys/in.h i_sysin
4591 : see if htonl --and friends-- exists
4596 : Maybe they are macros.
4601 #include <sys/types.h>
4602 #$i_niin I_NETINET_IN
4605 #include <netinet/in.h>
4611 printf("Defined as a macro.");
4614 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
4615 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
4617 echo "But it seems to be defined as a macro." >&4
4625 : see which of string.h or strings.h is needed
4627 strings=`./findhdr string.h`
4628 if $test "$strings" && $test -r "$strings"; then
4629 echo "Using <string.h> instead of <strings.h>." >&4
4633 strings=`./findhdr strings.h`
4634 if $test "$strings" && $test -r "$strings"; then
4635 echo "Using <strings.h> instead of <string.h>." >&4
4637 echo "No string header found -- You'll surely have problems." >&4
4643 "$undef") strings=`./findhdr strings.h`;;
4644 *) strings=`./findhdr string.h`;;
4649 if set index val -f; eval $csym; $val; then
4650 if set strchr val -f d_strchr; eval $csym; $val; then
4651 if $contains strchr "$strings" >/dev/null 2>&1 ; then
4654 echo "strchr() found." >&4
4658 echo "index() found." >&4
4663 echo "index() found." >&4
4666 if set strchr val -f d_strchr; eval $csym; $val; then
4669 echo "strchr() found." >&4
4671 echo "No index() or strchr() found!" >&4
4676 set d_strchr; eval $setvar
4678 set d_index; eval $setvar
4682 $cat >isascii.c <<'EOCP'
4693 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
4694 echo "isascii() found." >&4
4697 echo "isascii() NOT found." >&4
4704 : see if killpg exists
4708 : see if link exists
4712 : see if stdio is really std
4714 xxx=`./findhdr stdio.h`
4715 if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
4716 if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
4717 echo "Your stdio is pretty std." >&4
4720 echo "Your stdio isn't very std." >&4
4724 echo "Your stdio isn't very std." >&4
4730 : see if stdio is like that in linux
4731 case "$d_stdstdio" in
4734 xxx=`./findhdr stdio.h`
4735 $cppstdin $cppflags $cppminus < "$xxx" > stdio.E
4736 if $contains 'char.*_IO_read_base' stdio.E >/dev/null 2>&1 && \
4737 $contains '_IO_read_ptr' stdio.E >/dev/null 2>&1 && \
4738 $contains '_IO_read_end' stdio.E >/dev/null 2>&1 ; then
4739 echo "Your stdio looks like linux." >&4
4742 echo "You don't have linux stdio, either." >&4
4753 : see if localeconv exists
4754 set localeconv d_locconv
4757 : see if lockf exists
4761 : see if lstat exists
4765 : see if mblen exists
4769 : see if mbstowcs exists
4770 set mbstowcs d_mbstowcs
4773 : see if mbtowc exists
4777 : see if memcmp exists
4781 : see if memcpy exists
4785 : see if memmove exists
4786 set memmove d_memmove
4789 : see if memset exists
4793 : see if mkdir exists
4797 : see if mkfifo exists
4801 : see if mktime exists
4805 : see if msgctl exists
4809 : see if msgget exists
4813 : see if msgsnd exists
4817 : see if msgrcv exists
4821 : see how much of the 'msg*(2)' library is present.
4824 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
4825 *"$undef"*) h_msg=false;;
4827 : we could also check for sys/ipc.h ...
4828 if $h_msg && $test `./findhdr sys/msg.h`; then
4829 echo "You have the full msg*(2) library." >&4
4832 echo "You don't have the full msg*(2) library." >&4
4838 : see if this is a malloc.h system
4839 set malloc.h i_malloc
4842 : determine which malloc to compile in
4844 case "$usemymalloc" in
4845 ''|y*|true) dflt='y' ;;
4846 n*|false) dflt='n' ;;
4847 *) dflt="$usemymalloc" ;;
4849 rp="Do you wish to attempt to use the malloc that comes with $package?"
4855 mallocsrc='malloc.c'
4856 mallocobj='malloc.o'
4857 d_mymalloc="$define"
4860 : Remove malloc from list of libraries to use
4861 echo "Removing unneeded -lmalloc from library list" >&4
4862 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4865 echo "libs = $libs" >&4
4877 : compute the type returned by malloc
4879 case "$malloctype" in
4881 $cat >malloc.c <<END
4884 #include <sys/types.h>
4890 if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
4898 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4900 : see if nice exists
4904 : Locate the flags for 'open()'
4906 $cat >open3.c <<'EOCP'
4907 #include <sys/types.h>
4912 #include <sys/file.h>
4923 : check sys/file.h first to get FREAD on Sun
4924 if $test `./findhdr sys/file.h` && \
4925 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
4927 echo "<sys/file.h> defines the O_* constants..." >&4
4929 echo "and you have the 3 argument form of open()." >&4
4932 echo "but not the 3 argument form of open(). Oh, well." >&4
4935 elif $test `./findhdr fcntl.h` && \
4936 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
4938 echo "<fcntl.h> defines the O_* constants..." >&4
4940 echo "and you have the 3 argument form of open()." >&4
4943 echo "but not the 3 argument form of open(). Oh, well." >&4
4948 echo "I can't find the O_* constant definitions! You got problems." >&4
4954 : see if passwd exists
4958 : see if pause exists
4962 : see if pipe exists
4966 : see if this is a pwd system
4968 xxx=`./findhdr pwd.h`
4969 if $test "$xxx"; then
4971 echo "<pwd.h> found." >&4
4972 $cppstdin $cppflags $cppminus < $xxx >$$.h
4973 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
4978 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
4983 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
4984 d_pwchange="$define"
4988 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
4993 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
4994 d_pwexpire="$define"
4998 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
4999 d_pwcomment="$define"
5001 d_pwcomment="$undef"
5011 d_pwcomment="$undef"
5012 echo "<pwd.h> NOT found." >&4
5015 : see if readdir and friends exist
5016 set readdir d_readdir
5018 set seekdir d_seekdir
5020 set telldir d_telldir
5022 set rewinddir d_rewinddir
5025 : see if readlink exists
5026 set readlink d_readlink
5029 : see if rename exists
5033 : see if rmdir exists
5037 : can bcopy handle overlapping blocks?
5042 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
5043 $cat >foo.c <<'EOCP'
5046 char buf[128], abc[128];
5052 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
5054 for (align = 7; align >= 0; align--) {
5055 for (len = 36; len; len--) {
5058 for (off = 1; off <= len; off++) {
5059 bcopy(b, b+off, len);
5060 bcopy(b+off, b, len);
5061 if (bcmp(b, abc, len))
5069 if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5070 if ./safebcpy 2>/dev/null; then
5074 echo "It can't, sorry."
5077 echo "(I can't compile the test program, so we'll assume not...)"
5081 $rm -f foo.* safebcpy core
5085 : can memcpy handle overlapping blocks?
5090 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
5091 $cat >foo.c <<'EOCP'
5094 char buf[128], abc[128];
5100 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
5102 for (align = 7; align >= 0; align--) {
5103 for (len = 36; len; len--) {
5105 memcpy(abc, b, len);
5106 for (off = 1; off <= len; off++) {
5107 memcpy(b, b+off, len);
5108 memcpy(b+off, b, len);
5109 if (memcmp(b, abc, len))
5117 if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5118 if ./safemcpy 2>/dev/null; then
5122 echo "It can't, sorry."
5125 echo "(I can't compile the test program, so we'll assume not...)"
5129 $rm -f foo.* safemcpy core
5133 : see if select exists
5137 : see if semctl exists
5141 : see if semget exists
5145 : see if semop exists
5149 : see how much of the 'sem*(2)' library is present.
5152 case "$d_semctl$d_semget$d_semop" in
5153 *"$undef"*) h_sem=false;;
5155 : we could also check for sys/ipc.h ...
5156 if $h_sem && $test `./findhdr sys/sem.h`; then
5157 echo "You have the full sem*(2) library." >&4
5160 echo "You don't have the full sem*(2) library." >&4
5166 : see if setegid exists
5167 set setegid d_setegid
5170 : see if seteuid exists
5171 set seteuid d_seteuid
5174 : see if setlinebuf exists
5175 set setlinebuf d_setlinebuf
5178 : see if setlocale exists
5179 set setlocale d_setlocale
5182 : see if setpgid exists
5183 set setpgid d_setpgid
5186 : see if setpgrp2 exists
5187 set setpgrp2 d_setpgrp2
5190 : see if setpriority exists
5191 set setpriority d_setprior
5194 : see if setregid exists
5195 set setregid d_setregid
5197 set setresgid d_setresgid
5200 : see if setreuid exists
5201 set setreuid d_setreuid
5203 set setresuid d_setresuid
5206 : see if setrgid exists
5207 set setrgid d_setrgid
5210 : see if setruid exists
5211 set setruid d_setruid
5214 : see if setsid exists
5218 : see if shmctl exists
5222 : see if shmget exists
5226 : see if shmat exists
5229 : see what shmat returns
5232 $cat >shmat.c <<'END'
5233 #include <sys/shm.h>
5236 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
5241 echo "and it returns ($shmattype)." >&4
5242 : see if a prototype for shmat is available
5243 $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h > shmat.c 2>/dev/null
5244 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
5255 set d_shmatprototype
5258 : see if shmdt exists
5262 : see how much of the 'shm*(2)' library is present.
5265 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
5266 *"$undef"*) h_shm=false;;
5268 : we could also check for sys/ipc.h ...
5269 if $h_shm && $test `./findhdr sys/shm.h`; then
5270 echo "You have the full shm*(2) library." >&4
5273 echo "You don't have the full shm*(2) library." >&4
5281 : see whether socket exists
5283 $echo $n "Hmm... $c" >&4
5284 if set socket val -f d_socket; eval $csym; $val; then
5285 echo "Looks like you have Berkeley networking support." >&4
5287 if set setsockopt val -f; eval $csym; $val; then
5290 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
5294 if $contains socklib libc.list >/dev/null 2>&1; then
5295 echo "Looks like you have Berkeley networking support." >&4
5297 : we will have to assume that it supports the 4.2 BSD interface
5300 echo "You don't have Berkeley networking in libc.a..." >&4
5301 if test -f /usr/lib/libnet.a; then
5302 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
5303 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
5304 if $contains socket libc.list >/dev/null 2>&1; then
5305 echo "...but the Wollongong group seems to have hacked it in." >&4
5307 sockethdr="-I/usr/netinclude"
5309 if $contains setsockopt libc.list >/dev/null 2>&1; then
5312 echo "...using the old 4.1c interface, rather than 4.2" >&4
5316 echo "or even in libnet.a, which is peculiar." >&4
5321 echo "or anywhere else I see." >&4
5328 : see if socketpair exists
5329 set socketpair d_sockpair
5332 : see if stat knows about block sizes
5334 xxx=`./findhdr sys/stat.h`
5335 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
5336 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
5337 echo "Your stat() knows about block sizes." >&4
5340 echo "Your stat() doesn't know about block sizes." >&4
5344 echo "Your stat() doesn't know about block sizes." >&4
5350 : see if strcoll exists
5351 set strcoll d_strcoll
5354 : check for structure copying
5356 echo "Checking to see if your C compiler can copy structs..." >&4
5357 $cat >try.c <<'EOCP'
5367 if $cc -c try.c >/dev/null 2>&1 ; then
5372 echo "Nope, it can't."
5378 : see if strerror and/or sys_errlist[] exist
5380 if set strerror val -f d_strerror; eval $csym; $val; then
5381 echo 'strerror() found.' >&4
5382 d_strerror="$define"
5383 d_strerrm='strerror(e)'
5384 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5385 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
5386 d_syserrlst="$define"
5388 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
5389 d_syserrlst="$undef"
5391 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
5392 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
5393 echo 'strerror() found in string header.' >&4
5394 d_strerror="$define"
5395 d_strerrm='strerror(e)'
5396 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5397 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
5398 d_syserrlst="$define"
5400 echo "(You don't appear to have any sys_errlist[], how can this be?)"
5401 d_syserrlst="$undef"
5403 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5404 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
5406 d_syserrlst="$define"
5407 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
5409 echo 'strerror() and sys_errlist[] NOT found.' >&4
5411 d_syserrlst="$undef"
5412 d_strerrm='"unknown"'
5415 : see if strxfrm exists
5416 set strxfrm d_strxfrm
5419 : see if symlink exists
5420 set symlink d_symlink
5423 : see if syscall exists
5424 set syscall d_syscall
5427 : see if sysconf exists
5428 set sysconf d_sysconf
5431 : see if system exists
5435 : see if tcgetpgrp exists
5436 set tcgetpgrp d_tcgetpgrp
5439 : see if tcsetpgrp exists
5440 set tcsetpgrp d_tcsetpgrp
5443 : define an is-a-typedef? function
5444 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
5446 "") inclist="sys/types.h";;
5448 eval "varval=\$$var";
5452 for inc in $inclist; do
5453 echo "#include <$inc>" >>temp.c;
5455 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
5456 if $contains $type temp.E >/dev/null 2>&1; then
5462 *) eval "$var=$varval";;
5465 : see if this is a sys/times.h system
5466 set sys/times.h i_systimes
5469 : see if times exists
5471 if set times val -f d_times; eval $csym; $val; then
5472 echo 'times() found.' >&4
5475 case "$i_systimes" in
5476 "$define") inc='sys/times.h';;
5478 set clock_t clocktype long stdio.h sys/types.h $inc
5482 rp="What type is returned by times() on this sytem?"
5486 echo 'times() NOT found, hope that will do.' >&4
5491 : see if truncate exists
5492 set truncate d_truncate
5495 : see if tzname[] exists
5497 if set tzname val -a d_tzname; eval $csym; $val; then
5499 echo 'tzname[] found.' >&4
5502 echo 'tzname[] NOT found.' >&4
5507 : see if umask exists
5511 : see if we have to deal with yellow pages, now NIS.
5512 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5513 if $test -f /usr/etc/nibindd; then
5515 echo "I'm fairly confident you're on a NeXT."
5517 rp='Do you get the hosts file via NetInfo?'
5526 y*) hostcat='nidump hosts .';;
5527 *) hostcat='cat /etc/hosts';;
5535 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5543 rp='Are you getting the hosts file via yellow pages?'
5546 y*) hostcat='ypcat hosts';;
5547 *) hostcat='cat /etc/hosts';;
5553 : now get the host name
5555 echo "Figuring out host name..." >&4
5556 case "$myhostname" in
5558 echo 'Maybe "hostname" will work...'
5559 if tans=`sh -c hostname 2>&1` ; then
5567 if $test "$cont"; then
5569 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5570 if tans=`cat /etc/systemid 2>&1` ; then
5572 phostname='cat /etc/systemid'
5573 echo "Whadyaknow. Xenix always was a bit strange..."
5576 elif $test -r /etc/systemid; then
5577 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5580 if $test "$cont"; then
5581 echo 'No, maybe "uuname -l" will work...'
5582 if tans=`sh -c 'uuname -l' 2>&1` ; then
5584 phostname='uuname -l'
5586 echo 'Strange. Maybe "uname -n" will work...'
5587 if tans=`sh -c 'uname -n' 2>&1` ; then
5589 phostname='uname -n'
5591 echo 'Oh well, maybe I can mine it out of whoami.h...'
5592 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5593 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5594 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5596 case "$myhostname" in
5597 '') echo "Does this machine have an identity crisis or something?"
5600 echo "Well, you said $myhostname before..."
5601 phostname='echo $myhostname';;
5607 : you do not want to know about this
5612 if $test "$myhostname" ; then
5614 rp='Your host name appears to be "'$myhostname'".'" Right?"
5622 : bad guess or no guess
5623 while $test "X$myhostname" = X ; do
5625 rp="Please type the (one word) name of your host:"
5630 : translate upper to lower if necessary
5631 case "$myhostname" in
5633 echo "(Normalizing case in your host name)"
5634 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5638 : a little sanity check here
5639 case "$phostname" in
5642 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5643 $myhostname$mydomain|$myhostname) ;;
5645 case "$phostname" in
5647 echo "(That doesn't agree with your whoami.h file, by the way.)"
5650 echo "(That doesn't agree with your $phostname command, by the way.)"
5658 : see how we will look up host name
5661 : dummy stub to allow use of elif
5662 elif set uname val -f d_uname; eval $csym; $val; then
5665 uname() was found, but you're running xenix, and older versions of xenix
5666 have a broken uname(). If you don't really know whether your xenix is old
5667 enough to have a broken system call, use the default answer.
5674 rp='Is your uname() broken?'
5677 n*) d_uname="$define"; call=uname;;
5680 echo 'uname() found.' >&4
5685 case "$d_gethname" in
5686 '') d_gethname="$undef";;
5689 '') d_uname="$undef";;
5691 case "$d_phostname" in
5692 '') d_phostname="$undef";;
5695 : backward compatibility for d_hvfork
5696 if test X$d_hvfork != X; then
5700 : see if there is a vfork
5705 : Ok, but do we want to use it. vfork is reportedly unreliable in
5706 : perl on Solaris 2.x, and probably elsewhere.
5714 rp="Some systems have problems with vfork(). Do you want to use it?"
5719 echo "Ok, we won't use vfork()."
5728 $define) usevfork='true';;
5729 *) usevfork='false';;
5732 : see if this is an sysdir system
5733 set sys/dir.h i_sysdir
5736 : see if this is an sysndir system
5737 set sys/ndir.h i_sysndir
5740 : see if closedir exists
5741 set closedir d_closedir
5744 case "$d_closedir" in
5747 echo "Checking whether closedir() returns a status..." >&4
5748 cat > closedir.c <<EOM
5749 #$i_dirent I_DIRENT /**/
5750 #$i_sysdir I_SYS_DIR /**/
5751 #$i_sysndir I_SYS_NDIR /**/
5753 #if defined(I_DIRENT)
5755 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
5756 #include <sys/dir.h>
5760 #include <sys/ndir.h>
5764 #include <ndir.h> /* may be wrong in the future */
5766 #include <sys/dir.h>
5771 int main() { return closedir(opendir(".")); }
5773 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
5774 if ./closedir > /dev/null 2>&1 ; then
5775 echo "Yes, it does."
5778 echo "No, it doesn't."
5782 echo "(I can't seem to compile the test program--assuming it doesn't)"
5793 : check for volatile keyword
5795 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
5796 $cat >try.c <<'EOCP'
5799 typedef struct _goo_struct goo_struct;
5800 goo_struct * volatile goo = ((goo_struct *)0);
5801 struct _goo_struct {
5806 typedef unsigned short foo_t;
5809 volatile foo_t blech;
5813 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
5815 echo "Yup, it does."
5818 echo "Nope, it doesn't."
5824 : see if there is a wait4
5828 : see if waitpid exists
5829 set waitpid d_waitpid
5832 : see if wcstombs exists
5833 set wcstombs d_wcstombs
5836 : see if wctomb exists
5840 : preserve RCS keywords in files with variable substitution, grrr
5845 Revision='$Revision'
5847 : check for alignment requirements
5849 case "$alignbytes" in
5850 '') echo "Checking alignment constraints..." >&4
5851 $cat >try.c <<'EOCP'
5858 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
5861 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
5865 echo"(I can't seem to compile the test program...)"
5868 *) dflt="$alignbytes"
5871 rp="Doubles must be aligned on a how-many-byte boundary?"
5876 : determine where public executables go
5887 rp='Pathname where the public executables will reside?'
5894 Since you are running AFS, I need to distinguish the directory in which
5895 executables reside from the directory in which they are installed (and from
5896 which they are presumably copied to the former directory by occult means).
5899 case "$installbin" in
5900 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
5901 *) dflt="$installbin";;
5904 rp='Where will public executables be installed?'
5908 installbin="$binexp"
5911 : check for ordering of bytes in a long
5912 case "$byteorder" in
5916 In the following, larger digits indicate more significance. A big-endian
5917 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
5918 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
5919 machines may have weird orders like 3412. A Cray will report 87654321. If
5920 the test program works the default is probably right.
5921 I'm now running the test program...
5923 $cat >try.c <<'EOCP'
5930 char c[sizeof(long)];
5933 if (sizeof(long) > 4)
5934 u.l = (0x08070605L << 32) | 0x04030201L;
5937 for (i = 0; i < sizeof(long); i++)
5938 printf("%c", u.c[i]+'0');
5942 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
5945 ????|????????) echo "(The test program ran ok.)";;
5946 *) echo "(The test program didn't run right for some reason.)";;
5951 (I can't seem to compile the test program. Guessing big-endian...)
5960 rp="What is the order of bytes in a long?"
5965 : how do we catenate cpp tokens here?
5967 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
5968 $cat >cpp_stuff.c <<'EOCP'
5969 #define RCAT(a,b)a/**/b
5970 #define ACAT(a,b)a ## b
5974 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
5975 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
5976 echo "Oh! Smells like ANSI's been here."
5977 echo "We can catify or stringify, separately or together!"
5979 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
5980 echo "Ah, yes! The good old days!"
5981 echo "However, in the good old days we don't know how to stringify and"
5982 echo "catify at the same time."
5986 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
5987 to have to edit the values of CAT[2-5] in config.h...
5989 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
5993 : see if this is a db.h system
5999 : Check the return type needed for hash
6000 echo "Checking return type needed for hash for Berkeley DB ..." >&4
6002 #include <sys/types.h>
6013 info.hash = hash_cb ;
6016 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6017 if $contains warning try.out >>/dev/null 2>&1 ; then
6020 db_hashtype='u_int32_t'
6023 echo "I can't seem to compile the test program." >&4
6027 echo "Your version of Berkeley DB uses $db_hashtype for hash."
6035 : Check the return type needed for prefix
6036 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
6038 #include <sys/types.h>
6041 prefix_cb (key1, key2)
6049 info.prefix = prefix_cb ;
6052 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6053 if $contains warning try.out >>/dev/null 2>&1 ; then
6056 db_prefixtype='size_t'
6059 echo "I can't seem to compile the test program." >&4
6063 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
6065 *) db_prefixtype='int'
6069 : check for void type
6071 echo "Checking to see how well your C compiler groks the void type..." >&4
6074 Support flag bits are:
6075 1: basic void declarations.
6076 2: arrays of pointers to functions returning void.
6077 4: operations between pointers to and addresses of void functions.
6078 8: generic void pointers.
6081 case "$voidflags" in
6083 $cat >try.c <<'EOCP'
6089 extern void moo(); /* function returning void */
6090 void (*goo)(); /* ptr to func returning void */
6092 void *hue; /* generic ptr */
6106 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6107 voidflags=$defvoidused
6108 echo "It appears to support void to the level $package wants ($defvoidused)."
6109 if $contains warning .out >/dev/null 2>&1; then
6110 echo "However, you might get some warnings that look like this:"
6114 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6115 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
6116 echo "It supports 1..."
6117 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
6118 echo "It also supports 2..."
6119 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
6121 echo "And it supports 4 but not 8 definitely."
6123 echo "It doesn't support 4..."
6124 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
6126 echo "But it supports 8."
6129 echo "Neither does it support 8."
6133 echo "It does not support 2..."
6134 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
6136 echo "But it supports 4 and 8."
6138 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
6140 echo "And it supports 4 but has not heard about 8."
6142 echo "However it supports 8 but not 4."
6147 echo "There is no support at all for void."
6153 rp="Your void support flags add up to what?"
6158 : see if dbm.h is available
6163 : see if dbmclose exists
6164 set dbmclose d_dbmclose
6166 case "$d_dbmclose" in
6169 echo "We won't be including <dbm.h>"
6178 : see if ndbm.h is available
6183 : see if dbm_open exists
6184 set dbm_open d_dbm_open
6186 case "$d_dbm_open" in
6189 echo "We won't be including <ndbm.h>"
6198 : see if gdbm.h is available
6203 : see if gdbm_open exists
6204 set gdbm_open d_gdbm_open
6206 case "$d_gdbm_open" in
6209 echo "We won't be including <gdbm.h>"
6219 echo "Looking for extensions..." >&4
6223 if $test -f $xxx/$xxx.xs; then
6224 known_extensions="$known_extensions $xxx"
6227 set X $known_extensions
6229 known_extensions="$*"
6232 : Now see which are supported on this system.
6234 for xxx in $known_extensions ; do
6236 DB_File) case "$i_db" in
6237 $define) avail_ext="$avail_ext $xxx" ;;
6240 GDBM_File) case "$i_gdbm" in
6241 $define) avail_ext="$avail_ext $xxx" ;;
6244 NDBM_File) case "$i_ndbm" in
6245 $define) avail_ext="$avail_ext $xxx" ;;
6248 ODBM_File) case "$i_dbm" in
6249 $define) avail_ext="$avail_ext $xxx" ;;
6252 POSIX) case "$useposix" in
6253 true|define|y) avail_ext="$avail_ext $xxx" ;;
6256 Socket) case "$d_socket" in
6257 $define) avail_ext="$avail_ext $xxx" ;;
6260 *) avail_ext="$avail_ext $xxx"
6272 A number of extensions are supplied with $package. You may choose to
6273 compile these extensions for dynamic loading (the default), compile
6274 them into the $package executable (static loading), or not include
6275 them at all. Answer "none" to include no extensions.
6278 case "$dynamic_ext" in
6279 ''|' ') dflt="$avail_ext" ;;
6280 *) dflt="$dynamic_ext" ;;
6285 rp="What extensions do you wish to load dynamically?"
6288 none) dynamic_ext='' ;;
6289 *) dynamic_ext="$ans" ;;
6292 case "$static_ext" in
6294 : Exclude those already listed in dynamic linking
6296 for xxx in $avail_ext; do
6297 case " $dynamic_ext " in
6299 *) dflt="$dflt $xxx" ;;
6306 *) dflt="$static_ext"
6313 rp="What extensions do you wish to load statically?"
6316 none) static_ext='' ;;
6317 *) static_ext="$ans" ;;
6322 A number of extensions are supplied with $package. Answer "none"
6323 to include no extensions.
6326 case "$static_ext" in
6327 ''|' ') dflt="$avail_ext" ;;
6328 *) dflt="$static_ext" ;;
6334 rp="What extensions do you wish to include?"
6337 none) static_ext='' ;;
6338 *) static_ext="$ans" ;;
6343 set X $dynamic_ext $static_ext
6347 : see what type file positions are declared as in the library
6348 set fpos_t fpostype long stdio.h sys/types.h
6352 rp="What is the type for file position used by fsetpos()?"
6356 : see what type gids are declared as in the kernel
6357 set gid_t gidtype xxx stdio.h sys/types.h
6361 xxx=`./findhdr sys/user.h`
6362 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
6364 unsigned) dflt="$1 $2" ;;
6368 *) dflt="$gidtype";;
6371 rp="What is the type for group ids returned by getgid()?"
6375 : see if getgroups exists
6376 set getgroups d_getgrps
6379 : Find type of 2nd arg to getgroups
6381 case "$d_getgrps" in
6383 case "$groupstype" in
6384 '') dflt="$gidtype" ;;
6385 *) dflt="$groupstype" ;;
6388 What is the type of the second argument to getgroups()? Usually this
6389 is the same as group ids, $gidtype, but not always.
6392 rp='What type is the second argument to getgroups()?'
6396 *) groupstype="$gidtype";;
6399 : see what type lseek is declared as in the kernel
6400 set off_t lseektype long stdio.h sys/types.h
6404 rp="What type is lseek's offset on this system declared as?"
6408 : determine where manual pages go
6411 $package has manual pages available in source form.
6415 echo "However, you don't have nroff, so they're probably useless to you."
6420 echo "If you don't want the manual sources installed, answer 'none'."
6423 lookpath="$prefix/man/man1 $prefix/man/u_man/man1 $prefix/man/l_man/man1"
6424 lookpath="$lookpath /usr/local/man/man1 /usr/local/man/man1 /usr/man/manl"
6425 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
6426 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6427 lookpath="$lookpath /usr/man/man.L"
6428 mansrc=`./loc . $prefix/man/man1 $lookpath`
6429 if $test -d "$mansrc"; then
6440 rp='Where do the manual pages (source) go?'
6447 Since you are running AFS, I need to distinguish the directory in which
6448 manual pages reside from the directory in which they are installed (and from
6449 which they are presumably copied to the former directory by occult means).
6452 case "$installmansrc" in
6453 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
6454 *) dflt="$installmansrc";;
6457 rp='Where will man pages be installed?'
6459 installmansrc="$ans"
6461 installmansrc="$mansrcexp"
6477 : see what type is used for mode_t
6478 set mode_t modetype int stdio.h sys/types.h
6482 rp="What type is used for file modes?"
6486 : set the base revision
6489 : get the patchlevel
6491 echo "Getting the current patchlevel..." >&4
6492 if $test -r ../patchlevel.h;then
6493 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
6497 echo "(You have $package $baserev PL$patchlevel.)"
6499 : Cruising for prototypes
6501 echo "Checking out function prototypes..." >&4
6502 $cat >prototype.c <<'EOCP'
6503 main(int argc, char *argv[]) {
6506 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6507 echo "Your C compiler appears to support function prototypes."
6510 echo "Your C compiler doesn't seem to understand function prototypes."
6517 : check for size of random number generator
6521 echo "Checking to see how many bits your rand function produces..." >&4
6522 $cat >try.c <<'EOCP'
6527 register unsigned long tmp;
6528 register unsigned long max = 0L;
6530 for (i = 1000; i; i--) {
6531 tmp = (unsigned long)rand();
6532 if (tmp > max) max = tmp;
6534 for (i = 0; max; i++)
6539 if $cc try.c -o try >/dev/null 2>&1 ; then
6543 echo "(I can't seem to compile the test program...)"
6550 rp='How many bits does your rand() function produce?'
6555 : see if ar generates random libraries by itself
6557 echo "Checking how to generate random libraries on your machine..." >&4
6558 echo 'int bar1() { return bar2(); }' > bar1.c
6559 echo 'int bar2() { return 2; }' > bar2.c
6560 $cat > foo.c <<'EOP'
6561 main() { printf("%d\n", bar1()); exit(0); }
6563 $cc $ccflags -c bar1.c >/dev/null 2>&1
6564 $cc $ccflags -c bar2.c >/dev/null 2>&1
6565 $cc $ccflags -c foo.c >/dev/null 2>&1
6566 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
6567 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6568 ./foobar >/dev/null 2>&1; then
6569 echo "ar appears to generate random libraries itself."
6572 elif ar ts bar.a >/dev/null 2>&1 &&
6573 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6574 ./foobar >/dev/null 2>&1; then
6575 echo "a table of contents needs to be added with 'ar ts'."
6582 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
6583 $test -f $ranlib || ranlib=''
6586 if $test -n "$ranlib"; then
6587 echo "your system has '$ranlib'; we'll use that."
6590 echo "your system doesn't seem to support random libraries"
6591 echo "so we'll use lorder and tsort to order the libraries."
6598 : determine where public executable scripts go
6599 case "$scriptdir" in
6602 : guess some guesses
6603 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6604 $test -d /usr/share/bin && dflt=/usr/share/bin
6605 $test -d /usr/local/script && dflt=/usr/local/script
6606 $test -d $prefix/script && dflt=$prefix/script
6608 *) dflt="$scriptdir"
6613 Some installations have a separate directory just for executable scripts so
6614 that they can mount it across multiple architectures but keep the scripts in
6615 one spot. You might, for example, have a subdirectory of /usr/share for this.
6616 Or you might just lump your scripts in with all your other executables.
6620 rp='Where do you keep publicly executable scripts?'
6623 scriptdirexp="$ansexp"
6627 Since you are running AFS, I need to distinguish the directory in which
6628 scripts reside from the directory in which they are installed (and from
6629 which they are presumably copied to the former directory by occult means).
6632 case "$installscript" in
6633 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6634 *) dflt="$installscript";;
6637 rp='Where will public scripts be installed?'
6639 installscript="$ans"
6641 installscript="$scriptdirexp"
6644 : see if sys/select.h has to be included
6645 set sys/select.h i_sysselct
6648 : see if we should include time.h, sys/time.h, or both
6650 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
6651 $echo $n "I'm now running the test program...$c"
6652 $cat >try.c <<'EOCP'
6653 #include <sys/types.h>
6658 #ifdef SYSTIMEKERNEL
6661 #include <sys/time.h>
6664 #include <sys/select.h>
6673 struct timezone tzp;
6675 if (foo.tm_sec == foo.tm_sec)
6678 if (bar.tv_sec == bar.tv_sec)
6687 for s_timeval in '-DS_TIMEVAL' ''; do
6688 for i_systimek in '' '-DSYSTIMEKERNEL'; do
6689 for i_time in '' '-DI_TIME'; do
6690 for i_systime in '-DI_SYSTIME' ''; do
6694 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
6695 try.c -o try >/dev/null 2>&1 ; then
6696 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
6700 $echo $n "Succeeded with $flags$c"
6711 *SYSTIMEKERNEL*) i_systimek="$define"
6712 timeincl=`./findhdr sys/time.h`
6713 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
6714 *) i_systimek="$undef";;
6717 *I_TIME*) i_time="$define"
6718 timeincl=`./findhdr time.h`" $timeincl"
6719 echo "We'll include <time.h>." >&4;;
6720 *) i_time="$undef";;
6723 *I_SYSTIME*) i_systime="$define"
6724 timeincl=`./findhdr sys/time.h`" $timeincl"
6725 echo "We'll include <sys/time.h>." >&4;;
6726 *) i_systime="$undef";;
6730 : check for fd_set items
6733 Checking to see how well your C compiler handles fd_set and friends ...
6735 $cat >fd_set.c <<EOCP
6736 #$i_systime I_SYS_TIME
6737 #$i_sysselct I_SYS_SELECT
6738 #$d_socket HAS_SOCKET
6739 #include <sys/types.h>
6741 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6744 #include <sys/time.h>
6747 #include <sys/select.h>
6757 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
6764 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6765 d_fds_bits="$define"
6767 echo "Well, your system knows about the normal fd_set typedef..." >&4
6769 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
6770 d_fd_macros="$define"
6773 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
6775 d_fd_macros="$undef"
6779 Hmm, your compiler has some difficulty with fd_set. Checking further...
6781 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6784 echo "Well, your system has some sort of fd_set available..." >&4
6786 echo "and you have the normal fd_set macros." >&4
6787 d_fd_macros="$define"
6790 but not the normal fd_set macros! Gross! More work for me...
6792 d_fd_macros="$undef"
6795 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
6798 d_fd_macros="$undef"
6804 : check for type of arguments to select. This will only really
6805 : work if the system supports prototypes and provides one for
6809 : Make initial guess
6810 case "$selecttype" in
6813 $define) xxx='fd_set *' ;;
6817 *) xxx="$selecttype"
6822 'fd_set *') yyy='int *' ;;
6823 'int *') yyy='fd_set *' ;;
6828 Checking to see what type of arguments are expected by select().
6831 #$i_systime I_SYS_TIME
6832 #$i_sysselct I_SYS_SELECT
6833 #$d_socket HAS_SOCKET
6834 #include <sys/types.h>
6836 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6839 #include <sys/time.h>
6842 #include <sys/select.h>
6848 Select_fd_set_t readfds;
6849 Select_fd_set_t writefds;
6850 Select_fd_set_t exceptfds;
6851 struct timeval timeout;
6852 select(width, readfds, writefds, exceptfds, &timeout);
6856 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
6858 echo "Your system uses $xxx for the arguments to select." >&4
6859 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
6861 echo "Your system uses $yyy for the arguments to select." >&4
6863 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
6870 *) selecttype = 'int *'
6874 : generate list of signal names
6878 echo "Generating a list of signal names..." >&4
6879 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
6880 set X `cat $xxx 2>&1 | $awk '
6881 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
6882 sig[$3] = substr($2,4,20)
6883 if (max < $3 && $3 < 60) {
6889 for (i = 1; i <= max; i++) {
6903 echo 'kill -l' >/tmp/foo$$
6904 set X `csh -f </tmp/foo$$`
6908 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
6916 echo "The following signals are available:"
6918 echo $sig_name | $awk \
6919 'BEGIN { linelen = 0 }
6921 for (i = 1; i < NF; i++) {
6923 linelen = linelen + length(name)
6926 linelen = length(name)
6933 : see what type is used for size_t
6934 set size_t sizetype 'unsigned int' stdio.h sys/types.h
6938 rp="What type is used for the length parameter for string functions?"
6942 : see what type is used for signed size_t
6943 set ssize_t ssizetype int stdio.h sys/types.h
6946 $cat > ssize.c <<EOM
6948 #include <sys/types.h>
6949 #define Size_t $sizetype
6950 #define SSize_t $dflt
6953 if (sizeof(Size_t) == sizeof(SSize_t))
6955 else if (sizeof(Size_t) == sizeof(int))
6962 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
6964 echo "I'll be using $ssizetype for functions returning a byte count." >&4
6966 echo "(I can't compile the test program--please enlighten me!)"
6969 I need a type that is the same size as $sizetype, but is guaranteed to
6970 be signed. Common values are int and long.
6973 rp="What signed type is the same size as $sizetype?"
6977 $rm -f ssize ssize.[co]
6979 : see what type of char stdio uses.
6981 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
6982 echo "Your stdio uses unsigned chars." >&4
6983 stdchar="unsigned char"
6985 echo "Your stdio uses signed chars." >&4
6989 : see if time exists
6991 if set time val -f d_time; eval $csym; $val; then
6992 echo 'time() found.' >&4
6994 set time_t timetype long stdio.h sys/types.h
6998 rp="What type is returned by time() on this sytem?"
7002 echo 'time() not found, hope that will do.' >&4
7009 : see what type uids are declared as in the kernel
7010 set uid_t uidtype xxx stdio.h sys/types.h
7014 xxx=`./findhdr sys/user.h`
7015 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
7017 unsigned) dflt="$1 $2" ;;
7021 *) dflt="$uidtype";;
7024 rp="What is the type for user ids returned by getuid()?"
7028 : see if this is a sys/file.h system
7033 : do we need to #include <sys/file.h> ?
7039 echo "We'll be including <sys/file.h>." >&4
7042 echo "We won't be including <sys/file.h>." >&4
7052 : see if fcntl.h is there
7057 : see if we can include fcntl.h
7063 echo "We'll be including <fcntl.h>." >&4
7067 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
7069 echo "We won't be including <fcntl.h>." >&4
7081 : see if this is an grp system
7085 : see if this is a math.h system
7089 : see if memory.h is available.
7094 : See if it conflicts with string.h
7100 $cppstdin $cppflags $cppminus < $strings > mem.h
7101 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7103 echo "We won't be including <memory.h>."
7113 : see if net/errno.h is available
7118 : Unfortunately, it causes problems on some systems. Arrgh.
7124 #include <net/errno.h>
7130 if $cc $ccflags -c try.c >/dev/null 2>&1; then
7131 echo "We'll be including <net/errno.h>." >&4
7133 echo "We won't be including <net/errno.h>." >&4
7142 : get C preprocessor symbols handy
7144 $echo $n "Hmm... $c"
7145 echo $al | $tr ' ' '\012' >Cppsym.know
7157 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
7159 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
7162 unknown="\$unknown \$sym"
7172 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
7174 exit 0; _ _ _ _\1\\ \1\\
7177 echo "exit 1; _ _ _" >>Cppsym\$\$
7178 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
7180 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
7186 $rm -f Cppsym\$\$ Cppsym2\$\$
7191 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
7193 : now check the C compiler for additional symbols
7199 for i in \`$cc -v -c tmp.c 2>&1\`
7202 -D*) echo "\$i" | $sed 's/^-D//';;
7203 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
7210 ./ccsym | $sort | $uniq >ccsym.raw
7211 $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list
7212 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
7213 $comm -13 ccsym.true ccsym.list >ccsym.own
7214 $comm -12 ccsym.true ccsym.list >ccsym.com
7215 $comm -23 ccsym.true ccsym.list >ccsym.cpp
7218 if $test -z ccsym.raw; then
7219 echo "Your C compiler doesn't seem to define any symbol!" >&4
7221 echo "However, your C preprocessor defines the following ones:"
7224 if $test -s ccsym.com; then
7225 echo "Your C compiler and pre-processor define these symbols:"
7226 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
7229 $test "$silent" || sleep 1
7231 if $test -s ccsym.cpp; then
7232 $test "$also" && echo " "
7233 echo "Your C pre-processor ${also}defines the following $symbols:"
7234 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
7236 $test "$silent" || sleep 1
7238 if $test -s ccsym.own; then
7239 $test "$also" && echo " "
7240 echo "Your C compiler ${also}defines the following cpp variables:"
7241 $sed -e 's/\(.*\)=1/\1/' ccsym.own
7242 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
7243 $test "$silent" || sleep 1
7248 : see if this is a termio system
7252 if $test `./findhdr termios.h`; then
7253 set tcsetattr i_termios
7259 "$define") echo "You have POSIX termios.h... good!" >&4;;
7260 *) if ./Cppsym pyr; then
7261 case "`/bin/universe`" in
7262 ucb) if $test `./findhdr sgtty.h`; then
7264 echo "<sgtty.h> found." >&4
7266 echo "System is pyramid with BSD universe."
7267 echo "<sgtty.h> not found--you could have problems." >&4
7269 *) if $test `./findhdr termio.h`; then
7271 echo "<termio.h> found." >&4
7273 echo "System is pyramid with USG universe."
7274 echo "<termio.h> not found--you could have problems." >&4
7278 if $test `./findhdr termio.h`; then
7279 echo "<termio.h> found." >&4
7281 elif $test `./findhdr sgtty.h`; then
7282 echo "<sgtty.h> found." >&4
7285 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
7288 if $test `./findhdr sgtty.h`; then
7289 echo "<sgtty.h> found." >&4
7291 elif $test `./findhdr termio.h`; then
7292 echo "<termio.h> found." >&4
7295 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
7299 set i_termio; eval $setvar
7300 val=$val2; set i_sgtty; eval $setvar
7301 val=$val3; set i_termios; eval $setvar
7303 : see if stdarg is available
7305 if $test `./findhdr stdarg.h`; then
7306 echo "<stdarg.h> found." >&4
7309 echo "<stdarg.h> NOT found." >&4
7313 : see if varags is available
7315 if $test `./findhdr varargs.h`; then
7316 echo "<varargs.h> found." >&4
7318 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
7321 : set up the varargs testing programs
7322 $cat > varargs.c <<EOP
7327 #include <varargs.h>
7345 p = va_arg(ap, char *);
7350 $cat > varargs <<EOP
7351 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
7360 : now check which varargs header should be included
7365 if `./varargs I_STDARG`; then
7367 elif `./varargs I_VARARGS`; then
7372 if `./varargs I_VARARGS`; then
7379 echo "I could not find the definition for va_dcl... You have problems..." >&4
7380 val="$undef"; set i_stdarg; eval $setvar
7381 val="$undef"; set i_varargs; eval $setvar
7388 val="$define"; set i_stdarg; eval $setvar
7389 val="$undef"; set i_varargs; eval $setvar
7392 val="$undef"; set i_stdarg; eval $setvar
7393 val="$define"; set i_varargs; eval $setvar
7396 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
7400 : see if stddef is available
7401 set stddef.h i_stddef
7404 : see if stdlib is available
7405 set stdlib.h i_stdlib
7408 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
7409 set sys/filio.h i_sysfilio
7412 if $test `./findhdr sys/ioctl.h`; then
7414 echo '<sys/ioctl.h> found.' >&4
7417 if $test $i_sysfilio = "$define"; then
7418 echo '<sys/ioctl.h> NOT found.' >&4
7420 $test $i_sgtty = "$define" && xxx="sgtty.h"
7421 $test $i_termio = "$define" && xxx="termio.h"
7422 $test $i_termios = "$define" && xxx="termios.h"
7423 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
7429 : see if this is a sys/param system
7430 set sys/param.h i_sysparam
7433 : see if this is a unistd.h system
7434 set unistd.h i_unistd
7437 : see if this is an utime system
7441 : see if this is a vfork system
7452 : end of configuration questions
7454 echo "End of configuration questions."
7457 : back to where it started
7458 if test -d ../UU; then
7462 : configuration may be patched via a 'config.over' file
7463 if $test -f config.over; then
7466 rp='I see a config.over file. Do you wish to load it?'
7469 n*) echo "OK, I'll ignore it.";;
7471 echo "Configuration override changes have been loaded."
7476 : in case they want portability, strip down executable paths
7477 case "$d_portable" in
7480 echo "Stripping down executable paths..." >&4
7481 for file in $loclist $trylist; do
7487 : create config.sh file
7489 echo "Creating config.sh..." >&4
7490 $spitshell <<EOT >config.sh
7493 # This file was produced by running the Configure script. It holds all the
7494 # definitions figured out by Configure. Should you modify one of these values,
7495 # do not forget to propagate your changes by running "Configure -der". You may
7496 # instead choose to run each of the .SH files by yourself, or "Configure -S".
7499 # Configuration time: $cf_time
7500 # Configured by: $cf_by
7501 # Target system: $myuname
7511 Revision='$Revision'
7515 alignbytes='$alignbytes'
7516 aphostname='$aphostname'
7518 archlibexp='$archlibexp'
7519 archname='$archname'
7527 byteorder='$byteorder'
7529 castflags='$castflags'
7532 cccdlflags='$cccdlflags'
7533 ccdlflags='$ccdlflags'
7540 clocktype='$clocktype'
7542 compress='$compress'
7543 contains='$contains'
7547 cpp_stuff='$cpp_stuff'
7548 cppflags='$cppflags'
7550 cppminus='$cppminus'
7552 cppstdin='$cppstdin'
7553 cryptlib='$cryptlib'
7555 d_Gconvert='$d_Gconvert'
7556 d_access='$d_access'
7558 d_archlib='$d_archlib'
7559 d_attribut='$d_attribut'
7563 d_bsdpgrp='$d_bsdpgrp'
7565 d_casti32='$d_casti32'
7566 d_castneg='$d_castneg'
7567 d_charvspr='$d_charvspr'
7569 d_chroot='$d_chroot'
7570 d_chsize='$d_chsize'
7571 d_closedir='$d_closedir'
7575 d_cuserid='$d_cuserid'
7576 d_dbl_dig='$d_dbl_dig'
7577 d_difftime='$d_difftime'
7578 d_dirnamlen='$d_dirnamlen'
7579 d_dlerror='$d_dlerror'
7580 d_dlopen='$d_dlopen'
7581 d_dlsymun='$d_dlsymun'
7582 d_dosuid='$d_dosuid'
7585 d_eunice='$d_eunice'
7586 d_fchmod='$d_fchmod'
7587 d_fchown='$d_fchown'
7589 d_fd_macros='$d_fd_macros'
7590 d_fd_set='$d_fd_set'
7591 d_fds_bits='$d_fds_bits'
7592 d_fgetpos='$d_fgetpos'
7593 d_flexfnam='$d_flexfnam'
7597 d_fpathconf='$d_fpathconf'
7598 d_fsetpos='$d_fsetpos'
7599 d_getgrps='$d_getgrps'
7600 d_gethent='$d_gethent'
7601 d_gethname='$d_gethname'
7602 d_getlogin='$d_getlogin'
7603 d_getpgrp2='$d_getpgrp2'
7604 d_getpgrp='$d_getpgrp'
7605 d_getppid='$d_getppid'
7606 d_getprior='$d_getprior'
7610 d_isascii='$d_isascii'
7611 d_killpg='$d_killpg'
7613 d_linuxstd='$d_linuxstd'
7614 d_locconv='$d_locconv'
7618 d_mbstowcs='$d_mbstowcs'
7619 d_mbtowc='$d_mbtowc'
7620 d_memcmp='$d_memcmp'
7621 d_memcpy='$d_memcpy'
7622 d_memmove='$d_memmove'
7623 d_memset='$d_memset'
7625 d_mkfifo='$d_mkfifo'
7626 d_mktime='$d_mktime'
7628 d_msgctl='$d_msgctl'
7629 d_msgget='$d_msgget'
7630 d_msgrcv='$d_msgrcv'
7631 d_msgsnd='$d_msgsnd'
7632 d_mymalloc='$d_mymalloc'
7634 d_oldsock='$d_oldsock'
7636 d_passwd='$d_passwd'
7637 d_pathconf='$d_pathconf'
7639 d_phostname='$d_phostname'
7641 d_portable='$d_portable'
7643 d_pwchange='$d_pwchange'
7644 d_pwclass='$d_pwclass'
7645 d_pwcomment='$d_pwcomment'
7646 d_pwexpire='$d_pwexpire'
7647 d_pwquota='$d_pwquota'
7648 d_readdir='$d_readdir'
7649 d_readlink='$d_readlink'
7650 d_rename='$d_rename'
7651 d_rewinddir='$d_rewinddir'
7653 d_safebcpy='$d_safebcpy'
7654 d_safemcpy='$d_safemcpy'
7655 d_seekdir='$d_seekdir'
7656 d_select='$d_select'
7658 d_semctl='$d_semctl'
7659 d_semget='$d_semget'
7661 d_setegid='$d_setegid'
7662 d_seteuid='$d_seteuid'
7663 d_setlinebuf='$d_setlinebuf'
7664 d_setlocale='$d_setlocale'
7665 d_setpgid='$d_setpgid'
7666 d_setpgrp2='$d_setpgrp2'
7667 d_setpgrp='$d_setpgrp'
7668 d_setprior='$d_setprior'
7669 d_setregid='$d_setregid'
7670 d_setresgid='$d_setresgid'
7671 d_setresuid='$d_setresuid'
7672 d_setreuid='$d_setreuid'
7673 d_setrgid='$d_setrgid'
7674 d_setruid='$d_setruid'
7675 d_setsid='$d_setsid'
7678 d_shmatprototype='$d_shmatprototype'
7679 d_shmctl='$d_shmctl'
7681 d_shmget='$d_shmget'
7682 d_shrplib='$d_shrplib'
7683 d_socket='$d_socket'
7684 d_sockpair='$d_sockpair'
7685 d_statblks='$d_statblks'
7686 d_stdstdio='$d_stdstdio'
7687 d_strchr='$d_strchr'
7688 d_strcoll='$d_strcoll'
7689 d_strctcpy='$d_strctcpy'
7690 d_strerrm='$d_strerrm'
7691 d_strerror='$d_strerror'
7692 d_strxfrm='$d_strxfrm'
7693 d_suidsafe='$d_suidsafe'
7694 d_symlink='$d_symlink'
7695 d_syscall='$d_syscall'
7696 d_sysconf='$d_sysconf'
7697 d_sysernlst='$d_sysernlst'
7698 d_syserrlst='$d_syserrlst'
7699 d_system='$d_system'
7700 d_tcgetpgrp='$d_tcgetpgrp'
7701 d_tcsetpgrp='$d_tcsetpgrp'
7702 d_telldir='$d_telldir'
7705 d_truncate='$d_truncate'
7706 d_tzname='$d_tzname'
7710 d_void_closedir='$d_void_closedir'
7711 d_voidsig='$d_voidsig'
7712 d_voidtty='$d_voidtty'
7713 d_volatile='$d_volatile'
7714 d_vprintf='$d_vprintf'
7716 d_waitpid='$d_waitpid'
7717 d_wcstombs='$d_wcstombs'
7718 d_wctomb='$d_wctomb'
7721 db_hashtype='$db_hashtype'
7722 db_prefixtype='$db_prefixtype'
7723 defvoidused='$defvoidused'
7724 direntrytype='$direntrytype'
7727 dynamic_ext='$dynamic_ext'
7731 eunicefix='$eunicefix'
7733 extensions='$extensions'
7736 fpostype='$fpostype'
7738 gccversion='$gccversion'
7742 groupcat='$groupcat'
7743 groupstype='$groupstype'
7745 h_sysfile='$h_sysfile'
7749 i_bsdioctl='$i_bsdioctl'
7752 i_dirent='$i_dirent'
7759 i_limits='$i_limits'
7760 i_malloc='$i_malloc'
7762 i_memory='$i_memory'
7764 i_neterrno='$i_neterrno'
7768 i_stdarg='$i_stdarg'
7769 i_stddef='$i_stddef'
7770 i_stdlib='$i_stdlib'
7771 i_string='$i_string'
7772 i_sysdir='$i_sysdir'
7773 i_sysfile='$i_sysfile'
7774 i_sysfilio='$i_sysfilio'
7776 i_sysioctl='$i_sysioctl'
7777 i_sysndir='$i_sysndir'
7778 i_sysparam='$i_sysparam'
7779 i_sysselct='$i_sysselct'
7780 i_syssockio='$i_syssockio'
7781 i_systime='$i_systime'
7782 i_systimek='$i_systimek'
7783 i_systimes='$i_systimes'
7784 i_termio='$i_termio'
7785 i_termios='$i_termios'
7787 i_unistd='$i_unistd'
7789 i_varargs='$i_varargs'
7790 i_varhdr='$i_varhdr'
7794 installarchlib='$installarchlib'
7795 installbin='$installbin'
7796 installmansrc='$installmansrc'
7797 installprivlib='$installprivlib'
7798 installscript='$installscript'
7800 known_extensions='$known_extensions'
7803 lddlflags='$lddlflags'
7809 libswanted='$libswanted'
7818 lseektype='$lseektype'
7822 mallocobj='$mallocobj'
7823 mallocsrc='$mallocsrc'
7824 malloctype='$malloctype'
7827 mansrcexp='$mansrcexp'
7830 mips_type='$mips_type'
7833 modetype='$modetype'
7836 mydomain='$mydomain'
7837 myhostname='$myhostname'
7842 optimize='$optimize'
7843 orderlib='$orderlib'
7848 patchlevel='$patchlevel'
7851 phostname='$phostname'
7857 privlibexp='$privlibexp'
7858 prototype='$prototype'
7859 randbits='$randbits'
7864 scriptdir='$scriptdir'
7865 scriptdirexp='$scriptdirexp'
7867 selecttype='$selecttype'
7868 sendmail='$sendmail'
7871 sharpbang='$sharpbang'
7872 shmattype='$shmattype'
7875 sig_name='$sig_name'
7876 signal_t='$signal_t'
7877 sizetype='$sizetype'
7882 sockethdr='$sockethdr'
7883 socketlib='$socketlib'
7885 spackage='$spackage'
7886 spitshell='$spitshell'
7888 ssizetype='$ssizetype'
7890 static_ext='$static_ext'
7899 timeincl='$timeincl'
7900 timetype='$timetype'
7908 usemymalloc='$usemymalloc'
7910 useposix='$useposix'
7911 usevfork='$usevfork'
7915 voidflags='$voidflags'
7920 : add special variables
7921 $test -f patchlevel.h && \
7922 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
7923 echo "CONFIG=true" >>config.sh
7925 : propagate old symbols
7926 if $test -f UU/config.sh; then
7927 <UU/config.sh sort | uniq >UU/oldconfig.sh
7928 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
7929 sort | uniq -u >UU/oldsyms
7930 set X `cat UU/oldsyms`
7936 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
7938 echo "# Variables propagated from previous config.sh file." >>config.sh
7939 for sym in `cat UU/oldsyms`; do
7940 echo " Propagating $hint variable "'$'"$sym..."
7941 eval 'tmp="$'"${sym}"'"'
7943 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
7949 : Finish up by extracting the .SH files
7962 echo "If you didn't make any mistakes, then just type a carriage return here."
7963 rp="If you need to edit config.sh, do it as a shell escape here:"
7968 *) : in case they cannot read
7974 : if this fails, just run all the .SH files by hand
7981 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
7988 Now you need to generate make dependencies by running "make depend".
7989 You might prefer to run it in background: "make depend > makedepend.out &"
7990 It can take a while, so you might not want to run it right now.
7995 rp="Run make depend now?"
7999 make depend && echo "Now you must run a make."
8002 echo "You must run 'make depend' then 'make'."
8005 elif test -f [Mm]akefile; then
8007 echo "Now you must run a make."
8012 $rm -f kit*isdone ark*isdone