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 Feb 6 10:35:10 EST 1995 [metaconfig 3.0 PL50]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
60 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
61 paths=$paths:'/usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin'
62 paths=$paths:'/sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb'
63 paths=$paths:'/bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin'
64 paths=$paths:'/etc /usr/lib /usr/ucblib /lib /usr/ccs/lib'
65 paths=$paths:'/sbin /usr/sbin /usr/libexec'
71 *) test -d $p && PATH=$PATH:$p ;;
80 echo "Say 'sh $me', not 'sh <$me'"
84 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
85 if test -f /hp-ux -a -f /bin/ksh; then
86 if (PATH=.; alias -x) >/dev/null 2>&1; then
87 : already under /bin/ksh
90 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
96 : Warn them if they use ksh on other systems
97 (PATH=.; alias -x) >/dev/null 2>&1 && \
99 (I see you are using the Korn shell. Some ksh's blow up on $me,
100 especially on exotic machines. If yours does, try the Bourne shell instead.)
104 : Configure runs within the UU subdirectory
105 test -d UU || mkdir UU
530 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
533 : We must find out about Eunice early
535 if test -f /etc/unixtovms; then
536 eunicefix=/etc/unixtovms
538 if test -f /etc/unixtovms.exe; then
539 eunicefix=/etc/unixtovms.exe
542 : list of known cpp symbols, sorted alphabetically
543 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
544 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
545 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
546 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
547 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
548 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
549 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
550 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
551 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
552 al="$al VMS Xenix286"
553 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
554 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
555 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
556 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
557 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
558 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
559 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
560 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
561 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
562 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
563 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
564 al="$al __SVR4_2__ __UMAXV__"
565 al="$al ____386BSD____ __alpha __alpha__ __amiga"
566 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
567 al="$al __host_mips__"
568 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
569 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
570 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
571 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
572 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
573 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
574 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
575 al="$al __mc88100 __mc88100__ __mips __mips__"
576 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
577 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
578 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
579 al="$al _host_mips _mips _unix"
580 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
581 al="$al apollo ardent att386 att3b"
582 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
583 al="$al cadmus clipper concurrent convex cray ctix"
584 al="$al dmert encore gcos gcx gimpel gould"
585 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
586 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
587 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
588 al="$al i186 i286 i386 i486 i8086"
589 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
590 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
591 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
592 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
593 al="$al mc88000 mc88100 merlin mert mips mvs n16"
594 al="$al ncl_el ncl_mr"
595 al="$al news1500 news1700 news1800 news1900 news3700"
596 al="$al news700 news800 news900 ns16000 ns32000"
597 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
598 al="$al parisc pc532 pdp11 plexus posix pyr"
599 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
600 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
601 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
602 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
603 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
604 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
610 : change the next line if compiling for Xenix/286 on Xenix/386
611 xlibpth='/usr/lib/386 /lib/386'
613 : general looking path for locating libraries
614 glibpth="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
615 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
616 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
618 : Private path used by Configure to find libraries. Its value
619 : is prepended to libpth. This variable takes care of special
620 : machines, like the mips. Usually, it should be empty.
623 : default library list
625 : full support for void wanted by default
628 : set useposix=false in your hint file to disable the POSIX extension.
630 : no include file wanted by default
633 : List of libraries we want.
634 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
635 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
636 libswanted="$libswanted ucb bsd BSD PW x"
637 : We probably want to search /usr/shlib before most other libraries.
638 : This is only used by ext/util/extliblist
639 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
640 glibpth="/usr/shlib $glibpth"
641 : Do not use vfork unless overridden by a hint file.
643 : We might as well always be portable. It makes no difference for
644 : perl5, and makes people happy.
647 : script used to extract .SH files with variable substitutions
650 echo "Doing variable substitutions on .SH files..."
651 if test -f MANIFEST; then
652 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
653 : Pick up possible extension manifests.
654 for dir in ext/* ; do
655 if test -f $dir/MANIFEST; then
656 xxx=`awk '{print $1}' < $dir/MANIFEST |
657 sed -n "/\.SH$/ s@^@$dir/@p"`
658 shlist="$shlist $xxx"
663 echo "(Looking for .SH files under the current directory.)"
664 set x `find . -name "*.SH" -print`
668 0) set x *.SH; shift;;
670 if test ! -f $1; then
676 dir=`expr X$file : 'X\(.*\)/'`
677 file=`expr X$file : 'X.*/\(.*\)'`
678 (cd $dir && . ./$file)
685 if test -f config_h.SH; then
686 if test ! -f config.h; then
687 : oops, they left it out of MANIFEST, probably, so do it anyway.
693 : produce awk script to parse command line options
694 cat >options.awk <<'EOF'
696 optstr = "dD:eEf:hOrsSU:V"; # getopt-style specification
698 len = length(optstr);
699 for (i = 1; i <= len; i++) {
700 c = substr(optstr, i, 1);
701 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
712 if (substr(str, 1, 1) != "-") {
713 printf("'%s'\n", str);
717 for (i = 2; i <= len; i++) {
718 c = substr(str, i, 1);
720 printf("-%s\n", substr(str, i));
726 printf("'%s'\n", substr(str, i + 1));
739 : process the command line options
740 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
745 : set up default values
757 while test $# -gt 0; do
759 -d) shift; fastread=yes;;
760 -e) shift; alldone=cont;;
764 if test -r "$1"; then
767 echo "$me: cannot read config file $1." >&2
772 -h) shift; error=true;;
773 -r) shift; reuseval=true;;
774 -s) shift; silent=true;;
775 -E) shift; alldone=exit;;
776 -O) shift; override=true;;
777 -S) shift; extractsh=true;;
782 echo "$me: use '-U symbol=', not '-D symbol='." >&2
783 echo "$me: ignoring -D $1" >&2
786 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
787 *) echo "$1='define'" >> optdef.sh;;
794 *=) echo "$1" >> optdef.sh;;
796 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
797 echo "$me: ignoring -U $1" >&2
799 *) echo "$1='undef'" >> optdef.sh;;
803 -V) echo "$me generated by metaconfig 3.0 PL50." >&2
806 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
814 Usage: $me [-dehrEOSV] [-f config.sh] [-D symbol] [-D symbol=value]
815 [-U symbol] [-U symbol=]
816 -d : use defaults for all answers.
817 -e : go on without questioning past the production of config.sh.
818 -f : specify an alternate default configuration file.
819 -h : print this help message and exit (with an error status).
820 -r : reuse C symbols value if possible (skips costly nm extraction).
821 -s : silent mode, only echoes questions and essential information.
822 -D : define symbol to have some value:
823 -D symbol symbol gets the value 'define'
824 -D symbol=value symbol gets the value 'value'
825 -E : stop at the end of questions, after having produced config.sh.
826 -O : let -D and -U override definitions from loaded configuration file.
827 -S : perform variable substitutions on all .SH files (can mix with -f)
828 -U : undefine symbol:
829 -U symbol symbol gets the value 'undef'
830 -U symbol= symbol gets completely empty
831 -V : print version number and exit (with a zero status).
839 true) exec 1>/dev/null;;
842 : run the defines and the undefines, if any, but leave the file out there...
849 '') config_sh='config.sh'; config='./config.sh';;
850 /*) config="$config_sh";;
851 *) config="./$config_sh";;
854 echo "Fetching answers from $config_sh..."
857 test "$override" && . ./optdef.sh
868 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
869 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
870 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
871 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
872 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
875 : Eunice requires " " instead of "", can you believe it
878 echo "Beginning of configuration questions for $package."
880 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
882 : Some greps do not return status, grrr.
883 echo "grimblepritz" >grimble
884 if grep blurfldyick grimble >/dev/null 2>&1 ; then
886 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
892 : the following should work in any shell
896 echo "AGH! Grep doesn't return a status. Attempting remedial action."
897 cat >contains <<'EOSS'
898 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
903 : first determine how to suppress newline on echo command
905 echo "Checking echo to see how to suppress newlines..."
906 (echo "hi there\c" ; echo " ") >.echotmp
907 if $contains c .echotmp >/dev/null 2>&1 ; then
918 echo $n "The star should be here-->$c"
922 : Now test for existence of everything in MANIFEST
924 if test -f ../MANIFEST; then
925 echo "First let's make sure your kit is complete. Checking..." >&4
926 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
928 for filelist in x??; do
929 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
931 if test -s missing; then
935 THIS PACKAGE SEEMS TO BE INCOMPLETE.
937 You have the option of continuing the configuration process, despite the
938 distinct possibility that your kit is damaged, by typing 'y'es. If you
939 do, don't blame me if something goes wrong. I advise you to type 'n'o
940 and contact the author (lwall@netlabs.com).
943 echo $n "Continue? [n] $c" >&4
947 echo "Continuing..." >&4
951 echo "ABORTING..." >&4
956 echo "Looks good..." >&4
959 echo "There is no MANIFEST file. I hope your kit is complete !"
963 : compute the number of columns on the terminal for proper question formatting
968 : set up the echo used in my read
969 myecho="case \"\$xxxm\" in
970 '') echo $n \"\$rp $c\" >&4;;
972 '') echo $n \"[\$xxxm] $c\";;
974 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
976 echo $n \"[\$xxxm] $c\" >&4
978 echo $n \"\$rp [\$xxxm] $c\" >&4
984 : now set up to do reads with possible shell escape and default assignment
990 yes) case "\$dflt" in
993 case "\$silent-\$rp" in
998 *) case "\$silent" in
1004 while expr "X\$ans" : "X!" >/dev/null; do
1008 aok=''; eval "ans=\"\$answ\"" && aok=y
1013 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1018 echo "(OK, I'll run with -d after this question.)"
1021 echo "*** Sorry, \$1 not supported yet."
1033 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1043 echo "*** Substitution done -- please confirm."
1045 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1050 echo "*** Error -- try again."
1057 case "\$ans\$xxxm\$nostick" in
1069 : create .config dir to save info across Configure sessions
1070 test -d ../.config || mkdir ../.config
1071 cat >../.config/README <<EOF
1072 This directory created by Configure to save information that should
1073 persist across sessions.
1075 You may safely delete it if you wish.
1078 : general instructions
1081 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1082 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1085 rp='Would you like to see the instructions?'
1096 This installation shell script will examine your system and ask you questions
1097 to determine how the perl5 package should be installed. If you get
1098 stuck on a question, you may use a ! shell escape to start a subshell or
1099 execute a command. Many of the questions will have default answers in square
1100 brackets; typing carriage return will give you the default.
1102 On some of the questions which ask for file or directory names you are allowed
1103 to use the ~name construct to specify the login directory belonging to "name",
1104 even if you don't have a shell which knows about that. Questions where this is
1105 allowed will be marked "(~name ok)".
1109 dflt='Type carriage return to continue'
1113 The prompter used in this script allows you to use shell variables and
1114 backticks in your answers. You may use $1, $2, etc... to refer to the words
1115 in the default answer, as if the default line was a set of arguments given to a
1116 script shell. This means you may also use $* to repeat the whole default line,
1117 so you do not have to re-type everything to add something to the default.
1119 Everytime there is a substitution, you will have to confirm. If there is an
1120 error (e.g. an unmatched backtick), the default answer will remain unchanged
1121 and you will be prompted again.
1123 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1124 the questions and use the computed defaults (or the previous answers if there
1125 was already a config.sh file). Type 'Configure -h' for a list of options.
1126 You may also start interactively and then answer '& -d' at any prompt to turn
1127 on the non-interactive behaviour for the remaining of the execution.
1133 Much effort has been expended to ensure that this shell script will run on any
1134 Unix system. If despite that it blows up on yours, your best bet is to edit
1135 Configure and run it again. Also, let me (lwall@netlabs.com)
1136 know how I blew it. If you can't run Configure for some reason, you'll have to
1137 generate a config.sh file by hand.
1139 This installation script affects things in two ways:
1141 1) it may do direct variable substitutions on some of the files included
1143 2) it builds a config.h file for inclusion in C programs. You may edit
1144 any of these files as the need arises after running this script.
1146 If you make a mistake on a question, there is no easy way to back up to it
1147 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1148 files. Configure will offer to let you do this before it runs the SH files.
1151 dflt='Type carriage return to continue'
1153 case "$firsttime" in
1154 true) echo $user >>../.config/instruct;;
1158 : see if sh knows # comments
1160 echo "Checking your sh to see if it knows about # comments..." >&4
1161 if `sh -c '#' >/dev/null 2>&1`; then
1162 echo "Your sh handles # comments correctly."
1166 echo "Okay, let's see if #! works on this system..."
1168 test -f $xcat || xcat=/usr/bin/cat
1173 if test -s today; then
1177 echo "#! $xcat" > try
1181 if test -s today; then
1185 echo "It's just a comment."
1190 echo "Your sh doesn't grok # comments--I will strip them later on."
1193 echo "exec grep -v '^[ ]*#'" >spitshell
1195 $eunicefix spitshell
1196 spitshell=`pwd`/spitshell
1198 echo "I presume that if # doesn't work, #! won't work either!"
1203 : figure out how to guarantee sh startup
1205 echo "Checking out how to guarantee sh startup..." >&4
1207 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1208 *) startsh=$sharpbang'/bin/sh';;
1210 echo "Let's see if '$startsh' works..."
1220 echo "Yup, it does."
1222 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1226 : find out where common programs are
1228 echo "Locating common programs..." >&4
1241 if test -d \$dir/\$thing; then
1247 for thisthing in \$dir/\$thing; do
1248 : just loop through to pick last item
1250 if test -f \$thisthing; then
1253 elif test -f \$dir/\$thing.exe; then
1254 : on Eunice apparently
1298 pth=`echo $PATH | sed -e 's/:/ /g'`
1299 pth="$pth /lib /usr/lib"
1300 for file in $loclist; do
1301 xxx=`./loc $file $file $pth`
1306 echo $file is in $xxx.
1309 echo "I don't know where $file is. I hope it's in everyone's PATH."
1314 echo "Don't worry if any of the following aren't found..."
1316 for file in $trylist; do
1317 xxx=`./loc $file $file $pth`
1322 echo $file is in $xxx.
1325 echo "I don't see $file out there, $say."
1332 echo "Substituting grep for egrep."
1338 echo "Hopefully test is built into your sh."
1341 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1342 echo "Using the test built into your sh."
1350 echo "Hopefully echo is built into your sh."
1355 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1356 $echo $n "hi there$c" >foo1
1357 echo $n "hi there$c" >foo2
1358 if cmp foo1 foo2 >/dev/null 2>&1; then
1359 echo "They are compatible. In fact, they may be identical."
1366 They are not compatible! You are probably running ksh on a non-USG system.
1367 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1368 have echo built in and we may have to run some Bourne shell scripts. That
1369 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1372 $echo $n "The star should be here-->$c"
1379 : determine whether symbolic links are supported
1382 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1383 echo "Symbolic links are supported." >&4
1386 echo "Symbolic links are NOT supported." >&4
1391 : see whether [:lower:] and [:upper:] are supported character classes
1395 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1397 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1402 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1405 : set up the translation script tr, must be called with ./tr of course
1409 '[A-Z][a-z]') exec $tr '$up' '$low';;
1410 '[a-z][A-Z]') exec $tr '$low' '$up';;
1417 : Try to determine whether config.sh was made on this system
1418 case "$config_sh" in
1420 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1421 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1422 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1423 newmyuname="$myuname"
1425 if test "$fastread" = yes; then
1427 elif test -f ../config.sh; then
1428 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1429 eval "`grep myuname= ../config.sh`"
1431 if test "X$myuname" = "X$newmyuname"; then
1436 : Get old answers from old config file if Configure was run on the
1437 : same system, otherwise use the hints.
1440 if test -f config.sh; then
1442 rp="I see a config.sh file. Shall I use it to set the defaults?"
1445 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1446 *) echo "Fetching default answers from your old config.sh file..." >&4
1457 if test ! -f config.sh; then
1460 First time through, eh? I have some defaults handy for the following systems:
1463 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1465 : Half the following guesses are probably wrong... If you have better
1466 : tests or hints, please send them to lwall@netlabs.com
1467 : The metaconfig authors would also appreciate a copy...
1468 $test -f /irix && osname=irix
1469 $test -f /xenix && osname=sco_xenix
1470 $test -f /dynix && osname=dynix
1471 $test -f /dnix && osname=dnix
1472 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1473 $test -f /bin/mips && /bin/mips && osname=mips
1474 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1475 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1476 $test -d /usr/apollo/bin && osname=apollo
1477 $test -f /etc/saf/_sactab && osname=svr4
1478 $test -d /usr/include/minix && osname=minix
1479 if $test -f $uname; then
1487 umips) osname=umips ;;
1490 [23]100) osname=mips ;;
1491 next*) osname=next ;;
1492 news*) osname=news ;;
1494 if $test -f /etc/kconfig; then
1496 if test "$lns" = "ln -s"; then
1498 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1500 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1509 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1511 'not found') osvers="$4"."$3" ;;
1512 '<3240'|'<>3240') osvers=3.2.0 ;;
1513 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1514 '=3250'|'>3250') osvers=3.2.5 ;;
1521 domainos) osname=apollo
1527 freebsd) osname=freebsd
1529 genix) osname=genix ;;
1534 *.10.*) osvers=10 ;;
1551 netbsd*) osname=netbsd
1554 bsd386) osname=bsd386
1557 next*) osname=next ;;
1558 solaris) osname=solaris
1560 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1567 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1571 titanos) osname=titanos
1580 ultrix) osname=ultrix
1584 alpha) osname=dec_osf
1586 [vt]1\.*) osvers=1 ;;
1587 [vt]2\.*) osvers=2 ;;
1588 [vt]3\.*) osvers=3 ;;
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 "$value"; then
2332 echo "(Looking for $loc_file in directory $value.)"
2333 value="$value/$loc_file"
2335 if test -f "$value"; then
2338 case "$nopath_ok" in
2339 true) case "$value" in
2341 *) echo "Assuming $value will be in people's path."
2357 if test "$fastread" = yes; then
2362 rp="$what $value doesn't exist. Use that name anyway?"
2383 : What should the include directory be ?
2385 $echo $n "Hmm... $c"
2389 if $test -f /bin/mips && /bin/mips; then
2390 echo "Looks like a MIPS system..."
2391 $cat >usr.c <<'EOCP'
2392 #ifdef SYSTYPE_BSD43
2396 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2397 dflt='/bsd43/usr/include'
2401 mips_type='System V'
2403 $rm -f usr.c usr.out
2404 echo "and you're compiling with the $mips_type compiler and libraries."
2406 echo "Doesn't look like a MIPS system."
2417 rp='Where are the include files you want to use?'
2421 : see how we invoke the C preprocessor
2423 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2424 cat <<'EOT' >testcpp.c
2430 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2432 wrapper=`pwd`/cppstdin
2436 if $test "X$cppstdin" != "X" && \
2437 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2438 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2440 echo "You used to use $cppstdin $cppminus so we'll use that again."
2442 '') echo "But let's see if we can live without a wrapper..." ;;
2444 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2445 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2447 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2450 echo "(However, $cpprun $cpplast does not work, let's see...)"
2458 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2465 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2466 $cc -E <testcpp.c >testcpp.out 2>&1; \
2467 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2468 echo "Yup, it does."
2471 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2472 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2473 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2474 echo "Yup, it does."
2477 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2478 $cc -P <testcpp.c >testcpp.out 2>&1; \
2479 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2480 echo "Yipee, that works!"
2483 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2484 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2485 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2486 echo "At long last!"
2489 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2490 $cpp <testcpp.c >testcpp.out 2>&1; \
2491 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2495 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2496 $cpp - <testcpp.c >testcpp.out 2>&1; \
2497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2498 echo "Hooray, it works! I was beginning to wonder."
2501 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2502 $wrapper <testcpp.c >testcpp.out 2>&1; \
2503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2509 rp="No dice. I can't find a C preprocessor. Name one:"
2513 $x_cpp <testcpp.c >testcpp.out 2>&1
2514 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2515 echo "OK, that will do." >&4
2517 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2532 echo "Perhaps can we force $cc -E using a wrapper..."
2533 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2534 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2540 echo "Nope, we'll have to live without it..."
2555 *) $rm -f $wrapper;;
2557 $rm -f testcpp.c testcpp.out
2559 : determine optimize, if desired, or use for debug flag also
2563 *) dflt="$optimize";;
2567 Some C compilers have problems with their optimizers, by default, $package
2568 compiles with the -O flag to use the optimizer. Alternately, you might want
2569 to use the symbolic debugger, which uses the -g flag (on traditional Unix
2570 systems). Either flag can be specified here. To use neither flag, specify
2574 rp="What optimizer/debugger flag should be used?"
2578 'none') optimize=" ";;
2584 case "$gccversion" in
2585 1*) dflt='-fpcc-struct-return' ;;
2588 *-g*) dflt="$dflt -DDEBUGGING";;
2590 case "$gccversion" in
2591 2*) if test -d /etc/conf/kconfig.d &&
2592 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2601 case "$mips_type" in
2604 *) inclwanted="$inclwanted $usrinc/bsd";;
2606 for thisincl in $inclwanted; do
2607 if $test -d $thisincl; then
2608 if $test x$thisincl != x$usrinc; then
2611 *) dflt="$dflt -I$thisincl";;
2617 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2619 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2627 *) dflt="$dflt -D$2";;
2632 set signal.h __LANGUAGE_C__; eval $inctest
2634 set signal.h LANGUAGE_C; eval $inctest
2636 set signal.h NO_PROTOTYPE; eval $inctest
2637 set signal.h _NO_PROTO; eval $inctest
2644 *) dflt="$ccflags";;
2648 Your C compiler may want other flags. For this question you should include
2649 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
2650 but you should NOT include libraries or ld flags like -lwhatever. If you
2651 want $package to honor its debug switch, you should include -DDEBUGGING here.
2652 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
2653 -DHIDEMYMALLOC or -DCRIPPLED_CC.
2655 To use no flags, specify the word "none".
2661 rp="Any additional cc flags?"
2668 : the following weeds options from ccflags that are of no interest to cpp
2670 case "$gccversion" in
2671 1*) cppflags="$cppflags -D__GNUC__"
2673 case "$mips_type" in
2675 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2681 echo "Let me guess what the preprocessor flags are..." >&4
2695 *) ftry="$previous $flag";;
2697 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
2698 >cpp1.out 2>/dev/null && \
2699 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
2700 >cpp2.out 2>/dev/null && \
2701 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
2702 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
2704 cppflags="$cppflags $ftry"
2714 *-*) echo "They appear to be: $cppflags";;
2716 $rm -f cpp.c cpp?.out
2720 : flags used in final linking phase
2722 '') if ./venix; then
2728 *-posix*) dflt="$dflt -posix" ;;
2734 *) dflt="$ldflags";;
2737 rp="Any additional ld flags (NOT including libraries)?"
2743 rmlist="$rmlist pdp11"
2745 : Set private lib path
2748 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2753 '') dlist="$plibpth $glibpth";;
2754 *) dlist="$libpth";;
2757 : Now check and see which directories actually exist, avoiding duplicates
2761 if $test -d $xxx; then
2764 *) libpth="$libpth $xxx";;
2770 Some systems have incompatible or broken versions of libraries. Among
2771 the directories listed in the question below, please remove any you
2772 know not to be holding relevant libraries, and add any that are needed.
2773 Say "none" for none.
2784 rp="Directories to use for library searches?"
2791 : compute shared library extension
2794 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2804 On some systems, shared libraries may be available. Answer 'none' if
2805 you want to suppress searching of shared libraries for the remaining
2806 of this configuration.
2809 rp='What is the file extension used for shared libraries?'
2813 : Looking for optional libraries
2815 echo "Checking for optional libraries..." >&4
2820 case "$libswanted" in
2821 '') libswanted='c_s';;
2823 for thislib in $libswanted; do
2825 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2826 echo "Found -l$thislib (shared)."
2829 *) dflt="$dflt -l$thislib";;
2831 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2832 echo "Found -l$thislib (shared)."
2835 *) dflt="$dflt -l$thislib";;
2837 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
2838 echo "Found -l$thislib."
2841 *) dflt="$dflt -l$thislib";;
2843 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
2844 echo "Found -l${thislib}_s."
2847 *) dflt="$dflt -l${thislib}_s";;
2849 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
2850 echo "Found -l$thislib."
2853 *) dflt="$dflt -l$thislib";;
2856 echo "No -l$thislib."
2867 ' '|'') dflt='none';;
2872 Some versions of Unix support shared libraries, which make executables smaller
2873 but make load time slightly longer.
2875 On some systems, mostly newer Unix System V's, the shared library is included
2876 by putting the option "-lc_s" as the last thing on the cc command line when
2877 linking. Other systems use shared libraries by default. There may be other
2878 libraries needed to compile $package on your machine as well. If your system
2879 needs the "-lc_s" option, include it here. Include any other special libraries
2880 here as well. Say "none" for none.
2884 rp="Any additional libraries?"
2891 : see if nm is to be used to determine whether a symbol is defined or not
2894 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2895 if $test $dflt -gt 20; then
2910 I can use 'nm' to extract the symbols from your C libraries. This is a time
2911 consuming task which may generate huge output on the disk (up to 3 megabytes)
2912 but that should make the symbols extraction faster. The alternative is to skip
2913 the 'nm' extraction part and to compile a small test program instead to
2914 determine whether each symbol is present. If you have a fast C compiler and/or
2915 if your 'nm' output cannot be parsed, this may be the best solution.
2918 rp='Shall I use nm to extract C symbols from the libraries?'
2930 : nm options which may be necessary
2932 '') if $test -f /mach_boot; then
2934 elif $test -d /usr/ccs/lib; then
2936 elif $test -f /dgux; then
2945 : get list of predefined functions in a handy place
2950 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
2957 *) for thislib in $libs; do
2960 : Handle C library specially below.
2963 thislib=`echo $thislib | $sed -e 's/^-l//'`
2964 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
2966 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
2968 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
2970 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
2972 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
2974 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
2979 libnames="$libnames $try"
2981 *) libnames="$libnames $thislib" ;;
2989 set /usr/ccs/lib/libc.$so
2990 $test -r $1 || set /usr/lib/libc.$so
2991 $test -r $1 || set /usr/shlib/libc.$so
2992 $test -r $1 || set /usr/lib/libc.$so.[0-9]*
2993 $test -r $1 || set /lib/libc.$so
2994 $test -r $1 || set /lib/libsys_s.a
3001 if $test -r "$1"; then
3002 echo "Your (shared) C library seems to be in $1."
3004 elif $test -r /lib/libc && $test -r /lib/clib; then
3005 echo "Your C library seems to be in both /lib/clib and /lib/libc."
3007 libc='/lib/clib /lib/libc'
3008 if $test -r /lib/syslib; then
3009 echo "(Your math library is in /lib/syslib.)"
3010 libc="$libc /lib/syslib"
3012 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3013 echo "Your C library seems to be in $libc, as you said before."
3014 elif $test -r $incpath/usr/lib/libc.a; then
3015 libc=$incpath/usr/lib/libc.a;
3016 echo "Your C library seems to be in $libc. That's fine."
3017 elif $test -r /lib/libc.a; then
3019 echo "Your C library seems to be in $libc. You're normal."
3021 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
3023 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3024 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3025 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3027 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3029 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3032 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
3034 if $test -r "$tans"; then
3035 echo "Your C library seems to be in $tans, of all places."
3041 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3045 If the guess above is wrong (which it might be if you're using a strange
3046 compiler, or your machine supports multiple models), you can override it here.
3051 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3053 I can't seem to find your C library. I've looked in the following places:
3056 $sed 's/^/ /' libpath
3059 None of these seems to contain your C library. I need to get its name...
3064 rp='Where is your C library?'
3069 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3070 set X `cat libnames`
3073 case $# in 1) xxx=file; esac
3074 echo "Extracting names from the following $xxx for later perusal:" >&4
3076 $sed 's/^/ /' libnames >&4
3078 $echo $n "This may take a while...$c" >&4
3080 nm $nm_opt $* 2>/dev/null >libc.tmp
3082 $grep fprintf libc.tmp > libc.ptf
3083 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3084 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3085 if com="$sed -n -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
3087 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3089 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3091 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3093 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3095 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3097 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3099 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3101 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3103 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3105 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3107 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3109 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3110 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3112 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3114 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3116 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3118 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3120 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3122 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3124 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3127 nm -p $* 2>/dev/null >libc.tmp
3128 com="$sed -n -e 's/^.* [ADTS] *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
3129 eval "<libc.tmp $com >libc.list"
3130 if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3135 echo "nm didn't seem to work right. Trying ar instead..." >&4
3137 if ar t $libc > libc.tmp; then
3138 for thisname in $libnames; do
3139 ar t $thisname >>libc.tmp
3141 $sed -e 's/\.o$//' < libc.tmp > libc.list
3144 echo "ar didn't seem to work right." >&4
3145 echo "Maybe this is a Cray...trying bld instead..." >&4
3146 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
3147 for thisname in $libnames; do
3149 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
3150 ar t $thisname >>libc.tmp
3154 echo "That didn't work either. Giving up." >&4
3161 if $test -f /lib/syscalls.exp; then
3163 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3164 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3168 $rm -f libnames libpath
3170 : is a C symbol defined?
3173 -v) tf=libc.tmp; tc=""; tdc="";;
3174 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
3175 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3178 case "$reuseval-$4" in
3180 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3186 if $contains $tlook $tf >/dev/null 2>&1;
3191 echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
3192 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
3200 $define) tval=true;;
3206 : set up the script used to warn in case of inconsistency
3210 echo "*** WHOA THERE!!! ***" >&4
3211 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3212 rp=" Keep the $hint value?"
3215 y) td=$was; tu=$was;;
3219 : define an is-in-libc? function
3220 inlibc='echo " "; td=$define; tu=$undef;
3221 sym=$1; var=$2; eval "was=\$$2";
3223 case "$reuseval$was" in
3233 echo "$sym() found." >&4;
3234 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3236 echo "$sym() NOT found." >&4;
3237 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3241 $define) echo "$sym() found." >&4;;
3242 *) echo "$sym() NOT found." >&4;;
3246 : see if gconvert exists
3247 set gconvert d_gconvert
3250 case "$d_gconvert" in
3252 echo "We'll use it to convert floats into a string then." >&4
3253 d_Gconvert="gconvert((x),(n),(t),(b))"
3256 : Maybe we can emulate it with gcvt.
3262 : Test whether gcvt drops a trailing decimal point
3267 if (buf[0] != '1' || buf[1] != '\0')
3270 if (buf[0] != '0' || buf[1] != '\0')
3273 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
3278 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
3280 echo "Good, your gcvt() drops a trailing decimal point."
3281 echo "We'll use it to convert floats into a string." >&4
3282 d_Gconvert="gcvt((x),(n),(b))"
3284 echo "But your gcvt() keeps a trailing decimal point".
3288 echo "Hmm. I can't compile the gcvt test program."
3294 case "$d_Gconvert" in
3296 echo "I'll use sprintf instead to convert floats into a string." >&4
3297 d_Gconvert='sprintf((b),"%.*g",(n),(x))'
3302 : Initialize h_fcntl
3305 : Initialize h_sysfile
3308 : determine filename position in cpp output
3310 echo "Computing filename position in cpp output for #include directives..." >&4
3311 echo '#include <stdio.h>' > foo.c
3314 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3315 $grep '^[ ]*#.*stdio\.h' | \
3316 while read cline; do
3319 while $test \$# -gt 0; do
3320 if $test -r \`echo \$1 | $tr -d '"'\`; then
3325 pos=\`expr \$pos + 1\`
3337 *) pos="${fieldn}th";;
3339 echo "Your cpp writes the filename in the $pos field of the line."
3341 : locate header file
3346 if test -f $usrinc/\$wanted; then
3347 echo "$usrinc/\$wanted"
3350 awkprg='{ print \$$fieldn }'
3351 echo "#include <\$wanted>" > foo\$\$.c
3352 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3353 $grep "^[ ]*#.*\$wanted" | \
3354 while read cline; do
3355 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3357 */\$wanted) echo "\$name"; exit 0;;
3368 : access call always available on UNIX
3372 : locate the flags for 'access()'
3376 $cat >access.c <<'EOCP'
3377 #include <sys/types.h>
3382 #include <sys/file.h>
3391 : check sys/file.h first, no particular reason here
3392 if $test `./findhdr sys/file.h` && \
3393 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
3395 echo "<sys/file.h> defines the *_OK access constants." >&4
3396 elif $test `./findhdr fcntl.h` && \
3397 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
3399 echo "<fcntl.h> defines the *_OK access constants." >&4
3400 elif $test `./findhdr unistd.h` && \
3401 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
3402 echo "<unistd.h> defines the *_OK access constants." >&4
3404 echo "I can't find the four *_OK access constants--I'll use mine." >&4
3410 : see if alarm exists
3416 if test -d /afs; then
3417 echo "AFS may be running... I'll be extra cautious then..." >&4
3420 echo "AFS does not seem to be running..." >&4
3424 : determine root of directory hierarchy where package will be installed.
3427 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3435 By default, $package will be installed in $dflt/bin, manual
3436 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3437 all installation directories. Typically set to /usr/local, but you
3438 may choose /usr if you wish to install $package among your system
3439 binaries. If you wish to have binaries under /bin but manual pages
3440 under /usr/local/man, that's ok: you will be prompted separately
3441 for each of the installation directories, the prefix being only used
3442 to set the defaults.
3446 rp='Installation prefix to use?'
3454 *) oldprefix="$prefix";;
3461 : set the prefixit variable, to compute a suitable default value
3462 prefixit='case "$3" in
3464 case "$oldprefix" in
3465 "") eval "$1=\"\$$2\"";;
3472 ""|" ") eval "$1=\"\$$2\"";;
3478 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3480 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3481 /*-$oldprefix/*|\~*-$oldprefix/*)
3482 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3483 *) eval "$1=\"\$$2\"";;
3487 : determine where private executables go
3488 set dflt privlib lib/$package
3492 There are some auxiliary files for $package that need to be put into a
3493 private library directory that is accessible by everyone.
3497 rp='Pathname where the private library files will reside?'
3499 if $test "X$privlibexp" != "X$ansexp"; then
3503 privlibexp="$ansexp"
3507 Since you are running AFS, I need to distinguish the directory in which
3508 private files reside from the directory in which they are installed (and from
3509 which they are presumably copied to the former directory by occult means).
3512 case "$installprivlib" in
3513 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3514 *) dflt="$installprivlib";;
3517 rp='Where will private files be installed?'
3519 installprivlib="$ans"
3521 installprivlib="$privlibexp"
3524 : set the prefixup variable, to restore leading tilda escape
3525 prefixup='case "$prefixexp" in
3527 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3530 : determine where public architecture dependent libraries go
3531 if xxx=`./loc arch blurfl $pth`; test -f "$xxx"; then
3533 archname="${tarchname}-$osname"
3534 elif xxx=`./loc uname blurfl $pth`; test -f "$xxx" ; then
3535 if uname -m > tmparch 2>&1 ; then
3536 tarchname=`cat tmparch`
3537 archname="${tarchname}-$osname"
3549 dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
3553 *) dflt="$privlib/$archname";;
3556 *) dflt="$archlib";;
3560 $spackage contains architecture-dependent library files. If you are
3561 sharing libraries in a heterogeneous environment, you might store
3562 these files in a separate location. Otherwise, you can just include
3563 them with the rest of the public library files.
3567 rp='Where do you want to put the public architecture-dependent libraries?'
3570 archlibexp="$ansexp"
3575 Since you are running AFS, I need to distinguish the directory in which
3576 private files reside from the directory in which they are installed (and from
3577 which they are presumably copied to the former directory by occult means).
3580 case "$installarchlib" in
3581 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3582 *) dflt="$installarchlib";;
3585 rp='Where will architecture-dependent library files be installed?'
3587 installarchlib="$ans"
3589 installarchlib="$archlibexp"
3591 if $test X"$archlib" = X"$privlib"; then
3597 : function used to set $1 to $val
3598 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3600 $define$undef) . ./whoa; eval "$var=\$td";;
3601 $undef$define) . ./whoa; eval "$var=\$tu";;
3602 *) eval "$var=$val";;
3605 : Look for GNU-cc style attribute checking
3607 echo "Checking whether your compiler can handle __attribute__ ..." >&4
3608 $cat >attrib.c <<'EOCP'
3610 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
3612 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
3613 if $contains 'warning' attrib.out >/dev/null 2>&1; then
3614 echo "Your C compiler doesn't fully support __attribute__."
3617 echo "Your C compiler supports __attribute__."
3621 echo "Your C compiler doesn't seem to understand __attribute__ at all."
3628 : see if bcmp exists
3632 : see if bcopy exists
3636 : see if setpgrp exists
3637 set setpgrp d_setpgrp
3640 : see which flavor of setpgrp is in use
3641 case "$d_setpgrp" in
3647 if (getuid() == 0) {
3648 printf("(I see you are running Configure as super-user...)\n");
3651 if (-1 == setpgrp(1, 1))
3656 if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
3659 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
3661 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
3666 xxx="USG one, i.e. you use setpgrp()."
3669 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
3672 echo "Assuming your setpgrp is a $xxx" >&4
3681 : Check if we really have byacc
3683 ''|'byacc') val="$undef" ;;
3689 : see if bzero exists
3693 : check for length of integer
3697 echo "Checking to see how big your integers are..." >&4
3698 $cat >try.c <<'EOCP'
3702 printf("%d\n", sizeof(int));
3705 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
3709 echo "(I can't seem to compile the test program. Guessing...)"
3716 rp="What is the size of an integer (in bytes)?"
3721 : see if signal is declared as pointer to function returning int or void
3723 xxx=`./findhdr signal.h`
3724 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
3725 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3726 echo "You have int (*signal())() instead of void." >&4
3728 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3729 echo "You have void (*signal())() instead of int." >&4
3731 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3732 echo "You have int (*signal())() instead of void." >&4
3735 case "$d_voidsig" in
3737 echo "I can't determine whether signal handler returns void or int..." >&4
3739 rp="What type does your signal handler return?"
3746 echo "As you already told me, signal handler returns void." >&4;;
3748 echo "As you already told me, signal handler returns int." >&4;;
3753 case "$d_voidsig" in
3754 "$define") signal_t="void";;
3759 : check for ability to cast large floats to 32-bit ints.
3761 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
3762 if $test "$intsize" -eq 4; then
3768 #include <sys/types.h>
3770 $signal_t blech() { exit(3); }
3776 signal(SIGFPE, blech);
3778 f = (double) 0x7fffffff;
3782 if (i32 != ($xxx) f)
3787 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3791 echo "(I can't seem to compile the test program--assuming it can't)"
3799 echo "Nope, it can't."
3806 : check for ability to cast negative floats to unsigned
3808 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
3810 #include <sys/types.h>
3812 $signal_t blech() { exit(3); }
3816 unsigned long along;
3818 unsigned short ashort;
3821 signal(SIGFPE, blech);
3822 along = (unsigned long)f;
3823 aint = (unsigned int)f;
3824 ashort = (unsigned short)f;
3825 if (along != (unsigned long)-123)
3827 if (aint != (unsigned int)-123)
3829 if (ashort != (unsigned short)-123)
3831 f = (double)0x40000000;
3834 along = (unsigned long)f;
3835 if (along != 0x80000000)
3839 along = (unsigned long)f;
3840 if (along != 0x7fffffff)
3844 along = (unsigned long)f;
3845 if (along != 0x80000001)
3851 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3855 echo "(I can't seem to compile the test program--assuming it can't)"
3858 case "$castflags" in
3863 echo "Nope, it can't."
3870 : see if vprintf exists
3872 if set vprintf val -f d_vprintf; eval $csym; $val; then
3873 echo 'vprintf() found.' >&4
3875 $cat >vprintf.c <<'EOF'
3876 #include <varargs.h>
3878 main() { xxx("foo"); }
3887 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
3890 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
3891 echo "Your vsprintf() returns (int)." >&4
3894 echo "Your vsprintf() returns (char*)." >&4
3898 echo 'vprintf() NOT found.' >&4
3908 : see if chown exists
3912 : see if chroot exists
3916 : see if chsize exists
3920 : check for const keyword
3922 echo 'Checking to see if your C compiler knows about "const"...' >&4
3923 $cat >const.c <<'EOCP'
3924 typedef struct spug { int drokk; } spug;
3931 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
3933 echo "Yup, it does."
3936 echo "Nope, it doesn't."
3941 : see if crypt exists
3943 if set crypt val -f d_crypt; eval $csym; $val; then
3944 echo 'crypt() found.' >&4
3948 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
3949 if $test -z "$cryptlib"; then
3950 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
3954 if $test -z "$cryptlib"; then
3955 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
3959 if $test -z "$cryptlib"; then
3960 cryptlib=`./loc libcrypt.a "" $libpth`
3964 if $test -z "$cryptlib"; then
3965 echo 'crypt() NOT found.' >&4
3974 : get csh whereabouts
3976 'csh') val="$undef" ;;
3983 : see if cuserid exists
3984 set cuserid d_cuserid
3987 : define an alternate in-header-list? function
3988 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
3989 cont=true; xxf="echo \"<\$1> found.\" >&4";
3990 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
3991 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
3993 case $# in 4) instead=instead;; *) instead="at last";; esac;
3994 while $test "$cont"; do
3996 var=$2; eval "was=\$$2";
3997 if $test "$xxx" && $test -r "$xxx";
3999 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4002 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4003 set $yyy; shift; shift; yyy=$@;
4004 case $# in 0) cont="";;
4005 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4006 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4007 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4008 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4012 do set $yyy; var=$2; eval "was=\$$2";
4013 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4014 set $yyy; shift; shift; yyy=$@;
4017 : see if this is a limits.h system
4018 set limits.h i_limits
4021 : see if this is a float.h system
4025 : See if number of significant digits in a double precision number is known
4027 $cat >dbl_dig.c <<EOM
4037 printf("Contains DBL_DIG");
4040 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
4041 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
4042 echo "DBL_DIG found." >&4
4045 echo "DBL_DIG NOT found." >&4
4052 : see if difftime exists
4053 set difftime d_difftime
4056 : see if this is a dirent system
4058 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
4060 echo "<dirent.h> found." >&4
4063 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
4064 echo "<sys/dir.h> found." >&4
4067 xinc=`./findhdr sys/ndir.h`
4069 echo "<dirent.h> NOT found." >&4
4074 : Look for type of directory structure.
4076 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4078 case "$direntrytype" in
4081 $define) guess1='struct dirent' ;;
4082 *) guess1='struct direct' ;;
4085 *) guess1="$direntrytype"
4090 'struct dirent') guess2='struct direct' ;;
4091 *) guess2='struct dirent' ;;
4094 if $contains "$guess1" try.c >/dev/null 2>&1; then
4095 direntrytype="$guess1"
4096 echo "Your directory entries are $direntrytype." >&4
4097 elif $contains "$guess2" try.c >/dev/null 2>&1; then
4098 direntrytype="$guess2"
4099 echo "Your directory entries seem to be $direntrytype." >&4
4101 echo "I don't recognize your system's directory entries." >&4
4102 rp="What type is used for directory entries on this system?"
4110 : see if the directory entry stores field length
4112 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4113 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
4114 echo "Good, your directory entry keeps length information in d_namlen." >&4
4117 echo "Your directory entry does not know about the d_namlen field." >&4
4124 : see if dlerror exists
4125 set dlerror d_dlerror
4128 : see if dld is available
4132 : see if dlopen exists
4136 : determine which dynamic loading, if any, to compile in
4138 dldir="ext/DynaLoader"
4151 $define) dflt='y' ;;
4154 $define) dflt='y' ;;
4156 : Does a dl_xxx.xs file exist for this operating system
4157 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4160 rp="Do you wish to use dynamic loading?"
4167 if $test -f ../$dldir/dl_${osname}.xs ; then
4168 dflt="$dldir/dl_${osname}.xs"
4169 elif $test "$d_dlopen" = "$define" ; then
4170 dflt="$dldir/dl_dlopen.xs"
4171 elif $test "$i_dld" = "$define" ; then
4172 dflt="$dldir/dl_dld.xs"
4177 *) dflt="$dldir/$dlsrc"
4180 echo "The following dynamic loading files are available:"
4181 : Can not go over to $dldir because getfile has path hard-coded in.
4182 cd ..; ls -C $dldir/dl*.xs; cd UU
4183 rp="Source file to use for dynamic loading"
4188 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4191 Some systems may require passing special flags to $cc -c to
4192 compile modules that will be used to create a shared library.
4193 To use no flags, say "none".
4196 case "$cccdlflags" in
4197 ''|' ') case "$cc" in
4198 *gcc*) dflt='-fpic' ;;
4199 *) case "$osname" in
4201 next) dflt='none' ;;
4202 solaris) dflt='-K pic' ;;
4203 sunos) dflt='-pic' ;;
4204 svr4*|esix*) dflt='-Kpic' ;;
4208 *) dflt="$cccdlflags" ;;
4210 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4213 none) cccdlflags='' ;;
4214 *) cccdlflags="$ans" ;;
4219 Some systems may require passing special flags to ld to create a
4220 library that can be dynamically loaded. If your ld flags include
4221 -L/other/path options to locate libraries outside your loader's normal
4222 search path, you may need to specify those -L options here as well. To
4223 use no flags, say "none".
4226 case "$lddlflags" in
4227 ''|' ') case "$osname" in
4229 next) dflt='none' ;;
4230 solaris) dflt='-G' ;;
4231 sunos) dflt='-assert nodefinitions' ;;
4232 svr4*|esix*) dflt="-G $ldflags" ;;
4236 *) dflt="$lddlflags" ;;
4238 rp="Any special flags to pass to ld to create a dynamically loaded library?"
4241 none) lddlflags='' ;;
4242 *) lddlflags="$ans" ;;
4247 Some systems may require passing special flags to $cc to indicate that
4248 the resulting executable will use dynamic linking. To use no flags,
4252 case "$ccdlflags" in
4253 ''|' ') case "$osname" in
4254 hpux) dflt='none' ;;
4255 next) dflt='none' ;;
4256 sunos) dflt='none' ;;
4259 *) dflt="$ccdlflags" ;;
4261 rp="Any special flags to pass to $cc to use dynamic loading?"
4264 none) ccdlflags='' ;;
4265 *) ccdlflags="$ans" ;;
4282 System V Release 4 systems can support dynamic loading
4283 only if libperl is created as a shared library.
4290 set d_shrplib; eval $setvar
4291 case "$d_shrplib" in
4295 Be sure to add the perl source directory to the LD_LIBRARY_PATH
4296 environment variable before running make:
4297 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
4299 setenv LD_LIBRARY_PATH `cd ..;pwd`
4304 case "$d_shrplib" in
4307 "") dflt="$archlib/CORE";;
4308 *) dflt="$shrpdir";;
4310 rp="What directory should we install the shared libperl into?"
4319 : see if dlfcn is available
4327 On a few systems, the dynamically loaded modules that perl generates and uses
4328 will need a different extension then shared libs. The default will probably
4336 rp='What is the extension of dynamically loaded modules'
4345 : Check if dlsym need a leading underscore
4351 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
4352 $cat >dyna.c <<'EOM'
4361 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
4363 #include <sys/types.h>
4377 int mode = RTLD_LAZY ;
4379 handle = dlopen("./dyna.$dlext", mode) ;
4380 if (handle == NULL) {
4384 symbol = dlsym(handle, "fred") ;
4385 if (symbol == NULL) {
4386 /* try putting a leading underscore */
4387 symbol = dlsym(handle, "_fred") ;
4388 if (symbol == NULL) {
4399 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
4400 ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
4401 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
4404 1) echo "Test program failed using dlopen." >&4
4405 echo "Perhaps you should not use dynamic loading." >&4;;
4406 2) echo "Test program failed using dlsym." >&4
4407 echo "Perhaps you should not use dynamic loading." >&4;;
4408 3) echo "dlsym needs a leading underscore" >&4
4410 4) echo "dlsym doesn't need a leading underscore." >&4;;
4413 echo "I can't compile and run the test program." >&4
4418 $rm -f fred fred.? dyna.$dlext dyna.?
4423 : see if setuid scripts can be secure
4426 Some kernels have a bug that prevents setuid #! scripts from being
4427 secure. Some sites have disabled setuid #! scripts because of this.
4429 First let's decide if your kernel supports secure setuid #! scripts.
4430 (If setuid #! scripts would be secure but have been disabled anyway,
4431 don't say that they are secure if asked.)
4436 if $test -d /dev/fd; then
4437 echo "#!$ls" >reflect
4438 chmod +x,u+s reflect
4439 ./reflect >flect 2>&1
4440 if $contains "/dev/fd" flect >/dev/null; then
4441 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4445 If you are not sure if they are secure, I can check but I'll need a
4446 username and password different from the one you are using right now.
4447 If you don't have such a username or don't want me to test, simply
4451 rp='Other username to test security of setuid scripts with?'
4456 case "$d_suidsafe" in
4457 '') echo "I'll assume setuid scripts are *not* secure." >&4
4460 echo "Well, the $hint value is *not* secure." >&4
4462 *) echo "Well, the $hint value *is* secure." >&4
4467 $rm -f reflect flect
4468 echo "#!$ls" >reflect
4469 chmod +x,u+s reflect
4472 echo '"su" will (probably) prompt you for '"$ans's password."
4473 su $ans -c './reflect >flect'
4474 if $contains "/dev/fd" flect >/dev/null; then
4475 echo "Okay, it looks like setuid scripts are secure." >&4
4478 echo "I don't think setuid scripts are secure." >&4
4483 rp='Does your kernel have *secure* setuid scripts?'
4486 [yY]*) val="$define";;
4491 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4497 $rm -f reflect flect
4499 : now see if they want to do setuid emulation
4502 case "$d_suidsafe" in
4505 echo "No need to emulate SUID scripts since they are secure here." >& 4
4509 Some systems have disabled setuid scripts, especially systems where
4510 setuid scripts cannot be secure. On systems where setuid scripts have
4511 been disabled, the setuid/setgid bits on scripts are currently
4512 useless. It is possible for $package to detect those bits and emulate
4513 setuid/setgid in a secure fashion. This emulation will only work if
4514 setuid scripts have been disabled in your kernel.
4518 "$define") dflt=y ;;
4521 rp="Do you want to do setuid/setgid emulation?"
4524 [yY]*) val="$define";;
4532 : see if drem exists
4536 : see if dup2 exists
4540 : see if fchmod exists
4544 : see if fchown exists
4548 : see if this is an fcntl system
4552 : see if fgetpos exists
4553 set fgetpos d_fgetpos
4556 : see if we can have long filenames
4558 rmlist="$rmlist /tmp/cf$$"
4559 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
4560 first=123456789abcdef
4561 second=/tmp/cf$$/$first
4562 $rm -f $first $second
4563 if (echo hi >$first) 2>/dev/null; then
4564 if $test -f 123456789abcde; then
4565 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
4568 if (echo hi >$second) 2>/dev/null; then
4569 if $test -f /tmp/cf$$/123456789abcde; then
4571 That's peculiar... You can have filenames longer than 14 characters, but only
4572 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
4573 I shall consider your system cannot support long filenames at all.
4577 echo 'You can have filenames longer than 14 characters.' >&4
4582 How confusing! Some of your filesystems are sane enough to allow filenames
4583 longer than 14 characters but some others like /tmp can't even think about them.
4584 So, for now on, I shall assume your kernel does not allow them at all.
4591 You can't have filenames longer than 14 chars. You can't even think about them!
4597 $rm -rf /tmp/cf$$ 123456789abcde*
4599 : see if flock exists
4603 : see if fmod exists
4607 : see if fork exists
4611 : see if pathconf exists
4612 set pathconf d_pathconf
4615 : see if fpathconf exists
4616 set fpathconf d_fpathconf
4619 : see if fsetpos exists
4620 set fsetpos d_fsetpos
4623 : see if gethostent exists
4624 set gethostent d_gethent
4627 : see if getlogin exists
4628 set getlogin d_getlogin
4631 : see if getpgrp exists
4632 set getpgrp d_getpgrp
4635 : see if getpgrp2 exists
4636 set getpgrp2 d_getpgrp2
4639 : see if getppid exists
4640 set getppid d_getppid
4643 : see if getpriority exists
4644 set getpriority d_getprior
4647 : see if this is a netinet/in.h or sys/in.h system
4648 set netinet/in.h i_niin sys/in.h i_sysin
4651 : see if htonl --and friends-- exists
4656 : Maybe they are macros.
4661 #include <sys/types.h>
4662 #$i_niin I_NETINET_IN
4665 #include <netinet/in.h>
4671 printf("Defined as a macro.");
4674 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
4675 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
4677 echo "But it seems to be defined as a macro." >&4
4685 : see which of string.h or strings.h is needed
4687 strings=`./findhdr string.h`
4688 if $test "$strings" && $test -r "$strings"; then
4689 echo "Using <string.h> instead of <strings.h>." >&4
4693 strings=`./findhdr strings.h`
4694 if $test "$strings" && $test -r "$strings"; then
4695 echo "Using <strings.h> instead of <string.h>." >&4
4697 echo "No string header found -- You'll surely have problems." >&4
4703 "$undef") strings=`./findhdr strings.h`;;
4704 *) strings=`./findhdr string.h`;;
4709 if set index val -f; eval $csym; $val; then
4710 if set strchr val -f d_strchr; eval $csym; $val; then
4711 if $contains strchr "$strings" >/dev/null 2>&1 ; then
4714 echo "strchr() found." >&4
4718 echo "index() found." >&4
4723 echo "index() found." >&4
4726 if set strchr val -f d_strchr; eval $csym; $val; then
4729 echo "strchr() found." >&4
4731 echo "No index() or strchr() found!" >&4
4736 set d_strchr; eval $setvar
4738 set d_index; eval $setvar
4742 $cat >isascii.c <<'EOCP'
4753 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
4754 echo "isascii() found." >&4
4757 echo "isascii() NOT found." >&4
4764 : see if killpg exists
4768 : see if link exists
4772 : see if stdio is really std
4774 xxx=`./findhdr stdio.h`
4775 if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
4776 if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
4777 echo "Your stdio is pretty std." >&4
4780 echo "Your stdio isn't very std." >&4
4784 echo "Your stdio isn't very std." >&4
4790 : see if stdio is like that in linux
4791 case "$d_stdstdio" in
4794 xxx=`./findhdr stdio.h`
4795 $cppstdin $cppflags $cppminus < "$xxx" > stdio.E
4796 if $contains 'char.*_IO_read_base' stdio.E >/dev/null 2>&1 && \
4797 $contains '_IO_read_ptr' stdio.E >/dev/null 2>&1 && \
4798 $contains '_IO_read_end' stdio.E >/dev/null 2>&1 ; then
4799 echo "Your stdio looks like linux." >&4
4802 echo "You don't have linux stdio, either." >&4
4813 : see if localeconv exists
4814 set localeconv d_locconv
4817 : see if lockf exists
4821 : see if lstat exists
4825 : see if mblen exists
4829 : see if mbstowcs exists
4830 set mbstowcs d_mbstowcs
4833 : see if mbtowc exists
4837 : see if memcmp exists
4841 : see if memcpy exists
4845 : see if memmove exists
4846 set memmove d_memmove
4849 : see if memset exists
4853 : see if mkdir exists
4857 : see if mkfifo exists
4861 : see if mktime exists
4865 : see if msgctl exists
4869 : see if msgget exists
4873 : see if msgsnd exists
4877 : see if msgrcv exists
4881 : see how much of the 'msg*(2)' library is present.
4884 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
4885 *"$undef"*) h_msg=false;;
4887 : we could also check for sys/ipc.h ...
4888 if $h_msg && $test `./findhdr sys/msg.h`; then
4889 echo "You have the full msg*(2) library." >&4
4892 echo "You don't have the full msg*(2) library." >&4
4898 : see if this is a malloc.h system
4899 set malloc.h i_malloc
4902 : determine which malloc to compile in
4904 case "$usemymalloc" in
4905 ''|y*|true) dflt='y' ;;
4906 n*|false) dflt='n' ;;
4907 *) dflt="$usemymalloc" ;;
4909 rp="Do you wish to attempt to use the malloc that comes with $package?"
4915 mallocsrc='malloc.c'
4916 mallocobj='malloc.o'
4917 d_mymalloc="$define"
4920 : Remove malloc from list of libraries to use
4921 echo "Removing unneeded -lmalloc from library list" >&4
4922 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4925 echo "libs = $libs" >&4
4937 : compute the type returned by malloc
4939 case "$malloctype" in
4941 $cat >malloc.c <<END
4944 #include <sys/types.h>
4950 if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
4958 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4960 : see if nice exists
4964 : Locate the flags for 'open()'
4966 $cat >open3.c <<'EOCP'
4967 #include <sys/types.h>
4972 #include <sys/file.h>
4983 : check sys/file.h first to get FREAD on Sun
4984 if $test `./findhdr sys/file.h` && \
4985 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
4987 echo "<sys/file.h> defines the O_* constants..." >&4
4989 echo "and you have the 3 argument form of open()." >&4
4992 echo "but not the 3 argument form of open(). Oh, well." >&4
4995 elif $test `./findhdr fcntl.h` && \
4996 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
4998 echo "<fcntl.h> defines the O_* constants..." >&4
5000 echo "and you have the 3 argument form of open()." >&4
5003 echo "but not the 3 argument form of open(). Oh, well." >&4
5008 echo "I can't find the O_* constant definitions! You got problems." >&4
5014 : see if pause exists
5018 : see if pipe exists
5022 : see if this is a pwd system
5024 xxx=`./findhdr pwd.h`
5025 if $test "$xxx"; then
5027 echo "<pwd.h> found." >&4
5028 $cppstdin $cppflags $cppminus < $xxx >$$.h
5029 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
5034 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
5039 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
5040 d_pwchange="$define"
5044 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
5049 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
5050 d_pwexpire="$define"
5054 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
5055 d_pwcomment="$define"
5057 d_pwcomment="$undef"
5067 d_pwcomment="$undef"
5068 echo "<pwd.h> NOT found." >&4
5071 : see if readdir and friends exist
5072 set readdir d_readdir
5074 set seekdir d_seekdir
5076 set telldir d_telldir
5078 set rewinddir d_rewinddir
5081 : see if readlink exists
5082 set readlink d_readlink
5085 : see if rename exists
5089 : see if rmdir exists
5093 : can bcopy handle overlapping blocks?
5098 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
5099 $cat >foo.c <<'EOCP'
5102 char buf[128], abc[128];
5108 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
5110 for (align = 7; align >= 0; align--) {
5111 for (len = 36; len; len--) {
5114 for (off = 1; off <= len; off++) {
5115 bcopy(b, b+off, len);
5116 bcopy(b+off, b, len);
5117 if (bcmp(b, abc, len))
5125 if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5126 if ./safebcpy 2>/dev/null; then
5130 echo "It can't, sorry."
5133 echo "(I can't compile the test program, so we'll assume not...)"
5137 $rm -f foo.* safebcpy core
5141 : can memcpy handle overlapping blocks?
5146 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
5147 $cat >foo.c <<'EOCP'
5150 char buf[128], abc[128];
5156 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
5158 for (align = 7; align >= 0; align--) {
5159 for (len = 36; len; len--) {
5161 memcpy(abc, b, len);
5162 for (off = 1; off <= len; off++) {
5163 memcpy(b, b+off, len);
5164 memcpy(b+off, b, len);
5165 if (memcmp(b, abc, len))
5173 if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5174 if ./safemcpy 2>/dev/null; then
5178 echo "It can't, sorry."
5181 echo "(I can't compile the test program, so we'll assume not...)"
5185 $rm -f foo.* safemcpy core
5189 : see if select exists
5193 : see if semctl exists
5197 : see if semget exists
5201 : see if semop exists
5205 : see how much of the 'sem*(2)' library is present.
5208 case "$d_semctl$d_semget$d_semop" in
5209 *"$undef"*) h_sem=false;;
5211 : we could also check for sys/ipc.h ...
5212 if $h_sem && $test `./findhdr sys/sem.h`; then
5213 echo "You have the full sem*(2) library." >&4
5216 echo "You don't have the full sem*(2) library." >&4
5222 : see if setegid exists
5223 set setegid d_setegid
5226 : see if seteuid exists
5227 set seteuid d_seteuid
5230 : see if setlinebuf exists
5231 set setlinebuf d_setlinebuf
5234 : see if setlocale exists
5235 set setlocale d_setlocale
5238 : see if setpgid exists
5239 set setpgid d_setpgid
5242 : see if setpgrp2 exists
5243 set setpgrp2 d_setpgrp2
5246 : see if setpriority exists
5247 set setpriority d_setprior
5250 : see if setregid exists
5251 set setregid d_setregid
5253 set setresgid d_setresgid
5256 : see if setreuid exists
5257 set setreuid d_setreuid
5259 set setresuid d_setresuid
5262 : see if setrgid exists
5263 set setrgid d_setrgid
5266 : see if setruid exists
5267 set setruid d_setruid
5270 : see if setsid exists
5274 : see if shmctl exists
5278 : see if shmget exists
5282 : see if shmat exists
5285 : see what shmat returns
5288 $cat >shmat.c <<'END'
5289 #include <sys/shm.h>
5292 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
5297 echo "and it returns ($shmattype)." >&4
5298 : see if a prototype for shmat is available
5299 $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h > shmat.c 2>/dev/null
5300 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
5311 set d_shmatprototype
5314 : see if shmdt exists
5318 : see how much of the 'shm*(2)' library is present.
5321 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
5322 *"$undef"*) h_shm=false;;
5324 : we could also check for sys/ipc.h ...
5325 if $h_shm && $test `./findhdr sys/shm.h`; then
5326 echo "You have the full shm*(2) library." >&4
5329 echo "You don't have the full shm*(2) library." >&4
5337 : see whether socket exists
5339 $echo $n "Hmm... $c" >&4
5340 if set socket val -f d_socket; eval $csym; $val; then
5341 echo "Looks like you have Berkeley networking support." >&4
5343 if set setsockopt val -f; eval $csym; $val; then
5346 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
5350 if $contains socklib libc.list >/dev/null 2>&1; then
5351 echo "Looks like you have Berkeley networking support." >&4
5353 : we will have to assume that it supports the 4.2 BSD interface
5356 echo "You don't have Berkeley networking in libc.a..." >&4
5357 if test -f /usr/lib/libnet.a; then
5358 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
5359 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
5360 if $contains socket libc.list >/dev/null 2>&1; then
5361 echo "...but the Wollongong group seems to have hacked it in." >&4
5363 sockethdr="-I/usr/netinclude"
5365 if $contains setsockopt libc.list >/dev/null 2>&1; then
5368 echo "...using the old 4.1c interface, rather than 4.2" >&4
5372 echo "or even in libnet.a, which is peculiar." >&4
5377 echo "or anywhere else I see." >&4
5384 : see if socketpair exists
5385 set socketpair d_sockpair
5388 : see if stat knows about block sizes
5390 xxx=`./findhdr sys/stat.h`
5391 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
5392 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
5393 echo "Your stat() knows about block sizes." >&4
5396 echo "Your stat() doesn't know about block sizes." >&4
5400 echo "Your stat() doesn't know about block sizes." >&4
5406 : see if strcoll exists
5407 set strcoll d_strcoll
5410 : check for structure copying
5412 echo "Checking to see if your C compiler can copy structs..." >&4
5413 $cat >try.c <<'EOCP'
5423 if $cc -c try.c >/dev/null 2>&1 ; then
5428 echo "Nope, it can't."
5434 : see if strerror and/or sys_errlist[] exist
5436 if set strerror val -f d_strerror; eval $csym; $val; then
5437 echo 'strerror() found.' >&4
5438 d_strerror="$define"
5439 d_strerrm='strerror(e)'
5440 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5441 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
5442 d_syserrlst="$define"
5444 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
5445 d_syserrlst="$undef"
5447 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
5448 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
5449 echo 'strerror() found in string header.' >&4
5450 d_strerror="$define"
5451 d_strerrm='strerror(e)'
5452 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5453 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
5454 d_syserrlst="$define"
5456 echo "(You don't appear to have any sys_errlist[], how can this be?)"
5457 d_syserrlst="$undef"
5459 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5460 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
5462 d_syserrlst="$define"
5463 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
5465 echo 'strerror() and sys_errlist[] NOT found.' >&4
5467 d_syserrlst="$undef"
5468 d_strerrm='"unknown"'
5471 : see if strxfrm exists
5472 set strxfrm d_strxfrm
5475 : see if symlink exists
5476 set symlink d_symlink
5479 : see if syscall exists
5480 set syscall d_syscall
5483 : see if sysconf exists
5484 set sysconf d_sysconf
5487 : see if system exists
5491 : see if tcgetpgrp exists
5492 set tcgetpgrp d_tcgetpgrp
5495 : see if tcsetpgrp exists
5496 set tcsetpgrp d_tcsetpgrp
5499 : define an is-a-typedef? function
5500 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
5502 "") inclist="sys/types.h";;
5504 eval "varval=\$$var";
5508 for inc in $inclist; do
5509 echo "#include <$inc>" >>temp.c;
5511 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
5512 if $contains $type temp.E >/dev/null 2>&1; then
5518 *) eval "$var=$varval";;
5521 : see if this is a sys/times.h system
5522 set sys/times.h i_systimes
5525 : see if times exists
5527 if set times val -f d_times; eval $csym; $val; then
5528 echo 'times() found.' >&4
5531 case "$i_systimes" in
5532 "$define") inc='sys/times.h';;
5534 set clock_t clocktype long stdio.h sys/types.h $inc
5538 rp="What type is returned by times() on this sytem?"
5542 echo 'times() NOT found, hope that will do.' >&4
5547 : see if truncate exists
5548 set truncate d_truncate
5551 : see if tzname[] exists
5553 if set tzname val -a d_tzname; eval $csym; $val; then
5555 echo 'tzname[] found.' >&4
5558 echo 'tzname[] NOT found.' >&4
5563 : see if umask exists
5567 : see if we have to deal with yellow pages, now NIS.
5568 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5569 if $test -f /usr/etc/nibindd; then
5571 echo "I'm fairly confident you're on a NeXT."
5573 rp='Do you get the hosts file via NetInfo?'
5582 y*) hostcat='nidump hosts .';;
5583 *) hostcat='cat /etc/hosts';;
5591 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5599 rp='Are you getting the hosts file via yellow pages?'
5602 y*) hostcat='ypcat hosts';;
5603 *) hostcat='cat /etc/hosts';;
5609 : now get the host name
5611 echo "Figuring out host name..." >&4
5612 case "$myhostname" in
5614 echo 'Maybe "hostname" will work...'
5615 if tans=`sh -c hostname 2>&1` ; then
5623 if $test "$cont"; then
5625 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5626 if tans=`cat /etc/systemid 2>&1` ; then
5628 phostname='cat /etc/systemid'
5629 echo "Whadyaknow. Xenix always was a bit strange..."
5632 elif $test -r /etc/systemid; then
5633 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5636 if $test "$cont"; then
5637 echo 'No, maybe "uuname -l" will work...'
5638 if tans=`sh -c 'uuname -l' 2>&1` ; then
5640 phostname='uuname -l'
5642 echo 'Strange. Maybe "uname -n" will work...'
5643 if tans=`sh -c 'uname -n' 2>&1` ; then
5645 phostname='uname -n'
5647 echo 'Oh well, maybe I can mine it out of whoami.h...'
5648 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5649 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5650 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5652 case "$myhostname" in
5653 '') echo "Does this machine have an identity crisis or something?"
5656 echo "Well, you said $myhostname before..."
5657 phostname='echo $myhostname';;
5663 : you do not want to know about this
5668 if $test "$myhostname" ; then
5670 rp='Your host name appears to be "'$myhostname'".'" Right?"
5678 : bad guess or no guess
5679 while $test "X$myhostname" = X ; do
5681 rp="Please type the (one word) name of your host:"
5686 : translate upper to lower if necessary
5687 case "$myhostname" in
5689 echo "(Normalizing case in your host name)"
5690 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5694 : a little sanity check here
5695 case "$phostname" in
5698 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5699 $myhostname$mydomain|$myhostname) ;;
5701 case "$phostname" in
5703 echo "(That doesn't agree with your whoami.h file, by the way.)"
5706 echo "(That doesn't agree with your $phostname command, by the way.)"
5714 : see how we will look up host name
5717 : dummy stub to allow use of elif
5718 elif set uname val -f d_uname; eval $csym; $val; then
5721 uname() was found, but you're running xenix, and older versions of xenix
5722 have a broken uname(). If you don't really know whether your xenix is old
5723 enough to have a broken system call, use the default answer.
5730 rp='Is your uname() broken?'
5733 n*) d_uname="$define"; call=uname;;
5736 echo 'uname() found.' >&4
5741 case "$d_gethname" in
5742 '') d_gethname="$undef";;
5745 '') d_uname="$undef";;
5747 case "$d_phostname" in
5748 '') d_phostname="$undef";;
5751 : backward compatibility for d_hvfork
5752 if test X$d_hvfork != X; then
5756 : see if there is a vfork
5761 : Ok, but do we want to use it. vfork is reportedly unreliable in
5762 : perl on Solaris 2.x, and probably elsewhere.
5770 rp="Some systems have problems with vfork(). Do you want to use it?"
5775 echo "Ok, we won't use vfork()."
5784 $define) usevfork='true';;
5785 *) usevfork='false';;
5788 : see if this is an sysdir system
5789 set sys/dir.h i_sysdir
5792 : see if this is an sysndir system
5793 set sys/ndir.h i_sysndir
5796 : see if closedir exists
5797 set closedir d_closedir
5800 case "$d_closedir" in
5803 echo "Checking whether closedir() returns a status..." >&4
5804 cat > closedir.c <<EOM
5805 #$i_dirent I_DIRENT /**/
5806 #$i_sysdir I_SYS_DIR /**/
5807 #$i_sysndir I_SYS_NDIR /**/
5809 #if defined(I_DIRENT)
5811 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
5812 #include <sys/dir.h>
5816 #include <sys/ndir.h>
5820 #include <ndir.h> /* may be wrong in the future */
5822 #include <sys/dir.h>
5827 int main() { return closedir(opendir(".")); }
5829 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
5830 if ./closedir > /dev/null 2>&1 ; then
5831 echo "Yes, it does."
5834 echo "No, it doesn't."
5838 echo "(I can't seem to compile the test program--assuming it doesn't)"
5849 : check for volatile keyword
5851 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
5852 $cat >try.c <<'EOCP'
5855 typedef struct _goo_struct goo_struct;
5856 goo_struct * volatile goo = ((goo_struct *)0);
5857 struct _goo_struct {
5862 typedef unsigned short foo_t;
5865 volatile foo_t blech;
5869 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
5871 echo "Yup, it does."
5874 echo "Nope, it doesn't."
5880 : see if there is a wait4
5884 : see if waitpid exists
5885 set waitpid d_waitpid
5888 : see if wcstombs exists
5889 set wcstombs d_wcstombs
5892 : see if wctomb exists
5896 : preserve RCS keywords in files with variable substitution, grrr
5901 Revision='$Revision'
5903 : check for alignment requirements
5905 case "$alignbytes" in
5906 '') echo "Checking alignment constraints..." >&4
5907 $cat >try.c <<'EOCP'
5914 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
5917 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
5921 echo"(I can't seem to compile the test program...)"
5924 *) dflt="$alignbytes"
5927 rp="Doubles must be aligned on a how-many-byte boundary?"
5932 : determine where public executables go
5937 rp='Pathname where the public executables will reside?'
5939 if $test "X$ansexp" != "X$binexp"; then
5947 Since you are running AFS, I need to distinguish the directory in which
5948 executables reside from the directory in which they are installed (and from
5949 which they are presumably copied to the former directory by occult means).
5952 case "$installbin" in
5953 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
5954 *) dflt="$installbin";;
5957 rp='Where will public executables be installed?'
5961 installbin="$binexp"
5964 : check for ordering of bytes in a long
5965 case "$byteorder" in
5969 In the following, larger digits indicate more significance. A big-endian
5970 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
5971 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
5972 machines may have weird orders like 3412. A Cray will report 87654321. If
5973 the test program works the default is probably right.
5974 I'm now running the test program...
5976 $cat >try.c <<'EOCP'
5983 char c[sizeof(long)];
5986 if (sizeof(long) > 4)
5987 u.l = (0x08070605L << 32) | 0x04030201L;
5990 for (i = 0; i < sizeof(long); i++)
5991 printf("%c", u.c[i]+'0');
5995 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
5998 ????|????????) echo "(The test program ran ok.)";;
5999 *) echo "(The test program didn't run right for some reason.)";;
6004 (I can't seem to compile the test program. Guessing big-endian...)
6013 rp="What is the order of bytes in a long?"
6018 : how do we catenate cpp tokens here?
6020 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
6021 $cat >cpp_stuff.c <<'EOCP'
6022 #define RCAT(a,b)a/**/b
6023 #define ACAT(a,b)a ## b
6027 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
6028 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
6029 echo "Oh! Smells like ANSI's been here."
6030 echo "We can catify or stringify, separately or together!"
6032 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
6033 echo "Ah, yes! The good old days!"
6034 echo "However, in the good old days we don't know how to stringify and"
6035 echo "catify at the same time."
6039 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
6040 to have to edit the values of CAT[2-5] in config.h...
6042 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
6046 : see if this is a db.h system
6052 : Check the return type needed for hash
6053 echo "Checking return type needed for hash for Berkeley DB ..." >&4
6055 #include <sys/types.h>
6066 info.hash = hash_cb ;
6069 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6070 if $contains warning try.out >>/dev/null 2>&1 ; then
6073 db_hashtype='u_int32_t'
6076 echo "I can't seem to compile the test program." >&4
6080 echo "Your version of Berkeley DB uses $db_hashtype for hash."
6088 : Check the return type needed for prefix
6089 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
6091 #include <sys/types.h>
6094 prefix_cb (key1, key2)
6102 info.prefix = prefix_cb ;
6105 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6106 if $contains warning try.out >>/dev/null 2>&1 ; then
6109 db_prefixtype='size_t'
6112 echo "I can't seem to compile the test program." >&4
6116 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
6118 *) db_prefixtype='int'
6122 : check for void type
6124 echo "Checking to see how well your C compiler groks the void type..." >&4
6127 Support flag bits are:
6128 1: basic void declarations.
6129 2: arrays of pointers to functions returning void.
6130 4: operations between pointers to and addresses of void functions.
6131 8: generic void pointers.
6134 case "$voidflags" in
6136 $cat >try.c <<'EOCP'
6142 extern void moo(); /* function returning void */
6143 void (*goo)(); /* ptr to func returning void */
6145 void *hue; /* generic ptr */
6159 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6160 voidflags=$defvoidused
6161 echo "It appears to support void to the level $package wants ($defvoidused)."
6162 if $contains warning .out >/dev/null 2>&1; then
6163 echo "However, you might get some warnings that look like this:"
6167 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6168 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
6169 echo "It supports 1..."
6170 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
6171 echo "It also supports 2..."
6172 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
6174 echo "And it supports 4 but not 8 definitely."
6176 echo "It doesn't support 4..."
6177 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
6179 echo "But it supports 8."
6182 echo "Neither does it support 8."
6186 echo "It does not support 2..."
6187 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
6189 echo "But it supports 4 and 8."
6191 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
6193 echo "And it supports 4 but has not heard about 8."
6195 echo "However it supports 8 but not 4."
6200 echo "There is no support at all for void."
6206 rp="Your void support flags add up to what?"
6211 : see if dbm.h is available
6216 : see if dbmclose exists
6217 set dbmclose d_dbmclose
6219 case "$d_dbmclose" in
6222 echo "We won't be including <dbm.h>"
6231 : see if ndbm.h is available
6236 : see if dbm_open exists
6237 set dbm_open d_dbm_open
6239 case "$d_dbm_open" in
6242 echo "We won't be including <ndbm.h>"
6251 : see if gdbm.h is available
6256 : see if gdbm_open exists
6257 set gdbm_open d_gdbm_open
6259 case "$d_gdbm_open" in
6262 echo "We won't be including <gdbm.h>"
6272 echo "Looking for extensions..." >&4
6276 if $test -f $xxx/$xxx.xs; then
6277 known_extensions="$known_extensions $xxx"
6280 set X $known_extensions
6282 known_extensions="$*"
6285 : Now see which are supported on this system.
6287 for xxx in $known_extensions ; do
6289 DB_File) case "$i_db" in
6290 $define) avail_ext="$avail_ext $xxx" ;;
6293 GDBM_File) case "$i_gdbm" in
6294 $define) avail_ext="$avail_ext $xxx" ;;
6297 NDBM_File) case "$i_ndbm" in
6298 $define) avail_ext="$avail_ext $xxx" ;;
6301 ODBM_File) case "$i_dbm" in
6302 $define) avail_ext="$avail_ext $xxx" ;;
6305 POSIX) case "$useposix" in
6306 true|define|y) avail_ext="$avail_ext $xxx" ;;
6309 Socket) case "$d_socket" in
6310 $define) avail_ext="$avail_ext $xxx" ;;
6313 *) avail_ext="$avail_ext $xxx"
6325 A number of extensions are supplied with $package. You may choose to
6326 compile these extensions for dynamic loading (the default), compile
6327 them into the $package executable (static loading), or not include
6328 them at all. Answer "none" to include no extensions.
6331 case "$dynamic_ext" in
6332 ''|' ') dflt="$avail_ext" ;;
6333 *) dflt="$dynamic_ext" ;;
6338 rp="What extensions do you wish to load dynamically?"
6341 none) dynamic_ext='' ;;
6342 *) dynamic_ext="$ans" ;;
6345 case "$static_ext" in
6347 : Exclude those already listed in dynamic linking
6349 for xxx in $avail_ext; do
6350 case " $dynamic_ext " in
6352 *) dflt="$dflt $xxx" ;;
6359 *) dflt="$static_ext"
6366 rp="What extensions do you wish to load statically?"
6369 none) static_ext='' ;;
6370 *) static_ext="$ans" ;;
6375 A number of extensions are supplied with $package. Answer "none"
6376 to include no extensions.
6379 case "$static_ext" in
6380 ''|' ') dflt="$avail_ext" ;;
6381 *) dflt="$static_ext" ;;
6387 rp="What extensions do you wish to include?"
6390 none) static_ext='' ;;
6391 *) static_ext="$ans" ;;
6396 set X $dynamic_ext $static_ext
6400 : see what type file positions are declared as in the library
6401 set fpos_t fpostype long stdio.h sys/types.h
6405 rp="What is the type for file position used by fsetpos()?"
6409 : Store the full pathname to the sed program for use in the C program
6412 : see what type gids are declared as in the kernel
6413 set gid_t gidtype xxx stdio.h sys/types.h
6417 xxx=`./findhdr sys/user.h`
6418 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
6420 unsigned) dflt="$1 $2" ;;
6424 *) dflt="$gidtype";;
6427 rp="What is the type for group ids returned by getgid()?"
6431 : see if getgroups exists
6432 set getgroups d_getgrps
6435 : Find type of 2nd arg to getgroups
6437 case "$d_getgrps" in
6439 case "$groupstype" in
6440 '') dflt="$gidtype" ;;
6441 *) dflt="$groupstype" ;;
6444 What is the type of the second argument to getgroups()? Usually this
6445 is the same as group ids, $gidtype, but not always.
6448 rp='What type is the second argument to getgroups()?'
6452 *) groupstype="$gidtype";;
6455 : see what type lseek is declared as in the kernel
6456 set off_t lseektype long stdio.h sys/types.h
6460 rp="What type is lseek's offset on this system declared as?"
6464 : determine where manual pages go
6465 set mansrc mansrc none
6469 $spackage has manual pages available in source form.
6473 echo "However, you don't have nroff, so they're probably useless to you."
6478 echo "If you don't want the manual sources installed, answer 'none'."
6481 lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
6482 lookpath="$lookpath $prefixexp/man/l_man/man1"
6483 lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
6484 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
6485 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6486 lookpath="$lookpath /usr/man/man.L"
6487 mansrc=`./loc . $prefixexp/man/man1 $lookpath`
6488 if $test -d "$mansrc"; then
6502 rp='Where do the manual pages (source) go?'
6504 if test "X$mansrcexp" != "X$ansexp"; then
6516 Since you are running AFS, I need to distinguish the directory in which
6517 manual pages reside from the directory in which they are installed (and from
6518 which they are presumably copied to the former directory by occult means).
6521 case "$installmansrc" in
6522 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
6523 *) dflt="$installmansrc";;
6526 rp='Where will man pages be installed?'
6528 installmansrc="$ans"
6530 installmansrc="$mansrcexp"
6545 : see what type is used for mode_t
6546 set mode_t modetype int stdio.h sys/types.h
6550 rp="What type is used for file modes?"
6554 : set the base revision
6557 : get the patchlevel
6559 echo "Getting the current patchlevel..." >&4
6560 if $test -r ../patchlevel.h;then
6561 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
6565 echo "(You have $package $baserev PL$patchlevel.)"
6567 : Cruising for prototypes
6569 echo "Checking out function prototypes..." >&4
6570 $cat >prototype.c <<'EOCP'
6571 main(int argc, char *argv[]) {
6574 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6575 echo "Your C compiler appears to support function prototypes."
6578 echo "Your C compiler doesn't seem to understand function prototypes."
6585 : check for size of random number generator
6589 echo "Checking to see how many bits your rand function produces..." >&4
6590 $cat >try.c <<'EOCP'
6595 register unsigned long tmp;
6596 register unsigned long max = 0L;
6598 for (i = 1000; i; i--) {
6599 tmp = (unsigned long)rand();
6600 if (tmp > max) max = tmp;
6602 for (i = 0; max; i++)
6607 if $cc try.c -o try >/dev/null 2>&1 ; then
6611 echo "(I can't seem to compile the test program...)"
6618 rp='How many bits does your rand() function produce?'
6623 : see if ar generates random libraries by itself
6625 echo "Checking how to generate random libraries on your machine..." >&4
6626 echo 'int bar1() { return bar2(); }' > bar1.c
6627 echo 'int bar2() { return 2; }' > bar2.c
6628 $cat > foo.c <<'EOP'
6629 main() { printf("%d\n", bar1()); exit(0); }
6631 $cc $ccflags -c bar1.c >/dev/null 2>&1
6632 $cc $ccflags -c bar2.c >/dev/null 2>&1
6633 $cc $ccflags -c foo.c >/dev/null 2>&1
6634 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
6635 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6636 ./foobar >/dev/null 2>&1; then
6637 echo "ar appears to generate random libraries itself."
6640 elif ar ts bar.a >/dev/null 2>&1 &&
6641 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
6642 ./foobar >/dev/null 2>&1; then
6643 echo "a table of contents needs to be added with 'ar ts'."
6650 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
6651 $test -f $ranlib || ranlib=''
6654 if $test -n "$ranlib"; then
6655 echo "your system has '$ranlib'; we'll use that."
6658 echo "your system doesn't seem to support random libraries"
6659 echo "so we'll use lorder and tsort to order the libraries."
6666 : determine where public executable scripts go
6667 set scriptdir scriptdir
6669 case "$scriptdir" in
6672 : guess some guesses
6673 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6674 $test -d /usr/share/bin && dflt=/usr/share/bin
6675 $test -d /usr/local/script && dflt=/usr/local/script
6676 $test -d $prefixexp/script && dflt=$prefixexp/script
6680 *) dflt="$scriptdir"
6685 Some installations have a separate directory just for executable scripts so
6686 that they can mount it across multiple architectures but keep the scripts in
6687 one spot. You might, for example, have a subdirectory of /usr/share for this.
6688 Or you might just lump your scripts in with all your other executables.
6692 rp='Where do you keep publicly executable scripts?'
6694 if $test "X$ansexp" != "X$scriptdirexp"; then
6698 scriptdirexp="$ansexp"
6702 Since you are running AFS, I need to distinguish the directory in which
6703 scripts reside from the directory in which they are installed (and from
6704 which they are presumably copied to the former directory by occult means).
6707 case "$installscript" in
6708 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6709 *) dflt="$installscript";;
6712 rp='Where will public scripts be installed?'
6714 installscript="$ans"
6716 installscript="$scriptdirexp"
6719 : see if sys/select.h has to be included
6720 set sys/select.h i_sysselct
6723 : see if we should include time.h, sys/time.h, or both
6725 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
6726 $echo $n "I'm now running the test program...$c"
6727 $cat >try.c <<'EOCP'
6728 #include <sys/types.h>
6733 #ifdef SYSTIMEKERNEL
6736 #include <sys/time.h>
6739 #include <sys/select.h>
6748 struct timezone tzp;
6750 if (foo.tm_sec == foo.tm_sec)
6753 if (bar.tv_sec == bar.tv_sec)
6762 for s_timeval in '-DS_TIMEVAL' ''; do
6763 for i_systimek in '' '-DSYSTIMEKERNEL'; do
6764 for i_time in '' '-DI_TIME'; do
6765 for i_systime in '-DI_SYSTIME' ''; do
6769 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
6770 try.c -o try >/dev/null 2>&1 ; then
6771 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
6775 $echo $n "Succeeded with $flags$c"
6786 *SYSTIMEKERNEL*) i_systimek="$define"
6787 timeincl=`./findhdr sys/time.h`
6788 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
6789 *) i_systimek="$undef";;
6792 *I_TIME*) i_time="$define"
6793 timeincl=`./findhdr time.h`" $timeincl"
6794 echo "We'll include <time.h>." >&4;;
6795 *) i_time="$undef";;
6798 *I_SYSTIME*) i_systime="$define"
6799 timeincl=`./findhdr sys/time.h`" $timeincl"
6800 echo "We'll include <sys/time.h>." >&4;;
6801 *) i_systime="$undef";;
6805 : check for fd_set items
6808 Checking to see how well your C compiler handles fd_set and friends ...
6810 $cat >fd_set.c <<EOCP
6811 #$i_systime I_SYS_TIME
6812 #$i_sysselct I_SYS_SELECT
6813 #$d_socket HAS_SOCKET
6814 #include <sys/types.h>
6816 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6819 #include <sys/time.h>
6822 #include <sys/select.h>
6832 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
6839 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6840 d_fds_bits="$define"
6842 echo "Well, your system knows about the normal fd_set typedef..." >&4
6844 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
6845 d_fd_macros="$define"
6848 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
6850 d_fd_macros="$undef"
6854 Hmm, your compiler has some difficulty with fd_set. Checking further...
6856 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
6859 echo "Well, your system has some sort of fd_set available..." >&4
6861 echo "and you have the normal fd_set macros." >&4
6862 d_fd_macros="$define"
6865 but not the normal fd_set macros! Gross! More work for me...
6867 d_fd_macros="$undef"
6870 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
6873 d_fd_macros="$undef"
6879 : check for type of arguments to select. This will only really
6880 : work if the system supports prototypes and provides one for
6884 : Make initial guess
6885 case "$selecttype" in
6888 $define) xxx='fd_set *' ;;
6892 *) xxx="$selecttype"
6897 'fd_set *') yyy='int *' ;;
6898 'int *') yyy='fd_set *' ;;
6903 Checking to see what type of arguments are expected by select().
6906 #$i_systime I_SYS_TIME
6907 #$i_sysselct I_SYS_SELECT
6908 #$d_socket HAS_SOCKET
6909 #include <sys/types.h>
6911 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
6914 #include <sys/time.h>
6917 #include <sys/select.h>
6923 Select_fd_set_t readfds;
6924 Select_fd_set_t writefds;
6925 Select_fd_set_t exceptfds;
6926 struct timeval timeout;
6927 select(width, readfds, writefds, exceptfds, &timeout);
6931 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
6933 echo "Your system uses $xxx for the arguments to select." >&4
6934 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
6936 echo "Your system uses $yyy for the arguments to select." >&4
6938 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
6945 *) selecttype = 'int *'
6949 : generate list of signal names
6953 echo "Generating a list of signal names..." >&4
6954 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
6955 set X `cat $xxx 2>&1 | $awk '
6956 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
6957 sig[$3] = substr($2,4,20)
6958 if (max < $3 && $3 < 60) {
6964 for (i = 1; i <= max; i++) {
6978 echo 'kill -l' >/tmp/foo$$
6979 set X `csh -f </tmp/foo$$`
6983 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
6991 echo "The following signals are available:"
6993 echo $sig_name | $awk \
6994 'BEGIN { linelen = 0 }
6996 for (i = 1; i < NF; i++) {
6998 linelen = linelen + length(name)
7001 linelen = length(name)
7008 : see what type is used for size_t
7009 set size_t sizetype 'unsigned int' stdio.h sys/types.h
7013 rp="What type is used for the length parameter for string functions?"
7017 : see what type is used for signed size_t
7018 set ssize_t ssizetype int stdio.h sys/types.h
7021 $cat > ssize.c <<EOM
7023 #include <sys/types.h>
7024 #define Size_t $sizetype
7025 #define SSize_t $dflt
7028 if (sizeof(Size_t) == sizeof(SSize_t))
7030 else if (sizeof(Size_t) == sizeof(int))
7037 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
7039 echo "I'll be using $ssizetype for functions returning a byte count." >&4
7041 echo "(I can't compile the test program--please enlighten me!)"
7044 I need a type that is the same size as $sizetype, but is guaranteed to
7045 be signed. Common values are int and long.
7048 rp="What signed type is the same size as $sizetype?"
7052 $rm -f ssize ssize.[co]
7054 : see what type of char stdio uses.
7056 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7057 echo "Your stdio uses unsigned chars." >&4
7058 stdchar="unsigned char"
7060 echo "Your stdio uses signed chars." >&4
7064 : see if time exists
7066 if set time val -f d_time; eval $csym; $val; then
7067 echo 'time() found.' >&4
7069 set time_t timetype long stdio.h sys/types.h
7073 rp="What type is returned by time() on this sytem?"
7077 echo 'time() not found, hope that will do.' >&4
7084 : see what type uids are declared as in the kernel
7085 set uid_t uidtype xxx stdio.h sys/types.h
7089 xxx=`./findhdr sys/user.h`
7090 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
7092 unsigned) dflt="$1 $2" ;;
7096 *) dflt="$uidtype";;
7099 rp="What is the type for user ids returned by getuid()?"
7103 : see if this is a sys/file.h system
7108 : do we need to #include <sys/file.h> ?
7114 echo "We'll be including <sys/file.h>." >&4
7117 echo "We won't be including <sys/file.h>." >&4
7127 : see if fcntl.h is there
7132 : see if we can include fcntl.h
7138 echo "We'll be including <fcntl.h>." >&4
7142 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
7144 echo "We won't be including <fcntl.h>." >&4
7156 : see if this is an grp system
7160 : see if this is a math.h system
7164 : see if memory.h is available.
7169 : See if it conflicts with string.h
7175 $cppstdin $cppflags $cppminus < $strings > mem.h
7176 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7178 echo "We won't be including <memory.h>."
7188 : see if net/errno.h is available
7193 : Unfortunately, it causes problems on some systems. Arrgh.
7199 #include <net/errno.h>
7205 if $cc $ccflags -c try.c >/dev/null 2>&1; then
7206 echo "We'll be including <net/errno.h>." >&4
7208 echo "We won't be including <net/errno.h>." >&4
7217 : get C preprocessor symbols handy
7219 $echo $n "Hmm... $c"
7220 echo $al | $tr ' ' '\012' >Cppsym.know
7232 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
7234 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
7237 unknown="\$unknown \$sym"
7247 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
7249 exit 0; _ _ _ _\1\\ \1\\
7252 echo "exit 1; _ _ _" >>Cppsym\$\$
7253 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
7255 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
7261 $rm -f Cppsym\$\$ Cppsym2\$\$
7266 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
7268 : now check the C compiler for additional symbols
7274 for i in \`$cc -v -c tmp.c 2>&1\`
7277 -D*) echo "\$i" | $sed 's/^-D//';;
7278 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
7285 ./ccsym | $sort | $uniq >ccsym.raw
7286 $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list
7287 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
7288 $comm -13 ccsym.true ccsym.list >ccsym.own
7289 $comm -12 ccsym.true ccsym.list >ccsym.com
7290 $comm -23 ccsym.true ccsym.list >ccsym.cpp
7293 if $test -z ccsym.raw; then
7294 echo "Your C compiler doesn't seem to define any symbol!" >&4
7296 echo "However, your C preprocessor defines the following ones:"
7299 if $test -s ccsym.com; then
7300 echo "Your C compiler and pre-processor define these symbols:"
7301 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
7304 $test "$silent" || sleep 1
7306 if $test -s ccsym.cpp; then
7307 $test "$also" && echo " "
7308 echo "Your C pre-processor ${also}defines the following $symbols:"
7309 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
7311 $test "$silent" || sleep 1
7313 if $test -s ccsym.own; then
7314 $test "$also" && echo " "
7315 echo "Your C compiler ${also}defines the following cpp variables:"
7316 $sed -e 's/\(.*\)=1/\1/' ccsym.own
7317 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
7318 $test "$silent" || sleep 1
7323 : see if this is a termio system
7327 if $test `./findhdr termios.h`; then
7328 set tcsetattr i_termios
7334 "$define") echo "You have POSIX termios.h... good!" >&4;;
7335 *) if ./Cppsym pyr; then
7336 case "`/bin/universe`" in
7337 ucb) if $test `./findhdr sgtty.h`; then
7339 echo "<sgtty.h> found." >&4
7341 echo "System is pyramid with BSD universe."
7342 echo "<sgtty.h> not found--you could have problems." >&4
7344 *) if $test `./findhdr termio.h`; then
7346 echo "<termio.h> found." >&4
7348 echo "System is pyramid with USG universe."
7349 echo "<termio.h> not found--you could have problems." >&4
7353 if $test `./findhdr termio.h`; then
7354 echo "<termio.h> found." >&4
7356 elif $test `./findhdr sgtty.h`; then
7357 echo "<sgtty.h> found." >&4
7360 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
7363 if $test `./findhdr sgtty.h`; then
7364 echo "<sgtty.h> found." >&4
7366 elif $test `./findhdr termio.h`; then
7367 echo "<termio.h> found." >&4
7370 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
7374 set i_termio; eval $setvar
7375 val=$val2; set i_sgtty; eval $setvar
7376 val=$val3; set i_termios; eval $setvar
7378 : see if stdarg is available
7380 if $test `./findhdr stdarg.h`; then
7381 echo "<stdarg.h> found." >&4
7384 echo "<stdarg.h> NOT found." >&4
7388 : see if varags is available
7390 if $test `./findhdr varargs.h`; then
7391 echo "<varargs.h> found." >&4
7393 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
7396 : set up the varargs testing programs
7397 $cat > varargs.c <<EOP
7402 #include <varargs.h>
7420 p = va_arg(ap, char *);
7425 $cat > varargs <<EOP
7426 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
7435 : now check which varargs header should be included
7440 if `./varargs I_STDARG`; then
7442 elif `./varargs I_VARARGS`; then
7447 if `./varargs I_VARARGS`; then
7454 echo "I could not find the definition for va_dcl... You have problems..." >&4
7455 val="$undef"; set i_stdarg; eval $setvar
7456 val="$undef"; set i_varargs; eval $setvar
7463 val="$define"; set i_stdarg; eval $setvar
7464 val="$undef"; set i_varargs; eval $setvar
7467 val="$undef"; set i_stdarg; eval $setvar
7468 val="$define"; set i_varargs; eval $setvar
7471 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
7475 : see if stddef is available
7476 set stddef.h i_stddef
7479 : see if stdlib is available
7480 set stdlib.h i_stdlib
7483 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
7484 set sys/filio.h i_sysfilio
7487 if $test `./findhdr sys/ioctl.h`; then
7489 echo '<sys/ioctl.h> found.' >&4
7492 if $test $i_sysfilio = "$define"; then
7493 echo '<sys/ioctl.h> NOT found.' >&4
7495 $test $i_sgtty = "$define" && xxx="sgtty.h"
7496 $test $i_termio = "$define" && xxx="termio.h"
7497 $test $i_termios = "$define" && xxx="termios.h"
7498 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
7504 : see if this is a sys/param system
7505 set sys/param.h i_sysparam
7508 : see if sys/stat.h is available
7509 set sys/stat.h i_sysstat
7512 : see if this is a unistd.h system
7513 set unistd.h i_unistd
7516 : see if this is an utime system
7520 : see if this is a vfork system
7531 : end of configuration questions
7533 echo "End of configuration questions."
7536 : back to where it started
7537 if test -d ../UU; then
7541 : configuration may be patched via a 'config.over' file
7542 if $test -f config.over; then
7545 rp='I see a config.over file. Do you wish to load it?'
7548 n*) echo "OK, I'll ignore it.";;
7550 echo "Configuration override changes have been loaded."
7555 : in case they want portability, strip down executable paths
7556 case "$d_portable" in
7559 echo "Stripping down executable paths..." >&4
7560 for file in $loclist $trylist; do
7566 : create config.sh file
7568 echo "Creating config.sh..." >&4
7569 $spitshell <<EOT >config.sh
7572 # This file was produced by running the Configure script. It holds all the
7573 # definitions figured out by Configure. Should you modify one of these values,
7574 # do not forget to propagate your changes by running "Configure -der". You may
7575 # instead choose to run each of the .SH files by yourself, or "Configure -S".
7578 # Configuration time: $cf_time
7579 # Configured by: $cf_by
7580 # Target system: $myuname
7590 Revision='$Revision'
7594 alignbytes='$alignbytes'
7595 aphostname='$aphostname'
7597 archlibexp='$archlibexp'
7598 archname='$archname'
7606 byteorder='$byteorder'
7608 castflags='$castflags'
7611 cccdlflags='$cccdlflags'
7612 ccdlflags='$ccdlflags'
7619 clocktype='$clocktype'
7621 compress='$compress'
7622 contains='$contains'
7626 cpp_stuff='$cpp_stuff'
7627 cppflags='$cppflags'
7629 cppminus='$cppminus'
7631 cppstdin='$cppstdin'
7632 cryptlib='$cryptlib'
7634 d_Gconvert='$d_Gconvert'
7635 d_access='$d_access'
7637 d_archlib='$d_archlib'
7638 d_attribut='$d_attribut'
7642 d_bsdpgrp='$d_bsdpgrp'
7645 d_casti32='$d_casti32'
7646 d_castneg='$d_castneg'
7647 d_charvspr='$d_charvspr'
7649 d_chroot='$d_chroot'
7650 d_chsize='$d_chsize'
7651 d_closedir='$d_closedir'
7655 d_cuserid='$d_cuserid'
7656 d_dbl_dig='$d_dbl_dig'
7657 d_difftime='$d_difftime'
7658 d_dirnamlen='$d_dirnamlen'
7659 d_dlerror='$d_dlerror'
7660 d_dlopen='$d_dlopen'
7661 d_dlsymun='$d_dlsymun'
7662 d_dosuid='$d_dosuid'
7665 d_eunice='$d_eunice'
7666 d_fchmod='$d_fchmod'
7667 d_fchown='$d_fchown'
7669 d_fd_macros='$d_fd_macros'
7670 d_fd_set='$d_fd_set'
7671 d_fds_bits='$d_fds_bits'
7672 d_fgetpos='$d_fgetpos'
7673 d_flexfnam='$d_flexfnam'
7677 d_fpathconf='$d_fpathconf'
7678 d_fsetpos='$d_fsetpos'
7679 d_getgrps='$d_getgrps'
7680 d_gethent='$d_gethent'
7681 d_gethname='$d_gethname'
7682 d_getlogin='$d_getlogin'
7683 d_getpgrp2='$d_getpgrp2'
7684 d_getpgrp='$d_getpgrp'
7685 d_getppid='$d_getppid'
7686 d_getprior='$d_getprior'
7689 d_isascii='$d_isascii'
7690 d_killpg='$d_killpg'
7692 d_linuxstd='$d_linuxstd'
7693 d_locconv='$d_locconv'
7697 d_mbstowcs='$d_mbstowcs'
7698 d_mbtowc='$d_mbtowc'
7699 d_memcmp='$d_memcmp'
7700 d_memcpy='$d_memcpy'
7701 d_memmove='$d_memmove'
7702 d_memset='$d_memset'
7704 d_mkfifo='$d_mkfifo'
7705 d_mktime='$d_mktime'
7707 d_msgctl='$d_msgctl'
7708 d_msgget='$d_msgget'
7709 d_msgrcv='$d_msgrcv'
7710 d_msgsnd='$d_msgsnd'
7711 d_mymalloc='$d_mymalloc'
7713 d_oldsock='$d_oldsock'
7715 d_pathconf='$d_pathconf'
7717 d_phostname='$d_phostname'
7719 d_portable='$d_portable'
7721 d_pwchange='$d_pwchange'
7722 d_pwclass='$d_pwclass'
7723 d_pwcomment='$d_pwcomment'
7724 d_pwexpire='$d_pwexpire'
7725 d_pwquota='$d_pwquota'
7726 d_readdir='$d_readdir'
7727 d_readlink='$d_readlink'
7728 d_rename='$d_rename'
7729 d_rewinddir='$d_rewinddir'
7731 d_safebcpy='$d_safebcpy'
7732 d_safemcpy='$d_safemcpy'
7733 d_seekdir='$d_seekdir'
7734 d_select='$d_select'
7736 d_semctl='$d_semctl'
7737 d_semget='$d_semget'
7739 d_setegid='$d_setegid'
7740 d_seteuid='$d_seteuid'
7741 d_setlinebuf='$d_setlinebuf'
7742 d_setlocale='$d_setlocale'
7743 d_setpgid='$d_setpgid'
7744 d_setpgrp2='$d_setpgrp2'
7745 d_setpgrp='$d_setpgrp'
7746 d_setprior='$d_setprior'
7747 d_setregid='$d_setregid'
7748 d_setresgid='$d_setresgid'
7749 d_setresuid='$d_setresuid'
7750 d_setreuid='$d_setreuid'
7751 d_setrgid='$d_setrgid'
7752 d_setruid='$d_setruid'
7753 d_setsid='$d_setsid'
7756 d_shmatprototype='$d_shmatprototype'
7757 d_shmctl='$d_shmctl'
7759 d_shmget='$d_shmget'
7760 d_shrplib='$d_shrplib'
7761 d_socket='$d_socket'
7762 d_sockpair='$d_sockpair'
7763 d_statblks='$d_statblks'
7764 d_stdstdio='$d_stdstdio'
7765 d_strchr='$d_strchr'
7766 d_strcoll='$d_strcoll'
7767 d_strctcpy='$d_strctcpy'
7768 d_strerrm='$d_strerrm'
7769 d_strerror='$d_strerror'
7770 d_strxfrm='$d_strxfrm'
7771 d_suidsafe='$d_suidsafe'
7772 d_symlink='$d_symlink'
7773 d_syscall='$d_syscall'
7774 d_sysconf='$d_sysconf'
7775 d_sysernlst='$d_sysernlst'
7776 d_syserrlst='$d_syserrlst'
7777 d_system='$d_system'
7778 d_tcgetpgrp='$d_tcgetpgrp'
7779 d_tcsetpgrp='$d_tcsetpgrp'
7780 d_telldir='$d_telldir'
7783 d_truncate='$d_truncate'
7784 d_tzname='$d_tzname'
7788 d_void_closedir='$d_void_closedir'
7789 d_voidsig='$d_voidsig'
7790 d_voidtty='$d_voidtty'
7791 d_volatile='$d_volatile'
7792 d_vprintf='$d_vprintf'
7794 d_waitpid='$d_waitpid'
7795 d_wcstombs='$d_wcstombs'
7796 d_wctomb='$d_wctomb'
7799 db_hashtype='$db_hashtype'
7800 db_prefixtype='$db_prefixtype'
7801 defvoidused='$defvoidused'
7802 direntrytype='$direntrytype'
7805 dynamic_ext='$dynamic_ext'
7809 eunicefix='$eunicefix'
7811 extensions='$extensions'
7814 fpostype='$fpostype'
7815 full_csh='$full_csh'
7816 full_sed='$full_sed'
7818 gccversion='$gccversion'
7822 groupcat='$groupcat'
7823 groupstype='$groupstype'
7825 h_sysfile='$h_sysfile'
7829 i_bsdioctl='$i_bsdioctl'
7832 i_dirent='$i_dirent'
7839 i_limits='$i_limits'
7840 i_malloc='$i_malloc'
7842 i_memory='$i_memory'
7844 i_neterrno='$i_neterrno'
7848 i_stdarg='$i_stdarg'
7849 i_stddef='$i_stddef'
7850 i_stdlib='$i_stdlib'
7851 i_string='$i_string'
7852 i_sysdir='$i_sysdir'
7853 i_sysfile='$i_sysfile'
7854 i_sysfilio='$i_sysfilio'
7856 i_sysioctl='$i_sysioctl'
7857 i_sysndir='$i_sysndir'
7858 i_sysparam='$i_sysparam'
7859 i_sysselct='$i_sysselct'
7860 i_syssockio='$i_syssockio'
7861 i_sysstat='$i_sysstat'
7862 i_systime='$i_systime'
7863 i_systimek='$i_systimek'
7864 i_systimes='$i_systimes'
7865 i_termio='$i_termio'
7866 i_termios='$i_termios'
7868 i_unistd='$i_unistd'
7870 i_varargs='$i_varargs'
7871 i_varhdr='$i_varhdr'
7875 installarchlib='$installarchlib'
7876 installbin='$installbin'
7877 installmansrc='$installmansrc'
7878 installprivlib='$installprivlib'
7879 installscript='$installscript'
7881 known_extensions='$known_extensions'
7884 lddlflags='$lddlflags'
7890 libswanted='$libswanted'
7899 lseektype='$lseektype'
7903 mallocobj='$mallocobj'
7904 mallocsrc='$mallocsrc'
7905 malloctype='$malloctype'
7908 mansrcexp='$mansrcexp'
7911 mips_type='$mips_type'
7914 modetype='$modetype'
7917 mydomain='$mydomain'
7918 myhostname='$myhostname'
7923 optimize='$optimize'
7924 orderlib='$orderlib'
7929 patchlevel='$patchlevel'
7932 phostname='$phostname'
7937 prefixexp='$prefixexp'
7939 privlibexp='$privlibexp'
7940 prototype='$prototype'
7941 randbits='$randbits'
7946 scriptdir='$scriptdir'
7947 scriptdirexp='$scriptdirexp'
7949 selecttype='$selecttype'
7950 sendmail='$sendmail'
7953 sharpbang='$sharpbang'
7954 shmattype='$shmattype'
7957 sig_name='$sig_name'
7958 signal_t='$signal_t'
7959 sizetype='$sizetype'
7964 sockethdr='$sockethdr'
7965 socketlib='$socketlib'
7967 spackage='$spackage'
7968 spitshell='$spitshell'
7970 ssizetype='$ssizetype'
7972 static_ext='$static_ext'
7981 timeincl='$timeincl'
7982 timetype='$timetype'
7990 usemymalloc='$usemymalloc'
7992 useposix='$useposix'
7993 usevfork='$usevfork'
7997 voidflags='$voidflags'
8002 : add special variables
8003 $test -f patchlevel.h && \
8004 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
8005 echo "CONFIG=true" >>config.sh
8007 : propagate old symbols
8008 if $test -f UU/config.sh; then
8009 <UU/config.sh sort | uniq >UU/oldconfig.sh
8010 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
8011 sort | uniq -u >UU/oldsyms
8012 set X `cat UU/oldsyms`
8018 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
8020 echo "# Variables propagated from previous config.sh file." >>config.sh
8021 for sym in `cat UU/oldsyms`; do
8022 echo " Propagating $hint variable "'$'"$sym..."
8023 eval 'tmp="$'"${sym}"'"'
8025 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
8031 : Finish up by extracting the .SH files
8044 echo "If you didn't make any mistakes, then just type a carriage return here."
8045 rp="If you need to edit config.sh, do it as a shell escape here:"
8050 *) : in case they cannot read
8056 : if this fails, just run all the .SH files by hand
8063 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
8070 Now you need to generate make dependencies by running "make depend".
8071 You might prefer to run it in background: "make depend > makedepend.out &"
8072 It can take a while, so you might not want to run it right now.
8077 rp="Run make depend now?"
8081 make depend && echo "Now you must run a make."
8084 echo "You must run 'make depend' then 'make'."
8087 elif test -f [Mm]akefile; then
8089 echo "Now you must run a make."
8094 $rm -f kit*isdone ark*isdone