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 Mon Mar 6 11:00:02 EST 1995 [metaconfig 3.0 PL51]
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
533 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
536 : We must find out about Eunice early
538 if test -f /etc/unixtovms; then
539 eunicefix=/etc/unixtovms
541 if test -f /etc/unixtovms.exe; then
542 eunicefix=/etc/unixtovms.exe
545 : list of known cpp symbols, sorted alphabetically
546 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
547 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
548 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
549 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
550 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
551 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
552 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
553 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
554 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
555 al="$al VMS Xenix286"
556 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
557 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
558 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
559 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
560 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
561 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
562 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
563 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
564 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
565 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
566 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
567 al="$al __SVR4_2__ __UMAXV__"
568 al="$al ____386BSD____ __alpha __alpha__ __amiga"
569 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
570 al="$al __host_mips__"
571 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
572 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
573 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
574 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
575 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
576 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
577 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
578 al="$al __mc88100 __mc88100__ __mips __mips__"
579 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
580 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
581 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
582 al="$al _host_mips _mips _unix"
583 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
584 al="$al apollo ardent att386 att3b"
585 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
586 al="$al cadmus clipper concurrent convex cray ctix"
587 al="$al dmert encore gcos gcx gimpel gould"
588 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
589 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
590 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
591 al="$al i186 i286 i386 i486 i8086"
592 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
593 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
594 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
595 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
596 al="$al mc88000 mc88100 merlin mert mips mvs n16"
597 al="$al ncl_el ncl_mr"
598 al="$al news1500 news1700 news1800 news1900 news3700"
599 al="$al news700 news800 news900 ns16000 ns32000"
600 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
601 al="$al parisc pc532 pdp11 plexus posix pyr"
602 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
603 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
604 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
605 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
606 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
607 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
613 : change the next line if compiling for Xenix/286 on Xenix/386
614 xlibpth='/usr/lib/386 /lib/386'
616 : general looking path for locating libraries
617 glibpth="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
618 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
619 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
621 : Private path used by Configure to find libraries. Its value
622 : is prepended to libpth. This variable takes care of special
623 : machines, like the mips. Usually, it should be empty.
626 : default library list
628 : full support for void wanted by default
631 : set useposix=false in your hint file to disable the POSIX extension.
633 : no include file wanted by default
636 : List of libraries we want.
637 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
638 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
639 libswanted="$libswanted ucb bsd BSD PW x"
640 : We probably want to search /usr/shlib before most other libraries.
641 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
642 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
643 glibpth="/usr/shlib $glibpth"
644 : Do not use vfork unless overridden by a hint file.
646 : We might as well always be portable. It makes no difference for
647 : perl5, and makes people happy.
650 : script used to extract .SH files with variable substitutions
653 echo "Doing variable substitutions on .SH files..."
654 if test -f MANIFEST; then
655 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
656 : Pick up possible extension manifests.
657 for dir in ext/* ; do
658 if test -f $dir/MANIFEST; then
659 xxx=`awk '{print $1}' < $dir/MANIFEST |
660 sed -n "/\.SH$/ s@^@$dir/@p"`
661 shlist="$shlist $xxx"
666 echo "(Looking for .SH files under the current directory.)"
667 set x `find . -name "*.SH" -print`
671 0) set x *.SH; shift;;
673 if test ! -f $1; then
679 dir=`expr X$file : 'X\(.*\)/'`
680 file=`expr X$file : 'X.*/\(.*\)'`
681 (cd $dir && . ./$file)
688 if test -f config_h.SH; then
689 if test ! -f config.h; then
690 : oops, they left it out of MANIFEST, probably, so do it anyway.
696 : produce awk script to parse command line options
697 cat >options.awk <<'EOF'
699 optstr = "dD:eEf:hOrsSU:V"; # getopt-style specification
701 len = length(optstr);
702 for (i = 1; i <= len; i++) {
703 c = substr(optstr, i, 1);
704 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
715 if (substr(str, 1, 1) != "-") {
716 printf("'%s'\n", str);
720 for (i = 2; i <= len; i++) {
721 c = substr(str, i, 1);
723 printf("-%s\n", substr(str, i));
729 printf("'%s'\n", substr(str, i + 1));
742 : process the command line options
743 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
748 : set up default values
760 while test $# -gt 0; do
762 -d) shift; fastread=yes;;
763 -e) shift; alldone=cont;;
767 if test -r "$1"; then
770 echo "$me: cannot read config file $1." >&2
775 -h) shift; error=true;;
776 -r) shift; reuseval=true;;
777 -s) shift; silent=true;;
778 -E) shift; alldone=exit;;
779 -O) shift; override=true;;
780 -S) shift; extractsh=true;;
785 echo "$me: use '-U symbol=', not '-D symbol='." >&2
786 echo "$me: ignoring -D $1" >&2
789 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
790 *) echo "$1='define'" >> optdef.sh;;
797 *=) echo "$1" >> optdef.sh;;
799 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
800 echo "$me: ignoring -U $1" >&2
802 *) echo "$1='undef'" >> optdef.sh;;
806 -V) echo "$me generated by metaconfig 3.0 PL51." >&2
809 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
817 Usage: $me [-dehrEOSV] [-f config.sh] [-D symbol] [-D symbol=value]
818 [-U symbol] [-U symbol=]
819 -d : use defaults for all answers.
820 -e : go on without questioning past the production of config.sh.
821 -f : specify an alternate default configuration file.
822 -h : print this help message and exit (with an error status).
823 -r : reuse C symbols value if possible (skips costly nm extraction).
824 -s : silent mode, only echoes questions and essential information.
825 -D : define symbol to have some value:
826 -D symbol symbol gets the value 'define'
827 -D symbol=value symbol gets the value 'value'
828 -E : stop at the end of questions, after having produced config.sh.
829 -O : let -D and -U override definitions from loaded configuration file.
830 -S : perform variable substitutions on all .SH files (can mix with -f)
831 -U : undefine symbol:
832 -U symbol symbol gets the value 'undef'
833 -U symbol= symbol gets completely empty
834 -V : print version number and exit (with a zero status).
842 true) exec 1>/dev/null;;
845 : run the defines and the undefines, if any, but leave the file out there...
852 '') config_sh='config.sh'; config='./config.sh';;
853 /*) config="$config_sh";;
854 *) config="./$config_sh";;
857 echo "Fetching answers from $config_sh..."
860 test "$override" && . ./optdef.sh
871 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
872 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
873 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
874 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
875 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
878 : Eunice requires " " instead of "", can you believe it
881 echo "Beginning of configuration questions for $package."
883 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
885 : Some greps do not return status, grrr.
886 echo "grimblepritz" >grimble
887 if grep blurfldyick grimble >/dev/null 2>&1 ; then
889 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
895 : the following should work in any shell
899 echo "AGH! Grep doesn't return a status. Attempting remedial action."
900 cat >contains <<'EOSS'
901 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
906 : first determine how to suppress newline on echo command
908 echo "Checking echo to see how to suppress newlines..."
909 (echo "hi there\c" ; echo " ") >.echotmp
910 if $contains c .echotmp >/dev/null 2>&1 ; then
921 echo $n "The star should be here-->$c"
925 : Now test for existence of everything in MANIFEST
927 if test -f ../MANIFEST; then
928 echo "First let's make sure your kit is complete. Checking..." >&4
929 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
931 for filelist in x??; do
932 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
934 if test -s missing; then
938 THIS PACKAGE SEEMS TO BE INCOMPLETE.
940 You have the option of continuing the configuration process, despite the
941 distinct possibility that your kit is damaged, by typing 'y'es. If you
942 do, don't blame me if something goes wrong. I advise you to type 'n'o
943 and contact the author (lwall@netlabs.com).
946 echo $n "Continue? [n] $c" >&4
950 echo "Continuing..." >&4
954 echo "ABORTING..." >&4
959 echo "Looks good..." >&4
962 echo "There is no MANIFEST file. I hope your kit is complete !"
966 : compute the number of columns on the terminal for proper question formatting
971 : set up the echo used in my read
972 myecho="case \"\$xxxm\" in
973 '') echo $n \"\$rp $c\" >&4;;
975 '') echo $n \"[\$xxxm] $c\";;
977 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
979 echo $n \"[\$xxxm] $c\" >&4
981 echo $n \"\$rp [\$xxxm] $c\" >&4
987 : now set up to do reads with possible shell escape and default assignment
993 yes) case "\$dflt" in
996 case "\$silent-\$rp" in
1001 *) case "\$silent" in
1002 true) case "\$rp" in
1007 while expr "X\$ans" : "X!" >/dev/null; do
1011 aok=''; eval "ans=\"\$answ\"" && aok=y
1016 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1021 echo "(OK, I'll run with -d after this question.)"
1024 echo "*** Sorry, \$1 not supported yet."
1036 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1046 echo "*** Substitution done -- please confirm."
1048 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1053 echo "*** Error -- try again."
1060 case "\$ans\$xxxm\$nostick" in
1072 : create .config dir to save info across Configure sessions
1073 test -d ../.config || mkdir ../.config
1074 cat >../.config/README <<EOF
1075 This directory created by Configure to save information that should
1076 persist across sessions.
1078 You may safely delete it if you wish.
1081 : general instructions
1084 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1085 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1088 rp='Would you like to see the instructions?'
1099 This installation shell script will examine your system and ask you questions
1100 to determine how the perl5 package should be installed. If you get
1101 stuck on a question, you may use a ! shell escape to start a subshell or
1102 execute a command. Many of the questions will have default answers in square
1103 brackets; typing carriage return will give you the default.
1105 On some of the questions which ask for file or directory names you are allowed
1106 to use the ~name construct to specify the login directory belonging to "name",
1107 even if you don't have a shell which knows about that. Questions where this is
1108 allowed will be marked "(~name ok)".
1112 dflt='Type carriage return to continue'
1116 The prompter used in this script allows you to use shell variables and
1117 backticks in your answers. You may use $1, $2, etc... to refer to the words
1118 in the default answer, as if the default line was a set of arguments given to a
1119 script shell. This means you may also use $* to repeat the whole default line,
1120 so you do not have to re-type everything to add something to the default.
1122 Everytime there is a substitution, you will have to confirm. If there is an
1123 error (e.g. an unmatched backtick), the default answer will remain unchanged
1124 and you will be prompted again.
1126 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1127 the questions and use the computed defaults (or the previous answers if there
1128 was already a config.sh file). Type 'Configure -h' for a list of options.
1129 You may also start interactively and then answer '& -d' at any prompt to turn
1130 on the non-interactive behaviour for the remaining of the execution.
1136 Much effort has been expended to ensure that this shell script will run on any
1137 Unix system. If despite that it blows up on yours, your best bet is to edit
1138 Configure and run it again. If you can't run Configure for some reason,
1139 you'll have to generate a config.sh file by hand. Whatever problems you
1140 have, let me (lwall@netlabs.com) know how I blew it.
1142 This installation script affects things in two ways:
1144 1) it may do direct variable substitutions on some of the files included
1146 2) it builds a config.h file for inclusion in C programs. You may edit
1147 any of these files as the need arises after running this script.
1149 If you make a mistake on a question, there is no easy way to back up to it
1150 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1151 files. Configure will offer to let you do this before it runs the SH files.
1154 dflt='Type carriage return to continue'
1156 case "$firsttime" in
1157 true) echo $user >>../.config/instruct;;
1161 : see if sh knows # comments
1163 echo "Checking your sh to see if it knows about # comments..." >&4
1164 if `sh -c '#' >/dev/null 2>&1`; then
1165 echo "Your sh handles # comments correctly."
1169 echo "Okay, let's see if #! works on this system..."
1171 test -f $xcat || xcat=/usr/bin/cat
1176 if test -s today; then
1180 echo "#! $xcat" > try
1184 if test -s today; then
1188 echo "It's just a comment."
1193 echo "Your sh doesn't grok # comments--I will strip them later on."
1196 echo "exec grep -v '^[ ]*#'" >spitshell
1198 $eunicefix spitshell
1199 spitshell=`pwd`/spitshell
1201 echo "I presume that if # doesn't work, #! won't work either!"
1206 : figure out how to guarantee sh startup
1208 echo "Checking out how to guarantee sh startup..." >&4
1210 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1211 *) startsh=$sharpbang'/bin/sh';;
1213 echo "Let's see if '$startsh' works..."
1223 echo "Yup, it does."
1225 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1229 : find out where common programs are
1231 echo "Locating common programs..." >&4
1244 if test -d \$dir/\$thing; then
1250 for thisthing in \$dir/\$thing; do
1251 : just loop through to pick last item
1253 if test -f \$thisthing; then
1256 elif test -f \$dir/\$thing.exe; then
1257 : on Eunice apparently
1301 pth=`echo $PATH | sed -e 's/:/ /g'`
1302 pth="$pth /lib /usr/lib"
1303 for file in $loclist; do
1304 xxx=`./loc $file $file $pth`
1309 echo $file is in $xxx.
1312 echo "I don't know where $file is. I hope it's in everyone's PATH."
1317 echo "Don't worry if any of the following aren't found..."
1319 for file in $trylist; do
1320 xxx=`./loc $file $file $pth`
1325 echo $file is in $xxx.
1328 echo "I don't see $file out there, $say."
1335 echo "Substituting grep for egrep."
1341 echo "Hopefully test is built into your sh."
1344 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1345 echo "Using the test built into your sh."
1353 echo "Hopefully echo is built into your sh."
1358 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1359 $echo $n "hi there$c" >foo1
1360 echo $n "hi there$c" >foo2
1361 if cmp foo1 foo2 >/dev/null 2>&1; then
1362 echo "They are compatible. In fact, they may be identical."
1369 They are not compatible! You are probably running ksh on a non-USG system.
1370 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1371 have echo built in and we may have to run some Bourne shell scripts. That
1372 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1375 $echo $n "The star should be here-->$c"
1382 : determine whether symbolic links are supported
1385 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1386 echo "Symbolic links are supported." >&4
1389 echo "Symbolic links are NOT supported." >&4
1394 : see whether [:lower:] and [:upper:] are supported character classes
1398 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1400 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1405 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1408 : set up the translation script tr, must be called with ./tr of course
1412 '[A-Z][a-z]') exec $tr '$up' '$low';;
1413 '[a-z][A-Z]') exec $tr '$low' '$up';;
1420 : Try to determine whether config.sh was made on this system
1421 case "$config_sh" in
1423 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1424 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1425 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1426 newmyuname="$myuname"
1428 if test "$fastread" = yes; then
1430 elif test -f ../config.sh; then
1431 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1432 eval "`grep myuname= ../config.sh`"
1434 if test "X$myuname" = "X$newmyuname"; then
1439 : Get old answers from old config file if Configure was run on the
1440 : same system, otherwise use the hints.
1443 if test -f config.sh; then
1445 rp="I see a config.sh file. Shall I use it to set the defaults?"
1448 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1449 *) echo "Fetching default answers from your old config.sh file..." >&4
1460 if test ! -f config.sh; then
1463 First time through, eh? I have some defaults handy for the following systems:
1466 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1468 : Half the following guesses are probably wrong... If you have better
1469 : tests or hints, please send them to lwall@netlabs.com
1470 : The metaconfig authors would also appreciate a copy...
1471 $test -f /irix && osname=irix
1472 $test -f /xenix && osname=sco_xenix
1473 $test -f /dynix && osname=dynix
1474 $test -f /dnix && osname=dnix
1475 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1476 $test -f /bin/mips && /bin/mips && osname=mips
1477 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1478 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1479 $test -d /usr/apollo/bin && osname=apollo
1480 $test -f /etc/saf/_sactab && osname=svr4
1481 $test -d /usr/include/minix && osname=minix
1482 if $test -f $uname; then
1490 umips) osname=umips ;;
1493 [23]100) osname=mips ;;
1494 next*) osname=next ;;
1495 news*) osname=news ;;
1497 if $test -f /etc/kconfig; then
1499 if test "$lns" = "ln -s"; then
1501 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1503 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1512 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1514 'not found') osvers="$4"."$3" ;;
1515 '<3240'|'<>3240') osvers=3.2.0 ;;
1516 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1517 '=3250'|'>3250') osvers=3.2.5 ;;
1524 domainos) osname=apollo
1530 freebsd) osname=freebsd
1532 genix) osname=genix ;;
1537 *.10.*) osvers=10 ;;
1554 netbsd*) osname=netbsd
1557 bsd386) osname=bsd386
1560 next*) osname=next ;;
1561 solaris) osname=solaris
1563 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1570 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1574 titanos) osname=titanos
1583 ultrix) osname=ultrix
1589 osvers=`echo "$3" | sed 's/^[vt]//'`
1591 hp*) osname=hp_osf1 ;;
1592 mips) osname=mips_osf1 ;;
1598 $2) case "$osname" in
1602 : svr4.x or possibly later
1612 if test -f /stand/boot ; then
1613 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1614 if test -n "$INITPROG" -a -f "$INITPROG"; then
1615 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1616 if test -n "$isesix"; then
1624 *) if test -f /etc/systemid; then
1626 set `echo $3 | $sed 's/\./ /g'` $4
1627 if $test -f sco_$1_$2_$3.sh; then
1629 elif $test -f sco_$1_$2.sh; then
1631 elif $test -f sco_$1.sh; then
1636 '') : Still unknown. Probably a generic Sys V.
1645 *) case "$osname" in
1646 '') : Still unknown. Probably a generic BSD.
1654 if test -f /vmunix -a -f news_os.sh; then
1655 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1656 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1659 $rm -f ../UU/kernel.what
1663 : Now look for a hint file osname_osvers, unless one has been
1664 : specified already.
1667 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1668 : Also try without trailing minor version numbers.
1669 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1670 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1671 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1672 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1675 *) case "$osvers" in
1678 *) if $test -f $file.sh ; then
1680 elif $test -f $xfile.sh ; then
1682 elif $test -f $xxfile.sh ; then
1684 elif $test -f $xxxfile.sh ; then
1686 elif $test -f $xxxxfile.sh ; then
1688 elif $test -f "${osname}.sh" ; then
1699 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1705 You may give one or more space-separated answers, or "none" if appropriate.
1706 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1709 rp="Which of these apply, if any?"
1712 for file in $tans; do
1713 if $test -f $file.sh; then
1715 $cat $file.sh >> ../UU/config.sh
1716 elif $test X$tans = X -o X$tans = Xnone ; then
1719 : Give one chance to correct a possible typo.
1720 echo "$file.sh does not exist"
1722 rp="hint to use instead?"
1724 for file in $ans; do
1725 if $test -f "$file.sh"; then
1727 $cat $file.sh >> ../UU/config.sh
1728 elif $test X$ans = X -o X$ans = Xnone ; then
1731 echo "$file.sh does not exist -- ignored."
1738 : Remember our hint file for later.
1739 if $test -f "$file.sh" ; then
1751 echo "Fetching default answers from $config_sh..." >&4
1755 cp $config_sh config.sh 2>/dev/null
1764 test "$override" && . ./optdef.sh
1765 myuname="$newmyuname"
1767 : Restore computed paths
1768 for file in $loclist $trylist; do
1769 eval $file="\$_$file"
1774 Configure uses the operating system name and version to set some defaults.
1775 The default value is probably right if the name rings a bell. Otherwise,
1776 since spelling matters for me, either accept the default or answer "none"
1783 ''|' '|none) dflt=none ;;
1784 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1787 *) dflt="$osname" ;;
1789 rp="Operating system name?"
1793 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1795 : who configured the system
1796 cf_time=`$date 2>&1`
1797 (logname > .temp) >/dev/null 2>&1
1798 $test -s .temp || (whoami > .temp) >/dev/null 2>&1
1799 $test -s .temp || echo unknown > .temp
1803 : determine where manual pages are on this system
1807 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1808 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1809 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1810 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1811 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1812 sysman=`./loc . /usr/man/man1 $syspath`
1815 if $test -d "$sysman"; then
1816 echo "System manual is in $sysman." >&4
1818 echo "Could not find manual pages in source form." >&4
1821 : see what memory models we can support
1824 $cat >pdp11.c <<'EOP'
1833 cc -o pdp11 pdp11.c >/dev/null 2>&1
1834 if ./pdp11 2>/dev/null; then
1835 dflt='unsplit split'
1837 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1840 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1845 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1848 if $test -d /lib/large || $test -d /usr/lib/large; then
1851 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1860 Some systems have different model sizes. On most systems they are called
1861 small, medium, large, and huge. On the PDP11 they are called unsplit and
1862 split. If your system doesn't support different memory models, say "none".
1863 If you wish to force everything to one memory model, say "none" here and
1864 put the appropriate flags later when it asks you for other cc and ld flags.
1865 Venix systems may wish to put "none" and let the compiler figure things out.
1866 (In the following question multiple model names should be space separated.)
1869 rp="Which memory models are supported?"
1884 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
1885 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
1892 rp="What flag indicates separate I and D space?"
1900 *large*|*small*|*medium*|*huge*)
1907 rp="What flag indicates large model?"
1917 *huge*) case "$huge" in
1921 rp="What flag indicates huge model?"
1931 *medium*) case "$medium" in
1935 rp="What flag indicates medium model?"
1942 *) medium="$large";;
1945 *small*) case "$small" in
1949 rp="What flag indicates small model?"
1960 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
1964 : make some quick guesses about what we are up against
1966 $echo $n "Hmm... $c"
1975 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1976 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
1978 echo "Looks kind of like an OSF/1 system, but we'll see..."
1980 elif test `echo abc | tr a-z A-Z` = Abc ; then
1981 xxx=`./loc addbib blurfl $pth`
1982 if $test -f $xxx; then
1983 echo "Looks kind of like a USG system with BSD features, but we'll see..."
1987 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
1988 echo "Looks kind of like an extended USG system, but we'll see..."
1990 echo "Looks kind of like a USG system, but we'll see..."
1994 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
1995 echo "Looks kind of like a BSD system, but we'll see..."
1999 echo "Looks kind of like a Version 7 system, but we'll see..."
2002 case "$eunicefix" in
2005 There is, however, a strange, musty smell in the air that reminds me of
2006 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2010 : it so happens the Eunice I know will not run shell scripts in Unix format
2014 echo "Congratulations. You aren't running Eunice."
2018 if test -f /xenix; then
2019 echo "Actually, this looks more like a XENIX system..."
2024 echo "It's not Xenix..."
2029 if test -f /venix; then
2030 echo "Actually, this looks more like a VENIX system..."
2037 echo "Nor is it Venix..."
2040 chmod +x bsd usg v7 osf1 eunice xenix venix
2041 $eunicefix bsd usg v7 osf1 eunice xenix venix
2044 : see if we need a special compiler
2052 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2053 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2066 On some systems the default C compiler will not resolve multiple global
2067 references that happen to have the same name. On some such systems the "Mcc"
2068 command may be used to force these to be resolved. On other systems a "cc -M"
2069 command is required. (Note that the -M flag on other systems indicates a
2070 memory model to use!) If you have the Gnu C compiler, you might wish to use
2074 rp="What command will force resolution on this system?"
2082 rp="Use which C compiler?"
2087 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2088 $cat >gccvers.c <<EOM
2093 printf("%s\n", __VERSION__);
2095 printf("%s\n", "1");
2101 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
2102 gccversion=`./gccvers`
2103 case "$gccversion" in
2104 '') echo "You are not using GNU cc." ;;
2105 *) echo "You are using GNU cc $gccversion." ;;
2108 echo "I can't compile the test program -- Assuming it isn't GNU cc."
2111 case "$gccversion" in
2112 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2115 : decide how portable to be
2116 case "$d_portable" in
2122 I can set things up so that your shell scripts and binaries are more portable,
2123 at what may be a noticable cost in performance. In particular, if you
2124 ask to be portable, the following happens:
2126 1) Shell scripts will rely on the PATH variable rather than using
2127 the paths derived above.
2128 2) ~username interpretations will be done at run time rather than
2132 rp="Do you expect to run these scripts and binaries on multiple machines?"
2135 y*) d_portable="$define"
2137 *) d_portable="$undef" ;;
2140 : set up shell script to do ~ expansion
2146 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2149 if $test -f /bin/csh; then
2150 /bin/csh -f -c "glob \$1"
2155 name=\`$expr x\$1 : '..\([^/]*\)'\`
2156 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2157 if $test ! -d "\$dir"; then
2159 echo "\$me: can't locate home directory for: \$name" >&2
2164 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2180 : now set up to get a file name
2181 cat <<'EOSC' >getfile
2194 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2195 fn=`echo $fn | sed 's/(.*)//'`
2201 loc_file=`expr $fn : '.*:\(.*\)'`
2202 fn=`expr $fn : '\(.*\):.*'`
2210 */*) fullpath=true;;
2219 *e*) exp_file=true;;
2222 *p*) nopath_ok=true;;
2227 *d*) type='Directory';;
2228 *l*) type='Locate';;
2233 Locate) what='File';;
2238 case "$d_portable" in
2246 while test "$type"; do
2251 true) rp="$rp (~name ok)";;
2254 if test -f UU/getfile.ok && \
2255 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2274 value=`UU/filexp $ans`
2277 if test "$ans" != "$value"; then
2278 echo "(That expands to $value on this system.)"
2292 /*) value="$ansexp" ;;
2297 echo "I shall only accept a full path name, as in /bin/ls." >&4
2298 echo "Use a ! shell escape if you wish to check pathnames." >&4
2301 echo "Please give a full path name, starting with slash." >&4
2304 echo "Note that using ~name is ok provided it expands well." >&4
2317 if test -f "$ansexp"; then
2319 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2321 echo "($value is not a plain file, but that's ok.)"
2326 if test -d "$ansexp"; then
2331 if test -d "$ansexp"; then
2332 echo "(Looking for $loc_file in directory $value.)"
2333 value="$value/$loc_file"
2334 ansexp="$ansexp/$loc_file"
2336 if test -f "$ansexp"; then
2339 case "$nopath_ok" in
2340 true) case "$value" in
2342 *) echo "Assuming $value will be in people's path."
2358 if test "$fastread" = yes; then
2363 rp="$what $value doesn't exist. Use that name anyway?"
2384 : What should the include directory be ?
2386 $echo $n "Hmm... $c"
2390 if $test -f /bin/mips && /bin/mips; then
2391 echo "Looks like a MIPS system..."
2392 $cat >usr.c <<'EOCP'
2393 #ifdef SYSTYPE_BSD43
2397 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2398 dflt='/bsd43/usr/include'
2402 mips_type='System V'
2404 $rm -f usr.c usr.out
2405 echo "and you're compiling with the $mips_type compiler and libraries."
2408 echo "Doesn't look like a MIPS system."
2419 rp='Where are the include files you want to use?'
2423 : see how we invoke the C preprocessor
2425 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2426 cat <<'EOT' >testcpp.c
2432 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2434 wrapper=`pwd`/cppstdin
2438 if $test "X$cppstdin" != "X" && \
2439 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2440 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2442 echo "You used to use $cppstdin $cppminus so we'll use that again."
2444 '') echo "But let's see if we can live without a wrapper..." ;;
2446 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2447 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2449 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2452 echo "(However, $cpprun $cpplast does not work, let's see...)"
2460 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2467 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2468 $cc -E <testcpp.c >testcpp.out 2>&1; \
2469 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2470 echo "Yup, it does."
2473 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2474 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2476 echo "Yup, it does."
2479 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2480 $cc -P <testcpp.c >testcpp.out 2>&1; \
2481 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2482 echo "Yipee, that works!"
2485 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2486 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2487 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2488 echo "At long last!"
2491 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2492 $cpp <testcpp.c >testcpp.out 2>&1; \
2493 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2497 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2498 $cpp - <testcpp.c >testcpp.out 2>&1; \
2499 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2500 echo "Hooray, it works! I was beginning to wonder."
2503 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2504 $wrapper <testcpp.c >testcpp.out 2>&1; \
2505 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2511 rp="No dice. I can't find a C preprocessor. Name one:"
2515 $x_cpp <testcpp.c >testcpp.out 2>&1
2516 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2517 echo "OK, that will do." >&4
2519 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2534 echo "Perhaps can we force $cc -E using a wrapper..."
2535 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2536 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2542 echo "Nope, we'll have to live without it..."
2557 *) $rm -f $wrapper;;
2559 $rm -f testcpp.c testcpp.out
2561 : determine optimize, if desired, or use for debug flag also
2565 *) dflt="$optimize";;
2569 Some C compilers have problems with their optimizers, by default, $package
2570 compiles with the -O flag to use the optimizer. Alternately, you might want
2571 to use the symbolic debugger, which uses the -g flag (on traditional Unix
2572 systems). Either flag can be specified here. To use neither flag, specify
2576 rp="What optimizer/debugger flag should be used?"
2580 'none') optimize=" ";;
2586 case "$gccversion" in
2587 1*) dflt='-fpcc-struct-return' ;;
2590 *-g*) dflt="$dflt -DDEBUGGING";;
2592 case "$gccversion" in
2593 2*) if test -d /etc/conf/kconfig.d &&
2594 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2603 case "$mips_type" in
2606 *) inclwanted="$inclwanted $usrinc/bsd";;
2608 for thisincl in $inclwanted; do
2609 if $test -d $thisincl; then
2610 if $test x$thisincl != x$usrinc; then
2613 *) dflt="$dflt -I$thisincl";;
2619 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2621 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2629 *) dflt="$dflt -D$2";;
2634 set signal.h __LANGUAGE_C__; eval $inctest
2636 set signal.h LANGUAGE_C; eval $inctest
2638 set signal.h NO_PROTOTYPE; eval $inctest
2639 set signal.h _NO_PROTO; eval $inctest
2646 *) dflt="$ccflags";;
2650 Your C compiler may want other flags. For this question you should include
2651 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
2652 but you should NOT include libraries or ld flags like -lwhatever. If you
2653 want $package to honor its debug switch, you should include -DDEBUGGING here.
2654 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
2655 -DHIDEMYMALLOC or -DCRIPPLED_CC.
2657 To use no flags, specify the word "none".
2663 rp="Any additional cc flags?"
2670 : the following weeds options from ccflags that are of no interest to cpp
2672 case "$gccversion" in
2673 1*) cppflags="$cppflags -D__GNUC__"
2675 case "$mips_type" in
2677 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2683 echo "Let me guess what the preprocessor flags are..." >&4
2697 *) ftry="$previous $flag";;
2699 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
2700 >cpp1.out 2>/dev/null && \
2701 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
2702 >cpp2.out 2>/dev/null && \
2703 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
2704 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
2706 cppflags="$cppflags $ftry"
2716 *-*) echo "They appear to be: $cppflags";;
2718 $rm -f cpp.c cpp?.out
2722 : flags used in final linking phase
2724 '') if ./venix; then
2730 *-posix*) dflt="$dflt -posix" ;;
2736 *) dflt="$ldflags";;
2739 rp="Any additional ld flags (NOT including libraries)?"
2745 rmlist="$rmlist pdp11"
2747 : Set private lib path
2750 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2755 '') dlist="$plibpth $glibpth";;
2756 *) dlist="$libpth";;
2759 : Now check and see which directories actually exist, avoiding duplicates
2763 if $test -d $xxx; then
2766 *) libpth="$libpth $xxx";;
2772 Some systems have incompatible or broken versions of libraries. Among
2773 the directories listed in the question below, please remove any you
2774 know not to be holding relevant libraries, and add any that are needed.
2775 Say "none" for none.
2786 rp="Directories to use for library searches?"
2793 : compute shared library extension
2796 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2806 On some systems, shared libraries may be available. Answer 'none' if
2807 you want to suppress searching of shared libraries for the remaining
2808 of this configuration.
2811 rp='What is the file extension used for shared libraries?'
2815 : Looking for optional libraries
2817 echo "Checking for optional libraries..." >&4
2822 case "$libswanted" in
2823 '') libswanted='c_s';;
2825 for thislib in $libswanted; do
2827 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2828 echo "Found -l$thislib (shared)."
2831 *) dflt="$dflt -l$thislib";;
2833 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2834 echo "Found -l$thislib (shared)."
2837 *) dflt="$dflt -l$thislib";;
2839 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
2840 echo "Found -l$thislib."
2843 *) dflt="$dflt -l$thislib";;
2845 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
2846 echo "Found -l${thislib}_s."
2849 *) dflt="$dflt -l${thislib}_s";;
2851 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
2852 echo "Found -l$thislib."
2855 *) dflt="$dflt -l$thislib";;
2858 echo "No -l$thislib."
2869 ' '|'') dflt='none';;
2874 Some versions of Unix support shared libraries, which make executables smaller
2875 but make load time slightly longer.
2877 On some systems, mostly newer Unix System V's, the shared library is included
2878 by putting the option "-lc_s" as the last thing on the cc command line when
2879 linking. Other systems use shared libraries by default. There may be other
2880 libraries needed to compile $package on your machine as well. If your system
2881 needs the "-lc_s" option, include it here. Include any other special libraries
2882 here as well. Say "none" for none.
2886 rp="Any additional libraries?"
2893 : see if nm is to be used to determine whether a symbol is defined or not
2896 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2897 if $test $dflt -gt 20; then
2912 I can use 'nm' to extract the symbols from your C libraries. This is a time
2913 consuming task which may generate huge output on the disk (up to 3 megabytes)
2914 but that should make the symbols extraction faster. The alternative is to skip
2915 the 'nm' extraction part and to compile a small test program instead to
2916 determine whether each symbol is present. If you have a fast C compiler and/or
2917 if your 'nm' output cannot be parsed, this may be the best solution.
2920 rp='Shall I use nm to extract C symbols from the libraries?'
2932 : nm options which may be necessary
2934 '') if $test -f /mach_boot; then
2936 elif $test -d /usr/ccs/lib; then
2938 elif $test -f /dgux; then
2947 : get list of predefined functions in a handy place
2952 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
2959 *) for thislib in $libs; do
2962 : Handle C library specially below.
2965 thislib=`echo $thislib | $sed -e 's/^-l//'`
2966 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
2968 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
2970 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
2972 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
2974 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
2976 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
2981 libnames="$libnames $try"
2983 *) libnames="$libnames $thislib" ;;
2991 set /usr/ccs/lib/libc.$so
2992 $test -r $1 || set /usr/lib/libc.$so
2993 $test -r $1 || set /usr/shlib/libc.$so
2994 $test -r $1 || set /usr/lib/libc.$so.[0-9]*
2995 $test -r $1 || set /lib/libc.$so
2996 $test -r $1 || set /lib/libsys_s.a
3003 if $test -r "$1"; then
3004 echo "Your (shared) C library seems to be in $1."
3006 elif $test -r /lib/libc && $test -r /lib/clib; then
3007 echo "Your C library seems to be in both /lib/clib and /lib/libc."
3009 libc='/lib/clib /lib/libc'
3010 if $test -r /lib/syslib; then
3011 echo "(Your math library is in /lib/syslib.)"
3012 libc="$libc /lib/syslib"
3014 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3015 echo "Your C library seems to be in $libc, as you said before."
3016 elif $test -r $incpath/usr/lib/libc.a; then
3017 libc=$incpath/usr/lib/libc.a;
3018 echo "Your C library seems to be in $libc. That's fine."
3019 elif $test -r /lib/libc.a; then
3021 echo "Your C library seems to be in $libc. You're normal."
3023 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
3025 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3026 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3027 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3029 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3031 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3034 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
3036 if $test -r "$tans"; then
3037 echo "Your C library seems to be in $tans, of all places."
3043 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3047 If the guess above is wrong (which it might be if you're using a strange
3048 compiler, or your machine supports multiple models), you can override it here.
3053 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3055 I can't seem to find your C library. I've looked in the following places:
3058 $sed 's/^/ /' libpath
3061 None of these seems to contain your C library. I need to get its name...
3066 rp='Where is your C library?'
3071 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3072 set X `cat libnames`
3075 case $# in 1) xxx=file; esac
3076 echo "Extracting names from the following $xxx for later perusal:" >&4
3078 $sed 's/^/ /' libnames >&4
3080 $echo $n "This may take a while...$c" >&4
3082 nm $nm_opt $* 2>/dev/null >libc.tmp
3084 $grep fprintf libc.tmp > libc.ptf
3085 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3086 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3087 if com="$sed -n -e 's/__IO//' -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
3089 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3091 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3093 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3095 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3097 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3099 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3101 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3103 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3105 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3107 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3109 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3111 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3112 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3114 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3116 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3118 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3120 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3122 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3124 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3126 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3129 nm -p $* 2>/dev/null >libc.tmp
3130 com="$sed -n -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
3131 eval "<libc.tmp $com >libc.list"
3132 if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3137 echo "nm didn't seem to work right. Trying ar instead..." >&4
3139 if ar t $libc > libc.tmp; then
3140 for thisname in $libnames; do
3141 ar t $thisname >>libc.tmp
3143 $sed -e 's/\.o$//' < libc.tmp > libc.list
3146 echo "ar didn't seem to work right." >&4
3147 echo "Maybe this is a Cray...trying bld instead..." >&4
3148 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
3149 for thisname in $libnames; do
3151 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
3152 ar t $thisname >>libc.tmp
3156 echo "That didn't work either. Giving up." >&4
3163 if $test -f /lib/syscalls.exp; then
3165 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3166 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3170 $rm -f libnames libpath
3172 : is a C symbol defined?
3175 -v) tf=libc.tmp; tc=""; tdc="";;
3176 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
3177 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3180 case "$reuseval-$4" in
3182 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3188 if $contains $tlook $tf >/dev/null 2>&1;
3193 echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
3194 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
3202 $define) tval=true;;
3208 : set up the script used to warn in case of inconsistency
3212 echo "*** WHOA THERE!!! ***" >&4
3213 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3214 rp=" Keep the $hint value?"
3217 y) td=$was; tu=$was;;
3221 : define an is-in-libc? function
3222 inlibc='echo " "; td=$define; tu=$undef;
3223 sym=$1; var=$2; eval "was=\$$2";
3225 case "$reuseval$was" in
3235 echo "$sym() found." >&4;
3236 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3238 echo "$sym() NOT found." >&4;
3239 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3243 $define) echo "$sym() found." >&4;;
3244 *) echo "$sym() NOT found." >&4;;
3248 : see if gconvert exists
3249 set gconvert d_gconvert
3252 case "$d_gconvert" in
3254 echo "We'll use it to convert floats into a string then." >&4
3255 d_Gconvert="gconvert((x),(n),(t),(b))"
3258 : Maybe we can emulate it with gcvt.
3264 : Test whether gcvt drops a trailing decimal point
3269 if (buf[0] != '1' || buf[1] != '\0')
3272 if (buf[0] != '0' || buf[1] != '\0')
3275 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
3280 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
3282 echo "Good, your gcvt() drops a trailing decimal point."
3283 echo "We'll use it to convert floats into a string." >&4
3284 d_Gconvert="gcvt((x),(n),(b))"
3286 echo "But your gcvt() keeps a trailing decimal point".
3290 echo "Hmm. I can't compile the gcvt test program."
3296 case "$d_Gconvert" in
3298 echo "I'll use sprintf instead to convert floats into a string." >&4
3299 d_Gconvert='sprintf((b),"%.*g",(n),(x))'
3304 : Initialize h_fcntl
3307 : Initialize h_sysfile
3310 : determine filename position in cpp output
3312 echo "Computing filename position in cpp output for #include directives..." >&4
3313 echo '#include <stdio.h>' > foo.c
3316 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3317 $grep '^[ ]*#.*stdio\.h' | \
3318 while read cline; do
3321 while $test \$# -gt 0; do
3322 if $test -r \`echo \$1 | $tr -d '"'\`; then
3327 pos=\`expr \$pos + 1\`
3339 *) pos="${fieldn}th";;
3341 echo "Your cpp writes the filename in the $pos field of the line."
3343 : locate header file
3348 if test -f $usrinc/\$wanted; then
3349 echo "$usrinc/\$wanted"
3352 awkprg='{ print \$$fieldn }'
3353 echo "#include <\$wanted>" > foo\$\$.c
3354 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3355 $grep "^[ ]*#.*\$wanted" | \
3356 while read cline; do
3357 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3359 */\$wanted) echo "\$name"; exit 0;;
3370 : access call always available on UNIX
3374 : locate the flags for 'access()'
3378 $cat >access.c <<'EOCP'
3379 #include <sys/types.h>
3384 #include <sys/file.h>
3393 : check sys/file.h first, no particular reason here
3394 if $test `./findhdr sys/file.h` && \
3395 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
3397 echo "<sys/file.h> defines the *_OK access constants." >&4
3398 elif $test `./findhdr fcntl.h` && \
3399 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
3401 echo "<fcntl.h> defines the *_OK access constants." >&4
3402 elif $test `./findhdr unistd.h` && \
3403 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
3404 echo "<unistd.h> defines the *_OK access constants." >&4
3406 echo "I can't find the four *_OK access constants--I'll use mine." >&4
3412 : see if alarm exists
3416 : determine the architecture name
3418 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3419 tarch=`arch`"-$osname"
3420 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3421 if uname -m > tmparch 2>&1 ; then
3422 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
3430 case "$myarchname" in
3433 echo "(Your architecture name used to be $myarchname.)"
3439 *) dflt="$archname";;
3441 rp='What is your architecture name'
3448 if test -d /afs; then
3449 echo "AFS may be running... I'll be extra cautious then..." >&4
3452 echo "AFS does not seem to be running..." >&4
3456 : determine root of directory hierarchy where package will be installed.
3459 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3467 By default, $package will be installed in $dflt/bin, manual
3468 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3469 all installation directories. Typically set to /usr/local, but you
3470 may choose /usr if you wish to install $package among your system
3471 binaries. If you wish to have binaries under /bin but manual pages
3472 under /usr/local/man, that's ok: you will be prompted separately
3473 for each of the installation directories, the prefix being only used
3474 to set the defaults.
3478 rp='Installation prefix to use?'
3486 *) oldprefix="$prefix";;
3493 : set the prefixit variable, to compute a suitable default value
3494 prefixit='case "$3" in
3496 case "$oldprefix" in
3497 "") eval "$1=\"\$$2\"";;
3504 ""|" ") eval "$1=\"\$$2\"";;
3510 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3512 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3513 /*-$oldprefix/*|\~*-$oldprefix/*)
3514 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3515 *) eval "$1=\"\$$2\"";;
3519 : determine where private executables go
3520 set dflt privlib lib/$package
3524 There are some auxiliary files for $package that need to be put into a
3525 private library directory that is accessible by everyone.
3529 rp='Pathname where the private library files will reside?'
3531 if $test "X$privlibexp" != "X$ansexp"; then
3535 privlibexp="$ansexp"
3539 Since you are running AFS, I need to distinguish the directory in which
3540 private files reside from the directory in which they are installed (and from
3541 which they are presumably copied to the former directory by occult means).
3544 case "$installprivlib" in
3545 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3546 *) dflt="$installprivlib";;
3549 rp='Where will private files be installed?'
3551 installprivlib="$ans"
3553 installprivlib="$privlibexp"
3556 : set the prefixup variable, to restore leading tilda escape
3557 prefixup='case "$prefixexp" in
3559 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3562 : determine where public architecture dependent libraries go
3569 dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
3573 *) dflt="$privlib/$archname";;
3576 *) dflt="$archlib";;
3580 $spackage contains architecture-dependent library files. If you are
3581 sharing libraries in a heterogeneous environment, you might store
3582 these files in a separate location. Otherwise, you can just include
3583 them with the rest of the public library files.
3587 rp='Where do you want to put the public architecture-dependent libraries?'
3590 archlibexp="$ansexp"
3595 Since you are running AFS, I need to distinguish the directory in which
3596 private files reside from the directory in which they are installed (and from
3597 which they are presumably copied to the former directory by occult means).
3600 case "$installarchlib" in
3601 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3602 *) dflt="$installarchlib";;
3605 rp='Where will architecture-dependent library files be installed?'
3607 installarchlib="$ans"
3609 installarchlib="$archlibexp"
3611 if $test X"$archlib" = X"$privlib"; then
3617 : function used to set $1 to $val
3618 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3620 $define$undef) . ./whoa; eval "$var=\$td";;
3621 $undef$define) . ./whoa; eval "$var=\$tu";;
3622 *) eval "$var=$val";;
3625 : Look for GNU-cc style attribute checking
3627 echo "Checking whether your compiler can handle __attribute__ ..." >&4
3628 $cat >attrib.c <<'EOCP'
3630 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
3632 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
3633 if $contains 'warning' attrib.out >/dev/null 2>&1; then
3634 echo "Your C compiler doesn't fully support __attribute__."
3637 echo "Your C compiler supports __attribute__."
3641 echo "Your C compiler doesn't seem to understand __attribute__ at all."
3648 : see if bcmp exists
3652 : see if bcopy exists
3656 : see if setpgrp exists
3657 set setpgrp d_setpgrp
3660 : see which flavor of setpgrp is in use
3661 case "$d_setpgrp" in
3667 if (getuid() == 0) {
3668 printf("(I see you are running Configure as super-user...)\n");
3671 if (-1 == setpgrp(1, 1))
3676 if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
3679 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
3681 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
3686 xxx="USG one, i.e. you use setpgrp()."
3689 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
3692 echo "Assuming your setpgrp is a $xxx" >&4
3701 : Check if we really have byacc
3703 ''|'byacc') val="$undef" ;;
3709 : see if bzero exists
3713 : check for length of integer
3717 echo "Checking to see how big your integers are..." >&4
3718 $cat >try.c <<'EOCP'
3722 printf("%d\n", sizeof(int));
3725 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
3729 echo "(I can't seem to compile the test program. Guessing...)"
3736 rp="What is the size of an integer (in bytes)?"
3741 : see if signal is declared as pointer to function returning int or void
3743 xxx=`./findhdr signal.h`
3744 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
3745 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3746 echo "You have int (*signal())() instead of void." >&4
3748 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3749 echo "You have void (*signal())() instead of int." >&4
3751 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3752 echo "You have int (*signal())() instead of void." >&4
3755 case "$d_voidsig" in
3757 echo "I can't determine whether signal handler returns void or int..." >&4
3759 rp="What type does your signal handler return?"
3766 echo "As you already told me, signal handler returns void." >&4;;
3768 echo "As you already told me, signal handler returns int." >&4;;
3773 case "$d_voidsig" in
3774 "$define") signal_t="void";;
3779 : check for ability to cast large floats to 32-bit ints.
3781 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
3782 if $test "$intsize" -eq 4; then
3788 #include <sys/types.h>
3790 $signal_t blech() { exit(3); }
3796 signal(SIGFPE, blech);
3798 f = (double) 0x7fffffff;
3802 if (i32 != ($xxx) f)
3807 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3811 echo "(I can't seem to compile the test program--assuming it can't)"
3819 echo "Nope, it can't."
3826 : check for ability to cast negative floats to unsigned
3828 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
3830 #include <sys/types.h>
3832 $signal_t blech() { exit(3); }
3836 unsigned long along;
3838 unsigned short ashort;
3841 signal(SIGFPE, blech);
3842 along = (unsigned long)f;
3843 aint = (unsigned int)f;
3844 ashort = (unsigned short)f;
3845 if (along != (unsigned long)-123)
3847 if (aint != (unsigned int)-123)
3849 if (ashort != (unsigned short)-123)
3851 f = (double)0x40000000;
3854 along = (unsigned long)f;
3855 if (along != 0x80000000)
3859 along = (unsigned long)f;
3860 if (along != 0x7fffffff)
3864 along = (unsigned long)f;
3865 if (along != 0x80000001)
3871 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3875 echo "(I can't seem to compile the test program--assuming it can't)"
3878 case "$castflags" in
3883 echo "Nope, it can't."
3890 : see if vprintf exists
3892 if set vprintf val -f d_vprintf; eval $csym; $val; then
3893 echo 'vprintf() found.' >&4
3895 $cat >vprintf.c <<'EOF'
3896 #include <varargs.h>
3898 main() { xxx("foo"); }
3907 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
3910 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
3911 echo "Your vsprintf() returns (int)." >&4
3914 echo "Your vsprintf() returns (char*)." >&4
3918 echo 'vprintf() NOT found.' >&4
3928 : see if chown exists
3932 : see if chroot exists
3936 : see if chsize exists
3940 : check for const keyword
3942 echo 'Checking to see if your C compiler knows about "const"...' >&4
3943 $cat >const.c <<'EOCP'
3944 typedef struct spug { int drokk; } spug;
3951 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
3953 echo "Yup, it does."
3956 echo "Nope, it doesn't."
3961 : see if crypt exists
3963 if set crypt val -f d_crypt; eval $csym; $val; then
3964 echo 'crypt() found.' >&4
3968 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
3969 if $test -z "$cryptlib"; then
3970 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
3974 if $test -z "$cryptlib"; then
3975 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
3979 if $test -z "$cryptlib"; then
3980 cryptlib=`./loc libcrypt.a "" $libpth`
3984 if $test -z "$cryptlib"; then
3985 echo 'crypt() NOT found.' >&4
3994 : get csh whereabouts
3996 'csh') val="$undef" ;;
4003 : see if cuserid exists
4004 set cuserid d_cuserid
4007 : define an alternate in-header-list? function
4008 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4009 cont=true; xxf="echo \"<\$1> found.\" >&4";
4010 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4011 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4013 case $# in 4) instead=instead;; *) instead="at last";; esac;
4014 while $test "$cont"; do
4016 var=$2; eval "was=\$$2";
4017 if $test "$xxx" && $test -r "$xxx";
4019 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4022 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4023 set $yyy; shift; shift; yyy=$@;
4024 case $# in 0) cont="";;
4025 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4026 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4027 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4028 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4032 do set $yyy; var=$2; eval "was=\$$2";
4033 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4034 set $yyy; shift; shift; yyy=$@;
4037 : see if this is a limits.h system
4038 set limits.h i_limits
4041 : see if this is a float.h system
4045 : See if number of significant digits in a double precision number is known
4047 $cat >dbl_dig.c <<EOM
4057 printf("Contains DBL_DIG");
4060 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
4061 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
4062 echo "DBL_DIG found." >&4
4065 echo "DBL_DIG NOT found." >&4
4072 : see if difftime exists
4073 set difftime d_difftime
4076 : see if this is a dirent system
4078 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
4080 echo "<dirent.h> found." >&4
4083 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
4084 echo "<sys/dir.h> found." >&4
4087 xinc=`./findhdr sys/ndir.h`
4089 echo "<dirent.h> NOT found." >&4
4094 : Look for type of directory structure.
4096 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4098 case "$direntrytype" in
4101 $define) guess1='struct dirent' ;;
4102 *) guess1='struct direct' ;;
4105 *) guess1="$direntrytype"
4110 'struct dirent') guess2='struct direct' ;;
4111 *) guess2='struct dirent' ;;
4114 if $contains "$guess1" try.c >/dev/null 2>&1; then
4115 direntrytype="$guess1"
4116 echo "Your directory entries are $direntrytype." >&4
4117 elif $contains "$guess2" try.c >/dev/null 2>&1; then
4118 direntrytype="$guess2"
4119 echo "Your directory entries seem to be $direntrytype." >&4
4121 echo "I don't recognize your system's directory entries." >&4
4122 rp="What type is used for directory entries on this system?"
4130 : see if the directory entry stores field length
4132 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4133 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
4134 echo "Good, your directory entry keeps length information in d_namlen." >&4
4137 echo "Your directory entry does not know about the d_namlen field." >&4
4144 : see if dlerror exists
4145 set dlerror d_dlerror
4148 : see if dld is available
4152 : see if dlopen exists
4156 : determine which dynamic loading, if any, to compile in
4158 dldir="ext/DynaLoader"
4171 $define) dflt='y' ;;
4174 $define) dflt='y' ;;
4176 : Does a dl_xxx.xs file exist for this operating system
4177 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4180 rp="Do you wish to use dynamic loading?"
4187 if $test -f ../$dldir/dl_${osname}.xs ; then
4188 dflt="$dldir/dl_${osname}.xs"
4189 elif $test "$d_dlopen" = "$define" ; then
4190 dflt="$dldir/dl_dlopen.xs"
4191 elif $test "$i_dld" = "$define" ; then
4192 dflt="$dldir/dl_dld.xs"
4197 *) dflt="$dldir/$dlsrc"
4200 echo "The following dynamic loading files are available:"
4201 : Can not go over to $dldir because getfile has path hard-coded in.
4202 cd ..; ls -C $dldir/dl*.xs; cd UU
4203 rp="Source file to use for dynamic loading"
4208 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4211 Some systems may require passing special flags to $cc -c to
4212 compile modules that will be used to create a shared library.
4213 To use no flags, say "none".
4216 case "$cccdlflags" in
4217 ''|' ') case "$cc" in
4218 *gcc*) dflt='-fpic' ;;
4219 *) case "$osname" in
4221 next) dflt='none' ;;
4222 solaris) dflt='-K pic' ;;
4223 sunos) dflt='-pic' ;;
4224 svr4*|esix*) dflt='-Kpic' ;;
4228 *) dflt="$cccdlflags" ;;
4230 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4233 none) cccdlflags='' ;;
4234 *) cccdlflags="$ans" ;;
4239 Some systems may require passing special flags to ld to create a
4240 library that can be dynamically loaded. If your ld flags include
4241 -L/other/path options to locate libraries outside your loader's normal
4242 search path, you may need to specify those -L options here as well. To
4243 use no flags, say "none".
4246 case "$lddlflags" in
4247 ''|' ') case "$osname" in
4249 next) dflt='none' ;;
4250 solaris) dflt='-G' ;;
4251 sunos) dflt='-assert nodefinitions' ;;
4252 svr4*|esix*) dflt="-G $ldflags" ;;
4256 *) dflt="$lddlflags" ;;
4258 rp="Any special flags to pass to ld to create a dynamically loaded library?"
4261 none) lddlflags='' ;;
4262 *) lddlflags="$ans" ;;
4267 Some systems may require passing special flags to $cc to indicate that
4268 the resulting executable will use dynamic linking. To use no flags,
4272 case "$ccdlflags" in
4273 ''|' ') case "$osname" in
4274 hpux) dflt='none' ;;
4275 next) dflt='none' ;;
4276 sunos) dflt='none' ;;
4279 *) dflt="$ccdlflags" ;;
4281 rp="Any special flags to pass to $cc to use dynamic loading?"
4284 none) ccdlflags='' ;;
4285 *) ccdlflags="$ans" ;;
4302 System V Release 4 systems can support dynamic loading
4303 only if libperl is created as a shared library.
4310 set d_shrplib; eval $setvar
4311 case "$d_shrplib" in
4315 Be sure to add the perl source directory to the LD_LIBRARY_PATH
4316 environment variable before running make:
4317 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
4319 setenv LD_LIBRARY_PATH `cd ..;pwd`
4324 case "$d_shrplib" in
4327 "") dflt="$archlib/CORE";;
4328 *) dflt="$shrpdir";;
4330 rp="What directory should we install the shared libperl into?"
4339 : see if dlfcn is available
4347 On a few systems, the dynamically loaded modules that perl generates and uses
4348 will need a different extension then shared libs. The default will probably
4356 rp='What is the extension of dynamically loaded modules'
4365 : Check if dlsym need a leading underscore
4371 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
4372 $cat >dyna.c <<'EOM'
4381 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
4383 #include <sys/types.h>
4397 int mode = RTLD_LAZY ;
4399 handle = dlopen("./dyna.$dlext", mode) ;
4400 if (handle == NULL) {
4404 symbol = dlsym(handle, "fred") ;
4405 if (symbol == NULL) {
4406 /* try putting a leading underscore */
4407 symbol = dlsym(handle, "_fred") ;
4408 if (symbol == NULL) {
4419 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
4420 ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
4421 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
4424 1) echo "Test program failed using dlopen." >&4
4425 echo "Perhaps you should not use dynamic loading." >&4;;
4426 2) echo "Test program failed using dlsym." >&4
4427 echo "Perhaps you should not use dynamic loading." >&4;;
4428 3) echo "dlsym needs a leading underscore" >&4
4430 4) echo "dlsym doesn't need a leading underscore." >&4;;
4433 echo "I can't compile and run the test program." >&4
4438 $rm -f fred fred.? dyna.$dlext dyna.?
4443 : see if setuid scripts can be secure
4446 Some kernels have a bug that prevents setuid #! scripts from being
4447 secure. Some sites have disabled setuid #! scripts because of this.
4449 First let's decide if your kernel supports secure setuid #! scripts.
4450 (If setuid #! scripts would be secure but have been disabled anyway,
4451 don't say that they are secure if asked.)
4456 if $test -d /dev/fd; then
4457 echo "#!$ls" >reflect
4458 chmod +x,u+s reflect
4459 ./reflect >flect 2>&1
4460 if $contains "/dev/fd" flect >/dev/null; then
4461 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4465 If you are not sure if they are secure, I can check but I'll need a
4466 username and password different from the one you are using right now.
4467 If you don't have such a username or don't want me to test, simply
4471 rp='Other username to test security of setuid scripts with?'
4476 case "$d_suidsafe" in
4477 '') echo "I'll assume setuid scripts are *not* secure." >&4
4480 echo "Well, the $hint value is *not* secure." >&4
4482 *) echo "Well, the $hint value *is* secure." >&4
4487 $rm -f reflect flect
4488 echo "#!$ls" >reflect
4489 chmod +x,u+s reflect
4492 echo '"su" will (probably) prompt you for '"$ans's password."
4493 su $ans -c './reflect >flect'
4494 if $contains "/dev/fd" flect >/dev/null; then
4495 echo "Okay, it looks like setuid scripts are secure." >&4
4498 echo "I don't think setuid scripts are secure." >&4
4503 rp='Does your kernel have *secure* setuid scripts?'
4506 [yY]*) val="$define";;
4511 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4517 $rm -f reflect flect
4519 : now see if they want to do setuid emulation
4522 case "$d_suidsafe" in
4525 echo "No need to emulate SUID scripts since they are secure here." >& 4
4529 Some systems have disabled setuid scripts, especially systems where
4530 setuid scripts cannot be secure. On systems where setuid scripts have
4531 been disabled, the setuid/setgid bits on scripts are currently
4532 useless. It is possible for $package to detect those bits and emulate
4533 setuid/setgid in a secure fashion. This emulation will only work if
4534 setuid scripts have been disabled in your kernel.
4538 "$define") dflt=y ;;
4541 rp="Do you want to do setuid/setgid emulation?"
4544 [yY]*) val="$define";;
4552 : see if drem exists
4556 : see if dup2 exists
4560 : see if fchmod exists
4564 : see if fchown exists
4568 : see if this is an fcntl system
4572 : see if fgetpos exists
4573 set fgetpos d_fgetpos
4576 : see if we can have long filenames
4578 rmlist="$rmlist /tmp/cf$$"
4579 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
4580 first=123456789abcdef
4581 second=/tmp/cf$$/$first
4582 $rm -f $first $second
4583 if (echo hi >$first) 2>/dev/null; then
4584 if $test -f 123456789abcde; then
4585 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
4588 if (echo hi >$second) 2>/dev/null; then
4589 if $test -f /tmp/cf$$/123456789abcde; then
4591 That's peculiar... You can have filenames longer than 14 characters, but only
4592 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
4593 I shall consider your system cannot support long filenames at all.
4597 echo 'You can have filenames longer than 14 characters.' >&4
4602 How confusing! Some of your filesystems are sane enough to allow filenames
4603 longer than 14 characters but some others like /tmp can't even think about them.
4604 So, for now on, I shall assume your kernel does not allow them at all.
4611 You can't have filenames longer than 14 chars. You can't even think about them!
4617 $rm -rf /tmp/cf$$ 123456789abcde*
4619 : see if flock exists
4623 : see if fmod exists
4627 : see if fork exists
4631 : see if pathconf exists
4632 set pathconf d_pathconf
4635 : see if fpathconf exists
4636 set fpathconf d_fpathconf
4639 : see if fsetpos exists
4640 set fsetpos d_fsetpos
4643 : see if gethostent exists
4644 set gethostent d_gethent
4647 : see if getlogin exists
4648 set getlogin d_getlogin
4651 : see if getpgrp exists
4652 set getpgrp d_getpgrp
4655 : see if getpgrp2 exists
4656 set getpgrp2 d_getpgrp2
4659 : see if getppid exists
4660 set getppid d_getppid
4663 : see if getpriority exists
4664 set getpriority d_getprior
4667 : see if this is a netinet/in.h or sys/in.h system
4668 set netinet/in.h i_niin sys/in.h i_sysin
4671 : see if htonl --and friends-- exists
4676 : Maybe they are macros.
4681 #include <sys/types.h>
4682 #$i_niin I_NETINET_IN
4685 #include <netinet/in.h>
4691 printf("Defined as a macro.");
4694 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
4695 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
4697 echo "But it seems to be defined as a macro." >&4
4705 : see which of string.h or strings.h is needed
4707 strings=`./findhdr string.h`
4708 if $test "$strings" && $test -r "$strings"; then
4709 echo "Using <string.h> instead of <strings.h>." >&4
4713 strings=`./findhdr strings.h`
4714 if $test "$strings" && $test -r "$strings"; then
4715 echo "Using <strings.h> instead of <string.h>." >&4
4717 echo "No string header found -- You'll surely have problems." >&4
4723 "$undef") strings=`./findhdr strings.h`;;
4724 *) strings=`./findhdr string.h`;;
4729 if set index val -f; eval $csym; $val; then
4730 if set strchr val -f d_strchr; eval $csym; $val; then
4731 if $contains strchr "$strings" >/dev/null 2>&1 ; then
4734 echo "strchr() found." >&4
4738 echo "index() found." >&4
4743 echo "index() found." >&4
4746 if set strchr val -f d_strchr; eval $csym; $val; then
4749 echo "strchr() found." >&4
4751 echo "No index() or strchr() found!" >&4
4756 set d_strchr; eval $setvar
4758 set d_index; eval $setvar
4762 $cat >isascii.c <<'EOCP'
4773 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
4774 echo "isascii() found." >&4
4777 echo "isascii() NOT found." >&4
4784 : see if killpg exists
4788 : see if link exists
4792 : see if stdio is really std
4794 xxx=`./findhdr stdio.h`
4795 if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
4796 if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
4797 echo "Your stdio is pretty std." >&4
4800 echo "Your stdio isn't very std." >&4
4804 echo "Your stdio isn't very std." >&4
4810 : see if stdio is like that in linux
4811 case "$d_stdstdio" in
4814 xxx=`./findhdr stdio.h`
4815 $cppstdin $cppflags $cppminus < "$xxx" > stdio.E
4816 if $contains 'char.*_IO_read_base' stdio.E >/dev/null 2>&1 && \
4817 $contains '_IO_read_ptr' stdio.E >/dev/null 2>&1 && \
4818 $contains '_IO_read_end' stdio.E >/dev/null 2>&1 ; then
4819 echo "Your stdio looks like linux." >&4
4822 echo "You don't have linux stdio, either." >&4
4833 : see if localeconv exists
4834 set localeconv d_locconv
4837 : see if lockf exists
4841 : see if lstat exists
4845 : see if mblen exists
4849 : see if mbstowcs exists
4850 set mbstowcs d_mbstowcs
4853 : see if mbtowc exists
4857 : see if memcmp exists
4861 : see if memcpy exists
4865 : see if memmove exists
4866 set memmove d_memmove
4869 : see if memset exists
4873 : see if mkdir exists
4877 : see if mkfifo exists
4881 : see if mktime exists
4885 : see if msgctl exists
4889 : see if msgget exists
4893 : see if msgsnd exists
4897 : see if msgrcv exists
4901 : see how much of the 'msg*(2)' library is present.
4904 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
4905 *"$undef"*) h_msg=false;;
4907 : we could also check for sys/ipc.h ...
4908 if $h_msg && $test `./findhdr sys/msg.h`; then
4909 echo "You have the full msg*(2) library." >&4
4912 echo "You don't have the full msg*(2) library." >&4
4918 : see if this is a malloc.h system
4919 set malloc.h i_malloc
4922 : see if stdlib is available
4923 set stdlib.h i_stdlib
4926 : determine which malloc to compile in
4928 case "$usemymalloc" in
4929 ''|y*|true) dflt='y' ;;
4930 n*|false) dflt='n' ;;
4931 *) dflt="$usemymalloc" ;;
4933 rp="Do you wish to attempt to use the malloc that comes with $package?"
4939 mallocsrc='malloc.c'
4940 mallocobj='malloc.o'
4941 d_mymalloc="$define"
4944 : Remove malloc from list of libraries to use
4945 echo "Removing unneeded -lmalloc from library list" >&4
4946 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4949 echo "libs = $libs" >&4
4961 : compute the return types of malloc and free
4963 $cat >malloc.c <<END
4967 #include <sys/types.h>
4981 case "$malloctype" in
4983 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4990 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4994 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5001 echo "Your system uses $freetype free(), it would seem." >&4
5003 : see if nice exists
5007 : Locate the flags for 'open()'
5009 $cat >open3.c <<'EOCP'
5010 #include <sys/types.h>
5015 #include <sys/file.h>
5026 : check sys/file.h first to get FREAD on Sun
5027 if $test `./findhdr sys/file.h` && \
5028 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
5030 echo "<sys/file.h> defines the O_* constants..." >&4
5032 echo "and you have the 3 argument form of open()." >&4
5035 echo "but not the 3 argument form of open(). Oh, well." >&4
5038 elif $test `./findhdr fcntl.h` && \
5039 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5041 echo "<fcntl.h> defines the O_* constants..." >&4
5043 echo "and you have the 3 argument form of open()." >&4
5046 echo "but not the 3 argument form of open(). Oh, well." >&4
5051 echo "I can't find the O_* constant definitions! You got problems." >&4
5057 : see if pause exists
5061 : see if pipe exists
5065 : see if this is a pwd system
5067 xxx=`./findhdr pwd.h`
5068 if $test "$xxx"; then
5070 echo "<pwd.h> found." >&4
5071 $cppstdin $cppflags $cppminus < $xxx >$$.h
5072 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
5077 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
5082 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
5083 d_pwchange="$define"
5087 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
5092 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
5093 d_pwexpire="$define"
5097 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
5098 d_pwcomment="$define"
5100 d_pwcomment="$undef"
5110 d_pwcomment="$undef"
5111 echo "<pwd.h> NOT found." >&4
5114 : see if readdir and friends exist
5115 set readdir d_readdir
5117 set seekdir d_seekdir
5119 set telldir d_telldir
5121 set rewinddir d_rewinddir
5124 : see if readlink exists
5125 set readlink d_readlink
5128 : see if rename exists
5132 : see if rmdir exists
5136 : can bcopy handle overlapping blocks?
5141 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
5142 $cat >foo.c <<'EOCP'
5145 char buf[128], abc[128];
5151 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
5153 for (align = 7; align >= 0; align--) {
5154 for (len = 36; len; len--) {
5157 for (off = 1; off <= len; off++) {
5158 bcopy(b, b+off, len);
5159 bcopy(b+off, b, len);
5160 if (bcmp(b, abc, len))
5168 if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5169 if ./safebcpy 2>/dev/null; then
5173 echo "It can't, sorry."
5176 echo "(I can't compile the test program, so we'll assume not...)"
5180 $rm -f foo.* safebcpy core
5184 : can memcpy handle overlapping blocks?
5189 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
5190 $cat >foo.c <<'EOCP'
5193 char buf[128], abc[128];
5199 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
5201 for (align = 7; align >= 0; align--) {
5202 for (len = 36; len; len--) {
5204 memcpy(abc, b, len);
5205 for (off = 1; off <= len; off++) {
5206 memcpy(b, b+off, len);
5207 memcpy(b+off, b, len);
5208 if (memcmp(b, abc, len))
5216 if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5217 if ./safemcpy 2>/dev/null; then
5221 echo "It can't, sorry."
5224 echo "(I can't compile the test program, so we'll assume not...)"
5228 $rm -f foo.* safemcpy core
5232 : see if select exists
5236 : see if semctl exists
5240 : see if semget exists
5244 : see if semop exists
5248 : see how much of the 'sem*(2)' library is present.
5251 case "$d_semctl$d_semget$d_semop" in
5252 *"$undef"*) h_sem=false;;
5254 : we could also check for sys/ipc.h ...
5255 if $h_sem && $test `./findhdr sys/sem.h`; then
5256 echo "You have the full sem*(2) library." >&4
5259 echo "You don't have the full sem*(2) library." >&4
5265 : see if setegid exists
5266 set setegid d_setegid
5269 : see if seteuid exists
5270 set seteuid d_seteuid
5273 : see if setlinebuf exists
5274 set setlinebuf d_setlinebuf
5277 : see if setlocale exists
5278 set setlocale d_setlocale
5281 : see if setpgid exists
5282 set setpgid d_setpgid
5285 : see if setpgrp2 exists
5286 set setpgrp2 d_setpgrp2
5289 : see if setpriority exists
5290 set setpriority d_setprior
5293 : see if setregid exists
5294 set setregid d_setregid
5296 set setresgid d_setresgid
5299 : see if setreuid exists
5300 set setreuid d_setreuid
5302 set setresuid d_setresuid
5305 : see if setrgid exists
5306 set setrgid d_setrgid
5309 : see if setruid exists
5310 set setruid d_setruid
5313 : see if setsid exists
5317 : see if shmctl exists
5321 : see if shmget exists
5325 : see if shmat exists
5328 : see what shmat returns
5331 $cat >shmat.c <<'END'
5332 #include <sys/shm.h>
5335 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
5340 echo "and it returns ($shmattype)." >&4
5341 : see if a prototype for shmat is available
5342 $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h > shmat.c 2>/dev/null
5343 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
5354 set d_shmatprototype
5357 : see if shmdt exists
5361 : see how much of the 'shm*(2)' library is present.
5364 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
5365 *"$undef"*) h_shm=false;;
5367 : we could also check for sys/ipc.h ...
5368 if $h_shm && $test `./findhdr sys/shm.h`; then
5369 echo "You have the full shm*(2) library." >&4
5372 echo "You don't have the full shm*(2) library." >&4
5380 : see whether socket exists
5382 $echo $n "Hmm... $c" >&4
5383 if set socket val -f d_socket; eval $csym; $val; then
5384 echo "Looks like you have Berkeley networking support." >&4
5386 if set setsockopt val -f; eval $csym; $val; then
5389 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
5393 if $contains socklib libc.list >/dev/null 2>&1; then
5394 echo "Looks like you have Berkeley networking support." >&4
5396 : we will have to assume that it supports the 4.2 BSD interface
5399 echo "You don't have Berkeley networking in libc.a..." >&4
5400 if test -f /usr/lib/libnet.a; then
5401 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
5402 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
5403 if $contains socket libc.list >/dev/null 2>&1; then
5404 echo "...but the Wollongong group seems to have hacked it in." >&4
5406 sockethdr="-I/usr/netinclude"
5408 if $contains setsockopt libc.list >/dev/null 2>&1; then
5411 echo "...using the old 4.1c interface, rather than 4.2" >&4
5415 echo "or even in libnet.a, which is peculiar." >&4
5420 echo "or anywhere else I see." >&4
5427 : see if socketpair exists
5428 set socketpair d_sockpair
5431 : see if stat knows about block sizes
5433 xxx=`./findhdr sys/stat.h`
5434 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
5435 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
5436 echo "Your stat() knows about block sizes." >&4
5439 echo "Your stat() doesn't know about block sizes." >&4
5443 echo "Your stat() doesn't know about block sizes." >&4
5449 : see if strcoll exists
5450 set strcoll d_strcoll
5453 : check for structure copying
5455 echo "Checking to see if your C compiler can copy structs..." >&4
5456 $cat >try.c <<'EOCP'
5466 if $cc -c try.c >/dev/null 2>&1 ; then
5471 echo "Nope, it can't."
5477 : see if strerror and/or sys_errlist[] exist
5479 if set strerror val -f d_strerror; eval $csym; $val; then
5480 echo 'strerror() found.' >&4
5481 d_strerror="$define"
5482 d_strerrm='strerror(e)'
5483 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5484 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
5485 d_syserrlst="$define"
5487 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
5488 d_syserrlst="$undef"
5490 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
5491 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
5492 echo 'strerror() found in string header.' >&4
5493 d_strerror="$define"
5494 d_strerrm='strerror(e)'
5495 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5496 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
5497 d_syserrlst="$define"
5499 echo "(You don't appear to have any sys_errlist[], how can this be?)"
5500 d_syserrlst="$undef"
5502 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5503 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
5505 d_syserrlst="$define"
5506 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
5508 echo 'strerror() and sys_errlist[] NOT found.' >&4
5510 d_syserrlst="$undef"
5511 d_strerrm='"unknown"'
5514 : see if strxfrm exists
5515 set strxfrm d_strxfrm
5518 : see if symlink exists
5519 set symlink d_symlink
5522 : see if syscall exists
5523 set syscall d_syscall
5526 : see if sysconf exists
5527 set sysconf d_sysconf
5530 : see if system exists
5534 : see if tcgetpgrp exists
5535 set tcgetpgrp d_tcgetpgrp
5538 : see if tcsetpgrp exists
5539 set tcsetpgrp d_tcsetpgrp
5542 : define an is-a-typedef? function
5543 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
5545 "") inclist="sys/types.h";;
5547 eval "varval=\$$var";
5551 for inc in $inclist; do
5552 echo "#include <$inc>" >>temp.c;
5554 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
5555 if $contains $type temp.E >/dev/null 2>&1; then
5561 *) eval "$var=$varval";;
5564 : see if this is a sys/times.h system
5565 set sys/times.h i_systimes
5568 : see if times exists
5570 if set times val -f d_times; eval $csym; $val; then
5571 echo 'times() found.' >&4
5574 case "$i_systimes" in
5575 "$define") inc='sys/times.h';;
5577 set clock_t clocktype long stdio.h sys/types.h $inc
5581 rp="What type is returned by times() on this sytem?"
5585 echo 'times() NOT found, hope that will do.' >&4
5590 : see if truncate exists
5591 set truncate d_truncate
5594 : see if tzname[] exists
5596 if set tzname val -a d_tzname; eval $csym; $val; then
5598 echo 'tzname[] found.' >&4
5601 echo 'tzname[] NOT found.' >&4
5606 : see if umask exists
5610 : see if we have to deal with yellow pages, now NIS.
5611 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5612 if $test -f /usr/etc/nibindd; then
5614 echo "I'm fairly confident you're on a NeXT."
5616 rp='Do you get the hosts file via NetInfo?'
5625 y*) hostcat='nidump hosts .';;
5634 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5642 rp='Are you getting the hosts file via yellow pages?'
5645 y*) hostcat='ypcat hosts';;
5646 *) hostcat='cat /etc/hosts';;
5652 : now get the host name
5654 echo "Figuring out host name..." >&4
5655 case "$myhostname" in
5657 echo 'Maybe "hostname" will work...'
5658 if tans=`sh -c hostname 2>&1` ; then
5666 if $test "$cont"; then
5668 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5669 if tans=`cat /etc/systemid 2>&1` ; then
5671 phostname='cat /etc/systemid'
5672 echo "Whadyaknow. Xenix always was a bit strange..."
5675 elif $test -r /etc/systemid; then
5676 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5679 if $test "$cont"; then
5680 echo 'No, maybe "uuname -l" will work...'
5681 if tans=`sh -c 'uuname -l' 2>&1` ; then
5683 phostname='uuname -l'
5685 echo 'Strange. Maybe "uname -n" will work...'
5686 if tans=`sh -c 'uname -n' 2>&1` ; then
5688 phostname='uname -n'
5690 echo 'Oh well, maybe I can mine it out of whoami.h...'
5691 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5692 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5693 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5695 case "$myhostname" in
5696 '') echo "Does this machine have an identity crisis or something?"
5699 echo "Well, you said $myhostname before..."
5700 phostname='echo $myhostname';;
5706 : you do not want to know about this
5711 if $test "$myhostname" ; then
5713 rp='Your host name appears to be "'$myhostname'".'" Right?"
5721 : bad guess or no guess
5722 while $test "X$myhostname" = X ; do
5724 rp="Please type the (one word) name of your host:"
5729 : translate upper to lower if necessary
5730 case "$myhostname" in
5732 echo "(Normalizing case in your host name)"
5733 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5737 : a little sanity check here
5738 case "$phostname" in
5741 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5742 $myhostname$mydomain|$myhostname) ;;
5744 case "$phostname" in
5746 echo "(That doesn't agree with your whoami.h file, by the way.)"
5749 echo "(That doesn't agree with your $phostname command, by the way.)"
5757 : see how we will look up host name
5760 : dummy stub to allow use of elif
5761 elif set uname val -f d_uname; eval $csym; $val; then
5764 uname() was found, but you're running xenix, and older versions of xenix
5765 have a broken uname(). If you don't really know whether your xenix is old
5766 enough to have a broken system call, use the default answer.
5773 rp='Is your uname() broken?'
5776 n*) d_uname="$define"; call=uname;;
5779 echo 'uname() found.' >&4
5784 case "$d_gethname" in
5785 '') d_gethname="$undef";;
5788 '') d_uname="$undef";;
5790 case "$d_phostname" in
5791 '') d_phostname="$undef";;
5794 : backward compatibility for d_hvfork
5795 if test X$d_hvfork != X; then
5799 : see if there is a vfork
5804 : Ok, but do we want to use it. vfork is reportedly unreliable in
5805 : perl on Solaris 2.x, and probably elsewhere.
5813 rp="Some systems have problems with vfork(). Do you want to use it?"
5818 echo "Ok, we won't use vfork()."
5827 $define) usevfork='true';;
5828 *) usevfork='false';;
5831 : see if this is an sysdir system
5832 set sys/dir.h i_sysdir
5835 : see if this is an sysndir system
5836 set sys/ndir.h i_sysndir
5839 : see if closedir exists
5840 set closedir d_closedir
5843 case "$d_closedir" in
5846 echo "Checking whether closedir() returns a status..." >&4
5847 cat > closedir.c <<EOM
5848 #$i_dirent I_DIRENT /**/
5849 #$i_sysdir I_SYS_DIR /**/
5850 #$i_sysndir I_SYS_NDIR /**/
5852 #if defined(I_DIRENT)
5854 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
5855 #include <sys/dir.h>
5859 #include <sys/ndir.h>
5863 #include <ndir.h> /* may be wrong in the future */
5865 #include <sys/dir.h>
5870 int main() { return closedir(opendir(".")); }
5872 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
5873 if ./closedir > /dev/null 2>&1 ; then
5874 echo "Yes, it does."
5877 echo "No, it doesn't."
5881 echo "(I can't seem to compile the test program--assuming it doesn't)"
5892 : check for volatile keyword
5894 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
5895 $cat >try.c <<'EOCP'
5898 typedef struct _goo_struct goo_struct;
5899 goo_struct * volatile goo = ((goo_struct *)0);
5900 struct _goo_struct {
5905 typedef unsigned short foo_t;
5908 volatile foo_t blech;
5912 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
5914 echo "Yup, it does."
5917 echo "Nope, it doesn't."
5923 : see if there is a wait4
5927 : see if waitpid exists
5928 set waitpid d_waitpid
5931 : see if wcstombs exists
5932 set wcstombs d_wcstombs
5935 : see if wctomb exists
5939 : preserve RCS keywords in files with variable substitution, grrr
5944 Revision='$Revision'
5946 : check for alignment requirements
5948 case "$alignbytes" in
5949 '') echo "Checking alignment constraints..." >&4
5950 $cat >try.c <<'EOCP'
5957 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
5960 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
5964 echo"(I can't seem to compile the test program...)"
5967 *) dflt="$alignbytes"
5970 rp="Doubles must be aligned on a how-many-byte boundary?"
5975 : determine where public executables go
5980 rp='Pathname where the public executables will reside?'
5982 if $test "X$ansexp" != "X$binexp"; then
5990 Since you are running AFS, I need to distinguish the directory in which
5991 executables reside from the directory in which they are installed (and from
5992 which they are presumably copied to the former directory by occult means).
5995 case "$installbin" in
5996 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
5997 *) dflt="$installbin";;
6000 rp='Where will public executables be installed?'
6004 installbin="$binexp"
6007 : check for ordering of bytes in a long
6008 case "$byteorder" in
6012 In the following, larger digits indicate more significance. A big-endian
6013 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
6014 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
6015 machines may have weird orders like 3412. A Cray will report 87654321. If
6016 the test program works the default is probably right.
6017 I'm now running the test program...
6019 $cat >try.c <<'EOCP'
6026 char c[sizeof(long)];
6029 if (sizeof(long) > 4)
6030 u.l = (0x08070605L << 32) | 0x04030201L;
6033 for (i = 0; i < sizeof(long); i++)
6034 printf("%c", u.c[i]+'0');
6038 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
6041 ????|????????) echo "(The test program ran ok.)";;
6042 *) echo "(The test program didn't run right for some reason.)";;
6047 (I can't seem to compile the test program. Guessing big-endian...)
6056 rp="What is the order of bytes in a long?"
6061 : how do we catenate cpp tokens here?
6063 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
6064 $cat >cpp_stuff.c <<'EOCP'
6065 #define RCAT(a,b)a/**/b
6066 #define ACAT(a,b)a ## b
6070 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
6071 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
6072 echo "Oh! Smells like ANSI's been here."
6073 echo "We can catify or stringify, separately or together!"
6075 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
6076 echo "Ah, yes! The good old days!"
6077 echo "However, in the good old days we don't know how to stringify and"
6078 echo "catify at the same time."
6082 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
6083 to have to edit the values of CAT[2-5] in config.h...
6085 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
6089 : see if this is a db.h system
6095 : Check the return type needed for hash
6096 echo "Checking return type needed for hash for Berkeley DB ..." >&4
6098 #include <sys/types.h>
6109 info.hash = hash_cb ;
6112 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6113 if $contains warning try.out >>/dev/null 2>&1 ; then
6116 db_hashtype='u_int32_t'
6119 echo "I can't seem to compile the test program." >&4
6123 echo "Your version of Berkeley DB uses $db_hashtype for hash."
6131 : Check the return type needed for prefix
6132 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
6134 #include <sys/types.h>
6137 prefix_cb (key1, key2)
6145 info.prefix = prefix_cb ;
6148 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6149 if $contains warning try.out >>/dev/null 2>&1 ; then
6152 db_prefixtype='size_t'
6155 echo "I can't seem to compile the test program." >&4
6159 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
6161 *) db_prefixtype='int'
6165 : check for void type
6167 echo "Checking to see how well your C compiler groks the void type..." >&4
6170 Support flag bits are:
6171 1: basic void declarations.
6172 2: arrays of pointers to functions returning void.
6173 4: operations between pointers to and addresses of void functions.
6174 8: generic void pointers.
6177 case "$voidflags" in
6179 $cat >try.c <<'EOCP'
6185 extern void moo(); /* function returning void */
6186 void (*goo)(); /* ptr to func returning void */
6188 void *hue; /* generic ptr */
6202 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6203 voidflags=$defvoidused
6204 echo "It appears to support void to the level $package wants ($defvoidused)."
6205 if $contains warning .out >/dev/null 2>&1; then
6206 echo "However, you might get some warnings that look like this:"
6210 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6211 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
6212 echo "It supports 1..."
6213 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
6214 echo "It also supports 2..."
6215 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
6217 echo "And it supports 4 but not 8 definitely."
6219 echo "It doesn't support 4..."
6220 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
6222 echo "But it supports 8."
6225 echo "Neither does it support 8."
6229 echo "It does not support 2..."
6230 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
6232 echo "But it supports 4 and 8."
6234 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
6236 echo "And it supports 4 but has not heard about 8."
6238 echo "However it supports 8 but not 4."
6243 echo "There is no support at all for void."
6249 rp="Your void support flags add up to what?"
6254 : see if dbm.h is available
6259 : see if dbmclose exists
6260 set dbmclose d_dbmclose
6262 case "$d_dbmclose" in
6265 echo "We won't be including <dbm.h>"
6274 : see if ndbm.h is available
6279 : see if dbm_open exists
6280 set dbm_open d_dbm_open
6282 case "$d_dbm_open" in
6285 echo "We won't be including <ndbm.h>"
6294 : see if gdbm.h is available
6299 : see if gdbm_open exists
6300 set gdbm_open d_gdbm_open
6302 case "$d_gdbm_open" in
6305 echo "We won't be including <gdbm.h>"
6315 echo "Looking for extensions..." >&4
6319 if $test -f $xxx/$xxx.xs; then
6320 known_extensions="$known_extensions $xxx"
6323 set X $known_extensions
6325 known_extensions="$*"
6328 : Now see which are supported on this system.
6330 for xxx in $known_extensions ; do
6332 DB_File) case "$i_db" in
6333 $define) avail_ext="$avail_ext $xxx" ;;
6336 GDBM_File) case "$i_gdbm" in
6337 $define) avail_ext="$avail_ext $xxx" ;;
6340 NDBM_File) case "$i_ndbm" in
6341 $define) avail_ext="$avail_ext $xxx" ;;
6344 ODBM_File) case "$i_dbm" in
6345 $define) avail_ext="$avail_ext $xxx" ;;
6348 POSIX) case "$useposix" in
6349 true|define|y) avail_ext="$avail_ext $xxx" ;;
6352 Socket) case "$d_socket" in
6353 $define) avail_ext="$avail_ext $xxx" ;;
6356 *) avail_ext="$avail_ext $xxx"
6368 A number of extensions are supplied with $package. You may choose to
6369 compile these extensions for dynamic loading (the default), compile
6370 them into the $package executable (static loading), or not include
6371 them at all. Answer "none" to include no extensions.
6374 case "$dynamic_ext" in
6375 ''|' ') dflt="$avail_ext" ;;
6376 *) dflt="$dynamic_ext" ;;
6381 rp="What extensions do you wish to load dynamically?"
6384 none) dynamic_ext='' ;;
6385 *) dynamic_ext="$ans" ;;
6388 case "$static_ext" in
6390 : Exclude those already listed in dynamic linking
6392 for xxx in $avail_ext; do
6393 case " $dynamic_ext " in
6395 *) dflt="$dflt $xxx" ;;
6402 *) dflt="$static_ext"
6409 rp="What extensions do you wish to load statically?"
6412 none) static_ext='' ;;
6413 *) static_ext="$ans" ;;
6418 A number of extensions are supplied with $package. Answer "none"
6419 to include no extensions.
6422 case "$static_ext" in
6423 ''|' ') dflt="$avail_ext" ;;
6424 *) dflt="$static_ext" ;;
6430 rp="What extensions do you wish to include?"
6433 none) static_ext='' ;;
6434 *) static_ext="$ans" ;;
6439 set X $dynamic_ext $static_ext
6443 : see what type file positions are declared as in the library
6444 set fpos_t fpostype long stdio.h sys/types.h
6448 rp="What is the type for file position used by fsetpos()?"
6452 : Store the full pathname to the sed program for use in the C program
6455 : see what type gids are declared as in the kernel
6456 set gid_t gidtype xxx stdio.h sys/types.h
6460 xxx=`./findhdr sys/user.h`
6461 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
6463 unsigned) dflt="$1 $2" ;;
6467 *) dflt="$gidtype";;
6470 rp="What is the type for group ids returned by getgid()?"
6474 : see if getgroups exists
6475 set getgroups d_getgrps
6478 : Find type of 2nd arg to getgroups
6480 case "$d_getgrps" in
6482 case "$groupstype" in
6483 '') dflt="$gidtype" ;;
6484 *) dflt="$groupstype" ;;
6487 What is the type of the second argument to getgroups()? Usually this
6488 is the same as group ids, $gidtype, but not always.
6491 rp='What type is the second argument to getgroups()?'
6495 *) groupstype="$gidtype";;
6498 : see what type lseek is declared as in the kernel
6499 set off_t lseektype long stdio.h sys/types.h
6503 rp="What type is lseek's offset on this system declared as?"
6507 : determine where manual pages go
6508 set mansrc mansrc none
6512 $spackage has manual pages available in source form.
6516 echo "However, you don't have nroff, so they're probably useless to you."
6521 echo "If you don't want the manual sources installed, answer 'none'."
6524 lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
6525 lookpath="$lookpath $prefixexp/man/l_man/man1"
6526 lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
6527 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
6528 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6529 lookpath="$lookpath /usr/man/man.L"
6530 mansrc=`./loc . $prefixexp/man/man1 $lookpath`
6531 if $test -d "$mansrc"; then
6545 rp='Where do the manual pages (source) go?'
6547 if test "X$mansrcexp" != "X$ansexp"; then
6559 Since you are running AFS, I need to distinguish the directory in which
6560 manual pages reside from the directory in which they are installed (and from
6561 which they are presumably copied to the former directory by occult means).
6564 case "$installmansrc" in
6565 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
6566 *) dflt="$installmansrc";;
6569 rp='Where will man pages be installed?'
6571 installmansrc="$ans"
6573 installmansrc="$mansrcexp"
6588 : see what type is used for mode_t
6589 set mode_t modetype int stdio.h sys/types.h
6593 rp="What type is used for file modes?"
6597 : set the base revision
6600 : get the patchlevel
6602 echo "Getting the current patchlevel..." >&4
6603 if $test -r ../patchlevel.h;then
6604 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
6608 echo "(You have $package $baserev PL$patchlevel.)"
6610 : Cruising for prototypes
6612 echo "Checking out function prototypes..." >&4
6613 $cat >prototype.c <<'EOCP'
6614 main(int argc, char *argv[]) {
6617 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6618 echo "Your C compiler appears to support function prototypes."
6621 echo "Your C compiler doesn't seem to understand function prototypes."
6628 : check for size of random number generator
6632 echo "Checking to see how many bits your rand function produces..." >&4
6633 $cat >try.c <<'EOCP'
6638 register unsigned long tmp;
6639 register unsigned long max = 0L;
6641 for (i = 1000; i; i--) {
6642 tmp = (unsigned long)rand();
6643 if (tmp > max) max = tmp;
6645 for (i = 0; max; i++)
6650 if $cc try.c -o try >/dev/null 2>&1 ; then
6654 echo "(I can't seem to compile the test program...)"
6661 rp='How many bits does your rand() function produce?'
6666 : see if ar generates random libraries by itself
6668 echo "Checking how to generate random libraries on your machine..." >&4
6669 echo 'int bar1() { return bar2(); }' > bar1.c
6670 echo 'int bar2() { return 2; }' > bar2.c
6671 $cat > foo.c <<'EOP'
6672 main() { printf("%d\n", bar1()); exit(0); }
6674 $cc $ccflags -c bar1.c >/dev/null 2>&1
6675 $cc $ccflags -c bar2.c >/dev/null 2>&1
6676 $cc $ccflags -c foo.c >/dev/null 2>&1
6677 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
6678 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6679 ./foobar >/dev/null 2>&1; then
6680 echo "ar appears to generate random libraries itself."
6683 elif ar ts bar.a >/dev/null 2>&1 &&
6684 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6685 ./foobar >/dev/null 2>&1; then
6686 echo "a table of contents needs to be added with 'ar ts'."
6693 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
6694 $test -f $ranlib || ranlib=''
6697 if $test -n "$ranlib"; then
6698 echo "your system has '$ranlib'; we'll use that."
6701 echo "your system doesn't seem to support random libraries"
6702 echo "so we'll use lorder and tsort to order the libraries."
6709 : determine where public executable scripts go
6710 set scriptdir scriptdir
6712 case "$scriptdir" in
6715 : guess some guesses
6716 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6717 $test -d /usr/share/bin && dflt=/usr/share/bin
6718 $test -d /usr/local/script && dflt=/usr/local/script
6719 $test -d $prefixexp/script && dflt=$prefixexp/script
6723 *) dflt="$scriptdir"
6728 Some installations have a separate directory just for executable scripts so
6729 that they can mount it across multiple architectures but keep the scripts in
6730 one spot. You might, for example, have a subdirectory of /usr/share for this.
6731 Or you might just lump your scripts in with all your other executables.
6735 rp='Where do you keep publicly executable scripts?'
6737 if $test "X$ansexp" != "X$scriptdirexp"; then
6741 scriptdirexp="$ansexp"
6745 Since you are running AFS, I need to distinguish the directory in which
6746 scripts reside from the directory in which they are installed (and from
6747 which they are presumably copied to the former directory by occult means).
6750 case "$installscript" in
6751 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6752 *) dflt="$installscript";;
6755 rp='Where will public scripts be installed?'
6757 installscript="$ans"
6759 installscript="$scriptdirexp"
6762 : see if sys/select.h has to be included
6763 set sys/select.h i_sysselct
6766 : see if we should include time.h, sys/time.h, or both
6768 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
6769 $echo $n "I'm now running the test program...$c"
6770 $cat >try.c <<'EOCP'
6771 #include <sys/types.h>
6776 #ifdef SYSTIMEKERNEL
6779 #include <sys/time.h>
6782 #include <sys/select.h>
6791 struct timezone tzp;
6793 if (foo.tm_sec == foo.tm_sec)
6796 if (bar.tv_sec == bar.tv_sec)
6805 for s_timeval in '-DS_TIMEVAL' ''; do
6806 for i_systimek in '' '-DSYSTIMEKERNEL'; do
6807 for i_time in '' '-DI_TIME'; do
6808 for i_systime in '-DI_SYSTIME' ''; do
6812 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
6813 try.c -o try >/dev/null 2>&1 ; then
6814 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
6818 $echo $n "Succeeded with $flags$c"
6829 *SYSTIMEKERNEL*) i_systimek="$define"
6830 timeincl=`./findhdr sys/time.h`
6831 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
6832 *) i_systimek="$undef";;
6835 *I_TIME*) i_time="$define"
6836 timeincl=`./findhdr time.h`" $timeincl"
6837 echo "We'll include <time.h>." >&4;;
6838 *) i_time="$undef";;
6841 *I_SYSTIME*) i_systime="$define"
6842 timeincl=`./findhdr sys/time.h`" $timeincl"
6843 echo "We'll include <sys/time.h>." >&4;;
6844 *) i_systime="$undef";;
6848 : check for fd_set items
6851 Checking to see how well your C compiler handles fd_set and friends ...
6853 $cat >fd_set.c <<EOCP
6854 #$i_systime I_SYS_TIME
6855 #$i_sysselct I_SYS_SELECT
6856 #$d_socket HAS_SOCKET
6857 #include <sys/types.h>
6859 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6862 #include <sys/time.h>
6865 #include <sys/select.h>
6875 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
6882 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6883 d_fds_bits="$define"
6885 echo "Well, your system knows about the normal fd_set typedef..." >&4
6887 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
6888 d_fd_macros="$define"
6891 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
6893 d_fd_macros="$undef"
6897 Hmm, your compiler has some difficulty with fd_set. Checking further...
6899 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6902 echo "Well, your system has some sort of fd_set available..." >&4
6904 echo "and you have the normal fd_set macros." >&4
6905 d_fd_macros="$define"
6908 but not the normal fd_set macros! Gross! More work for me...
6910 d_fd_macros="$undef"
6913 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
6916 d_fd_macros="$undef"
6922 : check for type of arguments to select. This will only really
6923 : work if the system supports prototypes and provides one for
6927 : Make initial guess
6928 case "$selecttype" in
6931 $define) xxx='fd_set *' ;;
6935 *) xxx="$selecttype"
6940 'fd_set *') yyy='int *' ;;
6941 'int *') yyy='fd_set *' ;;
6946 Checking to see what type of arguments are expected by select().
6949 #$i_systime I_SYS_TIME
6950 #$i_sysselct I_SYS_SELECT
6951 #$d_socket HAS_SOCKET
6952 #include <sys/types.h>
6954 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6957 #include <sys/time.h>
6960 #include <sys/select.h>
6966 Select_fd_set_t readfds;
6967 Select_fd_set_t writefds;
6968 Select_fd_set_t exceptfds;
6969 struct timeval timeout;
6970 select(width, readfds, writefds, exceptfds, &timeout);
6974 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
6976 echo "Your system uses $xxx for the arguments to select." >&4
6977 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
6979 echo "Your system uses $yyy for the arguments to select." >&4
6981 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
6988 *) selecttype = 'int *'
6992 : generate list of signal names
6996 echo "Generating a list of signal names..." >&4
6997 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`" "`./findhdr linux/signal.h`
6998 set X `cat $xxx 2>&1 | $awk '
6999 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
7000 sig[$3] = substr($2,4,20)
7001 if (max < $3 && $3 < 60) {
7007 for (i = 1; i <= max; i++) {
7021 echo 'kill -l' >/tmp/foo$$
7022 set X `csh -f </tmp/foo$$`
7026 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
7034 echo "The following signals are available:"
7036 echo $sig_name | $awk \
7037 'BEGIN { linelen = 0 }
7039 for (i = 1; i < NF; i++) {
7041 linelen = linelen + length(name)
7044 linelen = length(name)
7051 : see what type is used for size_t
7052 set size_t sizetype 'unsigned int' stdio.h sys/types.h
7056 rp="What type is used for the length parameter for string functions?"
7060 : see what type is used for signed size_t
7061 set ssize_t ssizetype int stdio.h sys/types.h
7064 $cat > ssize.c <<EOM
7066 #include <sys/types.h>
7067 #define Size_t $sizetype
7068 #define SSize_t $dflt
7071 if (sizeof(Size_t) == sizeof(SSize_t))
7073 else if (sizeof(Size_t) == sizeof(int))
7080 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
7082 echo "I'll be using $ssizetype for functions returning a byte count." >&4
7084 echo "(I can't compile the test program--please enlighten me!)"
7087 I need a type that is the same size as $sizetype, but is guaranteed to
7088 be signed. Common values are int and long.
7091 rp="What signed type is the same size as $sizetype?"
7095 $rm -f ssize ssize.[co]
7097 : see what type of char stdio uses.
7099 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7100 echo "Your stdio uses unsigned chars." >&4
7101 stdchar="unsigned char"
7103 echo "Your stdio uses signed chars." >&4
7107 : see if time exists
7109 if set time val -f d_time; eval $csym; $val; then
7110 echo 'time() found.' >&4
7112 set time_t timetype long stdio.h sys/types.h
7116 rp="What type is returned by time() on this sytem?"
7120 echo 'time() not found, hope that will do.' >&4
7127 : see what type uids are declared as in the kernel
7128 set uid_t uidtype xxx stdio.h sys/types.h
7132 xxx=`./findhdr sys/user.h`
7133 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
7135 unsigned) dflt="$1 $2" ;;
7139 *) dflt="$uidtype";;
7142 rp="What is the type for user ids returned by getuid()?"
7146 : see if this is a sys/file.h system
7151 : do we need to #include <sys/file.h> ?
7157 echo "We'll be including <sys/file.h>." >&4
7160 echo "We won't be including <sys/file.h>." >&4
7170 : see if fcntl.h is there
7175 : see if we can include fcntl.h
7181 echo "We'll be including <fcntl.h>." >&4
7185 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
7187 echo "We won't be including <fcntl.h>." >&4
7199 : see if this is an grp system
7203 : see if this is a math.h system
7207 : see if memory.h is available.
7212 : See if it conflicts with string.h
7218 $cppstdin $cppflags $cppminus < $strings > mem.h
7219 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7221 echo "We won't be including <memory.h>."
7231 : see if net/errno.h is available
7236 : Unfortunately, it causes problems on some systems. Arrgh.
7242 #include <net/errno.h>
7248 if $cc $ccflags -c try.c >/dev/null 2>&1; then
7249 echo "We'll be including <net/errno.h>." >&4
7251 echo "We won't be including <net/errno.h>." >&4
7260 : get C preprocessor symbols handy
7262 $echo $n "Hmm... $c"
7263 echo $al | $tr ' ' '\012' >Cppsym.know
7275 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
7277 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
7280 unknown="\$unknown \$sym"
7290 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
7292 exit 0; _ _ _ _\1\\ \1\\
7295 echo "exit 1; _ _ _" >>Cppsym\$\$
7296 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
7298 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
7304 $rm -f Cppsym\$\$ Cppsym2\$\$
7309 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
7311 : now check the C compiler for additional symbols
7317 for i in \`$cc -v -c tmp.c 2>&1\`
7320 -D*) echo "\$i" | $sed 's/^-D//';;
7321 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
7328 ./ccsym | $sort | $uniq >ccsym.raw
7329 $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list
7330 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
7331 $comm -13 ccsym.true ccsym.list >ccsym.own
7332 $comm -12 ccsym.true ccsym.list >ccsym.com
7333 $comm -23 ccsym.true ccsym.list >ccsym.cpp
7336 if $test -z ccsym.raw; then
7337 echo "Your C compiler doesn't seem to define any symbol!" >&4
7339 echo "However, your C preprocessor defines the following ones:"
7342 if $test -s ccsym.com; then
7343 echo "Your C compiler and pre-processor define these symbols:"
7344 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
7347 $test "$silent" || sleep 1
7349 if $test -s ccsym.cpp; then
7350 $test "$also" && echo " "
7351 echo "Your C pre-processor ${also}defines the following $symbols:"
7352 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
7354 $test "$silent" || sleep 1
7356 if $test -s ccsym.own; then
7357 $test "$also" && echo " "
7358 echo "Your C compiler ${also}defines the following cpp variables:"
7359 $sed -e 's/\(.*\)=1/\1/' ccsym.own
7360 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
7361 $test "$silent" || sleep 1
7366 : see if this is a termio system
7370 if $test `./findhdr termios.h`; then
7371 set tcsetattr i_termios
7377 "$define") echo "You have POSIX termios.h... good!" >&4;;
7378 *) if ./Cppsym pyr; then
7379 case "`/bin/universe`" in
7380 ucb) if $test `./findhdr sgtty.h`; then
7382 echo "<sgtty.h> found." >&4
7384 echo "System is pyramid with BSD universe."
7385 echo "<sgtty.h> not found--you could have problems." >&4
7387 *) if $test `./findhdr termio.h`; then
7389 echo "<termio.h> found." >&4
7391 echo "System is pyramid with USG universe."
7392 echo "<termio.h> not found--you could have problems." >&4
7396 if $test `./findhdr termio.h`; then
7397 echo "<termio.h> found." >&4
7399 elif $test `./findhdr sgtty.h`; then
7400 echo "<sgtty.h> found." >&4
7403 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
7406 if $test `./findhdr sgtty.h`; then
7407 echo "<sgtty.h> found." >&4
7409 elif $test `./findhdr termio.h`; then
7410 echo "<termio.h> found." >&4
7413 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
7417 set i_termio; eval $setvar
7418 val=$val2; set i_sgtty; eval $setvar
7419 val=$val3; set i_termios; eval $setvar
7421 : see if stdarg is available
7423 if $test `./findhdr stdarg.h`; then
7424 echo "<stdarg.h> found." >&4
7427 echo "<stdarg.h> NOT found." >&4
7431 : see if varags is available
7433 if $test `./findhdr varargs.h`; then
7434 echo "<varargs.h> found." >&4
7436 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
7439 : set up the varargs testing programs
7440 $cat > varargs.c <<EOP
7445 #include <varargs.h>
7463 p = va_arg(ap, char *);
7468 $cat > varargs <<EOP
7469 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
7478 : now check which varargs header should be included
7483 if `./varargs I_STDARG`; then
7485 elif `./varargs I_VARARGS`; then
7490 if `./varargs I_VARARGS`; then
7497 echo "I could not find the definition for va_dcl... You have problems..." >&4
7498 val="$undef"; set i_stdarg; eval $setvar
7499 val="$undef"; set i_varargs; eval $setvar
7506 val="$define"; set i_stdarg; eval $setvar
7507 val="$undef"; set i_varargs; eval $setvar
7510 val="$undef"; set i_stdarg; eval $setvar
7511 val="$define"; set i_varargs; eval $setvar
7514 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
7518 : see if stddef is available
7519 set stddef.h i_stddef
7522 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
7523 set sys/filio.h i_sysfilio
7526 if $test `./findhdr sys/ioctl.h`; then
7528 echo '<sys/ioctl.h> found.' >&4
7531 if $test $i_sysfilio = "$define"; then
7532 echo '<sys/ioctl.h> NOT found.' >&4
7534 $test $i_sgtty = "$define" && xxx="sgtty.h"
7535 $test $i_termio = "$define" && xxx="termio.h"
7536 $test $i_termios = "$define" && xxx="termios.h"
7537 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
7543 : see if this is a sys/param system
7544 set sys/param.h i_sysparam
7547 : see if sys/stat.h is available
7548 set sys/stat.h i_sysstat
7551 : see if sys/types.h has to be included
7552 set sys/types.h i_systypes
7555 : see if this is a unistd.h system
7556 set unistd.h i_unistd
7559 : see if this is an utime system
7563 : see if this is a vfork system
7574 : end of configuration questions
7576 echo "End of configuration questions."
7579 : back to where it started
7580 if test -d ../UU; then
7584 : configuration may be patched via a 'config.over' file
7585 if $test -f config.over; then
7588 rp='I see a config.over file. Do you wish to load it?'
7591 n*) echo "OK, I'll ignore it.";;
7593 echo "Configuration override changes have been loaded."
7598 : in case they want portability, strip down executable paths
7599 case "$d_portable" in
7602 echo "Stripping down executable paths..." >&4
7603 for file in $loclist $trylist; do
7609 : create config.sh file
7611 echo "Creating config.sh..." >&4
7612 $spitshell <<EOT >config.sh
7615 # This file was produced by running the Configure script. It holds all the
7616 # definitions figured out by Configure. Should you modify one of these values,
7617 # do not forget to propagate your changes by running "Configure -der". You may
7618 # instead choose to run each of the .SH files by yourself, or "Configure -S".
7621 # Configuration time: $cf_time
7622 # Configured by: $cf_by
7623 # Target system: $myuname
7633 Revision='$Revision'
7637 alignbytes='$alignbytes'
7638 aphostname='$aphostname'
7640 archlibexp='$archlibexp'
7641 archname='$archname'
7649 byteorder='$byteorder'
7651 castflags='$castflags'
7654 cccdlflags='$cccdlflags'
7655 ccdlflags='$ccdlflags'
7662 clocktype='$clocktype'
7664 compress='$compress'
7665 contains='$contains'
7669 cpp_stuff='$cpp_stuff'
7670 cppflags='$cppflags'
7672 cppminus='$cppminus'
7674 cppstdin='$cppstdin'
7675 cryptlib='$cryptlib'
7677 d_Gconvert='$d_Gconvert'
7678 d_access='$d_access'
7680 d_archlib='$d_archlib'
7681 d_attribut='$d_attribut'
7685 d_bsdpgrp='$d_bsdpgrp'
7688 d_casti32='$d_casti32'
7689 d_castneg='$d_castneg'
7690 d_charvspr='$d_charvspr'
7692 d_chroot='$d_chroot'
7693 d_chsize='$d_chsize'
7694 d_closedir='$d_closedir'
7698 d_cuserid='$d_cuserid'
7699 d_dbl_dig='$d_dbl_dig'
7700 d_difftime='$d_difftime'
7701 d_dirnamlen='$d_dirnamlen'
7702 d_dlerror='$d_dlerror'
7703 d_dlopen='$d_dlopen'
7704 d_dlsymun='$d_dlsymun'
7705 d_dosuid='$d_dosuid'
7708 d_eunice='$d_eunice'
7709 d_fchmod='$d_fchmod'
7710 d_fchown='$d_fchown'
7712 d_fd_macros='$d_fd_macros'
7713 d_fd_set='$d_fd_set'
7714 d_fds_bits='$d_fds_bits'
7715 d_fgetpos='$d_fgetpos'
7716 d_flexfnam='$d_flexfnam'
7720 d_fpathconf='$d_fpathconf'
7721 d_fsetpos='$d_fsetpos'
7722 d_getgrps='$d_getgrps'
7723 d_gethent='$d_gethent'
7724 d_gethname='$d_gethname'
7725 d_getlogin='$d_getlogin'
7726 d_getpgrp2='$d_getpgrp2'
7727 d_getpgrp='$d_getpgrp'
7728 d_getppid='$d_getppid'
7729 d_getprior='$d_getprior'
7732 d_isascii='$d_isascii'
7733 d_killpg='$d_killpg'
7735 d_linuxstd='$d_linuxstd'
7736 d_locconv='$d_locconv'
7740 d_mbstowcs='$d_mbstowcs'
7741 d_mbtowc='$d_mbtowc'
7742 d_memcmp='$d_memcmp'
7743 d_memcpy='$d_memcpy'
7744 d_memmove='$d_memmove'
7745 d_memset='$d_memset'
7747 d_mkfifo='$d_mkfifo'
7748 d_mktime='$d_mktime'
7750 d_msgctl='$d_msgctl'
7751 d_msgget='$d_msgget'
7752 d_msgrcv='$d_msgrcv'
7753 d_msgsnd='$d_msgsnd'
7754 d_mymalloc='$d_mymalloc'
7756 d_oldsock='$d_oldsock'
7758 d_pathconf='$d_pathconf'
7760 d_phostname='$d_phostname'
7762 d_portable='$d_portable'
7764 d_pwchange='$d_pwchange'
7765 d_pwclass='$d_pwclass'
7766 d_pwcomment='$d_pwcomment'
7767 d_pwexpire='$d_pwexpire'
7768 d_pwquota='$d_pwquota'
7769 d_readdir='$d_readdir'
7770 d_readlink='$d_readlink'
7771 d_rename='$d_rename'
7772 d_rewinddir='$d_rewinddir'
7774 d_safebcpy='$d_safebcpy'
7775 d_safemcpy='$d_safemcpy'
7776 d_seekdir='$d_seekdir'
7777 d_select='$d_select'
7779 d_semctl='$d_semctl'
7780 d_semget='$d_semget'
7782 d_setegid='$d_setegid'
7783 d_seteuid='$d_seteuid'
7784 d_setlinebuf='$d_setlinebuf'
7785 d_setlocale='$d_setlocale'
7786 d_setpgid='$d_setpgid'
7787 d_setpgrp2='$d_setpgrp2'
7788 d_setpgrp='$d_setpgrp'
7789 d_setprior='$d_setprior'
7790 d_setregid='$d_setregid'
7791 d_setresgid='$d_setresgid'
7792 d_setresuid='$d_setresuid'
7793 d_setreuid='$d_setreuid'
7794 d_setrgid='$d_setrgid'
7795 d_setruid='$d_setruid'
7796 d_setsid='$d_setsid'
7799 d_shmatprototype='$d_shmatprototype'
7800 d_shmctl='$d_shmctl'
7802 d_shmget='$d_shmget'
7803 d_shrplib='$d_shrplib'
7804 d_socket='$d_socket'
7805 d_sockpair='$d_sockpair'
7806 d_statblks='$d_statblks'
7807 d_stdstdio='$d_stdstdio'
7808 d_strchr='$d_strchr'
7809 d_strcoll='$d_strcoll'
7810 d_strctcpy='$d_strctcpy'
7811 d_strerrm='$d_strerrm'
7812 d_strerror='$d_strerror'
7813 d_strxfrm='$d_strxfrm'
7814 d_suidsafe='$d_suidsafe'
7815 d_symlink='$d_symlink'
7816 d_syscall='$d_syscall'
7817 d_sysconf='$d_sysconf'
7818 d_sysernlst='$d_sysernlst'
7819 d_syserrlst='$d_syserrlst'
7820 d_system='$d_system'
7821 d_tcgetpgrp='$d_tcgetpgrp'
7822 d_tcsetpgrp='$d_tcsetpgrp'
7823 d_telldir='$d_telldir'
7826 d_truncate='$d_truncate'
7827 d_tzname='$d_tzname'
7831 d_void_closedir='$d_void_closedir'
7832 d_voidsig='$d_voidsig'
7833 d_voidtty='$d_voidtty'
7834 d_volatile='$d_volatile'
7835 d_vprintf='$d_vprintf'
7837 d_waitpid='$d_waitpid'
7838 d_wcstombs='$d_wcstombs'
7839 d_wctomb='$d_wctomb'
7842 db_hashtype='$db_hashtype'
7843 db_prefixtype='$db_prefixtype'
7844 defvoidused='$defvoidused'
7845 direntrytype='$direntrytype'
7848 dynamic_ext='$dynamic_ext'
7852 eunicefix='$eunicefix'
7854 extensions='$extensions'
7857 fpostype='$fpostype'
7858 freetype='$freetype'
7859 full_csh='$full_csh'
7860 full_sed='$full_sed'
7862 gccversion='$gccversion'
7866 groupcat='$groupcat'
7867 groupstype='$groupstype'
7869 h_sysfile='$h_sysfile'
7873 i_bsdioctl='$i_bsdioctl'
7876 i_dirent='$i_dirent'
7883 i_limits='$i_limits'
7884 i_malloc='$i_malloc'
7886 i_memory='$i_memory'
7888 i_neterrno='$i_neterrno'
7892 i_stdarg='$i_stdarg'
7893 i_stddef='$i_stddef'
7894 i_stdlib='$i_stdlib'
7895 i_string='$i_string'
7896 i_sysdir='$i_sysdir'
7897 i_sysfile='$i_sysfile'
7898 i_sysfilio='$i_sysfilio'
7900 i_sysioctl='$i_sysioctl'
7901 i_sysndir='$i_sysndir'
7902 i_sysparam='$i_sysparam'
7903 i_sysselct='$i_sysselct'
7904 i_syssockio='$i_syssockio'
7905 i_sysstat='$i_sysstat'
7906 i_systime='$i_systime'
7907 i_systimek='$i_systimek'
7908 i_systimes='$i_systimes'
7909 i_systypes='$i_systypes'
7910 i_termio='$i_termio'
7911 i_termios='$i_termios'
7913 i_unistd='$i_unistd'
7915 i_varargs='$i_varargs'
7916 i_varhdr='$i_varhdr'
7920 installarchlib='$installarchlib'
7921 installbin='$installbin'
7922 installmansrc='$installmansrc'
7923 installprivlib='$installprivlib'
7924 installscript='$installscript'
7926 known_extensions='$known_extensions'
7929 lddlflags='$lddlflags'
7935 libswanted='$libswanted'
7944 lseektype='$lseektype'
7948 mallocobj='$mallocobj'
7949 mallocsrc='$mallocsrc'
7950 malloctype='$malloctype'
7953 mansrcexp='$mansrcexp'
7956 mips_type='$mips_type'
7959 modetype='$modetype'
7962 myarchname='$myarchname'
7963 mydomain='$mydomain'
7964 myhostname='$myhostname'
7969 optimize='$optimize'
7970 orderlib='$orderlib'
7975 patchlevel='$patchlevel'
7978 phostname='$phostname'
7983 prefixexp='$prefixexp'
7985 privlibexp='$privlibexp'
7986 prototype='$prototype'
7987 randbits='$randbits'
7992 scriptdir='$scriptdir'
7993 scriptdirexp='$scriptdirexp'
7995 selecttype='$selecttype'
7996 sendmail='$sendmail'
7999 sharpbang='$sharpbang'
8000 shmattype='$shmattype'
8003 sig_name='$sig_name'
8004 signal_t='$signal_t'
8005 sizetype='$sizetype'
8010 sockethdr='$sockethdr'
8011 socketlib='$socketlib'
8013 spackage='$spackage'
8014 spitshell='$spitshell'
8016 ssizetype='$ssizetype'
8018 static_ext='$static_ext'
8027 timeincl='$timeincl'
8028 timetype='$timetype'
8036 usemymalloc='$usemymalloc'
8038 useposix='$useposix'
8039 usevfork='$usevfork'
8043 voidflags='$voidflags'
8048 : add special variables
8049 $test -f patchlevel.h && \
8050 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
8051 echo "CONFIG=true" >>config.sh
8053 : propagate old symbols
8054 if $test -f UU/config.sh; then
8055 <UU/config.sh sort | uniq >UU/oldconfig.sh
8056 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
8057 sort | uniq -u >UU/oldsyms
8058 set X `cat UU/oldsyms`
8064 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
8066 echo "# Variables propagated from previous config.sh file." >>config.sh
8067 for sym in `cat UU/oldsyms`; do
8068 echo " Propagating $hint variable "'$'"$sym..."
8069 eval 'tmp="$'"${sym}"'"'
8071 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
8077 : Finish up by extracting the .SH files
8091 If you'd like to make any changes to the config.sh file before I begin
8092 to configure things, do it as a shell escape now (e.g. !vi config.sh).
8095 rp="Press return or use a shell escape to edit config.sh:"
8100 *) : in case they cannot read
8106 : if this fails, just run all the .SH files by hand
8113 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
8120 Now you need to generate make dependencies by running "make depend".
8121 You might prefer to run it in background: "make depend > makedepend.out &"
8122 It can take a while, so you might not want to run it right now.
8127 rp="Run make depend now?"
8131 make depend && echo "Now you must run a make."
8134 echo "You must run 'make depend' then 'make'."
8137 elif test -f [Mm]akefile; then
8139 echo "Now you must run a make."
8144 $rm -f kit*isdone ark*isdone