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 Sat Feb 11 11:56:23 EST 1995 [metaconfig 3.0 PL50]
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
531 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
534 : We must find out about Eunice early
536 if test -f /etc/unixtovms; then
537 eunicefix=/etc/unixtovms
539 if test -f /etc/unixtovms.exe; then
540 eunicefix=/etc/unixtovms.exe
543 : list of known cpp symbols, sorted alphabetically
544 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
545 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
546 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
547 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
548 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
549 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
550 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
551 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
552 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
553 al="$al VMS Xenix286"
554 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
555 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
556 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
557 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
558 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
559 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
560 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
561 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
562 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
563 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
564 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
565 al="$al __SVR4_2__ __UMAXV__"
566 al="$al ____386BSD____ __alpha __alpha__ __amiga"
567 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
568 al="$al __host_mips__"
569 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
570 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
571 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
572 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
573 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
574 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
575 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
576 al="$al __mc88100 __mc88100__ __mips __mips__"
577 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
578 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
579 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
580 al="$al _host_mips _mips _unix"
581 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
582 al="$al apollo ardent att386 att3b"
583 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
584 al="$al cadmus clipper concurrent convex cray ctix"
585 al="$al dmert encore gcos gcx gimpel gould"
586 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
587 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
588 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
589 al="$al i186 i286 i386 i486 i8086"
590 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
591 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
592 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
593 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
594 al="$al mc88000 mc88100 merlin mert mips mvs n16"
595 al="$al ncl_el ncl_mr"
596 al="$al news1500 news1700 news1800 news1900 news3700"
597 al="$al news700 news800 news900 ns16000 ns32000"
598 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
599 al="$al parisc pc532 pdp11 plexus posix pyr"
600 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
601 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
602 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
603 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
604 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
605 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
611 : change the next line if compiling for Xenix/286 on Xenix/386
612 xlibpth='/usr/lib/386 /lib/386'
614 : general looking path for locating libraries
615 glibpth="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
616 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
617 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
619 : Private path used by Configure to find libraries. Its value
620 : is prepended to libpth. This variable takes care of special
621 : machines, like the mips. Usually, it should be empty.
624 : default library list
626 : full support for void wanted by default
629 : set useposix=false in your hint file to disable the POSIX extension.
631 : no include file wanted by default
634 : List of libraries we want.
635 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
636 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
637 libswanted="$libswanted ucb bsd BSD PW x"
638 : We probably want to search /usr/shlib before most other libraries.
639 : This is only used by ext/util/extliblist
640 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
641 glibpth="/usr/shlib $glibpth"
642 : Do not use vfork unless overridden by a hint file.
644 : We might as well always be portable. It makes no difference for
645 : perl5, and makes people happy.
648 : script used to extract .SH files with variable substitutions
651 echo "Doing variable substitutions on .SH files..."
652 if test -f MANIFEST; then
653 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
654 : Pick up possible extension manifests.
655 for dir in ext/* ; do
656 if test -f $dir/MANIFEST; then
657 xxx=`awk '{print $1}' < $dir/MANIFEST |
658 sed -n "/\.SH$/ s@^@$dir/@p"`
659 shlist="$shlist $xxx"
664 echo "(Looking for .SH files under the current directory.)"
665 set x `find . -name "*.SH" -print`
669 0) set x *.SH; shift;;
671 if test ! -f $1; then
677 dir=`expr X$file : 'X\(.*\)/'`
678 file=`expr X$file : 'X.*/\(.*\)'`
679 (cd $dir && . ./$file)
686 if test -f config_h.SH; then
687 if test ! -f config.h; then
688 : oops, they left it out of MANIFEST, probably, so do it anyway.
694 : produce awk script to parse command line options
695 cat >options.awk <<'EOF'
697 optstr = "dD:eEf:hOrsSU:V"; # getopt-style specification
699 len = length(optstr);
700 for (i = 1; i <= len; i++) {
701 c = substr(optstr, i, 1);
702 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
713 if (substr(str, 1, 1) != "-") {
714 printf("'%s'\n", str);
718 for (i = 2; i <= len; i++) {
719 c = substr(str, i, 1);
721 printf("-%s\n", substr(str, i));
727 printf("'%s'\n", substr(str, i + 1));
740 : process the command line options
741 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
746 : set up default values
758 while test $# -gt 0; do
760 -d) shift; fastread=yes;;
761 -e) shift; alldone=cont;;
765 if test -r "$1"; then
768 echo "$me: cannot read config file $1." >&2
773 -h) shift; error=true;;
774 -r) shift; reuseval=true;;
775 -s) shift; silent=true;;
776 -E) shift; alldone=exit;;
777 -O) shift; override=true;;
778 -S) shift; extractsh=true;;
783 echo "$me: use '-U symbol=', not '-D symbol='." >&2
784 echo "$me: ignoring -D $1" >&2
787 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
788 *) echo "$1='define'" >> optdef.sh;;
795 *=) echo "$1" >> optdef.sh;;
797 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
798 echo "$me: ignoring -U $1" >&2
800 *) echo "$1='undef'" >> optdef.sh;;
804 -V) echo "$me generated by metaconfig 3.0 PL50." >&2
807 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
815 Usage: $me [-dehrEOSV] [-f config.sh] [-D symbol] [-D symbol=value]
816 [-U symbol] [-U symbol=]
817 -d : use defaults for all answers.
818 -e : go on without questioning past the production of config.sh.
819 -f : specify an alternate default configuration file.
820 -h : print this help message and exit (with an error status).
821 -r : reuse C symbols value if possible (skips costly nm extraction).
822 -s : silent mode, only echoes questions and essential information.
823 -D : define symbol to have some value:
824 -D symbol symbol gets the value 'define'
825 -D symbol=value symbol gets the value 'value'
826 -E : stop at the end of questions, after having produced config.sh.
827 -O : let -D and -U override definitions from loaded configuration file.
828 -S : perform variable substitutions on all .SH files (can mix with -f)
829 -U : undefine symbol:
830 -U symbol symbol gets the value 'undef'
831 -U symbol= symbol gets completely empty
832 -V : print version number and exit (with a zero status).
840 true) exec 1>/dev/null;;
843 : run the defines and the undefines, if any, but leave the file out there...
850 '') config_sh='config.sh'; config='./config.sh';;
851 /*) config="$config_sh";;
852 *) config="./$config_sh";;
855 echo "Fetching answers from $config_sh..."
858 test "$override" && . ./optdef.sh
869 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
870 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
871 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
872 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
873 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
876 : Eunice requires " " instead of "", can you believe it
879 echo "Beginning of configuration questions for $package."
881 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
883 : Some greps do not return status, grrr.
884 echo "grimblepritz" >grimble
885 if grep blurfldyick grimble >/dev/null 2>&1 ; then
887 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
893 : the following should work in any shell
897 echo "AGH! Grep doesn't return a status. Attempting remedial action."
898 cat >contains <<'EOSS'
899 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
904 : first determine how to suppress newline on echo command
906 echo "Checking echo to see how to suppress newlines..."
907 (echo "hi there\c" ; echo " ") >.echotmp
908 if $contains c .echotmp >/dev/null 2>&1 ; then
919 echo $n "The star should be here-->$c"
923 : Now test for existence of everything in MANIFEST
925 if test -f ../MANIFEST; then
926 echo "First let's make sure your kit is complete. Checking..." >&4
927 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
929 for filelist in x??; do
930 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
932 if test -s missing; then
936 THIS PACKAGE SEEMS TO BE INCOMPLETE.
938 You have the option of continuing the configuration process, despite the
939 distinct possibility that your kit is damaged, by typing 'y'es. If you
940 do, don't blame me if something goes wrong. I advise you to type 'n'o
941 and contact the author (lwall@netlabs.com).
944 echo $n "Continue? [n] $c" >&4
948 echo "Continuing..." >&4
952 echo "ABORTING..." >&4
957 echo "Looks good..." >&4
960 echo "There is no MANIFEST file. I hope your kit is complete !"
964 : compute the number of columns on the terminal for proper question formatting
969 : set up the echo used in my read
970 myecho="case \"\$xxxm\" in
971 '') echo $n \"\$rp $c\" >&4;;
973 '') echo $n \"[\$xxxm] $c\";;
975 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
977 echo $n \"[\$xxxm] $c\" >&4
979 echo $n \"\$rp [\$xxxm] $c\" >&4
985 : now set up to do reads with possible shell escape and default assignment
991 yes) case "\$dflt" in
994 case "\$silent-\$rp" in
999 *) case "\$silent" in
1000 true) case "\$rp" in
1005 while expr "X\$ans" : "X!" >/dev/null; do
1009 aok=''; eval "ans=\"\$answ\"" && aok=y
1014 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1019 echo "(OK, I'll run with -d after this question.)"
1022 echo "*** Sorry, \$1 not supported yet."
1034 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1044 echo "*** Substitution done -- please confirm."
1046 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1051 echo "*** Error -- try again."
1058 case "\$ans\$xxxm\$nostick" in
1070 : create .config dir to save info across Configure sessions
1071 test -d ../.config || mkdir ../.config
1072 cat >../.config/README <<EOF
1073 This directory created by Configure to save information that should
1074 persist across sessions.
1076 You may safely delete it if you wish.
1079 : general instructions
1082 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1083 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1086 rp='Would you like to see the instructions?'
1097 This installation shell script will examine your system and ask you questions
1098 to determine how the perl5 package should be installed. If you get
1099 stuck on a question, you may use a ! shell escape to start a subshell or
1100 execute a command. Many of the questions will have default answers in square
1101 brackets; typing carriage return will give you the default.
1103 On some of the questions which ask for file or directory names you are allowed
1104 to use the ~name construct to specify the login directory belonging to "name",
1105 even if you don't have a shell which knows about that. Questions where this is
1106 allowed will be marked "(~name ok)".
1110 dflt='Type carriage return to continue'
1114 The prompter used in this script allows you to use shell variables and
1115 backticks in your answers. You may use $1, $2, etc... to refer to the words
1116 in the default answer, as if the default line was a set of arguments given to a
1117 script shell. This means you may also use $* to repeat the whole default line,
1118 so you do not have to re-type everything to add something to the default.
1120 Everytime there is a substitution, you will have to confirm. If there is an
1121 error (e.g. an unmatched backtick), the default answer will remain unchanged
1122 and you will be prompted again.
1124 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1125 the questions and use the computed defaults (or the previous answers if there
1126 was already a config.sh file). Type 'Configure -h' for a list of options.
1127 You may also start interactively and then answer '& -d' at any prompt to turn
1128 on the non-interactive behaviour for the remaining of the execution.
1134 Much effort has been expended to ensure that this shell script will run on any
1135 Unix system. If despite that it blows up on yours, your best bet is to edit
1136 Configure and run it again. Also, let me (lwall@netlabs.com)
1137 know how I blew it. If you can't run Configure for some reason, you'll have to
1138 generate a config.sh file by hand.
1140 This installation script affects things in two ways:
1142 1) it may do direct variable substitutions on some of the files included
1144 2) it builds a config.h file for inclusion in C programs. You may edit
1145 any of these files as the need arises after running this script.
1147 If you make a mistake on a question, there is no easy way to back up to it
1148 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1149 files. Configure will offer to let you do this before it runs the SH files.
1152 dflt='Type carriage return to continue'
1154 case "$firsttime" in
1155 true) echo $user >>../.config/instruct;;
1159 : see if sh knows # comments
1161 echo "Checking your sh to see if it knows about # comments..." >&4
1162 if `sh -c '#' >/dev/null 2>&1`; then
1163 echo "Your sh handles # comments correctly."
1167 echo "Okay, let's see if #! works on this system..."
1169 test -f $xcat || xcat=/usr/bin/cat
1174 if test -s today; then
1178 echo "#! $xcat" > try
1182 if test -s today; then
1186 echo "It's just a comment."
1191 echo "Your sh doesn't grok # comments--I will strip them later on."
1194 echo "exec grep -v '^[ ]*#'" >spitshell
1196 $eunicefix spitshell
1197 spitshell=`pwd`/spitshell
1199 echo "I presume that if # doesn't work, #! won't work either!"
1204 : figure out how to guarantee sh startup
1206 echo "Checking out how to guarantee sh startup..." >&4
1208 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1209 *) startsh=$sharpbang'/bin/sh';;
1211 echo "Let's see if '$startsh' works..."
1221 echo "Yup, it does."
1223 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1227 : find out where common programs are
1229 echo "Locating common programs..." >&4
1242 if test -d \$dir/\$thing; then
1248 for thisthing in \$dir/\$thing; do
1249 : just loop through to pick last item
1251 if test -f \$thisthing; then
1254 elif test -f \$dir/\$thing.exe; then
1255 : on Eunice apparently
1299 pth=`echo $PATH | sed -e 's/:/ /g'`
1300 pth="$pth /lib /usr/lib"
1301 for file in $loclist; do
1302 xxx=`./loc $file $file $pth`
1307 echo $file is in $xxx.
1310 echo "I don't know where $file is. I hope it's in everyone's PATH."
1315 echo "Don't worry if any of the following aren't found..."
1317 for file in $trylist; do
1318 xxx=`./loc $file $file $pth`
1323 echo $file is in $xxx.
1326 echo "I don't see $file out there, $say."
1333 echo "Substituting grep for egrep."
1339 echo "Hopefully test is built into your sh."
1342 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1343 echo "Using the test built into your sh."
1351 echo "Hopefully echo is built into your sh."
1356 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1357 $echo $n "hi there$c" >foo1
1358 echo $n "hi there$c" >foo2
1359 if cmp foo1 foo2 >/dev/null 2>&1; then
1360 echo "They are compatible. In fact, they may be identical."
1367 They are not compatible! You are probably running ksh on a non-USG system.
1368 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1369 have echo built in and we may have to run some Bourne shell scripts. That
1370 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1373 $echo $n "The star should be here-->$c"
1380 : determine whether symbolic links are supported
1383 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1384 echo "Symbolic links are supported." >&4
1387 echo "Symbolic links are NOT supported." >&4
1392 : see whether [:lower:] and [:upper:] are supported character classes
1396 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1398 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1403 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1406 : set up the translation script tr, must be called with ./tr of course
1410 '[A-Z][a-z]') exec $tr '$up' '$low';;
1411 '[a-z][A-Z]') exec $tr '$low' '$up';;
1418 : Try to determine whether config.sh was made on this system
1419 case "$config_sh" in
1421 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1422 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1423 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1424 newmyuname="$myuname"
1426 if test "$fastread" = yes; then
1428 elif test -f ../config.sh; then
1429 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1430 eval "`grep myuname= ../config.sh`"
1432 if test "X$myuname" = "X$newmyuname"; then
1437 : Get old answers from old config file if Configure was run on the
1438 : same system, otherwise use the hints.
1441 if test -f config.sh; then
1443 rp="I see a config.sh file. Shall I use it to set the defaults?"
1446 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1447 *) echo "Fetching default answers from your old config.sh file..." >&4
1458 if test ! -f config.sh; then
1461 First time through, eh? I have some defaults handy for the following systems:
1464 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1466 : Half the following guesses are probably wrong... If you have better
1467 : tests or hints, please send them to lwall@netlabs.com
1468 : The metaconfig authors would also appreciate a copy...
1469 $test -f /irix && osname=irix
1470 $test -f /xenix && osname=sco_xenix
1471 $test -f /dynix && osname=dynix
1472 $test -f /dnix && osname=dnix
1473 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1474 $test -f /bin/mips && /bin/mips && osname=mips
1475 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1476 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1477 $test -d /usr/apollo/bin && osname=apollo
1478 $test -f /etc/saf/_sactab && osname=svr4
1479 $test -d /usr/include/minix && osname=minix
1480 if $test -f $uname; then
1488 umips) osname=umips ;;
1491 [23]100) osname=mips ;;
1492 next*) osname=next ;;
1493 news*) osname=news ;;
1495 if $test -f /etc/kconfig; then
1497 if test "$lns" = "ln -s"; then
1499 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1501 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1510 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1512 'not found') osvers="$4"."$3" ;;
1513 '<3240'|'<>3240') osvers=3.2.0 ;;
1514 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1515 '=3250'|'>3250') osvers=3.2.5 ;;
1522 domainos) osname=apollo
1528 freebsd) osname=freebsd
1530 genix) osname=genix ;;
1535 *.10.*) osvers=10 ;;
1552 netbsd*) osname=netbsd
1555 bsd386) osname=bsd386
1558 next*) osname=next ;;
1559 solaris) osname=solaris
1561 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1568 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1572 titanos) osname=titanos
1581 ultrix) osname=ultrix
1587 osvers=`echo "$3" | sed 's/^[vt]//'`
1589 hp*) osname=hp_osf1 ;;
1590 mips) osname=mips_osf1 ;;
1596 $2) case "$osname" in
1600 : svr4.x or possibly later
1610 if test -f /stand/boot ; then
1611 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1612 if test -n "$INITPROG" -a -f "$INITPROG"; then
1613 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1614 if test -n "$isesix"; then
1622 *) if test -f /etc/systemid; then
1624 set `echo $3 | $sed 's/\./ /g'` $4
1625 if $test -f sco_$1_$2_$3.sh; then
1627 elif $test -f sco_$1_$2.sh; then
1629 elif $test -f sco_$1.sh; then
1634 '') : Still unknown. Probably a generic Sys V.
1643 *) case "$osname" in
1644 '') : Still unknown. Probably a generic BSD.
1652 if test -f /vmunix -a -f news_os.sh; then
1653 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1654 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1657 $rm -f ../UU/kernel.what
1661 : Now look for a hint file osname_osvers, unless one has been
1662 : specified already.
1665 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1666 : Also try without trailing minor version numbers.
1667 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1668 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1669 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1670 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1673 *) case "$osvers" in
1676 *) if $test -f $file.sh ; then
1678 elif $test -f $xfile.sh ; then
1680 elif $test -f $xxfile.sh ; then
1682 elif $test -f $xxxfile.sh ; then
1684 elif $test -f $xxxxfile.sh ; then
1686 elif $test -f "${osname}.sh" ; then
1697 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1703 You may give one or more space-separated answers, or "none" if appropriate.
1704 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1707 rp="Which of these apply, if any?"
1710 for file in $tans; do
1711 if $test -f $file.sh; then
1713 $cat $file.sh >> ../UU/config.sh
1714 elif $test X$tans = X -o X$tans = Xnone ; then
1717 : Give one chance to correct a possible typo.
1718 echo "$file.sh does not exist"
1720 rp="hint to use instead?"
1722 for file in $ans; do
1723 if $test -f "$file.sh"; then
1725 $cat $file.sh >> ../UU/config.sh
1726 elif $test X$ans = X -o X$ans = Xnone ; then
1729 echo "$file.sh does not exist -- ignored."
1736 : Remember our hint file for later.
1737 if $test -f "$file.sh" ; then
1749 echo "Fetching default answers from $config_sh..." >&4
1753 cp $config_sh config.sh 2>/dev/null
1762 test "$override" && . ./optdef.sh
1763 myuname="$newmyuname"
1765 : Restore computed paths
1766 for file in $loclist $trylist; do
1767 eval $file="\$_$file"
1772 Configure uses the operating system name and version to set some defaults.
1773 The default value is probably right if the name rings a bell. Otherwise,
1774 since spelling matters for me, either accept the default or answer "none"
1781 ''|' '|none) dflt=none ;;
1782 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1785 *) dflt="$osname" ;;
1787 rp="Operating system name?"
1791 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1793 : who configured the system
1794 cf_time=`$date 2>&1`
1795 (logname > .temp) >/dev/null 2>&1
1796 $test -s .temp || (whoami > .temp) >/dev/null 2>&1
1797 $test -s .temp || echo unknown > .temp
1801 : determine where manual pages are on this system
1805 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1806 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1807 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1808 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1809 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1810 sysman=`./loc . /usr/man/man1 $syspath`
1813 if $test -d "$sysman"; then
1814 echo "System manual is in $sysman." >&4
1816 echo "Could not find manual pages in source form." >&4
1819 : see what memory models we can support
1822 $cat >pdp11.c <<'EOP'
1831 cc -o pdp11 pdp11.c >/dev/null 2>&1
1832 if ./pdp11 2>/dev/null; then
1833 dflt='unsplit split'
1835 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1838 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1843 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1846 if $test -d /lib/large || $test -d /usr/lib/large; then
1849 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1858 Some systems have different model sizes. On most systems they are called
1859 small, medium, large, and huge. On the PDP11 they are called unsplit and
1860 split. If your system doesn't support different memory models, say "none".
1861 If you wish to force everything to one memory model, say "none" here and
1862 put the appropriate flags later when it asks you for other cc and ld flags.
1863 Venix systems may wish to put "none" and let the compiler figure things out.
1864 (In the following question multiple model names should be space separated.)
1867 rp="Which memory models are supported?"
1882 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
1883 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
1890 rp="What flag indicates separate I and D space?"
1898 *large*|*small*|*medium*|*huge*)
1905 rp="What flag indicates large model?"
1915 *huge*) case "$huge" in
1919 rp="What flag indicates huge model?"
1929 *medium*) case "$medium" in
1933 rp="What flag indicates medium model?"
1940 *) medium="$large";;
1943 *small*) case "$small" in
1947 rp="What flag indicates small model?"
1958 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
1962 : make some quick guesses about what we are up against
1964 $echo $n "Hmm... $c"
1973 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1974 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
1976 echo "Looks kind of like an OSF/1 system, but we'll see..."
1978 elif test `echo abc | tr a-z A-Z` = Abc ; then
1979 xxx=`./loc addbib blurfl $pth`
1980 if $test -f $xxx; then
1981 echo "Looks kind of like a USG system with BSD features, but we'll see..."
1985 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
1986 echo "Looks kind of like an extended USG system, but we'll see..."
1988 echo "Looks kind of like a USG system, but we'll see..."
1992 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
1993 echo "Looks kind of like a BSD system, but we'll see..."
1997 echo "Looks kind of like a Version 7 system, but we'll see..."
2000 case "$eunicefix" in
2003 There is, however, a strange, musty smell in the air that reminds me of
2004 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2008 : it so happens the Eunice I know will not run shell scripts in Unix format
2012 echo "Congratulations. You aren't running Eunice."
2016 if test -f /xenix; then
2017 echo "Actually, this looks more like a XENIX system..."
2022 echo "It's not Xenix..."
2027 if test -f /venix; then
2028 echo "Actually, this looks more like a VENIX system..."
2035 echo "Nor is it Venix..."
2038 chmod +x bsd usg v7 osf1 eunice xenix venix
2039 $eunicefix bsd usg v7 osf1 eunice xenix venix
2042 : see if we need a special compiler
2050 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2051 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2064 On some systems the default C compiler will not resolve multiple global
2065 references that happen to have the same name. On some such systems the "Mcc"
2066 command may be used to force these to be resolved. On other systems a "cc -M"
2067 command is required. (Note that the -M flag on other systems indicates a
2068 memory model to use!) If you have the Gnu C compiler, you might wish to use
2072 rp="What command will force resolution on this system?"
2080 rp="Use which C compiler?"
2085 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2086 $cat >gccvers.c <<EOM
2091 printf("%s\n", __VERSION__);
2093 printf("%s\n", "1");
2099 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
2100 gccversion=`./gccvers`
2101 case "$gccversion" in
2102 '') echo "You are not using GNU cc." ;;
2103 *) echo "You are using GNU cc $gccversion." ;;
2106 echo "I can't compile the test program -- Assuming it isn't GNU cc."
2109 case "$gccversion" in
2110 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2113 : decide how portable to be
2114 case "$d_portable" in
2120 I can set things up so that your shell scripts and binaries are more portable,
2121 at what may be a noticable cost in performance. In particular, if you
2122 ask to be portable, the following happens:
2124 1) Shell scripts will rely on the PATH variable rather than using
2125 the paths derived above.
2126 2) ~username interpretations will be done at run time rather than
2130 rp="Do you expect to run these scripts and binaries on multiple machines?"
2133 y*) d_portable="$define"
2135 *) d_portable="$undef" ;;
2138 : set up shell script to do ~ expansion
2144 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2147 if $test -f /bin/csh; then
2148 /bin/csh -f -c "glob \$1"
2153 name=\`$expr x\$1 : '..\([^/]*\)'\`
2154 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2155 if $test ! -d "\$dir"; then
2157 echo "\$me: can't locate home directory for: \$name" >&2
2162 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2178 : now set up to get a file name
2179 cat <<'EOSC' >getfile
2192 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2193 fn=`echo $fn | sed 's/(.*)//'`
2199 loc_file=`expr $fn : '.*:\(.*\)'`
2200 fn=`expr $fn : '\(.*\):.*'`
2208 */*) fullpath=true;;
2217 *e*) exp_file=true;;
2220 *p*) nopath_ok=true;;
2225 *d*) type='Directory';;
2226 *l*) type='Locate';;
2231 Locate) what='File';;
2236 case "$d_portable" in
2244 while test "$type"; do
2249 true) rp="$rp (~name ok)";;
2252 if test -f UU/getfile.ok && \
2253 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2272 value=`UU/filexp $ans`
2275 if test "$ans" != "$value"; then
2276 echo "(That expands to $value on this system.)"
2290 /*) value="$ansexp" ;;
2295 echo "I shall only accept a full path name, as in /bin/ls." >&4
2296 echo "Use a ! shell escape if you wish to check pathnames." >&4
2299 echo "Please give a full path name, starting with slash." >&4
2302 echo "Note that using ~name is ok provided it expands well." >&4
2315 if test -f "$ansexp"; then
2317 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2319 echo "($value is not a plain file, but that's ok.)"
2324 if test -d "$ansexp"; then
2329 if test -d "$value"; then
2330 echo "(Looking for $loc_file in directory $value.)"
2331 value="$value/$loc_file"
2333 if test -f "$value"; then
2336 case "$nopath_ok" in
2337 true) case "$value" in
2339 *) echo "Assuming $value will be in people's path."
2355 if test "$fastread" = yes; then
2360 rp="$what $value doesn't exist. Use that name anyway?"
2381 : What should the include directory be ?
2383 $echo $n "Hmm... $c"
2387 if $test -f /bin/mips && /bin/mips; then
2388 echo "Looks like a MIPS system..."
2389 $cat >usr.c <<'EOCP'
2390 #ifdef SYSTYPE_BSD43
2394 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2395 dflt='/bsd43/usr/include'
2399 mips_type='System V'
2401 $rm -f usr.c usr.out
2402 echo "and you're compiling with the $mips_type compiler and libraries."
2404 echo "Doesn't look like a MIPS system."
2415 rp='Where are the include files you want to use?'
2419 : see how we invoke the C preprocessor
2421 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2422 cat <<'EOT' >testcpp.c
2428 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2430 wrapper=`pwd`/cppstdin
2434 if $test "X$cppstdin" != "X" && \
2435 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2436 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2438 echo "You used to use $cppstdin $cppminus so we'll use that again."
2440 '') echo "But let's see if we can live without a wrapper..." ;;
2442 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2443 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2445 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2448 echo "(However, $cpprun $cpplast does not work, let's see...)"
2456 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2463 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2464 $cc -E <testcpp.c >testcpp.out 2>&1; \
2465 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2466 echo "Yup, it does."
2469 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2470 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2471 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2472 echo "Yup, it does."
2475 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2476 $cc -P <testcpp.c >testcpp.out 2>&1; \
2477 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2478 echo "Yipee, that works!"
2481 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2482 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2483 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2484 echo "At long last!"
2487 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2488 $cpp <testcpp.c >testcpp.out 2>&1; \
2489 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2493 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2494 $cpp - <testcpp.c >testcpp.out 2>&1; \
2495 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2496 echo "Hooray, it works! I was beginning to wonder."
2499 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2500 $wrapper <testcpp.c >testcpp.out 2>&1; \
2501 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2507 rp="No dice. I can't find a C preprocessor. Name one:"
2511 $x_cpp <testcpp.c >testcpp.out 2>&1
2512 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2513 echo "OK, that will do." >&4
2515 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2530 echo "Perhaps can we force $cc -E using a wrapper..."
2531 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2532 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2538 echo "Nope, we'll have to live without it..."
2553 *) $rm -f $wrapper;;
2555 $rm -f testcpp.c testcpp.out
2557 : determine optimize, if desired, or use for debug flag also
2561 *) dflt="$optimize";;
2565 Some C compilers have problems with their optimizers, by default, $package
2566 compiles with the -O flag to use the optimizer. Alternately, you might want
2567 to use the symbolic debugger, which uses the -g flag (on traditional Unix
2568 systems). Either flag can be specified here. To use neither flag, specify
2572 rp="What optimizer/debugger flag should be used?"
2576 'none') optimize=" ";;
2582 case "$gccversion" in
2583 1*) dflt='-fpcc-struct-return' ;;
2586 *-g*) dflt="$dflt -DDEBUGGING";;
2588 case "$gccversion" in
2589 2*) if test -d /etc/conf/kconfig.d &&
2590 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2599 case "$mips_type" in
2602 *) inclwanted="$inclwanted $usrinc/bsd";;
2604 for thisincl in $inclwanted; do
2605 if $test -d $thisincl; then
2606 if $test x$thisincl != x$usrinc; then
2609 *) dflt="$dflt -I$thisincl";;
2615 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2617 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2625 *) dflt="$dflt -D$2";;
2630 set signal.h __LANGUAGE_C__; eval $inctest
2632 set signal.h LANGUAGE_C; eval $inctest
2634 set signal.h NO_PROTOTYPE; eval $inctest
2635 set signal.h _NO_PROTO; eval $inctest
2642 *) dflt="$ccflags";;
2646 Your C compiler may want other flags. For this question you should include
2647 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
2648 but you should NOT include libraries or ld flags like -lwhatever. If you
2649 want $package to honor its debug switch, you should include -DDEBUGGING here.
2650 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
2651 -DHIDEMYMALLOC or -DCRIPPLED_CC.
2653 To use no flags, specify the word "none".
2659 rp="Any additional cc flags?"
2666 : the following weeds options from ccflags that are of no interest to cpp
2668 case "$gccversion" in
2669 1*) cppflags="$cppflags -D__GNUC__"
2671 case "$mips_type" in
2673 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2679 echo "Let me guess what the preprocessor flags are..." >&4
2693 *) ftry="$previous $flag";;
2695 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
2696 >cpp1.out 2>/dev/null && \
2697 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
2698 >cpp2.out 2>/dev/null && \
2699 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
2700 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
2702 cppflags="$cppflags $ftry"
2712 *-*) echo "They appear to be: $cppflags";;
2714 $rm -f cpp.c cpp?.out
2718 : flags used in final linking phase
2720 '') if ./venix; then
2726 *-posix*) dflt="$dflt -posix" ;;
2732 *) dflt="$ldflags";;
2735 rp="Any additional ld flags (NOT including libraries)?"
2741 rmlist="$rmlist pdp11"
2743 : Set private lib path
2746 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2751 '') dlist="$plibpth $glibpth";;
2752 *) dlist="$libpth";;
2755 : Now check and see which directories actually exist, avoiding duplicates
2759 if $test -d $xxx; then
2762 *) libpth="$libpth $xxx";;
2768 Some systems have incompatible or broken versions of libraries. Among
2769 the directories listed in the question below, please remove any you
2770 know not to be holding relevant libraries, and add any that are needed.
2771 Say "none" for none.
2782 rp="Directories to use for library searches?"
2789 : compute shared library extension
2792 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2802 On some systems, shared libraries may be available. Answer 'none' if
2803 you want to suppress searching of shared libraries for the remaining
2804 of this configuration.
2807 rp='What is the file extension used for shared libraries?'
2811 : Looking for optional libraries
2813 echo "Checking for optional libraries..." >&4
2818 case "$libswanted" in
2819 '') libswanted='c_s';;
2821 for thislib in $libswanted; do
2823 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2824 echo "Found -l$thislib (shared)."
2827 *) dflt="$dflt -l$thislib";;
2829 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2830 echo "Found -l$thislib (shared)."
2833 *) dflt="$dflt -l$thislib";;
2835 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
2836 echo "Found -l$thislib."
2839 *) dflt="$dflt -l$thislib";;
2841 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
2842 echo "Found -l${thislib}_s."
2845 *) dflt="$dflt -l${thislib}_s";;
2847 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
2848 echo "Found -l$thislib."
2851 *) dflt="$dflt -l$thislib";;
2854 echo "No -l$thislib."
2865 ' '|'') dflt='none';;
2870 Some versions of Unix support shared libraries, which make executables smaller
2871 but make load time slightly longer.
2873 On some systems, mostly newer Unix System V's, the shared library is included
2874 by putting the option "-lc_s" as the last thing on the cc command line when
2875 linking. Other systems use shared libraries by default. There may be other
2876 libraries needed to compile $package on your machine as well. If your system
2877 needs the "-lc_s" option, include it here. Include any other special libraries
2878 here as well. Say "none" for none.
2882 rp="Any additional libraries?"
2889 : see if nm is to be used to determine whether a symbol is defined or not
2892 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2893 if $test $dflt -gt 20; then
2908 I can use 'nm' to extract the symbols from your C libraries. This is a time
2909 consuming task which may generate huge output on the disk (up to 3 megabytes)
2910 but that should make the symbols extraction faster. The alternative is to skip
2911 the 'nm' extraction part and to compile a small test program instead to
2912 determine whether each symbol is present. If you have a fast C compiler and/or
2913 if your 'nm' output cannot be parsed, this may be the best solution.
2916 rp='Shall I use nm to extract C symbols from the libraries?'
2928 : nm options which may be necessary
2930 '') if $test -f /mach_boot; then
2932 elif $test -d /usr/ccs/lib; then
2934 elif $test -f /dgux; then
2943 : get list of predefined functions in a handy place
2948 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
2955 *) for thislib in $libs; do
2958 : Handle C library specially below.
2961 thislib=`echo $thislib | $sed -e 's/^-l//'`
2962 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
2964 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
2966 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
2968 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
2970 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
2972 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
2977 libnames="$libnames $try"
2979 *) libnames="$libnames $thislib" ;;
2987 set /usr/ccs/lib/libc.$so
2988 $test -r $1 || set /usr/lib/libc.$so
2989 $test -r $1 || set /usr/shlib/libc.$so
2990 $test -r $1 || set /usr/lib/libc.$so.[0-9]*
2991 $test -r $1 || set /lib/libc.$so
2992 $test -r $1 || set /lib/libsys_s.a
2999 if $test -r "$1"; then
3000 echo "Your (shared) C library seems to be in $1."
3002 elif $test -r /lib/libc && $test -r /lib/clib; then
3003 echo "Your C library seems to be in both /lib/clib and /lib/libc."
3005 libc='/lib/clib /lib/libc'
3006 if $test -r /lib/syslib; then
3007 echo "(Your math library is in /lib/syslib.)"
3008 libc="$libc /lib/syslib"
3010 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3011 echo "Your C library seems to be in $libc, as you said before."
3012 elif $test -r $incpath/usr/lib/libc.a; then
3013 libc=$incpath/usr/lib/libc.a;
3014 echo "Your C library seems to be in $libc. That's fine."
3015 elif $test -r /lib/libc.a; then
3017 echo "Your C library seems to be in $libc. You're normal."
3019 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
3021 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3022 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3023 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3025 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3027 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3030 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
3032 if $test -r "$tans"; then
3033 echo "Your C library seems to be in $tans, of all places."
3039 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3043 If the guess above is wrong (which it might be if you're using a strange
3044 compiler, or your machine supports multiple models), you can override it here.
3049 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3051 I can't seem to find your C library. I've looked in the following places:
3054 $sed 's/^/ /' libpath
3057 None of these seems to contain your C library. I need to get its name...
3062 rp='Where is your C library?'
3067 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3068 set X `cat libnames`
3071 case $# in 1) xxx=file; esac
3072 echo "Extracting names from the following $xxx for later perusal:" >&4
3074 $sed 's/^/ /' libnames >&4
3076 $echo $n "This may take a while...$c" >&4
3078 nm $nm_opt $* 2>/dev/null >libc.tmp
3080 $grep fprintf libc.tmp > libc.ptf
3081 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3082 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3083 if com="$sed -n -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
3085 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3087 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3089 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3091 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3093 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3095 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3097 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3099 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3101 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3103 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3105 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3107 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3108 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3110 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3112 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3114 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3116 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3118 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3120 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3122 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3125 nm -p $* 2>/dev/null >libc.tmp
3126 com="$sed -n -e 's/^.* [ADTS] *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
3127 eval "<libc.tmp $com >libc.list"
3128 if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3133 echo "nm didn't seem to work right. Trying ar instead..." >&4
3135 if ar t $libc > libc.tmp; then
3136 for thisname in $libnames; do
3137 ar t $thisname >>libc.tmp
3139 $sed -e 's/\.o$//' < libc.tmp > libc.list
3142 echo "ar didn't seem to work right." >&4
3143 echo "Maybe this is a Cray...trying bld instead..." >&4
3144 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
3145 for thisname in $libnames; do
3147 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
3148 ar t $thisname >>libc.tmp
3152 echo "That didn't work either. Giving up." >&4
3159 if $test -f /lib/syscalls.exp; then
3161 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3162 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3166 $rm -f libnames libpath
3168 : is a C symbol defined?
3171 -v) tf=libc.tmp; tc=""; tdc="";;
3172 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
3173 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3176 case "$reuseval-$4" in
3178 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3184 if $contains $tlook $tf >/dev/null 2>&1;
3189 echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
3190 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
3198 $define) tval=true;;
3204 : set up the script used to warn in case of inconsistency
3208 echo "*** WHOA THERE!!! ***" >&4
3209 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3210 rp=" Keep the $hint value?"
3213 y) td=$was; tu=$was;;
3217 : define an is-in-libc? function
3218 inlibc='echo " "; td=$define; tu=$undef;
3219 sym=$1; var=$2; eval "was=\$$2";
3221 case "$reuseval$was" in
3231 echo "$sym() found." >&4;
3232 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3234 echo "$sym() NOT found." >&4;
3235 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3239 $define) echo "$sym() found." >&4;;
3240 *) echo "$sym() NOT found." >&4;;
3244 : see if gconvert exists
3245 set gconvert d_gconvert
3248 case "$d_gconvert" in
3250 echo "We'll use it to convert floats into a string then." >&4
3251 d_Gconvert="gconvert((x),(n),(t),(b))"
3254 : Maybe we can emulate it with gcvt.
3260 : Test whether gcvt drops a trailing decimal point
3265 if (buf[0] != '1' || buf[1] != '\0')
3268 if (buf[0] != '0' || buf[1] != '\0')
3271 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
3276 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
3278 echo "Good, your gcvt() drops a trailing decimal point."
3279 echo "We'll use it to convert floats into a string." >&4
3280 d_Gconvert="gcvt((x),(n),(b))"
3282 echo "But your gcvt() keeps a trailing decimal point".
3286 echo "Hmm. I can't compile the gcvt test program."
3292 case "$d_Gconvert" in
3294 echo "I'll use sprintf instead to convert floats into a string." >&4
3295 d_Gconvert='sprintf((b),"%.*g",(n),(x))'
3300 : Initialize h_fcntl
3303 : Initialize h_sysfile
3306 : determine filename position in cpp output
3308 echo "Computing filename position in cpp output for #include directives..." >&4
3309 echo '#include <stdio.h>' > foo.c
3312 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3313 $grep '^[ ]*#.*stdio\.h' | \
3314 while read cline; do
3317 while $test \$# -gt 0; do
3318 if $test -r \`echo \$1 | $tr -d '"'\`; then
3323 pos=\`expr \$pos + 1\`
3335 *) pos="${fieldn}th";;
3337 echo "Your cpp writes the filename in the $pos field of the line."
3339 : locate header file
3344 if test -f $usrinc/\$wanted; then
3345 echo "$usrinc/\$wanted"
3348 awkprg='{ print \$$fieldn }'
3349 echo "#include <\$wanted>" > foo\$\$.c
3350 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3351 $grep "^[ ]*#.*\$wanted" | \
3352 while read cline; do
3353 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3355 */\$wanted) echo "\$name"; exit 0;;
3366 : access call always available on UNIX
3370 : locate the flags for 'access()'
3374 $cat >access.c <<'EOCP'
3375 #include <sys/types.h>
3380 #include <sys/file.h>
3389 : check sys/file.h first, no particular reason here
3390 if $test `./findhdr sys/file.h` && \
3391 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
3393 echo "<sys/file.h> defines the *_OK access constants." >&4
3394 elif $test `./findhdr fcntl.h` && \
3395 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
3397 echo "<fcntl.h> defines the *_OK access constants." >&4
3398 elif $test `./findhdr unistd.h` && \
3399 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
3400 echo "<unistd.h> defines the *_OK access constants." >&4
3402 echo "I can't find the four *_OK access constants--I'll use mine." >&4
3408 : see if alarm exists
3414 if test -d /afs; then
3415 echo "AFS may be running... I'll be extra cautious then..." >&4
3418 echo "AFS does not seem to be running..." >&4
3422 : determine root of directory hierarchy where package will be installed.
3425 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3433 By default, $package will be installed in $dflt/bin, manual
3434 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3435 all installation directories. Typically set to /usr/local, but you
3436 may choose /usr if you wish to install $package among your system
3437 binaries. If you wish to have binaries under /bin but manual pages
3438 under /usr/local/man, that's ok: you will be prompted separately
3439 for each of the installation directories, the prefix being only used
3440 to set the defaults.
3444 rp='Installation prefix to use?'
3452 *) oldprefix="$prefix";;
3459 : set the prefixit variable, to compute a suitable default value
3460 prefixit='case "$3" in
3462 case "$oldprefix" in
3463 "") eval "$1=\"\$$2\"";;
3470 ""|" ") eval "$1=\"\$$2\"";;
3476 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3478 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3479 /*-$oldprefix/*|\~*-$oldprefix/*)
3480 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3481 *) eval "$1=\"\$$2\"";;
3485 : determine where private executables go
3486 set dflt privlib lib/$package
3490 There are some auxiliary files for $package that need to be put into a
3491 private library directory that is accessible by everyone.
3495 rp='Pathname where the private library files will reside?'
3497 if $test "X$privlibexp" != "X$ansexp"; then
3501 privlibexp="$ansexp"
3505 Since you are running AFS, I need to distinguish the directory in which
3506 private files reside from the directory in which they are installed (and from
3507 which they are presumably copied to the former directory by occult means).
3510 case "$installprivlib" in
3511 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3512 *) dflt="$installprivlib";;
3515 rp='Where will private files be installed?'
3517 installprivlib="$ans"
3519 installprivlib="$privlibexp"
3522 : set the prefixup variable, to restore leading tilda escape
3523 prefixup='case "$prefixexp" in
3525 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3528 : determine where public architecture dependent libraries go
3531 if xxx=`./loc arch blurfl $pth`; test -f "$xxx"; then
3533 archname="${tarchname}-$osname"
3534 elif xxx=`./loc uname blurfl $pth`; test -f "$xxx" ; then
3535 if uname -m > tmparch 2>&1 ; then
3536 tarchname=`cat tmparch`
3537 archname="${tarchname}-$osname"
3551 dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
3555 *) dflt="$privlib/$archname";;
3558 *) dflt="$archlib";;
3562 $spackage contains architecture-dependent library files. If you are
3563 sharing libraries in a heterogeneous environment, you might store
3564 these files in a separate location. Otherwise, you can just include
3565 them with the rest of the public library files.
3569 rp='Where do you want to put the public architecture-dependent libraries?'
3572 archlibexp="$ansexp"
3577 Since you are running AFS, I need to distinguish the directory in which
3578 private files reside from the directory in which they are installed (and from
3579 which they are presumably copied to the former directory by occult means).
3582 case "$installarchlib" in
3583 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3584 *) dflt="$installarchlib";;
3587 rp='Where will architecture-dependent library files be installed?'
3589 installarchlib="$ans"
3591 installarchlib="$archlibexp"
3593 if $test X"$archlib" = X"$privlib"; then
3599 : function used to set $1 to $val
3600 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3602 $define$undef) . ./whoa; eval "$var=\$td";;
3603 $undef$define) . ./whoa; eval "$var=\$tu";;
3604 *) eval "$var=$val";;
3607 : Look for GNU-cc style attribute checking
3609 echo "Checking whether your compiler can handle __attribute__ ..." >&4
3610 $cat >attrib.c <<'EOCP'
3612 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
3614 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
3615 if $contains 'warning' attrib.out >/dev/null 2>&1; then
3616 echo "Your C compiler doesn't fully support __attribute__."
3619 echo "Your C compiler supports __attribute__."
3623 echo "Your C compiler doesn't seem to understand __attribute__ at all."
3630 : see if bcmp exists
3634 : see if bcopy exists
3638 : see if setpgrp exists
3639 set setpgrp d_setpgrp
3642 : see which flavor of setpgrp is in use
3643 case "$d_setpgrp" in
3649 if (getuid() == 0) {
3650 printf("(I see you are running Configure as super-user...)\n");
3653 if (-1 == setpgrp(1, 1))
3658 if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
3661 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
3663 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
3668 xxx="USG one, i.e. you use setpgrp()."
3671 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
3674 echo "Assuming your setpgrp is a $xxx" >&4
3683 : Check if we really have byacc
3685 ''|'byacc') val="$undef" ;;
3691 : see if bzero exists
3695 : check for length of integer
3699 echo "Checking to see how big your integers are..." >&4
3700 $cat >try.c <<'EOCP'
3704 printf("%d\n", sizeof(int));
3707 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
3711 echo "(I can't seem to compile the test program. Guessing...)"
3718 rp="What is the size of an integer (in bytes)?"
3723 : see if signal is declared as pointer to function returning int or void
3725 xxx=`./findhdr signal.h`
3726 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
3727 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3728 echo "You have int (*signal())() instead of void." >&4
3730 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3731 echo "You have void (*signal())() instead of int." >&4
3733 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3734 echo "You have int (*signal())() instead of void." >&4
3737 case "$d_voidsig" in
3739 echo "I can't determine whether signal handler returns void or int..." >&4
3741 rp="What type does your signal handler return?"
3748 echo "As you already told me, signal handler returns void." >&4;;
3750 echo "As you already told me, signal handler returns int." >&4;;
3755 case "$d_voidsig" in
3756 "$define") signal_t="void";;
3761 : check for ability to cast large floats to 32-bit ints.
3763 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
3764 if $test "$intsize" -eq 4; then
3770 #include <sys/types.h>
3772 $signal_t blech() { exit(3); }
3778 signal(SIGFPE, blech);
3780 f = (double) 0x7fffffff;
3784 if (i32 != ($xxx) f)
3789 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3793 echo "(I can't seem to compile the test program--assuming it can't)"
3801 echo "Nope, it can't."
3808 : check for ability to cast negative floats to unsigned
3810 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
3812 #include <sys/types.h>
3814 $signal_t blech() { exit(3); }
3818 unsigned long along;
3820 unsigned short ashort;
3823 signal(SIGFPE, blech);
3824 along = (unsigned long)f;
3825 aint = (unsigned int)f;
3826 ashort = (unsigned short)f;
3827 if (along != (unsigned long)-123)
3829 if (aint != (unsigned int)-123)
3831 if (ashort != (unsigned short)-123)
3833 f = (double)0x40000000;
3836 along = (unsigned long)f;
3837 if (along != 0x80000000)
3841 along = (unsigned long)f;
3842 if (along != 0x7fffffff)
3846 along = (unsigned long)f;
3847 if (along != 0x80000001)
3853 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3857 echo "(I can't seem to compile the test program--assuming it can't)"
3860 case "$castflags" in
3865 echo "Nope, it can't."
3872 : see if vprintf exists
3874 if set vprintf val -f d_vprintf; eval $csym; $val; then
3875 echo 'vprintf() found.' >&4
3877 $cat >vprintf.c <<'EOF'
3878 #include <varargs.h>
3880 main() { xxx("foo"); }
3889 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
3892 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
3893 echo "Your vsprintf() returns (int)." >&4
3896 echo "Your vsprintf() returns (char*)." >&4
3900 echo 'vprintf() NOT found.' >&4
3910 : see if chown exists
3914 : see if chroot exists
3918 : see if chsize exists
3922 : check for const keyword
3924 echo 'Checking to see if your C compiler knows about "const"...' >&4
3925 $cat >const.c <<'EOCP'
3926 typedef struct spug { int drokk; } spug;
3933 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
3935 echo "Yup, it does."
3938 echo "Nope, it doesn't."
3943 : see if crypt exists
3945 if set crypt val -f d_crypt; eval $csym; $val; then
3946 echo 'crypt() found.' >&4
3950 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
3951 if $test -z "$cryptlib"; then
3952 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
3956 if $test -z "$cryptlib"; then
3957 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
3961 if $test -z "$cryptlib"; then
3962 cryptlib=`./loc libcrypt.a "" $libpth`
3966 if $test -z "$cryptlib"; then
3967 echo 'crypt() NOT found.' >&4
3976 : get csh whereabouts
3978 'csh') val="$undef" ;;
3985 : see if cuserid exists
3986 set cuserid d_cuserid
3989 : define an alternate in-header-list? function
3990 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
3991 cont=true; xxf="echo \"<\$1> found.\" >&4";
3992 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
3993 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
3995 case $# in 4) instead=instead;; *) instead="at last";; esac;
3996 while $test "$cont"; do
3998 var=$2; eval "was=\$$2";
3999 if $test "$xxx" && $test -r "$xxx";
4001 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4004 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4005 set $yyy; shift; shift; yyy=$@;
4006 case $# in 0) cont="";;
4007 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4008 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4009 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4010 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4014 do set $yyy; var=$2; eval "was=\$$2";
4015 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4016 set $yyy; shift; shift; yyy=$@;
4019 : see if this is a limits.h system
4020 set limits.h i_limits
4023 : see if this is a float.h system
4027 : See if number of significant digits in a double precision number is known
4029 $cat >dbl_dig.c <<EOM
4039 printf("Contains DBL_DIG");
4042 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
4043 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
4044 echo "DBL_DIG found." >&4
4047 echo "DBL_DIG NOT found." >&4
4054 : see if difftime exists
4055 set difftime d_difftime
4058 : see if this is a dirent system
4060 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
4062 echo "<dirent.h> found." >&4
4065 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
4066 echo "<sys/dir.h> found." >&4
4069 xinc=`./findhdr sys/ndir.h`
4071 echo "<dirent.h> NOT found." >&4
4076 : Look for type of directory structure.
4078 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4080 case "$direntrytype" in
4083 $define) guess1='struct dirent' ;;
4084 *) guess1='struct direct' ;;
4087 *) guess1="$direntrytype"
4092 'struct dirent') guess2='struct direct' ;;
4093 *) guess2='struct dirent' ;;
4096 if $contains "$guess1" try.c >/dev/null 2>&1; then
4097 direntrytype="$guess1"
4098 echo "Your directory entries are $direntrytype." >&4
4099 elif $contains "$guess2" try.c >/dev/null 2>&1; then
4100 direntrytype="$guess2"
4101 echo "Your directory entries seem to be $direntrytype." >&4
4103 echo "I don't recognize your system's directory entries." >&4
4104 rp="What type is used for directory entries on this system?"
4112 : see if the directory entry stores field length
4114 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4115 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
4116 echo "Good, your directory entry keeps length information in d_namlen." >&4
4119 echo "Your directory entry does not know about the d_namlen field." >&4
4126 : see if dlerror exists
4127 set dlerror d_dlerror
4130 : see if dld is available
4134 : see if dlopen exists
4138 : determine which dynamic loading, if any, to compile in
4140 dldir="ext/DynaLoader"
4153 $define) dflt='y' ;;
4156 $define) dflt='y' ;;
4158 : Does a dl_xxx.xs file exist for this operating system
4159 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4162 rp="Do you wish to use dynamic loading?"
4169 if $test -f ../$dldir/dl_${osname}.xs ; then
4170 dflt="$dldir/dl_${osname}.xs"
4171 elif $test "$d_dlopen" = "$define" ; then
4172 dflt="$dldir/dl_dlopen.xs"
4173 elif $test "$i_dld" = "$define" ; then
4174 dflt="$dldir/dl_dld.xs"
4179 *) dflt="$dldir/$dlsrc"
4182 echo "The following dynamic loading files are available:"
4183 : Can not go over to $dldir because getfile has path hard-coded in.
4184 cd ..; ls -C $dldir/dl*.xs; cd UU
4185 rp="Source file to use for dynamic loading"
4190 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4193 Some systems may require passing special flags to $cc -c to
4194 compile modules that will be used to create a shared library.
4195 To use no flags, say "none".
4198 case "$cccdlflags" in
4199 ''|' ') case "$cc" in
4200 *gcc*) dflt='-fpic' ;;
4201 *) case "$osname" in
4203 next) dflt='none' ;;
4204 solaris) dflt='-K pic' ;;
4205 sunos) dflt='-pic' ;;
4206 svr4*|esix*) dflt='-Kpic' ;;
4210 *) dflt="$cccdlflags" ;;
4212 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4215 none) cccdlflags='' ;;
4216 *) cccdlflags="$ans" ;;
4221 Some systems may require passing special flags to ld to create a
4222 library that can be dynamically loaded. If your ld flags include
4223 -L/other/path options to locate libraries outside your loader's normal
4224 search path, you may need to specify those -L options here as well. To
4225 use no flags, say "none".
4228 case "$lddlflags" in
4229 ''|' ') case "$osname" in
4231 next) dflt='none' ;;
4232 solaris) dflt='-G' ;;
4233 sunos) dflt='-assert nodefinitions' ;;
4234 svr4*|esix*) dflt="-G $ldflags" ;;
4238 *) dflt="$lddlflags" ;;
4240 rp="Any special flags to pass to ld to create a dynamically loaded library?"
4243 none) lddlflags='' ;;
4244 *) lddlflags="$ans" ;;
4249 Some systems may require passing special flags to $cc to indicate that
4250 the resulting executable will use dynamic linking. To use no flags,
4254 case "$ccdlflags" in
4255 ''|' ') case "$osname" in
4256 hpux) dflt='none' ;;
4257 next) dflt='none' ;;
4258 sunos) dflt='none' ;;
4261 *) dflt="$ccdlflags" ;;
4263 rp="Any special flags to pass to $cc to use dynamic loading?"
4266 none) ccdlflags='' ;;
4267 *) ccdlflags="$ans" ;;
4284 System V Release 4 systems can support dynamic loading
4285 only if libperl is created as a shared library.
4292 set d_shrplib; eval $setvar
4293 case "$d_shrplib" in
4297 Be sure to add the perl source directory to the LD_LIBRARY_PATH
4298 environment variable before running make:
4299 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
4301 setenv LD_LIBRARY_PATH `cd ..;pwd`
4306 case "$d_shrplib" in
4309 "") dflt="$archlib/CORE";;
4310 *) dflt="$shrpdir";;
4312 rp="What directory should we install the shared libperl into?"
4321 : see if dlfcn is available
4329 On a few systems, the dynamically loaded modules that perl generates and uses
4330 will need a different extension then shared libs. The default will probably
4338 rp='What is the extension of dynamically loaded modules'
4347 : Check if dlsym need a leading underscore
4353 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
4354 $cat >dyna.c <<'EOM'
4363 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
4365 #include <sys/types.h>
4379 int mode = RTLD_LAZY ;
4381 handle = dlopen("./dyna.$dlext", mode) ;
4382 if (handle == NULL) {
4386 symbol = dlsym(handle, "fred") ;
4387 if (symbol == NULL) {
4388 /* try putting a leading underscore */
4389 symbol = dlsym(handle, "_fred") ;
4390 if (symbol == NULL) {
4401 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
4402 ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
4403 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
4406 1) echo "Test program failed using dlopen." >&4
4407 echo "Perhaps you should not use dynamic loading." >&4;;
4408 2) echo "Test program failed using dlsym." >&4
4409 echo "Perhaps you should not use dynamic loading." >&4;;
4410 3) echo "dlsym needs a leading underscore" >&4
4412 4) echo "dlsym doesn't need a leading underscore." >&4;;
4415 echo "I can't compile and run the test program." >&4
4420 $rm -f fred fred.? dyna.$dlext dyna.?
4425 : see if setuid scripts can be secure
4428 Some kernels have a bug that prevents setuid #! scripts from being
4429 secure. Some sites have disabled setuid #! scripts because of this.
4431 First let's decide if your kernel supports secure setuid #! scripts.
4432 (If setuid #! scripts would be secure but have been disabled anyway,
4433 don't say that they are secure if asked.)
4438 if $test -d /dev/fd; then
4439 echo "#!$ls" >reflect
4440 chmod +x,u+s reflect
4441 ./reflect >flect 2>&1
4442 if $contains "/dev/fd" flect >/dev/null; then
4443 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4447 If you are not sure if they are secure, I can check but I'll need a
4448 username and password different from the one you are using right now.
4449 If you don't have such a username or don't want me to test, simply
4453 rp='Other username to test security of setuid scripts with?'
4458 case "$d_suidsafe" in
4459 '') echo "I'll assume setuid scripts are *not* secure." >&4
4462 echo "Well, the $hint value is *not* secure." >&4
4464 *) echo "Well, the $hint value *is* secure." >&4
4469 $rm -f reflect flect
4470 echo "#!$ls" >reflect
4471 chmod +x,u+s reflect
4474 echo '"su" will (probably) prompt you for '"$ans's password."
4475 su $ans -c './reflect >flect'
4476 if $contains "/dev/fd" flect >/dev/null; then
4477 echo "Okay, it looks like setuid scripts are secure." >&4
4480 echo "I don't think setuid scripts are secure." >&4
4485 rp='Does your kernel have *secure* setuid scripts?'
4488 [yY]*) val="$define";;
4493 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4499 $rm -f reflect flect
4501 : now see if they want to do setuid emulation
4504 case "$d_suidsafe" in
4507 echo "No need to emulate SUID scripts since they are secure here." >& 4
4511 Some systems have disabled setuid scripts, especially systems where
4512 setuid scripts cannot be secure. On systems where setuid scripts have
4513 been disabled, the setuid/setgid bits on scripts are currently
4514 useless. It is possible for $package to detect those bits and emulate
4515 setuid/setgid in a secure fashion. This emulation will only work if
4516 setuid scripts have been disabled in your kernel.
4520 "$define") dflt=y ;;
4523 rp="Do you want to do setuid/setgid emulation?"
4526 [yY]*) val="$define";;
4534 : see if drem exists
4538 : see if dup2 exists
4542 : see if fchmod exists
4546 : see if fchown exists
4550 : see if this is an fcntl system
4554 : see if fgetpos exists
4555 set fgetpos d_fgetpos
4558 : see if we can have long filenames
4560 rmlist="$rmlist /tmp/cf$$"
4561 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
4562 first=123456789abcdef
4563 second=/tmp/cf$$/$first
4564 $rm -f $first $second
4565 if (echo hi >$first) 2>/dev/null; then
4566 if $test -f 123456789abcde; then
4567 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
4570 if (echo hi >$second) 2>/dev/null; then
4571 if $test -f /tmp/cf$$/123456789abcde; then
4573 That's peculiar... You can have filenames longer than 14 characters, but only
4574 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
4575 I shall consider your system cannot support long filenames at all.
4579 echo 'You can have filenames longer than 14 characters.' >&4
4584 How confusing! Some of your filesystems are sane enough to allow filenames
4585 longer than 14 characters but some others like /tmp can't even think about them.
4586 So, for now on, I shall assume your kernel does not allow them at all.
4593 You can't have filenames longer than 14 chars. You can't even think about them!
4599 $rm -rf /tmp/cf$$ 123456789abcde*
4601 : see if flock exists
4605 : see if fmod exists
4609 : see if fork exists
4613 : see if pathconf exists
4614 set pathconf d_pathconf
4617 : see if fpathconf exists
4618 set fpathconf d_fpathconf
4621 : see if fsetpos exists
4622 set fsetpos d_fsetpos
4625 : see if gethostent exists
4626 set gethostent d_gethent
4629 : see if getlogin exists
4630 set getlogin d_getlogin
4633 : see if getpgrp exists
4634 set getpgrp d_getpgrp
4637 : see if getpgrp2 exists
4638 set getpgrp2 d_getpgrp2
4641 : see if getppid exists
4642 set getppid d_getppid
4645 : see if getpriority exists
4646 set getpriority d_getprior
4649 : see if this is a netinet/in.h or sys/in.h system
4650 set netinet/in.h i_niin sys/in.h i_sysin
4653 : see if htonl --and friends-- exists
4658 : Maybe they are macros.
4663 #include <sys/types.h>
4664 #$i_niin I_NETINET_IN
4667 #include <netinet/in.h>
4673 printf("Defined as a macro.");
4676 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
4677 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
4679 echo "But it seems to be defined as a macro." >&4
4687 : see which of string.h or strings.h is needed
4689 strings=`./findhdr string.h`
4690 if $test "$strings" && $test -r "$strings"; then
4691 echo "Using <string.h> instead of <strings.h>." >&4
4695 strings=`./findhdr strings.h`
4696 if $test "$strings" && $test -r "$strings"; then
4697 echo "Using <strings.h> instead of <string.h>." >&4
4699 echo "No string header found -- You'll surely have problems." >&4
4705 "$undef") strings=`./findhdr strings.h`;;
4706 *) strings=`./findhdr string.h`;;
4711 if set index val -f; eval $csym; $val; then
4712 if set strchr val -f d_strchr; eval $csym; $val; then
4713 if $contains strchr "$strings" >/dev/null 2>&1 ; then
4716 echo "strchr() found." >&4
4720 echo "index() found." >&4
4725 echo "index() found." >&4
4728 if set strchr val -f d_strchr; eval $csym; $val; then
4731 echo "strchr() found." >&4
4733 echo "No index() or strchr() found!" >&4
4738 set d_strchr; eval $setvar
4740 set d_index; eval $setvar
4744 $cat >isascii.c <<'EOCP'
4755 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
4756 echo "isascii() found." >&4
4759 echo "isascii() NOT found." >&4
4766 : see if killpg exists
4770 : see if link exists
4774 : see if stdio is really std
4776 xxx=`./findhdr stdio.h`
4777 if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
4778 if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
4779 echo "Your stdio is pretty std." >&4
4782 echo "Your stdio isn't very std." >&4
4786 echo "Your stdio isn't very std." >&4
4792 : see if stdio is like that in linux
4793 case "$d_stdstdio" in
4796 xxx=`./findhdr stdio.h`
4797 $cppstdin $cppflags $cppminus < "$xxx" > stdio.E
4798 if $contains 'char.*_IO_read_base' stdio.E >/dev/null 2>&1 && \
4799 $contains '_IO_read_ptr' stdio.E >/dev/null 2>&1 && \
4800 $contains '_IO_read_end' stdio.E >/dev/null 2>&1 ; then
4801 echo "Your stdio looks like linux." >&4
4804 echo "You don't have linux stdio, either." >&4
4815 : see if localeconv exists
4816 set localeconv d_locconv
4819 : see if lockf exists
4823 : see if lstat exists
4827 : see if mblen exists
4831 : see if mbstowcs exists
4832 set mbstowcs d_mbstowcs
4835 : see if mbtowc exists
4839 : see if memcmp exists
4843 : see if memcpy exists
4847 : see if memmove exists
4848 set memmove d_memmove
4851 : see if memset exists
4855 : see if mkdir exists
4859 : see if mkfifo exists
4863 : see if mktime exists
4867 : see if msgctl exists
4871 : see if msgget exists
4875 : see if msgsnd exists
4879 : see if msgrcv exists
4883 : see how much of the 'msg*(2)' library is present.
4886 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
4887 *"$undef"*) h_msg=false;;
4889 : we could also check for sys/ipc.h ...
4890 if $h_msg && $test `./findhdr sys/msg.h`; then
4891 echo "You have the full msg*(2) library." >&4
4894 echo "You don't have the full msg*(2) library." >&4
4900 : see if this is a malloc.h system
4901 set malloc.h i_malloc
4904 : determine which malloc to compile in
4906 case "$usemymalloc" in
4907 ''|y*|true) dflt='y' ;;
4908 n*|false) dflt='n' ;;
4909 *) dflt="$usemymalloc" ;;
4911 rp="Do you wish to attempt to use the malloc that comes with $package?"
4917 mallocsrc='malloc.c'
4918 mallocobj='malloc.o'
4919 d_mymalloc="$define"
4922 : Remove malloc from list of libraries to use
4923 echo "Removing unneeded -lmalloc from library list" >&4
4924 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4927 echo "libs = $libs" >&4
4939 : compute the type returned by malloc
4941 case "$malloctype" in
4943 $cat >malloc.c <<END
4946 #include <sys/types.h>
4952 if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
4960 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4962 : see if nice exists
4966 : Locate the flags for 'open()'
4968 $cat >open3.c <<'EOCP'
4969 #include <sys/types.h>
4974 #include <sys/file.h>
4985 : check sys/file.h first to get FREAD on Sun
4986 if $test `./findhdr sys/file.h` && \
4987 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
4989 echo "<sys/file.h> defines the O_* constants..." >&4
4991 echo "and you have the 3 argument form of open()." >&4
4994 echo "but not the 3 argument form of open(). Oh, well." >&4
4997 elif $test `./findhdr fcntl.h` && \
4998 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5000 echo "<fcntl.h> defines the O_* constants..." >&4
5002 echo "and you have the 3 argument form of open()." >&4
5005 echo "but not the 3 argument form of open(). Oh, well." >&4
5010 echo "I can't find the O_* constant definitions! You got problems." >&4
5016 : see if pause exists
5020 : see if pipe exists
5024 : see if this is a pwd system
5026 xxx=`./findhdr pwd.h`
5027 if $test "$xxx"; then
5029 echo "<pwd.h> found." >&4
5030 $cppstdin $cppflags $cppminus < $xxx >$$.h
5031 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
5036 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
5041 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
5042 d_pwchange="$define"
5046 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
5051 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
5052 d_pwexpire="$define"
5056 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
5057 d_pwcomment="$define"
5059 d_pwcomment="$undef"
5069 d_pwcomment="$undef"
5070 echo "<pwd.h> NOT found." >&4
5073 : see if readdir and friends exist
5074 set readdir d_readdir
5076 set seekdir d_seekdir
5078 set telldir d_telldir
5080 set rewinddir d_rewinddir
5083 : see if readlink exists
5084 set readlink d_readlink
5087 : see if rename exists
5091 : see if rmdir exists
5095 : can bcopy handle overlapping blocks?
5100 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
5101 $cat >foo.c <<'EOCP'
5104 char buf[128], abc[128];
5110 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
5112 for (align = 7; align >= 0; align--) {
5113 for (len = 36; len; len--) {
5116 for (off = 1; off <= len; off++) {
5117 bcopy(b, b+off, len);
5118 bcopy(b+off, b, len);
5119 if (bcmp(b, abc, len))
5127 if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5128 if ./safebcpy 2>/dev/null; then
5132 echo "It can't, sorry."
5135 echo "(I can't compile the test program, so we'll assume not...)"
5139 $rm -f foo.* safebcpy core
5143 : can memcpy handle overlapping blocks?
5148 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
5149 $cat >foo.c <<'EOCP'
5152 char buf[128], abc[128];
5158 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
5160 for (align = 7; align >= 0; align--) {
5161 for (len = 36; len; len--) {
5163 memcpy(abc, b, len);
5164 for (off = 1; off <= len; off++) {
5165 memcpy(b, b+off, len);
5166 memcpy(b+off, b, len);
5167 if (memcmp(b, abc, len))
5175 if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5176 if ./safemcpy 2>/dev/null; then
5180 echo "It can't, sorry."
5183 echo "(I can't compile the test program, so we'll assume not...)"
5187 $rm -f foo.* safemcpy core
5191 : see if select exists
5195 : see if semctl exists
5199 : see if semget exists
5203 : see if semop exists
5207 : see how much of the 'sem*(2)' library is present.
5210 case "$d_semctl$d_semget$d_semop" in
5211 *"$undef"*) h_sem=false;;
5213 : we could also check for sys/ipc.h ...
5214 if $h_sem && $test `./findhdr sys/sem.h`; then
5215 echo "You have the full sem*(2) library." >&4
5218 echo "You don't have the full sem*(2) library." >&4
5224 : see if setegid exists
5225 set setegid d_setegid
5228 : see if seteuid exists
5229 set seteuid d_seteuid
5232 : see if setlinebuf exists
5233 set setlinebuf d_setlinebuf
5236 : see if setlocale exists
5237 set setlocale d_setlocale
5240 : see if setpgid exists
5241 set setpgid d_setpgid
5244 : see if setpgrp2 exists
5245 set setpgrp2 d_setpgrp2
5248 : see if setpriority exists
5249 set setpriority d_setprior
5252 : see if setregid exists
5253 set setregid d_setregid
5255 set setresgid d_setresgid
5258 : see if setreuid exists
5259 set setreuid d_setreuid
5261 set setresuid d_setresuid
5264 : see if setrgid exists
5265 set setrgid d_setrgid
5268 : see if setruid exists
5269 set setruid d_setruid
5272 : see if setsid exists
5276 : see if shmctl exists
5280 : see if shmget exists
5284 : see if shmat exists
5287 : see what shmat returns
5290 $cat >shmat.c <<'END'
5291 #include <sys/shm.h>
5294 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
5299 echo "and it returns ($shmattype)." >&4
5300 : see if a prototype for shmat is available
5301 $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h > shmat.c 2>/dev/null
5302 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
5313 set d_shmatprototype
5316 : see if shmdt exists
5320 : see how much of the 'shm*(2)' library is present.
5323 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
5324 *"$undef"*) h_shm=false;;
5326 : we could also check for sys/ipc.h ...
5327 if $h_shm && $test `./findhdr sys/shm.h`; then
5328 echo "You have the full shm*(2) library." >&4
5331 echo "You don't have the full shm*(2) library." >&4
5339 : see whether socket exists
5341 $echo $n "Hmm... $c" >&4
5342 if set socket val -f d_socket; eval $csym; $val; then
5343 echo "Looks like you have Berkeley networking support." >&4
5345 if set setsockopt val -f; eval $csym; $val; then
5348 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
5352 if $contains socklib libc.list >/dev/null 2>&1; then
5353 echo "Looks like you have Berkeley networking support." >&4
5355 : we will have to assume that it supports the 4.2 BSD interface
5358 echo "You don't have Berkeley networking in libc.a..." >&4
5359 if test -f /usr/lib/libnet.a; then
5360 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
5361 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
5362 if $contains socket libc.list >/dev/null 2>&1; then
5363 echo "...but the Wollongong group seems to have hacked it in." >&4
5365 sockethdr="-I/usr/netinclude"
5367 if $contains setsockopt libc.list >/dev/null 2>&1; then
5370 echo "...using the old 4.1c interface, rather than 4.2" >&4
5374 echo "or even in libnet.a, which is peculiar." >&4
5379 echo "or anywhere else I see." >&4
5386 : see if socketpair exists
5387 set socketpair d_sockpair
5390 : see if stat knows about block sizes
5392 xxx=`./findhdr sys/stat.h`
5393 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
5394 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
5395 echo "Your stat() knows about block sizes." >&4
5398 echo "Your stat() doesn't know about block sizes." >&4
5402 echo "Your stat() doesn't know about block sizes." >&4
5408 : see if strcoll exists
5409 set strcoll d_strcoll
5412 : check for structure copying
5414 echo "Checking to see if your C compiler can copy structs..." >&4
5415 $cat >try.c <<'EOCP'
5425 if $cc -c try.c >/dev/null 2>&1 ; then
5430 echo "Nope, it can't."
5436 : see if strerror and/or sys_errlist[] exist
5438 if set strerror val -f d_strerror; eval $csym; $val; then
5439 echo 'strerror() found.' >&4
5440 d_strerror="$define"
5441 d_strerrm='strerror(e)'
5442 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5443 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
5444 d_syserrlst="$define"
5446 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
5447 d_syserrlst="$undef"
5449 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
5450 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
5451 echo 'strerror() found in string header.' >&4
5452 d_strerror="$define"
5453 d_strerrm='strerror(e)'
5454 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5455 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
5456 d_syserrlst="$define"
5458 echo "(You don't appear to have any sys_errlist[], how can this be?)"
5459 d_syserrlst="$undef"
5461 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5462 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
5464 d_syserrlst="$define"
5465 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
5467 echo 'strerror() and sys_errlist[] NOT found.' >&4
5469 d_syserrlst="$undef"
5470 d_strerrm='"unknown"'
5473 : see if strxfrm exists
5474 set strxfrm d_strxfrm
5477 : see if symlink exists
5478 set symlink d_symlink
5481 : see if syscall exists
5482 set syscall d_syscall
5485 : see if sysconf exists
5486 set sysconf d_sysconf
5489 : see if system exists
5493 : see if tcgetpgrp exists
5494 set tcgetpgrp d_tcgetpgrp
5497 : see if tcsetpgrp exists
5498 set tcsetpgrp d_tcsetpgrp
5501 : define an is-a-typedef? function
5502 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
5504 "") inclist="sys/types.h";;
5506 eval "varval=\$$var";
5510 for inc in $inclist; do
5511 echo "#include <$inc>" >>temp.c;
5513 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
5514 if $contains $type temp.E >/dev/null 2>&1; then
5520 *) eval "$var=$varval";;
5523 : see if this is a sys/times.h system
5524 set sys/times.h i_systimes
5527 : see if times exists
5529 if set times val -f d_times; eval $csym; $val; then
5530 echo 'times() found.' >&4
5533 case "$i_systimes" in
5534 "$define") inc='sys/times.h';;
5536 set clock_t clocktype long stdio.h sys/types.h $inc
5540 rp="What type is returned by times() on this sytem?"
5544 echo 'times() NOT found, hope that will do.' >&4
5549 : see if truncate exists
5550 set truncate d_truncate
5553 : see if tzname[] exists
5555 if set tzname val -a d_tzname; eval $csym; $val; then
5557 echo 'tzname[] found.' >&4
5560 echo 'tzname[] NOT found.' >&4
5565 : see if umask exists
5569 : see if we have to deal with yellow pages, now NIS.
5570 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5571 if $test -f /usr/etc/nibindd; then
5573 echo "I'm fairly confident you're on a NeXT."
5575 rp='Do you get the hosts file via NetInfo?'
5584 y*) hostcat='nidump hosts .';;
5585 *) hostcat='cat /etc/hosts';;
5593 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5601 rp='Are you getting the hosts file via yellow pages?'
5604 y*) hostcat='ypcat hosts';;
5605 *) hostcat='cat /etc/hosts';;
5611 : now get the host name
5613 echo "Figuring out host name..." >&4
5614 case "$myhostname" in
5616 echo 'Maybe "hostname" will work...'
5617 if tans=`sh -c hostname 2>&1` ; then
5625 if $test "$cont"; then
5627 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5628 if tans=`cat /etc/systemid 2>&1` ; then
5630 phostname='cat /etc/systemid'
5631 echo "Whadyaknow. Xenix always was a bit strange..."
5634 elif $test -r /etc/systemid; then
5635 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5638 if $test "$cont"; then
5639 echo 'No, maybe "uuname -l" will work...'
5640 if tans=`sh -c 'uuname -l' 2>&1` ; then
5642 phostname='uuname -l'
5644 echo 'Strange. Maybe "uname -n" will work...'
5645 if tans=`sh -c 'uname -n' 2>&1` ; then
5647 phostname='uname -n'
5649 echo 'Oh well, maybe I can mine it out of whoami.h...'
5650 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5651 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5652 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5654 case "$myhostname" in
5655 '') echo "Does this machine have an identity crisis or something?"
5658 echo "Well, you said $myhostname before..."
5659 phostname='echo $myhostname';;
5665 : you do not want to know about this
5670 if $test "$myhostname" ; then
5672 rp='Your host name appears to be "'$myhostname'".'" Right?"
5680 : bad guess or no guess
5681 while $test "X$myhostname" = X ; do
5683 rp="Please type the (one word) name of your host:"
5688 : translate upper to lower if necessary
5689 case "$myhostname" in
5691 echo "(Normalizing case in your host name)"
5692 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5696 : a little sanity check here
5697 case "$phostname" in
5700 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5701 $myhostname$mydomain|$myhostname) ;;
5703 case "$phostname" in
5705 echo "(That doesn't agree with your whoami.h file, by the way.)"
5708 echo "(That doesn't agree with your $phostname command, by the way.)"
5716 : see how we will look up host name
5719 : dummy stub to allow use of elif
5720 elif set uname val -f d_uname; eval $csym; $val; then
5723 uname() was found, but you're running xenix, and older versions of xenix
5724 have a broken uname(). If you don't really know whether your xenix is old
5725 enough to have a broken system call, use the default answer.
5732 rp='Is your uname() broken?'
5735 n*) d_uname="$define"; call=uname;;
5738 echo 'uname() found.' >&4
5743 case "$d_gethname" in
5744 '') d_gethname="$undef";;
5747 '') d_uname="$undef";;
5749 case "$d_phostname" in
5750 '') d_phostname="$undef";;
5753 : backward compatibility for d_hvfork
5754 if test X$d_hvfork != X; then
5758 : see if there is a vfork
5763 : Ok, but do we want to use it. vfork is reportedly unreliable in
5764 : perl on Solaris 2.x, and probably elsewhere.
5772 rp="Some systems have problems with vfork(). Do you want to use it?"
5777 echo "Ok, we won't use vfork()."
5786 $define) usevfork='true';;
5787 *) usevfork='false';;
5790 : see if this is an sysdir system
5791 set sys/dir.h i_sysdir
5794 : see if this is an sysndir system
5795 set sys/ndir.h i_sysndir
5798 : see if closedir exists
5799 set closedir d_closedir
5802 case "$d_closedir" in
5805 echo "Checking whether closedir() returns a status..." >&4
5806 cat > closedir.c <<EOM
5807 #$i_dirent I_DIRENT /**/
5808 #$i_sysdir I_SYS_DIR /**/
5809 #$i_sysndir I_SYS_NDIR /**/
5811 #if defined(I_DIRENT)
5813 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
5814 #include <sys/dir.h>
5818 #include <sys/ndir.h>
5822 #include <ndir.h> /* may be wrong in the future */
5824 #include <sys/dir.h>
5829 int main() { return closedir(opendir(".")); }
5831 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
5832 if ./closedir > /dev/null 2>&1 ; then
5833 echo "Yes, it does."
5836 echo "No, it doesn't."
5840 echo "(I can't seem to compile the test program--assuming it doesn't)"
5851 : check for volatile keyword
5853 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
5854 $cat >try.c <<'EOCP'
5857 typedef struct _goo_struct goo_struct;
5858 goo_struct * volatile goo = ((goo_struct *)0);
5859 struct _goo_struct {
5864 typedef unsigned short foo_t;
5867 volatile foo_t blech;
5871 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
5873 echo "Yup, it does."
5876 echo "Nope, it doesn't."
5882 : see if there is a wait4
5886 : see if waitpid exists
5887 set waitpid d_waitpid
5890 : see if wcstombs exists
5891 set wcstombs d_wcstombs
5894 : see if wctomb exists
5898 : preserve RCS keywords in files with variable substitution, grrr
5903 Revision='$Revision'
5905 : check for alignment requirements
5907 case "$alignbytes" in
5908 '') echo "Checking alignment constraints..." >&4
5909 $cat >try.c <<'EOCP'
5916 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
5919 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
5923 echo"(I can't seem to compile the test program...)"
5926 *) dflt="$alignbytes"
5929 rp="Doubles must be aligned on a how-many-byte boundary?"
5934 : determine where public executables go
5939 rp='Pathname where the public executables will reside?'
5941 if $test "X$ansexp" != "X$binexp"; then
5949 Since you are running AFS, I need to distinguish the directory in which
5950 executables reside from the directory in which they are installed (and from
5951 which they are presumably copied to the former directory by occult means).
5954 case "$installbin" in
5955 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
5956 *) dflt="$installbin";;
5959 rp='Where will public executables be installed?'
5963 installbin="$binexp"
5966 : check for ordering of bytes in a long
5967 case "$byteorder" in
5971 In the following, larger digits indicate more significance. A big-endian
5972 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
5973 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
5974 machines may have weird orders like 3412. A Cray will report 87654321. If
5975 the test program works the default is probably right.
5976 I'm now running the test program...
5978 $cat >try.c <<'EOCP'
5985 char c[sizeof(long)];
5988 if (sizeof(long) > 4)
5989 u.l = (0x08070605L << 32) | 0x04030201L;
5992 for (i = 0; i < sizeof(long); i++)
5993 printf("%c", u.c[i]+'0');
5997 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
6000 ????|????????) echo "(The test program ran ok.)";;
6001 *) echo "(The test program didn't run right for some reason.)";;
6006 (I can't seem to compile the test program. Guessing big-endian...)
6015 rp="What is the order of bytes in a long?"
6020 : how do we catenate cpp tokens here?
6022 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
6023 $cat >cpp_stuff.c <<'EOCP'
6024 #define RCAT(a,b)a/**/b
6025 #define ACAT(a,b)a ## b
6029 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
6030 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
6031 echo "Oh! Smells like ANSI's been here."
6032 echo "We can catify or stringify, separately or together!"
6034 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
6035 echo "Ah, yes! The good old days!"
6036 echo "However, in the good old days we don't know how to stringify and"
6037 echo "catify at the same time."
6041 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
6042 to have to edit the values of CAT[2-5] in config.h...
6044 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
6048 : see if this is a db.h system
6054 : Check the return type needed for hash
6055 echo "Checking return type needed for hash for Berkeley DB ..." >&4
6057 #include <sys/types.h>
6068 info.hash = hash_cb ;
6071 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6072 if $contains warning try.out >>/dev/null 2>&1 ; then
6075 db_hashtype='u_int32_t'
6078 echo "I can't seem to compile the test program." >&4
6082 echo "Your version of Berkeley DB uses $db_hashtype for hash."
6090 : Check the return type needed for prefix
6091 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
6093 #include <sys/types.h>
6096 prefix_cb (key1, key2)
6104 info.prefix = prefix_cb ;
6107 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6108 if $contains warning try.out >>/dev/null 2>&1 ; then
6111 db_prefixtype='size_t'
6114 echo "I can't seem to compile the test program." >&4
6118 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
6120 *) db_prefixtype='int'
6124 : check for void type
6126 echo "Checking to see how well your C compiler groks the void type..." >&4
6129 Support flag bits are:
6130 1: basic void declarations.
6131 2: arrays of pointers to functions returning void.
6132 4: operations between pointers to and addresses of void functions.
6133 8: generic void pointers.
6136 case "$voidflags" in
6138 $cat >try.c <<'EOCP'
6144 extern void moo(); /* function returning void */
6145 void (*goo)(); /* ptr to func returning void */
6147 void *hue; /* generic ptr */
6161 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6162 voidflags=$defvoidused
6163 echo "It appears to support void to the level $package wants ($defvoidused)."
6164 if $contains warning .out >/dev/null 2>&1; then
6165 echo "However, you might get some warnings that look like this:"
6169 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6170 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
6171 echo "It supports 1..."
6172 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
6173 echo "It also supports 2..."
6174 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
6176 echo "And it supports 4 but not 8 definitely."
6178 echo "It doesn't support 4..."
6179 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
6181 echo "But it supports 8."
6184 echo "Neither does it support 8."
6188 echo "It does not support 2..."
6189 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
6191 echo "But it supports 4 and 8."
6193 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
6195 echo "And it supports 4 but has not heard about 8."
6197 echo "However it supports 8 but not 4."
6202 echo "There is no support at all for void."
6208 rp="Your void support flags add up to what?"
6213 : see if dbm.h is available
6218 : see if dbmclose exists
6219 set dbmclose d_dbmclose
6221 case "$d_dbmclose" in
6224 echo "We won't be including <dbm.h>"
6233 : see if ndbm.h is available
6238 : see if dbm_open exists
6239 set dbm_open d_dbm_open
6241 case "$d_dbm_open" in
6244 echo "We won't be including <ndbm.h>"
6253 : see if gdbm.h is available
6258 : see if gdbm_open exists
6259 set gdbm_open d_gdbm_open
6261 case "$d_gdbm_open" in
6264 echo "We won't be including <gdbm.h>"
6274 echo "Looking for extensions..." >&4
6278 if $test -f $xxx/$xxx.xs; then
6279 known_extensions="$known_extensions $xxx"
6282 set X $known_extensions
6284 known_extensions="$*"
6287 : Now see which are supported on this system.
6289 for xxx in $known_extensions ; do
6291 DB_File) case "$i_db" in
6292 $define) avail_ext="$avail_ext $xxx" ;;
6295 GDBM_File) case "$i_gdbm" in
6296 $define) avail_ext="$avail_ext $xxx" ;;
6299 NDBM_File) case "$i_ndbm" in
6300 $define) avail_ext="$avail_ext $xxx" ;;
6303 ODBM_File) case "$i_dbm" in
6304 $define) avail_ext="$avail_ext $xxx" ;;
6307 POSIX) case "$useposix" in
6308 true|define|y) avail_ext="$avail_ext $xxx" ;;
6311 Socket) case "$d_socket" in
6312 $define) avail_ext="$avail_ext $xxx" ;;
6315 *) avail_ext="$avail_ext $xxx"
6327 A number of extensions are supplied with $package. You may choose to
6328 compile these extensions for dynamic loading (the default), compile
6329 them into the $package executable (static loading), or not include
6330 them at all. Answer "none" to include no extensions.
6333 case "$dynamic_ext" in
6334 ''|' ') dflt="$avail_ext" ;;
6335 *) dflt="$dynamic_ext" ;;
6340 rp="What extensions do you wish to load dynamically?"
6343 none) dynamic_ext='' ;;
6344 *) dynamic_ext="$ans" ;;
6347 case "$static_ext" in
6349 : Exclude those already listed in dynamic linking
6351 for xxx in $avail_ext; do
6352 case " $dynamic_ext " in
6354 *) dflt="$dflt $xxx" ;;
6361 *) dflt="$static_ext"
6368 rp="What extensions do you wish to load statically?"
6371 none) static_ext='' ;;
6372 *) static_ext="$ans" ;;
6377 A number of extensions are supplied with $package. Answer "none"
6378 to include no extensions.
6381 case "$static_ext" in
6382 ''|' ') dflt="$avail_ext" ;;
6383 *) dflt="$static_ext" ;;
6389 rp="What extensions do you wish to include?"
6392 none) static_ext='' ;;
6393 *) static_ext="$ans" ;;
6398 set X $dynamic_ext $static_ext
6402 : see what type file positions are declared as in the library
6403 set fpos_t fpostype long stdio.h sys/types.h
6407 rp="What is the type for file position used by fsetpos()?"
6411 : Store the full pathname to the sed program for use in the C program
6414 : see what type gids are declared as in the kernel
6415 set gid_t gidtype xxx stdio.h sys/types.h
6419 xxx=`./findhdr sys/user.h`
6420 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
6422 unsigned) dflt="$1 $2" ;;
6426 *) dflt="$gidtype";;
6429 rp="What is the type for group ids returned by getgid()?"
6433 : see if getgroups exists
6434 set getgroups d_getgrps
6437 : Find type of 2nd arg to getgroups
6439 case "$d_getgrps" in
6441 case "$groupstype" in
6442 '') dflt="$gidtype" ;;
6443 *) dflt="$groupstype" ;;
6446 What is the type of the second argument to getgroups()? Usually this
6447 is the same as group ids, $gidtype, but not always.
6450 rp='What type is the second argument to getgroups()?'
6454 *) groupstype="$gidtype";;
6457 : see what type lseek is declared as in the kernel
6458 set off_t lseektype long stdio.h sys/types.h
6462 rp="What type is lseek's offset on this system declared as?"
6466 : determine where manual pages go
6467 set mansrc mansrc none
6471 $spackage has manual pages available in source form.
6475 echo "However, you don't have nroff, so they're probably useless to you."
6480 echo "If you don't want the manual sources installed, answer 'none'."
6483 lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
6484 lookpath="$lookpath $prefixexp/man/l_man/man1"
6485 lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
6486 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
6487 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6488 lookpath="$lookpath /usr/man/man.L"
6489 mansrc=`./loc . $prefixexp/man/man1 $lookpath`
6490 if $test -d "$mansrc"; then
6504 rp='Where do the manual pages (source) go?'
6506 if test "X$mansrcexp" != "X$ansexp"; then
6518 Since you are running AFS, I need to distinguish the directory in which
6519 manual pages reside from the directory in which they are installed (and from
6520 which they are presumably copied to the former directory by occult means).
6523 case "$installmansrc" in
6524 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
6525 *) dflt="$installmansrc";;
6528 rp='Where will man pages be installed?'
6530 installmansrc="$ans"
6532 installmansrc="$mansrcexp"
6547 : see what type is used for mode_t
6548 set mode_t modetype int stdio.h sys/types.h
6552 rp="What type is used for file modes?"
6556 : set the base revision
6559 : get the patchlevel
6561 echo "Getting the current patchlevel..." >&4
6562 if $test -r ../patchlevel.h;then
6563 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
6567 echo "(You have $package $baserev PL$patchlevel.)"
6569 : Cruising for prototypes
6571 echo "Checking out function prototypes..." >&4
6572 $cat >prototype.c <<'EOCP'
6573 main(int argc, char *argv[]) {
6576 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6577 echo "Your C compiler appears to support function prototypes."
6580 echo "Your C compiler doesn't seem to understand function prototypes."
6587 : check for size of random number generator
6591 echo "Checking to see how many bits your rand function produces..." >&4
6592 $cat >try.c <<'EOCP'
6597 register unsigned long tmp;
6598 register unsigned long max = 0L;
6600 for (i = 1000; i; i--) {
6601 tmp = (unsigned long)rand();
6602 if (tmp > max) max = tmp;
6604 for (i = 0; max; i++)
6609 if $cc try.c -o try >/dev/null 2>&1 ; then
6613 echo "(I can't seem to compile the test program...)"
6620 rp='How many bits does your rand() function produce?'
6625 : see if ar generates random libraries by itself
6627 echo "Checking how to generate random libraries on your machine..." >&4
6628 echo 'int bar1() { return bar2(); }' > bar1.c
6629 echo 'int bar2() { return 2; }' > bar2.c
6630 $cat > foo.c <<'EOP'
6631 main() { printf("%d\n", bar1()); exit(0); }
6633 $cc $ccflags -c bar1.c >/dev/null 2>&1
6634 $cc $ccflags -c bar2.c >/dev/null 2>&1
6635 $cc $ccflags -c foo.c >/dev/null 2>&1
6636 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
6637 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6638 ./foobar >/dev/null 2>&1; then
6639 echo "ar appears to generate random libraries itself."
6642 elif ar ts bar.a >/dev/null 2>&1 &&
6643 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6644 ./foobar >/dev/null 2>&1; then
6645 echo "a table of contents needs to be added with 'ar ts'."
6652 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
6653 $test -f $ranlib || ranlib=''
6656 if $test -n "$ranlib"; then
6657 echo "your system has '$ranlib'; we'll use that."
6660 echo "your system doesn't seem to support random libraries"
6661 echo "so we'll use lorder and tsort to order the libraries."
6668 : determine where public executable scripts go
6669 set scriptdir scriptdir
6671 case "$scriptdir" in
6674 : guess some guesses
6675 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6676 $test -d /usr/share/bin && dflt=/usr/share/bin
6677 $test -d /usr/local/script && dflt=/usr/local/script
6678 $test -d $prefixexp/script && dflt=$prefixexp/script
6682 *) dflt="$scriptdir"
6687 Some installations have a separate directory just for executable scripts so
6688 that they can mount it across multiple architectures but keep the scripts in
6689 one spot. You might, for example, have a subdirectory of /usr/share for this.
6690 Or you might just lump your scripts in with all your other executables.
6694 rp='Where do you keep publicly executable scripts?'
6696 if $test "X$ansexp" != "X$scriptdirexp"; then
6700 scriptdirexp="$ansexp"
6704 Since you are running AFS, I need to distinguish the directory in which
6705 scripts reside from the directory in which they are installed (and from
6706 which they are presumably copied to the former directory by occult means).
6709 case "$installscript" in
6710 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6711 *) dflt="$installscript";;
6714 rp='Where will public scripts be installed?'
6716 installscript="$ans"
6718 installscript="$scriptdirexp"
6721 : see if sys/select.h has to be included
6722 set sys/select.h i_sysselct
6725 : see if we should include time.h, sys/time.h, or both
6727 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
6728 $echo $n "I'm now running the test program...$c"
6729 $cat >try.c <<'EOCP'
6730 #include <sys/types.h>
6735 #ifdef SYSTIMEKERNEL
6738 #include <sys/time.h>
6741 #include <sys/select.h>
6750 struct timezone tzp;
6752 if (foo.tm_sec == foo.tm_sec)
6755 if (bar.tv_sec == bar.tv_sec)
6764 for s_timeval in '-DS_TIMEVAL' ''; do
6765 for i_systimek in '' '-DSYSTIMEKERNEL'; do
6766 for i_time in '' '-DI_TIME'; do
6767 for i_systime in '-DI_SYSTIME' ''; do
6771 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
6772 try.c -o try >/dev/null 2>&1 ; then
6773 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
6777 $echo $n "Succeeded with $flags$c"
6788 *SYSTIMEKERNEL*) i_systimek="$define"
6789 timeincl=`./findhdr sys/time.h`
6790 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
6791 *) i_systimek="$undef";;
6794 *I_TIME*) i_time="$define"
6795 timeincl=`./findhdr time.h`" $timeincl"
6796 echo "We'll include <time.h>." >&4;;
6797 *) i_time="$undef";;
6800 *I_SYSTIME*) i_systime="$define"
6801 timeincl=`./findhdr sys/time.h`" $timeincl"
6802 echo "We'll include <sys/time.h>." >&4;;
6803 *) i_systime="$undef";;
6807 : check for fd_set items
6810 Checking to see how well your C compiler handles fd_set and friends ...
6812 $cat >fd_set.c <<EOCP
6813 #$i_systime I_SYS_TIME
6814 #$i_sysselct I_SYS_SELECT
6815 #$d_socket HAS_SOCKET
6816 #include <sys/types.h>
6818 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6821 #include <sys/time.h>
6824 #include <sys/select.h>
6834 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
6841 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6842 d_fds_bits="$define"
6844 echo "Well, your system knows about the normal fd_set typedef..." >&4
6846 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
6847 d_fd_macros="$define"
6850 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
6852 d_fd_macros="$undef"
6856 Hmm, your compiler has some difficulty with fd_set. Checking further...
6858 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6861 echo "Well, your system has some sort of fd_set available..." >&4
6863 echo "and you have the normal fd_set macros." >&4
6864 d_fd_macros="$define"
6867 but not the normal fd_set macros! Gross! More work for me...
6869 d_fd_macros="$undef"
6872 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
6875 d_fd_macros="$undef"
6881 : check for type of arguments to select. This will only really
6882 : work if the system supports prototypes and provides one for
6886 : Make initial guess
6887 case "$selecttype" in
6890 $define) xxx='fd_set *' ;;
6894 *) xxx="$selecttype"
6899 'fd_set *') yyy='int *' ;;
6900 'int *') yyy='fd_set *' ;;
6905 Checking to see what type of arguments are expected by select().
6908 #$i_systime I_SYS_TIME
6909 #$i_sysselct I_SYS_SELECT
6910 #$d_socket HAS_SOCKET
6911 #include <sys/types.h>
6913 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6916 #include <sys/time.h>
6919 #include <sys/select.h>
6925 Select_fd_set_t readfds;
6926 Select_fd_set_t writefds;
6927 Select_fd_set_t exceptfds;
6928 struct timeval timeout;
6929 select(width, readfds, writefds, exceptfds, &timeout);
6933 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
6935 echo "Your system uses $xxx for the arguments to select." >&4
6936 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
6938 echo "Your system uses $yyy for the arguments to select." >&4
6940 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
6947 *) selecttype = 'int *'
6951 : generate list of signal names
6955 echo "Generating a list of signal names..." >&4
6956 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
6957 set X `cat $xxx 2>&1 | $awk '
6958 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
6959 sig[$3] = substr($2,4,20)
6960 if (max < $3 && $3 < 60) {
6966 for (i = 1; i <= max; i++) {
6980 echo 'kill -l' >/tmp/foo$$
6981 set X `csh -f </tmp/foo$$`
6985 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
6993 echo "The following signals are available:"
6995 echo $sig_name | $awk \
6996 'BEGIN { linelen = 0 }
6998 for (i = 1; i < NF; i++) {
7000 linelen = linelen + length(name)
7003 linelen = length(name)
7010 : see what type is used for size_t
7011 set size_t sizetype 'unsigned int' stdio.h sys/types.h
7015 rp="What type is used for the length parameter for string functions?"
7019 : see what type is used for signed size_t
7020 set ssize_t ssizetype int stdio.h sys/types.h
7023 $cat > ssize.c <<EOM
7025 #include <sys/types.h>
7026 #define Size_t $sizetype
7027 #define SSize_t $dflt
7030 if (sizeof(Size_t) == sizeof(SSize_t))
7032 else if (sizeof(Size_t) == sizeof(int))
7039 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
7041 echo "I'll be using $ssizetype for functions returning a byte count." >&4
7043 echo "(I can't compile the test program--please enlighten me!)"
7046 I need a type that is the same size as $sizetype, but is guaranteed to
7047 be signed. Common values are int and long.
7050 rp="What signed type is the same size as $sizetype?"
7054 $rm -f ssize ssize.[co]
7056 : see what type of char stdio uses.
7058 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7059 echo "Your stdio uses unsigned chars." >&4
7060 stdchar="unsigned char"
7062 echo "Your stdio uses signed chars." >&4
7066 : see if time exists
7068 if set time val -f d_time; eval $csym; $val; then
7069 echo 'time() found.' >&4
7071 set time_t timetype long stdio.h sys/types.h
7075 rp="What type is returned by time() on this sytem?"
7079 echo 'time() not found, hope that will do.' >&4
7086 : see what type uids are declared as in the kernel
7087 set uid_t uidtype xxx stdio.h sys/types.h
7091 xxx=`./findhdr sys/user.h`
7092 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
7094 unsigned) dflt="$1 $2" ;;
7098 *) dflt="$uidtype";;
7101 rp="What is the type for user ids returned by getuid()?"
7105 : see if this is a sys/file.h system
7110 : do we need to #include <sys/file.h> ?
7116 echo "We'll be including <sys/file.h>." >&4
7119 echo "We won't be including <sys/file.h>." >&4
7129 : see if fcntl.h is there
7134 : see if we can include fcntl.h
7140 echo "We'll be including <fcntl.h>." >&4
7144 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
7146 echo "We won't be including <fcntl.h>." >&4
7158 : see if this is an grp system
7162 : see if this is a math.h system
7166 : see if memory.h is available.
7171 : See if it conflicts with string.h
7177 $cppstdin $cppflags $cppminus < $strings > mem.h
7178 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7180 echo "We won't be including <memory.h>."
7190 : see if net/errno.h is available
7195 : Unfortunately, it causes problems on some systems. Arrgh.
7201 #include <net/errno.h>
7207 if $cc $ccflags -c try.c >/dev/null 2>&1; then
7208 echo "We'll be including <net/errno.h>." >&4
7210 echo "We won't be including <net/errno.h>." >&4
7219 : get C preprocessor symbols handy
7221 $echo $n "Hmm... $c"
7222 echo $al | $tr ' ' '\012' >Cppsym.know
7234 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
7236 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
7239 unknown="\$unknown \$sym"
7249 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
7251 exit 0; _ _ _ _\1\\ \1\\
7254 echo "exit 1; _ _ _" >>Cppsym\$\$
7255 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
7257 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
7263 $rm -f Cppsym\$\$ Cppsym2\$\$
7268 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
7270 : now check the C compiler for additional symbols
7276 for i in \`$cc -v -c tmp.c 2>&1\`
7279 -D*) echo "\$i" | $sed 's/^-D//';;
7280 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
7287 ./ccsym | $sort | $uniq >ccsym.raw
7288 $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list
7289 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
7290 $comm -13 ccsym.true ccsym.list >ccsym.own
7291 $comm -12 ccsym.true ccsym.list >ccsym.com
7292 $comm -23 ccsym.true ccsym.list >ccsym.cpp
7295 if $test -z ccsym.raw; then
7296 echo "Your C compiler doesn't seem to define any symbol!" >&4
7298 echo "However, your C preprocessor defines the following ones:"
7301 if $test -s ccsym.com; then
7302 echo "Your C compiler and pre-processor define these symbols:"
7303 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
7306 $test "$silent" || sleep 1
7308 if $test -s ccsym.cpp; then
7309 $test "$also" && echo " "
7310 echo "Your C pre-processor ${also}defines the following $symbols:"
7311 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
7313 $test "$silent" || sleep 1
7315 if $test -s ccsym.own; then
7316 $test "$also" && echo " "
7317 echo "Your C compiler ${also}defines the following cpp variables:"
7318 $sed -e 's/\(.*\)=1/\1/' ccsym.own
7319 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
7320 $test "$silent" || sleep 1
7325 : see if this is a termio system
7329 if $test `./findhdr termios.h`; then
7330 set tcsetattr i_termios
7336 "$define") echo "You have POSIX termios.h... good!" >&4;;
7337 *) if ./Cppsym pyr; then
7338 case "`/bin/universe`" in
7339 ucb) if $test `./findhdr sgtty.h`; then
7341 echo "<sgtty.h> found." >&4
7343 echo "System is pyramid with BSD universe."
7344 echo "<sgtty.h> not found--you could have problems." >&4
7346 *) if $test `./findhdr termio.h`; then
7348 echo "<termio.h> found." >&4
7350 echo "System is pyramid with USG universe."
7351 echo "<termio.h> not found--you could have problems." >&4
7355 if $test `./findhdr termio.h`; then
7356 echo "<termio.h> found." >&4
7358 elif $test `./findhdr sgtty.h`; then
7359 echo "<sgtty.h> found." >&4
7362 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
7365 if $test `./findhdr sgtty.h`; then
7366 echo "<sgtty.h> found." >&4
7368 elif $test `./findhdr termio.h`; then
7369 echo "<termio.h> found." >&4
7372 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
7376 set i_termio; eval $setvar
7377 val=$val2; set i_sgtty; eval $setvar
7378 val=$val3; set i_termios; eval $setvar
7380 : see if stdarg is available
7382 if $test `./findhdr stdarg.h`; then
7383 echo "<stdarg.h> found." >&4
7386 echo "<stdarg.h> NOT found." >&4
7390 : see if varags is available
7392 if $test `./findhdr varargs.h`; then
7393 echo "<varargs.h> found." >&4
7395 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
7398 : set up the varargs testing programs
7399 $cat > varargs.c <<EOP
7404 #include <varargs.h>
7422 p = va_arg(ap, char *);
7427 $cat > varargs <<EOP
7428 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
7437 : now check which varargs header should be included
7442 if `./varargs I_STDARG`; then
7444 elif `./varargs I_VARARGS`; then
7449 if `./varargs I_VARARGS`; then
7456 echo "I could not find the definition for va_dcl... You have problems..." >&4
7457 val="$undef"; set i_stdarg; eval $setvar
7458 val="$undef"; set i_varargs; eval $setvar
7465 val="$define"; set i_stdarg; eval $setvar
7466 val="$undef"; set i_varargs; eval $setvar
7469 val="$undef"; set i_stdarg; eval $setvar
7470 val="$define"; set i_varargs; eval $setvar
7473 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
7477 : see if stddef is available
7478 set stddef.h i_stddef
7481 : see if stdlib is available
7482 set stdlib.h i_stdlib
7485 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
7486 set sys/filio.h i_sysfilio
7489 if $test `./findhdr sys/ioctl.h`; then
7491 echo '<sys/ioctl.h> found.' >&4
7494 if $test $i_sysfilio = "$define"; then
7495 echo '<sys/ioctl.h> NOT found.' >&4
7497 $test $i_sgtty = "$define" && xxx="sgtty.h"
7498 $test $i_termio = "$define" && xxx="termio.h"
7499 $test $i_termios = "$define" && xxx="termios.h"
7500 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
7506 : see if this is a sys/param system
7507 set sys/param.h i_sysparam
7510 : see if sys/stat.h is available
7511 set sys/stat.h i_sysstat
7514 : see if sys/types.h has to be included
7515 set sys/types.h i_systypes
7518 : see if this is a unistd.h system
7519 set unistd.h i_unistd
7522 : see if this is an utime system
7526 : see if this is a vfork system
7537 : end of configuration questions
7539 echo "End of configuration questions."
7542 : back to where it started
7543 if test -d ../UU; then
7547 : configuration may be patched via a 'config.over' file
7548 if $test -f config.over; then
7551 rp='I see a config.over file. Do you wish to load it?'
7554 n*) echo "OK, I'll ignore it.";;
7556 echo "Configuration override changes have been loaded."
7561 : in case they want portability, strip down executable paths
7562 case "$d_portable" in
7565 echo "Stripping down executable paths..." >&4
7566 for file in $loclist $trylist; do
7572 : create config.sh file
7574 echo "Creating config.sh..." >&4
7575 $spitshell <<EOT >config.sh
7578 # This file was produced by running the Configure script. It holds all the
7579 # definitions figured out by Configure. Should you modify one of these values,
7580 # do not forget to propagate your changes by running "Configure -der". You may
7581 # instead choose to run each of the .SH files by yourself, or "Configure -S".
7584 # Configuration time: $cf_time
7585 # Configured by: $cf_by
7586 # Target system: $myuname
7596 Revision='$Revision'
7600 alignbytes='$alignbytes'
7601 aphostname='$aphostname'
7603 archlibexp='$archlibexp'
7604 archname='$archname'
7612 byteorder='$byteorder'
7614 castflags='$castflags'
7617 cccdlflags='$cccdlflags'
7618 ccdlflags='$ccdlflags'
7625 clocktype='$clocktype'
7627 compress='$compress'
7628 contains='$contains'
7632 cpp_stuff='$cpp_stuff'
7633 cppflags='$cppflags'
7635 cppminus='$cppminus'
7637 cppstdin='$cppstdin'
7638 cryptlib='$cryptlib'
7640 d_Gconvert='$d_Gconvert'
7641 d_access='$d_access'
7643 d_archlib='$d_archlib'
7644 d_attribut='$d_attribut'
7648 d_bsdpgrp='$d_bsdpgrp'
7651 d_casti32='$d_casti32'
7652 d_castneg='$d_castneg'
7653 d_charvspr='$d_charvspr'
7655 d_chroot='$d_chroot'
7656 d_chsize='$d_chsize'
7657 d_closedir='$d_closedir'
7661 d_cuserid='$d_cuserid'
7662 d_dbl_dig='$d_dbl_dig'
7663 d_difftime='$d_difftime'
7664 d_dirnamlen='$d_dirnamlen'
7665 d_dlerror='$d_dlerror'
7666 d_dlopen='$d_dlopen'
7667 d_dlsymun='$d_dlsymun'
7668 d_dosuid='$d_dosuid'
7671 d_eunice='$d_eunice'
7672 d_fchmod='$d_fchmod'
7673 d_fchown='$d_fchown'
7675 d_fd_macros='$d_fd_macros'
7676 d_fd_set='$d_fd_set'
7677 d_fds_bits='$d_fds_bits'
7678 d_fgetpos='$d_fgetpos'
7679 d_flexfnam='$d_flexfnam'
7683 d_fpathconf='$d_fpathconf'
7684 d_fsetpos='$d_fsetpos'
7685 d_getgrps='$d_getgrps'
7686 d_gethent='$d_gethent'
7687 d_gethname='$d_gethname'
7688 d_getlogin='$d_getlogin'
7689 d_getpgrp2='$d_getpgrp2'
7690 d_getpgrp='$d_getpgrp'
7691 d_getppid='$d_getppid'
7692 d_getprior='$d_getprior'
7695 d_isascii='$d_isascii'
7696 d_killpg='$d_killpg'
7698 d_linuxstd='$d_linuxstd'
7699 d_locconv='$d_locconv'
7703 d_mbstowcs='$d_mbstowcs'
7704 d_mbtowc='$d_mbtowc'
7705 d_memcmp='$d_memcmp'
7706 d_memcpy='$d_memcpy'
7707 d_memmove='$d_memmove'
7708 d_memset='$d_memset'
7710 d_mkfifo='$d_mkfifo'
7711 d_mktime='$d_mktime'
7713 d_msgctl='$d_msgctl'
7714 d_msgget='$d_msgget'
7715 d_msgrcv='$d_msgrcv'
7716 d_msgsnd='$d_msgsnd'
7717 d_mymalloc='$d_mymalloc'
7719 d_oldsock='$d_oldsock'
7721 d_pathconf='$d_pathconf'
7723 d_phostname='$d_phostname'
7725 d_portable='$d_portable'
7727 d_pwchange='$d_pwchange'
7728 d_pwclass='$d_pwclass'
7729 d_pwcomment='$d_pwcomment'
7730 d_pwexpire='$d_pwexpire'
7731 d_pwquota='$d_pwquota'
7732 d_readdir='$d_readdir'
7733 d_readlink='$d_readlink'
7734 d_rename='$d_rename'
7735 d_rewinddir='$d_rewinddir'
7737 d_safebcpy='$d_safebcpy'
7738 d_safemcpy='$d_safemcpy'
7739 d_seekdir='$d_seekdir'
7740 d_select='$d_select'
7742 d_semctl='$d_semctl'
7743 d_semget='$d_semget'
7745 d_setegid='$d_setegid'
7746 d_seteuid='$d_seteuid'
7747 d_setlinebuf='$d_setlinebuf'
7748 d_setlocale='$d_setlocale'
7749 d_setpgid='$d_setpgid'
7750 d_setpgrp2='$d_setpgrp2'
7751 d_setpgrp='$d_setpgrp'
7752 d_setprior='$d_setprior'
7753 d_setregid='$d_setregid'
7754 d_setresgid='$d_setresgid'
7755 d_setresuid='$d_setresuid'
7756 d_setreuid='$d_setreuid'
7757 d_setrgid='$d_setrgid'
7758 d_setruid='$d_setruid'
7759 d_setsid='$d_setsid'
7762 d_shmatprototype='$d_shmatprototype'
7763 d_shmctl='$d_shmctl'
7765 d_shmget='$d_shmget'
7766 d_shrplib='$d_shrplib'
7767 d_socket='$d_socket'
7768 d_sockpair='$d_sockpair'
7769 d_statblks='$d_statblks'
7770 d_stdstdio='$d_stdstdio'
7771 d_strchr='$d_strchr'
7772 d_strcoll='$d_strcoll'
7773 d_strctcpy='$d_strctcpy'
7774 d_strerrm='$d_strerrm'
7775 d_strerror='$d_strerror'
7776 d_strxfrm='$d_strxfrm'
7777 d_suidsafe='$d_suidsafe'
7778 d_symlink='$d_symlink'
7779 d_syscall='$d_syscall'
7780 d_sysconf='$d_sysconf'
7781 d_sysernlst='$d_sysernlst'
7782 d_syserrlst='$d_syserrlst'
7783 d_system='$d_system'
7784 d_tcgetpgrp='$d_tcgetpgrp'
7785 d_tcsetpgrp='$d_tcsetpgrp'
7786 d_telldir='$d_telldir'
7789 d_truncate='$d_truncate'
7790 d_tzname='$d_tzname'
7794 d_void_closedir='$d_void_closedir'
7795 d_voidsig='$d_voidsig'
7796 d_voidtty='$d_voidtty'
7797 d_volatile='$d_volatile'
7798 d_vprintf='$d_vprintf'
7800 d_waitpid='$d_waitpid'
7801 d_wcstombs='$d_wcstombs'
7802 d_wctomb='$d_wctomb'
7805 db_hashtype='$db_hashtype'
7806 db_prefixtype='$db_prefixtype'
7807 defvoidused='$defvoidused'
7808 direntrytype='$direntrytype'
7811 dynamic_ext='$dynamic_ext'
7815 eunicefix='$eunicefix'
7817 extensions='$extensions'
7820 fpostype='$fpostype'
7821 full_csh='$full_csh'
7822 full_sed='$full_sed'
7824 gccversion='$gccversion'
7828 groupcat='$groupcat'
7829 groupstype='$groupstype'
7831 h_sysfile='$h_sysfile'
7835 i_bsdioctl='$i_bsdioctl'
7838 i_dirent='$i_dirent'
7845 i_limits='$i_limits'
7846 i_malloc='$i_malloc'
7848 i_memory='$i_memory'
7850 i_neterrno='$i_neterrno'
7854 i_stdarg='$i_stdarg'
7855 i_stddef='$i_stddef'
7856 i_stdlib='$i_stdlib'
7857 i_string='$i_string'
7858 i_sysdir='$i_sysdir'
7859 i_sysfile='$i_sysfile'
7860 i_sysfilio='$i_sysfilio'
7862 i_sysioctl='$i_sysioctl'
7863 i_sysndir='$i_sysndir'
7864 i_sysparam='$i_sysparam'
7865 i_sysselct='$i_sysselct'
7866 i_syssockio='$i_syssockio'
7867 i_sysstat='$i_sysstat'
7868 i_systime='$i_systime'
7869 i_systimek='$i_systimek'
7870 i_systimes='$i_systimes'
7871 i_systypes='$i_systypes'
7872 i_termio='$i_termio'
7873 i_termios='$i_termios'
7875 i_unistd='$i_unistd'
7877 i_varargs='$i_varargs'
7878 i_varhdr='$i_varhdr'
7882 installarchlib='$installarchlib'
7883 installbin='$installbin'
7884 installmansrc='$installmansrc'
7885 installprivlib='$installprivlib'
7886 installscript='$installscript'
7888 known_extensions='$known_extensions'
7891 lddlflags='$lddlflags'
7897 libswanted='$libswanted'
7906 lseektype='$lseektype'
7910 mallocobj='$mallocobj'
7911 mallocsrc='$mallocsrc'
7912 malloctype='$malloctype'
7915 mansrcexp='$mansrcexp'
7918 mips_type='$mips_type'
7921 modetype='$modetype'
7924 mydomain='$mydomain'
7925 myhostname='$myhostname'
7930 optimize='$optimize'
7931 orderlib='$orderlib'
7936 patchlevel='$patchlevel'
7939 phostname='$phostname'
7944 prefixexp='$prefixexp'
7946 privlibexp='$privlibexp'
7947 prototype='$prototype'
7948 randbits='$randbits'
7953 scriptdir='$scriptdir'
7954 scriptdirexp='$scriptdirexp'
7956 selecttype='$selecttype'
7957 sendmail='$sendmail'
7960 sharpbang='$sharpbang'
7961 shmattype='$shmattype'
7964 sig_name='$sig_name'
7965 signal_t='$signal_t'
7966 sizetype='$sizetype'
7971 sockethdr='$sockethdr'
7972 socketlib='$socketlib'
7974 spackage='$spackage'
7975 spitshell='$spitshell'
7977 ssizetype='$ssizetype'
7979 static_ext='$static_ext'
7988 timeincl='$timeincl'
7989 timetype='$timetype'
7997 usemymalloc='$usemymalloc'
7999 useposix='$useposix'
8000 usevfork='$usevfork'
8004 voidflags='$voidflags'
8009 : add special variables
8010 $test -f patchlevel.h && \
8011 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
8012 echo "CONFIG=true" >>config.sh
8014 : propagate old symbols
8015 if $test -f UU/config.sh; then
8016 <UU/config.sh sort | uniq >UU/oldconfig.sh
8017 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
8018 sort | uniq -u >UU/oldsyms
8019 set X `cat UU/oldsyms`
8025 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
8027 echo "# Variables propagated from previous config.sh file." >>config.sh
8028 for sym in `cat UU/oldsyms`; do
8029 echo " Propagating $hint variable "'$'"$sym..."
8030 eval 'tmp="$'"${sym}"'"'
8032 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
8038 : Finish up by extracting the .SH files
8051 echo "If you didn't make any mistakes, then just type a carriage return here."
8052 rp="If you need to edit config.sh, do it as a shell escape here:"
8057 *) : in case they cannot read
8063 : if this fails, just run all the .SH files by hand
8070 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
8077 Now you need to generate make dependencies by running "make depend".
8078 You might prefer to run it in background: "make depend > makedepend.out &"
8079 It can take a while, so you might not want to run it right now.
8084 rp="Run make depend now?"
8088 make depend && echo "Now you must run a make."
8091 echo "You must run 'make depend' then 'make'."
8094 elif test -f [Mm]akefile; then
8096 echo "Now you must run a make."
8101 $rm -f kit*isdone ark*isdone