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 and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Wed May 13 13:35:54 EDT 1998 [metaconfig 3.0 PL70]
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`
58 : Proper separator for the PATH environment variable
60 : On OS/2 this directory should exist if this is not floppy only system :-]
61 if test -d c:/. ; then
62 if test -n "$OS2_SHELL"; then
64 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
65 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
66 elif test -n "$DJGPP"; then
72 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
73 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
74 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
75 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
76 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
77 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
78 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
79 paths="$paths /sbin /usr/sbin /usr/libexec"
85 *) test -d $p && PATH=$PATH$p_$p ;;
92 : shall we be using ksh?
98 if (PATH=.; alias -x) >/dev/null 2>&1; then
101 if test -f /hp-ux -a -f /bin/ksh; then
102 needksh='to avoid sh bug in "here document" expansion'
104 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
105 if test X`/usr/bin/uname -v` = X4; then
106 avoidksh="to avoid AIX 4's /bin/sh"
110 case "$inksh/$needksh" in
117 case "$inksh/$avoidksh" in
123 case "$inksh/$needksh-$avoidksh-" in
126 (I see you are using the Korn shell. Some ksh's blow up on $me,
127 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
133 echo "(Feeding myself to $newsh $reason.)"
135 Configure|*/Configure) exec $newsh $0 "$@";;
136 *) exec $newsh Configure "$@";;
141 : Configure runs within the UU subdirectory
142 test -d UU || mkdir UU
394 d_pthreads_created_joinable=''
688 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
691 : We must find out about Eunice early
693 if test -f /etc/unixtovms; then
694 eunicefix=/etc/unixtovms
696 if test -f /etc/unixtovms.exe; then
697 eunicefix=/etc/unixtovms.exe
700 : list of known cpp symbols, sorted alphabetically
701 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
702 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
703 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
704 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
705 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
706 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
707 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
708 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
709 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
710 al="$al VMS Xenix286"
711 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
712 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
713 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
714 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
715 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
716 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
717 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
718 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
719 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
720 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
721 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
722 al="$al __SVR4_2__ __UMAXV__"
723 al="$al ____386BSD____ __alpha __alpha__ __amiga"
724 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
725 al="$al __host_mips__"
726 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
727 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
728 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
729 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
730 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
731 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
732 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
733 al="$al __mc88100 __mc88100__ __mips __mips__"
734 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
735 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
736 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
737 al="$al _host_mips _mips _unix"
738 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
739 al="$al apollo ardent att386 att3b"
740 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
741 al="$al cadmus clipper concurrent convex cray ctix"
742 al="$al dmert encore gcos gcx gimpel gould"
743 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
744 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
745 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
746 al="$al i186 i286 i386 i486 i8086"
747 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
748 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
749 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
750 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
751 al="$al mc88000 mc88100 merlin mert mips mvs n16"
752 al="$al ncl_el ncl_mr"
753 al="$al news1500 news1700 news1800 news1900 news3700"
754 al="$al news700 news800 news900 ns16000 ns32000"
755 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
756 al="$al parisc pc532 pdp11 plexus posix pyr"
757 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
758 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
759 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
760 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
761 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
762 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
766 : change the next line if compiling for Xenix/286 on Xenix/386
767 xlibpth='/usr/lib/386 /lib/386'
769 : Possible local library directories to search.
770 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
771 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
773 : general looking path for locating libraries
774 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
775 glibpth="$glibpth /lib /usr/lib $xlibpth"
776 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
777 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
779 : Private path used by Configure to find libraries. Its value
780 : is prepended to libpth. This variable takes care of special
781 : machines, like the mips. Usually, it should be empty.
784 : default library list
786 : full support for void wanted by default
789 : Possible local include directories to search.
790 : Set locincpth to "" in a hint file to defeat local include searches.
791 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
792 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
794 : no include file wanted by default
797 : Trailing extension. Override this in a hint file, if needed.
799 : Extra object files, if any, needed on this platform.
802 : set useposix=false in your hint file to disable the POSIX extension.
804 : set useopcode=false in your hint file to disable the Opcode extension.
806 : set usethreads on the Configure command line to enable threads.
807 : List of libraries we want.
808 : If anyone needs -lnet, put it in a hint file.
809 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
810 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
811 libswanted="$libswanted ucb bsd BSD PW x"
812 : We probably want to search /usr/shlib before most other libraries.
813 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
814 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
815 glibpth="/usr/shlib $glibpth"
816 : Do not use vfork unless overridden by a hint file.
819 : Find the basic shell for Bourne shell scripts
823 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
826 if test -f "$xxx"; then
829 : Build up a list and do a single loop so we can 'break' out.
830 pth=`echo $PATH | sed -e "s/$p_/ /g"`
831 for xxx in sh bash ksh pdksh ash; do
833 try="$try ${p}/${xxx}"
837 if test -f "$xxx"; then
840 elif test -f "$xxx.exe"; then
851 $me: Fatal Error: I can't find a Bourne Shell anywhere.
853 Usually it's in /bin/sh. How did you even get this far?
854 Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and
855 we'll try to straighten this all out.
861 : see if sh knows # comments
862 if `$sh -c '#' >/dev/null 2>&1`; then
866 test -f $xcat || xcat=/usr/bin/cat
871 if test -s today; then
874 echo "#! $xcat" > try
878 if test -s today; then
886 echo "Your $sh doesn't grok # comments--I will strip them later on."
889 echo "exec grep -v '^[ ]*#'" >spitshell
892 spitshell=`pwd`/spitshell
894 echo "I presume that if # doesn't work, #! won't work either!"
899 : figure out how to guarantee sh startup
901 '') startsh=${sharpbang}${sh} ;;
913 : echo "Yup, it does."
915 echo "Hmm... '$startsh' does not guarantee sh startup..."
916 echo "You may have to fix up the shell scripts to make sure $sh runs them."
920 : produce awk script to parse command line options
921 cat >options.awk <<'EOF'
923 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
925 len = length(optstr);
926 for (i = 1; i <= len; i++) {
927 c = substr(optstr, i, 1);
928 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
939 if (substr(str, 1, 1) != "-") {
940 printf("'%s'\n", str);
944 for (i = 2; i <= len; i++) {
945 c = substr(str, i, 1);
947 printf("-%s\n", substr(str, i));
953 printf("'%s'\n", substr(str, i + 1));
966 : process the command line options
967 set X `for arg in "$@"; do echo "X$arg"; done |
968 sed -e s/X// | awk -f options.awk`
973 : set up default values
990 while test $# -gt 0; do
992 -d) shift; fastread=yes;;
993 -e) shift; alldone=cont;;
997 if test -r "$1"; then
1000 echo "$me: cannot read config file $1." >&2
1005 -h) shift; error=true;;
1006 -r) shift; reuseval=true;;
1007 -s) shift; silent=true; realsilent=true;;
1008 -E) shift; alldone=exit;;
1009 -K) shift; knowitall=true;;
1010 -O) shift; override=true;;
1011 -S) shift; silent=true; extractsh=true;;
1016 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1017 echo "$me: ignoring -D $1" >&2
1020 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1021 *) echo "$1='define'" >> optdef.sh;;
1028 *=) echo "$1" >> optdef.sh;;
1030 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1031 echo "$me: ignoring -U $1" >&2
1033 *) echo "$1='undef'" >> optdef.sh;;
1037 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1040 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1048 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1049 [-U symbol] [-U symbol=]
1050 -d : use defaults for all answers.
1051 -e : go on without questioning past the production of config.sh.
1052 -f : specify an alternate default configuration file.
1053 -h : print this help message and exit (with an error status).
1054 -r : reuse C symbols value if possible (skips costly nm extraction).
1055 -s : silent mode, only echoes questions and essential information.
1056 -D : define symbol to have some value:
1057 -D symbol symbol gets the value 'define'
1058 -D symbol=value symbol gets the value 'value'
1059 -E : stop at the end of questions, after having produced config.sh.
1060 -K : do not use unless you know what you are doing.
1061 -O : let -D and -U override definitions from loaded configuration file.
1062 -S : perform variable substitutions on all .SH files (can mix with -f)
1063 -U : undefine symbol:
1064 -U symbol symbol gets the value 'undef'
1065 -U symbol= symbol gets completely empty
1066 -V : print version number and exit (with a zero status).
1073 case "$fastread$alldone" in
1076 if test ! -t 0; then
1077 echo "Say 'sh Configure', not 'sh <Configure'"
1085 true) exec 1>/dev/null;;
1088 : run the defines and the undefines, if any, but leave the file out there...
1094 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1095 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1096 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1097 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1098 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1101 : Some greps do not return status, grrr.
1102 echo "grimblepritz" >grimble
1103 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1105 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1111 : the following should work in any shell
1115 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1116 cat >contains <<'EOSS'
1117 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1122 : Find the path to the source tree
1125 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1136 if test -f $rsrc/Configure && \
1137 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1139 : found it, so we are ok.
1142 for src in . .. ../.. ../../.. ../../../..; do
1143 if test -f ../$src/Configure && \
1144 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1155 Sorry, I can't seem to locate the source dir for $package. Please start
1156 Configure with an explicit path -- i.e. /some/path/Configure.
1164 echo "Sources for $package found in \"$src\"." >&4
1168 : script used to extract .SH files with variable substitutions
1169 cat >extract <<'EOS'
1171 echo "Doing variable substitutions on .SH files..."
1172 if test -f $src/MANIFEST; then
1173 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
1175 echo "(Looking for .SH files under the source directory.)"
1176 set x `(cd $src; find . -name "*.SH" -print)`
1180 0) set x `(cd $src; echo *.SH)`; shift;;
1182 if test ! -f $src/$1; then
1188 while test $name; do
1189 if test ! -d "$name"; then
1190 create="$name $create";
1191 name=`echo $name | sed -e "s|^[^/]*$||"`;
1192 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1197 for file in $create; do
1206 dir=`expr X$file : 'X\(.*\)/'`
1207 file=`expr X$file : 'X.*/\(.*\)'`
1208 (cd $dir && . ./$file)
1218 dir=`expr X$file : 'X\(.*\)/'`
1219 file=`expr X$file : 'X.*/\(.*\)'`
1220 (set x $dir; shift; eval $mkdir_p)
1230 if test -f $src/config_h.SH; then
1231 if test ! -f config.h; then
1232 : oops, they left it out of MANIFEST, probably, so do it anyway.
1238 : extract files and exit if asked to do so
1239 case "$extractsh" in
1241 case "$realsilent" in
1245 case "$config_sh" in
1246 '') config_sh='config.sh';;
1249 echo "Fetching answers from $config_sh..."
1252 test "$override" && . ./optdef.sh
1261 : Eunice requires " " instead of "", can you believe it
1264 echo "Beginning of configuration questions for $package."
1266 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1268 : first determine how to suppress newline on echo command
1270 echo "Checking echo to see how to suppress newlines..."
1271 (echo "hi there\c" ; echo " ") >.echotmp
1272 if $contains c .echotmp >/dev/null 2>&1 ; then
1283 echo $n "The star should be here-->$c"
1287 : Now test for existence of everything in MANIFEST
1289 if test -f $rsrc/MANIFEST; then
1290 echo "First let's make sure your kit is complete. Checking..." >&4
1291 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1294 for filelist in x??; do
1295 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1297 if test -s missing; then
1301 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1303 You have the option of continuing the configuration process, despite the
1304 distinct possibility that your kit is damaged, by typing 'y'es. If you
1305 do, don't blame me if something goes wrong. I advise you to type 'n'o
1306 and contact the author (doughera@lafcol.lafayette.edu).
1309 echo $n "Continue? [n] $c" >&4
1313 echo "Continuing..." >&4
1317 echo "ABORTING..." >&4
1322 echo "Looks good..."
1325 echo "There is no MANIFEST file. I hope your kit is complete !"
1329 : compute the number of columns on the terminal for proper question formatting
1334 : set up the echo used in my read
1335 myecho="case \"\$xxxm\" in
1336 '') echo $n \"\$rp $c\" >&4;;
1338 '') echo $n \"[\$xxxm] $c\";;
1340 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1342 echo $n \"[\$xxxm] $c\" >&4
1344 echo $n \"\$rp [\$xxxm] $c\" >&4
1350 : now set up to do reads with possible shell escape and default assignment
1356 case "\$fastread" in
1357 yes) case "\$dflt" in
1360 case "\$silent-\$rp" in
1365 *) case "\$silent" in
1366 true) case "\$rp" in
1371 while expr "X\$ans" : "X!" >/dev/null; do
1375 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1383 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1392 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1397 echo "(OK, I'll run with -d after this question.)" >&4
1400 echo "*** Sorry, \$1 not supported yet." >&4
1410 echo "*** Substitution done -- please confirm."
1412 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1417 echo "*** Error -- try again."
1424 case "\$ans\$xxxm\$nostick" in
1436 : create .config dir to save info across Configure sessions
1437 test -d ../.config || mkdir ../.config
1438 cat >../.config/README <<EOF
1439 This directory created by Configure to save information that should
1440 persist across sessions for $package.
1442 You may safely delete it if you wish.
1445 : general instructions
1448 user=`(logname) 2>/dev/null`
1450 '') user=`whoami 2>&1`;;
1452 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1455 rp='Would you like to see the instructions?'
1466 This installation shell script will examine your system and ask you questions
1467 to determine how the perl5 package should be installed. If you get
1468 stuck on a question, you may use a ! shell escape to start a subshell or
1469 execute a command. Many of the questions will have default answers in square
1470 brackets; typing carriage return will give you the default.
1472 On some of the questions which ask for file or directory names you are allowed
1473 to use the ~name construct to specify the login directory belonging to "name",
1474 even if you don't have a shell which knows about that. Questions where this is
1475 allowed will be marked "(~name ok)".
1479 dflt='Type carriage return to continue'
1483 The prompter used in this script allows you to use shell variables and
1484 backticks in your answers. You may use $1, $2, etc... to refer to the words
1485 in the default answer, as if the default line was a set of arguments given to a
1486 script shell. This means you may also use $* to repeat the whole default line,
1487 so you do not have to re-type everything to add something to the default.
1489 Everytime there is a substitution, you will have to confirm. If there is an
1490 error (e.g. an unmatched backtick), the default answer will remain unchanged
1491 and you will be prompted again.
1493 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1494 the questions and use the computed defaults (or the previous answers if there
1495 was already a config.sh file). Type 'Configure -h' for a list of options.
1496 You may also start interactively and then answer '& -d' at any prompt to turn
1497 on the non-interactive behaviour for the remainder of the execution.
1503 Much effort has been expended to ensure that this shell script will run on any
1504 Unix system. If despite that it blows up on yours, your best bet is to edit
1505 Configure and run it again. If you can't run Configure for some reason,
1506 you'll have to generate a config.sh file by hand. Whatever problems you
1507 have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
1509 This installation script affects things in two ways:
1511 1) it may do direct variable substitutions on some of the files included
1513 2) it builds a config.h file for inclusion in C programs. You may edit
1514 any of these files as the need arises after running this script.
1516 If you make a mistake on a question, there is no easy way to back up to it
1517 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1518 files. Configure will offer to let you do this before it runs the SH files.
1521 dflt='Type carriage return to continue'
1523 case "$firsttime" in
1524 true) echo $user >>../.config/instruct;;
1528 : find out where common programs are
1530 echo "Locating common programs..." >&4
1543 if test -d \$dir/\$thing; then
1549 for thisthing in \$dir/\$thing; do
1550 : just loop through to pick last item
1552 if test -f \$thisthing; then
1555 elif test -f \$dir/\$thing.exe; then
1556 if test -n "$DJGPP"; then
1557 echo \$dir/\$thing.exe
1559 : on Eunice apparently
1614 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1615 pth="$pth /lib /usr/lib"
1616 for file in $loclist; do
1620 if test -f "$xxx"; then
1623 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1624 xxx=`./loc $file $file $pth`
1627 '') xxx=`./loc $file $file $pth`;;
1628 *) xxx=`./loc $xxx $xxx $pth`;;
1634 echo $file is in $xxx.
1637 echo $file is in $xxx.
1640 echo "I don't know where '$file' is, and my life depends on it." >&4
1641 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1647 echo "Don't worry if any of the following aren't found..."
1649 for file in $trylist; do
1653 if test -f "$xxx"; then
1656 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1657 xxx=`./loc $file $file $pth`
1660 '') xxx=`./loc $file $file $pth`;;
1661 *) xxx=`./loc $xxx $xxx $pth`;;
1667 echo $file is in $xxx.
1670 echo $file is in $xxx.
1673 echo "I don't see $file out there, $say."
1680 echo "Substituting grep for egrep."
1686 echo "Substituting cp for ln."
1692 echo "Hopefully test is built into your sh."
1695 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1696 echo "Using the test built into your sh."
1704 echo "Hopefully echo is built into your sh."
1709 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1710 $echo $n "hi there$c" >foo1
1711 echo $n "hi there$c" >foo2
1712 if cmp foo1 foo2 >/dev/null 2>&1; then
1713 echo "They are compatible. In fact, they may be identical."
1720 They are not compatible! You are probably running ksh on a non-USG system.
1721 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1722 have echo built in and we may have to run some Bourne shell scripts. That
1723 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1726 $echo $n "The star should be here-->$c"
1733 : determine whether symbolic links are supported
1736 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1737 echo "Symbolic links are supported." >&4
1740 echo "Symbolic links are NOT supported." >&4
1745 : see whether [:lower:] and [:upper:] are supported character classes
1749 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1751 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1756 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1759 : set up the translation script tr, must be called with ./tr of course
1763 '[A-Z][a-z]') exec $tr '$up' '$low';;
1764 '[a-z][A-Z]') exec $tr '$low' '$up';;
1771 : Try to determine whether config.sh was made on this system
1772 case "$config_sh" in
1774 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1775 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1776 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1777 newmyuname="$myuname"
1779 case "$knowitall" in
1781 if test -f ../config.sh; then
1782 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1783 eval "`grep myuname= ../config.sh`"
1785 if test "X$myuname" = "X$newmyuname"; then
1793 : Get old answers from old config file if Configure was run on the
1794 : same system, otherwise use the hints.
1797 if test -f config.sh; then
1799 rp="I see a config.sh file. Shall I use it to set the defaults?"
1802 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1803 *) echo "Fetching default answers from your old config.sh file..." >&4
1811 : Older versions did not always set $sh. Catch re-use of such
1820 if test ! -f config.sh; then
1823 First time through, eh? I have some defaults handy for some systems
1824 that need some extra help getting the Configure answers right:
1827 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1829 : Half the following guesses are probably wrong... If you have better
1830 : tests or hints, please send them to doughera@lafcol.lafayette.edu
1831 : The metaconfig authors would also appreciate a copy...
1832 $test -f /irix && osname=irix
1833 $test -f /xenix && osname=sco_xenix
1834 $test -f /dynix && osname=dynix
1835 $test -f /dnix && osname=dnix
1836 $test -f /lynx.os && osname=lynxos
1837 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1838 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1839 $test -f /bin/mips && /bin/mips && osname=mips
1840 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1841 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1842 $test -d /usr/apollo/bin && osname=apollo
1843 $test -f /etc/saf/_sactab && osname=svr4
1844 $test -d /usr/include/minix && osname=minix
1845 if $test -d /MachTen; then
1847 if $test -x /sbin/version; then
1848 osvers=`/sbin/version | $awk '{print $2}' |
1849 $sed -e 's/[A-Za-z]$//'`
1850 elif $test -x /usr/etc/version; then
1851 osvers=`/usr/etc/version | $awk '{print $2}' |
1852 $sed -e 's/[A-Za-z]$//'`
1857 if $test -f $uname; then
1865 umips) osname=umips ;;
1868 [23]100) osname=mips ;;
1869 next*) osname=next ;;
1871 if $test -f /etc/kconfig; then
1873 if test "$lns" = "ln -s"; then
1875 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1877 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1883 if test -n "$DJGPP"; then
1892 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1894 'not found') osvers="$4"."$3" ;;
1895 '<3240'|'<>3240') osvers=3.2.0 ;;
1896 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1897 '=3250'|'>3250') osvers=3.2.5 ;;
1901 *dc.osx) osname=dcosx
1907 domainos) osname=apollo
1913 dynixptx*) osname=dynixptx
1916 freebsd) osname=freebsd
1918 genix) osname=genix ;;
1923 *.10.*) osvers=10 ;;
1924 *.11.*) osvers=11 ;;
1925 *.12.*) osvers=12 ;;
1941 netbsd*) osname=netbsd
1944 news-os) osvers="$3"
1946 4*) osname=newsos4 ;;
1950 bsd386) osname=bsd386
1953 powerux | power_ux | powermax_os | powermaxos | \
1954 powerunix | power_unix) osname=powerux
1957 next*) osname=next ;;
1958 solaris) osname=solaris
1960 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1967 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1971 titanos) osname=titanos
1980 ultrix) osname=ultrix
1983 osf1|mls+) case "$5" in
1986 osvers=`echo "$3" | sed 's/^[xvt]//'`
1988 hp*) osname=hp_osf1 ;;
1989 mips) osname=mips_osf1 ;;
1998 $2) case "$osname" in
2002 : svr4.x or possibly later
2012 if test -f /stand/boot ; then
2013 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2014 if test -n "$INITPROG" -a -f "$INITPROG"; then
2015 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2016 if test -n "$isesix"; then
2024 *) if test -f /etc/systemid; then
2026 set `echo $3 | $sed 's/\./ /g'` $4
2027 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2029 elif $test -f $src/hints/sco_$1_$2.sh; then
2031 elif $test -f $src/hints/sco_$1.sh; then
2036 '') : Still unknown. Probably a generic Sys V.
2045 *) case "$osname" in
2046 '') : Still unknown. Probably a generic BSD.
2054 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2055 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2056 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2059 $rm -f UU/kernel.what
2060 elif test -d c:/.; then
2067 : Now look for a hint file osname_osvers, unless one has been
2068 : specified already.
2071 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2072 : Also try without trailing minor version numbers.
2073 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2074 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2075 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2076 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2079 *) case "$osvers" in
2082 *) if $test -f $src/hints/$file.sh ; then
2084 elif $test -f $src/hints/$xfile.sh ; then
2086 elif $test -f $src/hints/$xxfile.sh ; then
2088 elif $test -f $src/hints/$xxxfile.sh ; then
2090 elif $test -f $src/hints/$xxxxfile.sh ; then
2092 elif $test -f "$src/hints/${osname}.sh" ; then
2101 if $test -f Policy.sh ; then
2104 none) dflt="Policy" ;;
2105 *) dflt="Policy $dflt" ;;
2110 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2114 if $test -f Policy.sh ; then
2117 There's also a Policy hint file available, which should make the
2118 site-specific (policy) questions easier to answer.
2125 You may give one or more space-separated answers, or "none" if appropriate.
2126 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2127 is a good thing. DO NOT give a wrong version.
2131 rp="Which of these apply, if any?"
2134 for file in $tans; do
2135 if $test X$file = XPolicy -a -f Policy.sh; then
2137 $cat Policy.sh >> UU/config.sh
2138 elif $test -f $src/hints/$file.sh; then
2139 . $src/hints/$file.sh
2140 $cat $src/hints/$file.sh >> UU/config.sh
2141 elif $test X$tans = X -o X$tans = Xnone ; then
2144 : Give one chance to correct a possible typo.
2145 echo "$file.sh does not exist"
2147 rp="hint to use instead?"
2149 for file in $ans; do
2150 if $test -f "$src/hints/$file.sh"; then
2151 . $src/hints/$file.sh
2152 $cat $src/hints/$file.sh >> UU/config.sh
2153 elif $test X$ans = X -o X$ans = Xnone ; then
2156 echo "$file.sh does not exist -- ignored."
2163 : Remember our hint file for later.
2164 if $test -f "$src/hints/$file.sh" ; then
2174 echo "Fetching default answers from $config_sh..." >&4
2178 cp $config_sh config.sh 2>/dev/null
2188 test "$override" && . ./optdef.sh
2189 myuname="$newmyuname"
2191 : Restore computed paths
2192 for file in $loclist $trylist; do
2193 eval $file="\$_$file"
2198 Configure uses the operating system name and version to set some defaults.
2199 The default value is probably right if the name rings a bell. Otherwise,
2200 since spelling matters for me, either accept the default or answer "none"
2207 ''|' '|none) dflt=none ;;
2208 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2211 *) dflt="$osname" ;;
2213 rp="Operating system name?"
2217 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2223 ''|' '|none) dflt=none ;;
2224 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2225 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2227 ''|' ') dflt=none ;;
2232 *) dflt="$osvers" ;;
2234 rp="Operating system version?"
2241 : who configured the system
2242 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2243 cf_by=`(logname) 2>/dev/null`
2246 cf_by=`(whoami) 2>/dev/null`
2248 "") cf_by=unknown ;;
2252 : set up the script used to warn in case of inconsistency
2259 echo "*** WHOA THERE!!! ***" >&4
2260 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2261 rp=" Keep the $hint value?"
2264 y) td=$was; tu=$was;;
2268 : function used to set $1 to $val
2269 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2271 $define$undef) . ./whoa; eval "$var=\$td";;
2272 $undef$define) . ./whoa; eval "$var=\$tu";;
2273 *) eval "$var=$val";;
2278 Perl can be built to take advantage of threads, on some systems.
2279 To do so, Configure must be run with -Dusethreads.
2280 (See README.threads for details.)
2282 case "$usethreads" in
2283 $define|true|[yY]*) dflt='y';;
2286 rp='Build a threading Perl?'
2289 y|Y) val="$define" ;;
2294 : Look for a hint-file generated 'call-back-unit'. Now that the
2295 : user has specified if a threading perl is to be built, we may need
2296 : to set or change some other defaults.
2297 if $test -f usethreads.cbu; then
2300 case "$d_oldpthreads" in
2301 '') : Configure tests would be welcome here. For now, assume undef.
2303 *) val="$d_oldpthreads" ;;
2308 : determine the architecture name
2310 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2311 tarch=`arch`"-$osname"
2312 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2313 if uname -m > tmparch 2>&1 ; then
2314 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2315 -e 's/$/'"-$osname/" tmparch`
2323 case "$myarchname" in
2326 echo "(Your architecture name used to be $myarchname.)"
2332 *) dflt="$archname";;
2334 rp='What is your architecture name'
2336 case "$usethreads" in
2337 $define) echo "Threads selected." >&4
2339 *-thread) echo "...and architecture name already ends in -thread." >&4
2342 *) archname="$ans-thread"
2343 echo "...setting architecture name to $archname." >&4
2347 *) archname="$ans" ;;
2353 $define|true) afs=true ;;
2354 $undef|false) afs=false ;;
2355 *) if test -d /afs; then
2363 echo "AFS may be running... I'll be extra cautious then..." >&4
2365 echo "AFS does not seem to be running..." >&4
2368 : decide how portable to be. Allow command line overrides.
2369 case "$d_portable" in
2371 *) d_portable="$define" ;;
2374 : set up shell script to do ~ expansion
2380 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2383 if $test -f /bin/csh; then
2384 /bin/csh -f -c "glob \$1"
2389 name=\`$expr x\$1 : '..\([^/]*\)'\`
2390 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2391 if $test ! -d "\$dir"; then
2393 echo "\$me: can't locate home directory for: \$name" >&2
2398 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2414 : now set up to get a file name
2418 cat <<'EOSC' >>getfile
2431 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2432 fn=`echo $fn | sed 's/(.*)//'`
2438 loc_file=`expr $fn : '.*:\(.*\)'`
2439 fn=`expr $fn : '\(.*\):.*'`
2447 */*) fullpath=true;;
2456 *e*) exp_file=true;;
2459 *p*) nopath_ok=true;;
2464 *d*) type='Directory';;
2465 *l*) type='Locate';;
2470 Locate) what='File';;
2475 case "$d_portable" in
2483 while test "$type"; do
2488 true) rp="$rp (~name ok)";;
2491 if test -f UU/getfile.ok && \
2492 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2511 value=`UU/filexp $ans`
2514 if test "$ans" != "$value"; then
2515 echo "(That expands to $value on this system.)"
2529 /*) value="$ansexp" ;;
2534 echo "I shall only accept a full path name, as in /bin/ls." >&4
2535 echo "Use a ! shell escape if you wish to check pathnames." >&4
2538 echo "Please give a full path name, starting with slash." >&4
2541 echo "Note that using ~name is ok provided it expands well." >&4
2554 if test -f "$ansexp"; then
2556 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2558 echo "($value is not a plain file, but that's ok.)"
2563 if test -d "$ansexp"; then
2568 if test -d "$ansexp"; then
2569 echo "(Looking for $loc_file in directory $value.)"
2570 value="$value/$loc_file"
2571 ansexp="$ansexp/$loc_file"
2573 if test -f "$ansexp"; then
2576 case "$nopath_ok" in
2577 true) case "$value" in
2579 *) echo "Assuming $value will be in people's path."
2595 if test "$fastread" = yes; then
2600 rp="$what $value doesn't exist. Use that name anyway?"
2621 : determine root of directory hierarchy where package will be installed.
2624 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2632 By default, $package will be installed in $dflt/bin, manual
2633 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2634 all installation directories. Typically set to /usr/local, but you
2635 may choose /usr if you wish to install $package among your system
2636 binaries. If you wish to have binaries under /bin but manual pages
2637 under /usr/local/man, that's ok: you will be prompted separately
2638 for each of the installation directories, the prefix being only used
2639 to set the defaults.
2643 rp='Installation prefix to use?'
2651 *) oldprefix="$prefix";;
2658 : set the prefixit variable, to compute a suitable default value
2659 prefixit='case "$3" in
2661 case "$oldprefix" in
2662 "") eval "$1=\"\$$2\"";;
2669 ""|" ") eval "$1=\"\$$2\"";;
2675 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2677 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2678 /*-$oldprefix/*|\~*-$oldprefix/*)
2679 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2680 *) eval "$1=\"\$$2\"";;
2684 : determine where private library files go
2685 : Usual default is /usr/local/lib/perl5. Also allow things like
2686 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2688 *perl*) set dflt privlib lib ;;
2689 *) set dflt privlib lib/$package ;;
2694 There are some auxiliary files for $package that need to be put into a
2695 private library directory that is accessible by everyone.
2699 rp='Pathname where the private library files will reside?'
2701 if $test "X$privlibexp" != "X$ansexp"; then
2705 privlibexp="$ansexp"
2709 Since you are running AFS, I need to distinguish the directory in which
2710 private files reside from the directory in which they are installed (and from
2711 which they are presumably copied to the former directory by occult means).
2714 case "$installprivlib" in
2715 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2716 *) dflt="$installprivlib";;
2719 rp='Where will private files be installed?'
2721 installprivlib="$ans"
2723 installprivlib="$privlibexp"
2726 : set the base revision
2729 : get the patchlevel
2731 echo "Getting the current patchlevel..." >&4
2732 if $test -r $rsrc/patchlevel.h;then
2733 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2734 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2739 $echo $n "(You have $package" $c
2742 *) $echo $n " $baserev" $c ;;
2744 $echo $n " patchlevel $patchlevel" $c
2745 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2748 : set the prefixup variable, to restore leading tilda escape
2749 prefixup='case "$prefixexp" in
2751 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2754 : determine where public architecture dependent libraries go
2760 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2764 *) if test 0 -eq "$subversion"; then
2765 version=`LC_ALL=C; export LC_ALL; \
2766 echo $baserev $patchlevel | \
2767 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2769 version=`LC_ALL=C; export LC_ALL; \
2770 echo $baserev $patchlevel $subversion | \
2771 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2773 dflt="$privlib/$archname/$version"
2783 $spackage contains architecture-dependent library files. If you are
2784 sharing libraries in a heterogeneous environment, you might store
2785 these files in a separate location. Otherwise, you can just include
2786 them with the rest of the public library files.
2790 rp='Where do you want to put the public architecture-dependent libraries?'
2793 archlibexp="$ansexp"
2798 Since you are running AFS, I need to distinguish the directory in
2799 which architecture-dependent library files reside from the directory
2800 in which they are installed (and from which they are presumably copied
2801 to the former directory by occult means).
2804 case "$installarchlib" in
2805 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2806 *) dflt="$installarchlib";;
2809 rp='Where will architecture-dependent library files be installed?'
2811 installarchlib="$ans"
2813 installarchlib="$archlibexp"
2815 if $test X"$archlib" = X"$privlib"; then
2821 : make some quick guesses about what we are up against
2823 $echo $n "Hmm... $c"
2833 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2834 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2836 echo "Looks kind of like an OSF/1 system, but we'll see..."
2838 elif test `echo abc | tr a-z A-Z` = Abc ; then
2839 xxx=`./loc addbib blurfl $pth`
2840 if $test -f $xxx; then
2841 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2845 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2846 echo "Looks kind of like an extended USG system, but we'll see..."
2848 echo "Looks kind of like a USG system, but we'll see..."
2852 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2853 echo "Looks kind of like a BSD system, but we'll see..."
2857 echo "Looks kind of like a Version 7 system, but we'll see..."
2860 case "$eunicefix" in
2863 There is, however, a strange, musty smell in the air that reminds me of
2864 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2868 : it so happens the Eunice I know will not run shell scripts in Unix format
2872 echo "Congratulations. You aren't running Eunice."
2876 : Detect OS2. The p_ variable is set above in the Head.U unit.
2881 I have the feeling something is not exactly right, however...don't tell me...
2882 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2887 if test -f /xenix; then
2888 echo "Actually, this looks more like a XENIX system..."
2893 echo "It's not Xenix..."
2898 if test -f /venix; then
2899 echo "Actually, this looks more like a VENIX system..."
2906 echo "Nor is it Venix..."
2909 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2910 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2913 : see if setuid scripts can be secure
2916 Some kernels have a bug that prevents setuid #! scripts from being
2917 secure. Some sites have disabled setuid #! scripts because of this.
2919 First let's decide if your kernel supports secure setuid #! scripts.
2920 (If setuid #! scripts would be secure but have been disabled anyway,
2921 don't say that they are secure if asked.)
2926 if $test -d /dev/fd; then
2927 echo "#!$ls" >reflect
2928 chmod +x,u+s reflect
2929 ./reflect >flect 2>&1
2930 if $contains "/dev/fd" flect >/dev/null; then
2931 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2935 If you are not sure if they are secure, I can check but I'll need a
2936 username and password different from the one you are using right now.
2937 If you don't have such a username or don't want me to test, simply
2941 rp='Other username to test security of setuid scripts with?'
2946 case "$d_suidsafe" in
2947 '') echo "I'll assume setuid scripts are *not* secure." >&4
2950 echo "Well, the $hint value is *not* secure." >&4
2952 *) echo "Well, the $hint value *is* secure." >&4
2957 $rm -f reflect flect
2958 echo "#!$ls" >reflect
2959 chmod +x,u+s reflect
2962 echo '"su" will (probably) prompt you for '"$ans's password."
2963 su $ans -c './reflect >flect'
2964 if $contains "/dev/fd" flect >/dev/null; then
2965 echo "Okay, it looks like setuid scripts are secure." >&4
2968 echo "I don't think setuid scripts are secure." >&4
2973 rp='Does your kernel have *secure* setuid scripts?'
2976 [yY]*) val="$define";;
2981 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
2982 echo "(That's for file descriptors, not floppy disks.)"
2988 $rm -f reflect flect
2990 : now see if they want to do setuid emulation
2993 case "$d_suidsafe" in
2996 echo "No need to emulate SUID scripts since they are secure here." >& 4
3000 Some systems have disabled setuid scripts, especially systems where
3001 setuid scripts cannot be secure. On systems where setuid scripts have
3002 been disabled, the setuid/setgid bits on scripts are currently
3003 useless. It is possible for $package to detect those bits and emulate
3004 setuid/setgid in a secure fashion. This emulation will only work if
3005 setuid scripts have been disabled in your kernel.
3009 "$define") dflt=y ;;
3012 rp="Do you want to do setuid/setgid emulation?"
3015 [yY]*) val="$define";;
3023 : determine where manual pages are on this system
3027 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3028 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3029 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3030 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3031 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3032 sysman=`./loc . /usr/man/man1 $syspath`
3035 if $test -d "$sysman"; then
3036 echo "System manual is in $sysman." >&4
3038 echo "Could not find manual pages in source form." >&4
3041 : see what memory models we can support
3044 $cat >pdp11.c <<'EOP'
3053 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3054 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3055 dflt='unsplit split'
3057 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3060 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3065 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3068 if $test -d /lib/large || $test -d /usr/lib/large; then
3071 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3080 Some systems have different model sizes. On most systems they are called
3081 small, medium, large, and huge. On the PDP11 they are called unsplit and
3082 split. If your system doesn't support different memory models, say "none".
3083 If you wish to force everything to one memory model, say "none" here and
3084 put the appropriate flags later when it asks you for other cc and ld flags.
3085 Venix systems may wish to put "none" and let the compiler figure things out.
3086 (In the following question multiple model names should be space separated.)
3088 The default for most systems is "none".
3091 rp="Which memory models are supported?"
3106 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3107 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3114 rp="What flag indicates separate I and D space?"
3122 *large*|*small*|*medium*|*huge*)
3129 rp="What flag indicates large model?"
3139 *huge*) case "$huge" in
3143 rp="What flag indicates huge model?"
3153 *medium*) case "$medium" in
3157 rp="What flag indicates medium model?"
3164 *) medium="$large";;
3167 *small*) case "$small" in
3171 rp="What flag indicates small model?"
3182 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3185 $rm -f pdp11.* pdp11
3187 : see if we need a special compiler
3195 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3196 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3210 On some older systems the default C compiler will not resolve multiple global
3211 references that happen to have the same name. On some such systems the "Mcc"
3212 command may be used to force these to be resolved. On other systems a "cc -M"
3213 command is required. (Note that the -M flag on other systems indicates a
3214 memory model to use!) If you have the Gnu C compiler, you might wish to use
3220 rp="Use which C compiler?"
3228 rp="Use which C compiler?"
3232 : Look for a hint-file generated 'call-back-unit'. Now that the
3233 : user has specified the compiler, we may need to set or change some
3235 if $test -f cc.cbu; then
3239 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3240 $cat >gccvers.c <<EOM
3245 printf("%s\n", __VERSION__);
3247 printf("%s\n", "1");
3253 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3254 gccversion=`./gccvers`
3255 case "$gccversion" in
3256 '') echo "You are not using GNU cc." ;;
3257 *) echo "You are using GNU cc $gccversion." ;;
3261 echo "*** WHOA THERE!!! ***" >&4
3262 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3263 case "$knowitall" in
3265 echo " You'd better start hunting for one and let me know about it." >&4
3271 case "$gccversion" in
3272 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3275 : What should the include directory be ?
3277 $echo $n "Hmm... $c"
3281 if $test -f /bin/mips && /bin/mips; then
3282 echo "Looks like a MIPS system..."
3283 $cat >usr.c <<'EOCP'
3284 #ifdef SYSTYPE_BSD43
3288 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3289 dflt='/bsd43/usr/include'
3293 mips_type='System V'
3295 $rm -f usr.c usr.out
3296 echo "and you're compiling with the $mips_type compiler and libraries."
3300 echo "Doesn't look like a MIPS system."
3310 case "$xxx_prompt" in
3313 rp='Where are the include files you want to use?'
3321 : see how we invoke the C preprocessor
3323 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3324 cat <<'EOT' >testcpp.c
3330 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3332 wrapper=`pwd`/cppstdin
3336 if $test "X$cppstdin" != "X" && \
3337 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3338 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3340 echo "You used to use $cppstdin $cppminus so we'll use that again."
3342 '') echo "But let's see if we can live without a wrapper..." ;;
3344 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3347 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3350 echo "(However, $cpprun $cpplast does not work, let's see...)"
3358 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3365 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3366 $cc -E <testcpp.c >testcpp.out 2>&1; \
3367 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3368 echo "Yup, it does."
3371 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3372 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3373 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3374 echo "Yup, it does."
3377 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3378 $cc -P <testcpp.c >testcpp.out 2>&1; \
3379 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3380 echo "Yipee, that works!"
3383 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3384 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3385 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3386 echo "At long last!"
3389 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3390 $cpp <testcpp.c >testcpp.out 2>&1; \
3391 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3395 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3396 $cpp - <testcpp.c >testcpp.out 2>&1; \
3397 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3398 echo "Hooray, it works! I was beginning to wonder."
3401 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3402 $wrapper <testcpp.c >testcpp.out 2>&1; \
3403 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3409 rp="No dice. I can't find a C preprocessor. Name one:"
3413 $x_cpp <testcpp.c >testcpp.out 2>&1
3414 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3415 echo "OK, that will do." >&4
3417 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3432 echo "Perhaps can we force $cc -E using a wrapper..."
3433 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3434 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3440 echo "Nope, we'll have to live without it..."
3455 *) $rm -f $wrapper;;
3457 $rm -f testcpp.c testcpp.out
3459 : Set private lib path
3462 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3467 '') dlist="$loclibpth $plibpth $glibpth";;
3468 *) dlist="$libpth";;
3471 : Now check and see which directories actually exist, avoiding duplicates
3475 if $test -d $xxx; then
3478 *) libpth="$libpth $xxx";;
3484 Some systems have incompatible or broken versions of libraries. Among
3485 the directories listed in the question below, please remove any you
3486 know not to be holding relevant libraries, and add any that are needed.
3487 Say "none" for none.
3498 rp="Directories to use for library searches?"
3505 : compute shared library extension
3508 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3518 On some systems, shared libraries may be available. Answer 'none' if
3519 you want to suppress searching of shared libraries for the remaining
3520 of this configuration.
3523 rp='What is the file extension used for shared libraries?'
3527 : Define several unixisms.
3528 : Hints files or command line option can be used to override them.
3529 : The convoluted testing is in case hints files set either the old
3532 '') case "$exe_ext" in
3534 *) _exe="$exe_ext" ;;
3539 '') case "$lib_ext" in
3546 '') case "$obj_ext" in
3553 '') case "$path_sep" in
3564 : Which makefile gets called first. This is used by make depend.
3565 case "$firstmakefile" in
3566 '') firstmakefile='makefile';;
3569 : Looking for optional libraries
3571 echo "Checking for optional libraries..." >&4
3576 case "$libswanted" in
3577 '') libswanted='c_s';;
3579 for thislib in $libswanted; do
3581 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3582 echo "Found -l$thislib (shared)."
3585 *) dflt="$dflt -l$thislib";;
3587 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3588 echo "Found -l$thislib (shared)."
3591 *) dflt="$dflt -l$thislib";;
3593 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3594 echo "Found -l$thislib."
3597 *) dflt="$dflt -l$thislib";;
3599 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3600 echo "Found -l$thislib."
3603 *) dflt="$dflt -l$thislib";;
3605 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3606 echo "Found -l${thislib}_s."
3609 *) dflt="$dflt -l${thislib}_s";;
3611 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3612 echo "Found -l$thislib."
3615 *) dflt="$dflt -l$thislib";;
3618 echo "No -l$thislib."
3629 ' '|'') dflt='none';;
3634 Some versions of Unix support shared libraries, which make executables smaller
3635 but make load time slightly longer.
3637 On some systems, mostly System V Release 3's, the shared library is included
3638 by putting the option "-lc_s" as the last thing on the cc command line when
3639 linking. Other systems use shared libraries by default. There may be other
3640 libraries needed to compile $package on your machine as well. If your system
3641 needs the "-lc_s" option, include it here. Include any other special libraries
3642 here as well. Say "none" for none.
3646 rp="Any additional libraries?"
3653 : determine optimize, if desired, or use for debug flag also
3655 ' '|$undef) dflt='none';;
3657 *) dflt="$optimize";;
3661 Some C compilers have problems with their optimizers. By default, $package
3662 compiles with the -O flag to use the optimizer. Alternately, you might want
3663 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3664 systems). Either flag can be specified here. To use neither flag, specify
3668 rp="What optimizer/debugger flag should be used?"
3672 'none') optimize=" ";;
3676 : We will not override a previous value, but we might want to
3677 : augment a hint file
3680 case "$gccversion" in
3681 1*) dflt='-fpcc-struct-return' ;;
3684 *-g*) dflt="$dflt -DDEBUGGING";;
3686 case "$gccversion" in
3687 2*) if test -d /etc/conf/kconfig.d &&
3688 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3697 case "$mips_type" in
3698 *BSD*|'') inclwanted="$locincpth $usrinc";;
3699 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3701 for thisincl in $inclwanted; do
3702 if $test -d $thisincl; then
3703 if $test x$thisincl != x$usrinc; then
3706 *) dflt="$dflt -I$thisincl";;
3712 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3714 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3722 *) dflt="$dflt -D$2";;
3727 set signal.h __LANGUAGE_C__; eval $inctest
3729 set signal.h LANGUAGE_C; eval $inctest
3733 none|recommended) dflt="$ccflags $dflt" ;;
3734 *) dflt="$ccflags";;
3742 Your C compiler may want other flags. For this question you should include
3743 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3744 but you should NOT include libraries or ld flags like -lwhatever. If you
3745 want $package to honor its debug switch, you should include -DDEBUGGING here.
3746 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3748 To use no flags, specify the word "none".
3754 rp="Any additional cc flags?"
3761 : the following weeds options from ccflags that are of no interest to cpp
3763 case "$gccversion" in
3764 1*) cppflags="$cppflags -D__GNUC__"
3766 case "$mips_type" in
3768 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3774 echo "Let me guess what the preprocessor flags are..." >&4
3788 *) ftry="$previous $flag";;
3790 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3791 >cpp1.out 2>/dev/null && \
3792 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3793 >cpp2.out 2>/dev/null && \
3794 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3795 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3797 cppflags="$cppflags $ftry"
3807 *-*) echo "They appear to be: $cppflags";;
3809 $rm -f cpp.c cpp?.out
3813 : flags used in final linking phase
3815 '') if ./venix; then
3821 *-posix*) dflt="$dflt -posix" ;;
3824 *) dflt="$ldflags";;
3827 : Try to guess additional flags to pick up local libraries.
3828 for thislibdir in $libpth; do
3829 case " $loclibpth " in
3832 *"-L$thislibdir "*) ;;
3833 *) dflt="$dflt -L$thislibdir" ;;
3845 Your C linker may need flags. For this question you should
3846 include -L/whatever and any other flags used by the C linker, but you
3847 should NOT include libraries like -lwhatever.
3849 Make sure you include the appropriate -L/path flags if your C linker
3850 does not normally search all of the directories you specified above,
3853 To use no flags, specify the word "none".
3857 rp="Any additional ld flags (NOT including libraries)?"
3863 rmlist="$rmlist pdp11"
3867 echo "Checking your choice of C compiler and flags for coherency..." >&4
3868 set X $cc $optimize $ccflags $ldflags -o try try.c $libs
3871 I've tried to compile and run a simple program with:
3876 and I got the following output:
3879 $cat > try.c <<'EOF'
3881 main() { printf("Ok\n"); exit(0); }
3884 if sh -c "$cc $optimize $ccflags $ldflags -o try try.c $libs" >>try.msg 2>&1; then
3885 if sh -c './try' >>try.msg 2>&1; then
3889 *) echo 'The program compiled OK, but produced no output.' >> try.msg
3892 cat >> try.msg <<'EOQS'
3893 If $libs contains -lsfio, and sfio is mis-configured, then it
3894 sometimes (apparently) runs and exits with a 0 status, but with no
3895 output! It may have to do with sfio's use of _exit vs. exit.
3898 rp="You have a big problem. Shall I abort Configure"
3905 echo "The program compiled OK, but exited with status $?." >>try.msg
3906 rp="You have a problem. Shall I abort Configure"
3910 echo "I can't compile the test program." >>try.msg
3911 rp="You have a BIG problem. Shall I abort Configure"
3917 case "$knowitall" in
3919 echo "(The supplied flags might be incorrect with this C compiler.)"
3927 *) echo "Ok. Stopping Configure." >&4
3932 n) echo "OK, that should do.";;
3934 $rm -f try try.* core
3936 : Cruising for prototypes
3938 echo "Checking out function prototypes..." >&4
3939 $cat >prototype.c <<'EOCP'
3940 main(int argc, char *argv[]) {
3943 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
3944 echo "Your C compiler appears to support function prototypes."
3947 echo "Your C compiler doesn't seem to understand function prototypes."
3954 case "$prototype" in
3956 *) ansi2knr='ansi2knr'
3961 This version of $package can only be compiled by a compiler that
3962 understands function prototypes. Unfortunately, your C compiler
3964 doesn't seem to understand them. Sorry about that.
3966 If GNU cc is avaiable for your system, perhaps you could try that instead.
3968 Eventually, we hope to support building Perl with pre-ANSI compilers.
3969 If you would like to help in that effort, please contact <perlbug@perl.org>.
3971 Aborting Configure now.
3977 : determine where public executables go
3982 rp='Pathname where the public executables will reside?'
3984 if $test "X$ansexp" != "X$binexp"; then
3992 Since you are running AFS, I need to distinguish the directory in which
3993 executables reside from the directory in which they are installed (and from
3994 which they are presumably copied to the former directory by occult means).
3997 case "$installbin" in
3998 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
3999 *) dflt="$installbin";;
4002 rp='Where will public executables be installed?'
4006 installbin="$binexp"
4009 : define a shorthand compile call
4013 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4014 : define a shorthand compile call for compilations that should be ok.
4018 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4021 echo "Checking for GNU C Library..." >&4
4022 cat >gnulibc.c <<EOM
4026 return __libc_main();
4030 if eval $compile && \
4031 ./gnulibc | $contains '^GNU C Library'; then
4033 echo "You are using the GNU C Library"
4036 echo "You are not using the GNU C Library"
4042 : see if nm is to be used to determine whether a symbol is defined or not
4046 case "$d_gnulibc" in
4049 echo "nm probably won't work on the GNU C Library." >&4
4055 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4057 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4058 echo "'nm' won't be sufficient on this sytem." >&4
4064 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4065 if $test $dflt -gt 20; then
4075 true|$define) dflt=y;;
4082 I can use $nm to extract the symbols from your C libraries. This
4083 is a time consuming task which may generate huge output on the disk (up
4084 to 3 megabytes) but that should make the symbols extraction faster. The
4085 alternative is to skip the 'nm' extraction part and to compile a small
4086 test program instead to determine whether each symbol is present. If
4087 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4088 this may be the best solution.
4090 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4093 rp="Shall I use $nm to extract C symbols from the libraries?"
4096 [Nn]*) usenm=false;;
4105 : nm options which may be necessary
4107 '') if $test -f /mach_boot; then
4109 elif $test -d /usr/ccs/lib; then
4110 nm_opt='-p' # Solaris (and SunOS?)
4111 elif $test -f /dgux; then
4113 elif $test -f /lib64/rld; then
4114 nm_opt='-p' # 64-bit Irix
4120 : nm options which may be necessary for shared libraries but illegal
4121 : for archive libraries. Thank you, Linux.
4122 case "$nm_so_opt" in
4123 '') case "$myuname" in
4125 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4126 nm_so_opt='--dynamic'
4135 : get list of predefined functions in a handy place
4140 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4147 *) for thislib in $libs; do
4150 : Handle C library specially below.
4153 thislib=`echo $thislib | $sed -e 's/^-l//'`
4154 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4156 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4158 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4160 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4162 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4164 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4166 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4171 libnames="$libnames $try"
4173 *) libnames="$libnames $thislib" ;;
4182 for xxx in $libpth; do
4183 $test -r $1 || set $xxx/libc.$so
4184 : The messy sed command sorts on library version numbers.
4186 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4187 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4189 s/[0-9][0-9]*/0000&/g
4190 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4193 sort | $sed -e 's/^.* //'`
4196 $test -r $1 || set /usr/ccs/lib/libc.$so
4197 $test -r $1 || set /lib/libsys_s$_a
4203 if $test -r "$1"; then
4204 echo "Your (shared) C library seems to be in $1."
4206 elif $test -r /lib/libc && $test -r /lib/clib; then
4207 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4209 libc='/lib/clib /lib/libc'
4210 if $test -r /lib/syslib; then
4211 echo "(Your math library is in /lib/syslib.)"
4212 libc="$libc /lib/syslib"
4214 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4215 echo "Your C library seems to be in $libc, as you said before."
4216 elif $test -r $incpath/usr/lib/libc$_a; then
4217 libc=$incpath/usr/lib/libc$_a;
4218 echo "Your C library seems to be in $libc. That's fine."
4219 elif $test -r /lib/libc$_a; then
4221 echo "Your C library seems to be in $libc. You're normal."
4223 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4225 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4226 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4227 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4229 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4231 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4234 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4236 if $test -r "$tans"; then
4237 echo "Your C library seems to be in $tans, of all places."
4243 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4247 If the guess above is wrong (which it might be if you're using a strange
4248 compiler, or your machine supports multiple models), you can override it here.
4253 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4255 I can't seem to find your C library. I've looked in the following places:
4258 $sed 's/^/ /' libpath
4261 None of these seems to contain your C library. I need to get its name...
4266 rp='Where is your C library?'
4271 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4272 set X `cat libnames`
4275 case $# in 1) xxx=file; esac
4276 echo "Extracting names from the following $xxx for later perusal:" >&4
4278 $sed 's/^/ /' libnames >&4
4280 $echo $n "This may take a while...$c" >&4
4284 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4285 *) $nm $nm_opt $file 2>/dev/null;;
4290 $grep fprintf libc.tmp > libc.ptf
4291 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4292 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4294 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4296 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4298 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4300 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4302 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4304 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4306 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4308 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4310 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4312 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4314 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4316 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4318 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4319 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4321 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4323 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4325 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4327 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4329 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4331 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4335 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4339 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4343 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4345 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4348 $nm -p $* 2>/dev/null >libc.tmp
4349 $grep fprintf libc.tmp > libc.ptf
4350 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4351 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4357 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4359 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4360 for thisname in $libnames $libc; do
4361 $ar t $thisname >>libc.tmp
4363 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4365 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4366 # Repeat libc to extract forwarders to DLL entries too
4367 for thisname in $libnames $libc; do
4368 $ar tv $thisname >>libc.tmp
4369 # Revision 50 of EMX has bug in $ar.
4370 # it will not extract forwarders to DLL entries
4371 # Use emximp which will extract exactly them.
4372 emximp -o tmp.imp $thisname \
4374 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4375 < tmp.imp >>libc.tmp
4378 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4381 echo "$ar didn't seem to work right." >&4
4382 echo "Maybe this is a Cray...trying bld instead..." >&4
4383 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4385 for thisname in $libnames; do
4387 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4388 $ar t $thisname >>libc.tmp
4392 echo "That didn't work either. Giving up." >&4
4399 if $test -f /lib/syscalls.exp; then
4401 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4402 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4406 $rm -f libnames libpath
4408 : determine filename position in cpp output
4410 echo "Computing filename position in cpp output for #include directives..." >&4
4411 echo '#include <stdio.h>' > foo.c
4414 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4415 $grep '^[ ]*#.*stdio\.h' | \
4416 while read cline; do
4419 while $test \$# -gt 0; do
4420 if $test -r \`echo \$1 | $tr -d '"'\`; then
4425 pos=\`expr \$pos + 1\`
4437 *) pos="${fieldn}th";;
4439 echo "Your cpp writes the filename in the $pos field of the line."
4441 : locate header file
4446 if test -f $usrinc/\$wanted; then
4447 echo "$usrinc/\$wanted"
4450 awkprg='{ print \$$fieldn }'
4451 echo "#include <\$wanted>" > foo\$\$.c
4452 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4453 $grep "^[ ]*#.*\$wanted" | \
4454 while read cline; do
4455 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4457 */\$wanted) echo "\$name"; exit 0;;
4468 : define an alternate in-header-list? function
4469 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4470 cont=true; xxf="echo \"<\$1> found.\" >&4";
4471 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4472 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4474 case $# in 4) instead=instead;; *) instead="at last";; esac;
4475 while $test "$cont"; do
4477 var=$2; eval "was=\$$2";
4478 if $test "$xxx" && $test -r "$xxx";
4480 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4483 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4484 set $yyy; shift; shift; yyy=$@;
4485 case $# in 0) cont="";;
4486 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4487 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4488 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4489 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4493 do set $yyy; var=$2; eval "was=\$$2";
4494 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4495 set $yyy; shift; shift; yyy=$@;
4498 : see if dld is available
4502 : is a C symbol defined?
4505 -v) tf=libc.tmp; tc=""; tdc="";;
4506 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4507 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4510 case "$reuseval-$4" in
4512 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4518 if $contains $tlook $tf >/dev/null 2>&1;
4523 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4524 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4532 $define) tval=true;;
4538 : define an is-in-libc? function
4539 inlibc='echo " "; td=$define; tu=$undef;
4540 sym=$1; var=$2; eval "was=\$$2";
4542 case "$reuseval$was" in
4552 echo "$sym() found." >&4;
4553 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4555 echo "$sym() NOT found." >&4;
4556 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4560 $define) echo "$sym() found." >&4;;
4561 *) echo "$sym() NOT found." >&4;;
4565 : see if dlopen exists
4572 : determine which dynamic loading, if any, to compile in
4574 dldir="ext/DynaLoader"
4587 $define) dflt='y' ;;
4590 $define) dflt='y' ;;
4592 : Does a dl_xxx.xs file exist for this operating system
4593 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4596 rp="Do you wish to use dynamic loading?"
4603 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4604 dflt="$dldir/dl_${osname}.xs"
4605 elif $test "$d_dlopen" = "$define" ; then
4606 dflt="$dldir/dl_dlopen.xs"
4607 elif $test "$i_dld" = "$define" ; then
4608 dflt="$dldir/dl_dld.xs"
4613 *) dflt="$dldir/$dlsrc"
4616 echo "The following dynamic loading files are available:"
4617 : Can not go over to $dldir because getfile has path hard-coded in.
4618 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4619 rp="Source file to use for dynamic loading"
4621 # XXX This getfile call will fail the existence check if you try
4622 # building away from $src (this is not supported yet).
4626 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4630 Some systems may require passing special flags to $cc -c to
4631 compile modules that will be used to create a shared library.
4632 To use no flags, say "none".
4635 case "$cccdlflags" in
4636 '') case "$gccversion" in
4637 '') case "$osname" in
4639 next) dflt='none' ;;
4640 irix*) dflt='-KPIC' ;;
4641 svr4*|esix*|solaris)
4643 *-DDEBUGGING*) dflt='-KPIC' ;;
4647 sunos) dflt='-pic' ;;
4651 *) case "$osname" in
4652 svr4*|esix*|solaris)
4654 *-DDEBUGGING*) dflt='-fPIC' ;;
4661 *) dflt="$cccdlflags" ;;
4663 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4666 none) cccdlflags=' ' ;;
4667 *) cccdlflags="$ans" ;;
4672 Some systems use ld to create libraries that can be dynamically loaded,
4673 while other systems (such as those using ELF) use $cc.
4677 '') $cat >try.c <<'EOM'
4678 /* Test for whether ELF binaries are produced */
4683 int i = open("a.out",O_RDONLY);
4686 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4687 exit(0); /* succeed (yes, it's ELF) */
4692 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4694 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4698 echo "I'll use ld to build dynamic libraries."
4707 rp="What command should be used to create dynamic libraries?"
4713 Some systems may require passing special flags to $ld to create a
4714 library that can be dynamically loaded. If your ld flags include
4715 -L/other/path options to locate libraries outside your loader's normal
4716 search path, you may need to specify those -L options here as well. To
4717 use no flags, say "none".
4720 case "$lddlflags" in
4721 '') case "$osname" in
4723 linux|irix*) dflt='-shared' ;;
4724 next) dflt='none' ;;
4725 solaris) dflt='-G' ;;
4726 sunos) dflt='-assert nodefinitions' ;;
4727 svr4*|esix*) dflt="-G $ldflags" ;;
4731 *) dflt="$lddlflags" ;;
4734 : Try to guess additional flags to pick up local libraries.
4735 for thisflag in $ldflags; do
4740 *) dflt="$dflt $thisflag" ;;
4750 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4753 none) lddlflags=' ' ;;
4754 *) lddlflags="$ans" ;;
4759 Some systems may require passing special flags to $cc to indicate that
4760 the resulting executable will use dynamic linking. To use no flags,
4764 case "$ccdlflags" in
4765 '') case "$osname" in
4766 hpux) dflt='-Wl,-E' ;;
4767 linux) dflt='-rdynamic' ;;
4768 next) dflt='none' ;;
4769 sunos) dflt='none' ;;
4772 *) dflt="$ccdlflags" ;;
4774 rp="Any special flags to pass to $cc to use dynamic loading?"
4777 none) ccdlflags=' ' ;;
4778 *) ccdlflags="$ans" ;;
4792 # No dynamic loading being used, so don't bother even to prompt.
4795 *) case "$useshrplib" in
4796 '') case "$osname" in
4797 svr4*|dgux|dynixptx|esix|powerux)
4799 also='Building a shared libperl is required for dynamic loading to work on your system.'
4804 also='Building a shared libperl is needed for MAB support.'
4822 The perl executable is normally obtained by linking perlmain.c with
4823 libperl${_a}, any static extensions (usually just DynaLoader), and
4824 any other libraries needed on this system (such as -lm, etc.). Since
4825 your system supports dynamic loading, it is probably possible to build
4826 a shared libperl.$so. If you will have more than one executable linked
4827 to libperl.$so, this will significantly reduce the size of each
4828 executable, but it may have a noticeable affect on performance. The
4829 default is probably sensible for your system.
4833 rp="Build a shared libperl.$so (y/n)"
4838 # Why does next4 have to be so different?
4839 case "${osname}${osvers}" in
4840 next4*) xxx='DYLD_LIBRARY_PATH' ;;
4841 os2*) xxx='' ;; # Nothing special needed.
4842 *) xxx='LD_LIBRARY_PATH' ;;
4844 if test X"$xxx" != "X"; then
4845 $cat <<EOM | $tee -a ../config.msg >&4
4847 To build perl, you must add the current working directory to your
4848 $xxx environment variable before running make. You can do
4850 $xxx=\`pwd\`; export $xxx
4851 for Bourne-style shells, or
4853 for Csh-style shells. You *MUST* do this before running make.
4858 *) useshrplib='false' ;;
4863 case "$useshrplib" in
4867 # Figure out a good name for libperl.so. Since it gets stored in
4868 # a version-specific architecture-dependent library, the version
4869 # number isn't really that important, except for making cc/ld happy.
4871 # A name such as libperl.so.3.1
4872 majmin="libperl.$so.$patchlevel.$subversion"
4873 # A name such as libperl.so.301
4874 majonly=`echo $patchlevel $subversion |
4875 $awk '{printf "%d%02d", $1, $2}'`
4876 majonly=libperl.$so.$majonly
4877 # I'd prefer to keep the os-specific stuff here to a minimum, and
4878 # rely on figuring it out from the naming of libc.
4879 case "${osname}${osvers}" in
4882 # XXX How handle the --version stuff for MAB?
4884 linux*) # ld won't link with a bare -lperl otherwise.
4887 *) # Try to guess based on whether libc has major.minor.
4889 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
4890 *libc.$so.[0-9]*) dflt=$majonly ;;
4891 *) dflt=libperl.$so ;;
4901 I need to select a good name for the shared libperl. If your system uses
4902 library names with major and minor numbers, then you might want something
4903 like $majmin. Alternatively, if your system uses a single version
4904 number for shared libraries, then you might want to use $majonly.
4905 Or, your system might be quite happy with a simple libperl.$so.
4907 Since the shared libperl will get installed into a version-specific
4908 architecture-dependent directory, the version number of the shared perl
4909 library probably isn't important, so the default should be o.k.
4912 rp='What name do you want to give to the shared libperl?'
4915 echo "Ok, I'll use $libperl"
4918 libperl="libperl${_a}"
4922 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
4926 WARNING: Use of the shrpdir variable for the installation location of
4927 the shared $libperl is not supported. It was never documented and
4928 will not work in this version. Let me (doughera@lafcol.lafayette.edu)
4929 know of any problems this may cause.
4935 But your current setting of $shrpdir is
4936 the default anyway, so it's harmless.
4941 Further, your current attempted setting of $shrpdir
4942 conflicts with the value of $archlibexp/CORE
4943 that installperl will use.
4950 # How will the perl executable find the installed shared $libperl?
4951 # Add $xxx to ccdlflags.
4952 # If we can't figure out a command-line option, use $shrpenv to
4953 # set env LD_RUN_PATH. The main perl makefile uses this.
4954 shrpdir=$archlibexp/CORE
4957 if "$useshrplib"; then
4960 # We'll set it in Makefile.SH...
4966 xxx="-Wl,-R$shrpdir"
4968 linux|irix*|dec_osf)
4969 xxx="-Wl,-rpath,$shrpdir"
4972 # next doesn't like the default...
4975 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
4981 # Only add $xxx if it isn't already in ccdlflags.
4982 case " $ccdlflags " in
4984 *) ccdlflags="$ccdlflags $xxx"
4987 Adding $xxx to the flags
4988 passed to $ld so that the perl executable will find the
4989 installed shared $libperl.
4997 # Respect a hint or command-line value.
4999 '') shrpenv="$tmp_shrpenv" ;;
5002 : determine where manual pages go
5003 set man1dir man1dir none
5007 $spackage has manual pages available in source form.
5011 echo "However, you don't have nroff, so they're probably useless to you."
5013 '') man1dir="none";;
5016 echo "If you don't want the manual sources installed, answer 'none'."
5021 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5022 lookpath="$lookpath $prefixexp/man/p_man/man1"
5023 lookpath="$lookpath $prefixexp/man/u_man/man1"
5024 lookpath="$lookpath $prefixexp/man/man.1"
5026 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5027 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5037 rp="Where do the main $spackage manual pages (source) go?"
5039 if $test "X$man1direxp" != "X$ansexp"; then
5043 man1direxp="$ansexp"
5051 Since you are running AFS, I need to distinguish the directory in which
5052 manual pages reside from the directory in which they are installed (and from
5053 which they are presumably copied to the former directory by occult means).
5056 case "$installman1dir" in
5057 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5058 *) dflt="$installman1dir";;
5061 rp='Where will man pages be installed?'
5063 installman1dir="$ans"
5065 installman1dir="$man1direxp"
5068 : What suffix to use on installed man pages
5075 rp="What suffix should be used for the main $spackage man pages?"
5077 '') case "$man1dir" in
5091 *) dflt="$man1ext";;
5098 : see if we can have long filenames
5100 rmlist="$rmlist /tmp/cf$$"
5101 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5102 first=123456789abcdef
5103 second=/tmp/cf$$/$first
5104 $rm -f $first $second
5105 if (echo hi >$first) 2>/dev/null; then
5106 if $test -f 123456789abcde; then
5107 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5110 if (echo hi >$second) 2>/dev/null; then
5111 if $test -f /tmp/cf$$/123456789abcde; then
5113 That's peculiar... You can have filenames longer than 14 characters, but only
5114 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5115 I shall consider your system cannot support long filenames at all.
5119 echo 'You can have filenames longer than 14 characters.' >&4
5124 How confusing! Some of your filesystems are sane enough to allow filenames
5125 longer than 14 characters but some others like /tmp can't even think about them.
5126 So, for now on, I shall assume your kernel does not allow them at all.
5133 You can't have filenames longer than 14 chars. You can't even think about them!
5139 $rm -rf /tmp/cf$$ 123456789abcde*
5141 : determine where library module manual pages go
5142 set man3dir man3dir none
5146 $spackage has manual pages for many of the library modules.
5152 However, you don't have nroff, so they're probably useless to you.
5155 '') man3dir="none";;
5159 case "$d_flexfnam" in
5162 However, your system can't handle the long file names like File::Basename.3.
5165 '') man3dir="none";;
5169 echo "If you don't want the manual sources installed, answer 'none'."
5170 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5172 '') case "$prefix" in
5173 *$prog*) dflt=`echo $man1dir |
5174 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5175 *) dflt="$privlib/man/man3" ;;
5179 *) dflt="$man3dir" ;;
5184 rp="Where do the $package library man pages (source) go?"
5186 if test "X$man3direxp" != "X$ansexp"; then
5191 man3direxp="$ansexp"
5199 Since you are running AFS, I need to distinguish the directory in which
5200 manual pages reside from the directory in which they are installed (and from
5201 which they are presumably copied to the former directory by occult means).
5204 case "$installman3dir" in
5205 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5206 *) dflt="$installman3dir";;
5209 rp='Where will man pages be installed?'
5211 installman3dir="$ans"
5213 installman3dir="$man3direxp"
5216 : What suffix to use on installed man pages
5223 rp="What suffix should be used for the $package library man pages?"
5225 '') case "$man3dir" in
5239 *) dflt="$man3ext";;
5246 : see if we have to deal with yellow pages, now NIS.
5247 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5248 if $test -f /usr/etc/nibindd; then
5250 echo "I'm fairly confident you're on a NeXT."
5252 rp='Do you get the hosts file via NetInfo?'
5261 y*) hostcat='nidump hosts .';;
5262 *) case "$hostcat" in
5263 nidump*) hostcat='';;
5273 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5281 rp='Are you getting the hosts file via yellow pages?'
5284 y*) hostcat='ypcat hosts';;
5285 *) hostcat='cat /etc/hosts';;
5291 '') hostcat='cat /etc/hosts';;
5294 '') groupcat='cat /etc/group';;
5297 '') passcat='cat /etc/passwd';;
5300 : now get the host name
5302 echo "Figuring out host name..." >&4
5303 case "$myhostname" in
5305 echo 'Maybe "hostname" will work...'
5306 if tans=`sh -c hostname 2>&1` ; then
5314 if $test "$cont"; then
5316 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5317 if tans=`cat /etc/systemid 2>&1` ; then
5319 phostname='cat /etc/systemid'
5320 echo "Whadyaknow. Xenix always was a bit strange..."
5323 elif $test -r /etc/systemid; then
5324 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5327 if $test "$cont"; then
5328 echo 'No, maybe "uuname -l" will work...'
5329 if tans=`sh -c 'uuname -l' 2>&1` ; then
5331 phostname='uuname -l'
5333 echo 'Strange. Maybe "uname -n" will work...'
5334 if tans=`sh -c 'uname -n' 2>&1` ; then
5336 phostname='uname -n'
5338 echo 'Oh well, maybe I can mine it out of whoami.h...'
5339 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5340 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5341 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5343 case "$myhostname" in
5344 '') echo "Does this machine have an identity crisis or something?"
5347 echo "Well, you said $myhostname before..."
5348 phostname='echo $myhostname';;
5354 : you do not want to know about this
5359 if $test "$myhostname" ; then
5361 rp='Your host name appears to be "'$myhostname'".'" Right?"
5369 : bad guess or no guess
5370 while $test "X$myhostname" = X ; do
5372 rp="Please type the (one word) name of your host:"
5377 : translate upper to lower if necessary
5378 case "$myhostname" in
5380 echo "(Normalizing case in your host name)"
5381 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5385 case "$myhostname" in
5387 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5388 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5389 echo "(Trimming domain name from host name--host name is now $myhostname)"
5391 *) case "$mydomain" in
5394 test "X$hostcat" = "Xypcat hosts" &&
5395 ypmatch "$myhostname" hosts 2>/dev/null |\
5396 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5399 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5400 /[ ]$myhostname[ . ]/p" > hosts
5403 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5404 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5405 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5406 hosts | $sort | $uniq | \
5407 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5408 case `$echo X$dflt` in
5409 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5412 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5417 tans=`./loc resolv.conf X /etc /usr/etc`
5418 if $test -f "$tans"; then
5419 echo "(Attempting domain name extraction from $tans)"
5420 dflt=.`$sed -n -e 's/ / /g' \
5421 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5422 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5424 .) dflt=.`$sed -n -e 's/ / /g' \
5425 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5426 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5433 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5434 dflt=.`sh -c domainname 2>/dev/null`
5437 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5442 .) echo "(Lost all hope -- silly guess then)"
5448 *) dflt="$mydomain";;
5452 rp="What is your domain name?"
5462 : translate upper to lower if necessary
5465 echo "(Normalizing case in your domain name)"
5466 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5470 : a little sanity check here
5471 case "$phostname" in
5474 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5475 $myhostname$mydomain|$myhostname) ;;
5477 case "$phostname" in
5479 echo "(That doesn't agree with your whoami.h file, by the way.)"
5482 echo "(That doesn't agree with your $phostname command, by the way.)"
5492 I need to get your e-mail address in Internet format if possible, i.e.
5493 something like user@host.domain. Please answer accurately since I have
5494 no easy means to double check it. The default value provided below
5495 is most probably close to the reality but may not be valid from outside
5496 your organization...
5500 while test "$cont"; do
5502 '') dflt="$cf_by@$myhostname$mydomain";;
5503 *) dflt="$cf_email";;
5505 rp='What is your e-mail address?'
5511 rp='Address does not look like an Internet one. Use it anyway?'
5527 If you or somebody else will be maintaining perl at your site, please
5528 fill in the correct e-mail address here so that they may be contacted
5529 if necessary. Currently, the "perlbug" program included with perl
5530 will send mail to this address in addition to perlbug@perl.com. You may
5531 enter "none" for no administrator.
5534 case "$perladmin" in
5535 '') dflt="$cf_email";;
5536 *) dflt="$perladmin";;
5538 rp='Perl administrator e-mail address'
5542 : figure out how to guarantee perl startup
5543 case "$startperl" in
5545 case "$sharpbang" in
5549 I can use the #! construct to start perl on your system. This will
5550 make startup of perl scripts faster, but may cause problems if you
5551 want to share those scripts and perl is not in a standard place
5552 ($binexp/perl) on all your platforms. The alternative is to force
5553 a shell by starting the script with a single ':' character.
5557 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5560 none) startperl=": # use perl";;
5561 *) startperl="#!$ans"
5562 if $test 30 -lt `echo "$ans" | wc -c`; then
5565 WARNING: Some systems limit the #! command to 32 characters.
5566 If you experience difficulty running Perl scripts with #!, try
5567 installing Perl in a directory with a shorter pathname.
5573 *) startperl=": # use perl"
5578 echo "I'll use $startperl to start perl scripts."
5580 : figure best path for perl in scripts
5583 perlpath="$binexp/perl"
5584 case "$startperl" in
5589 I will use the "eval 'exec'" idiom to start Perl on your system.
5590 I can use the full path of your Perl binary for this purpose, but
5591 doing so may cause problems if you want to share those scripts and
5592 Perl is not always in a standard place ($binexp/perl).
5596 rp="What path shall I use in \"eval 'exec'\"?"
5603 case "$startperl" in
5605 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5608 : determine where public executable scripts go
5609 set scriptdir scriptdir
5611 case "$scriptdir" in
5614 : guess some guesses
5615 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5616 $test -d /usr/share/bin && dflt=/usr/share/bin
5617 $test -d /usr/local/script && dflt=/usr/local/script
5618 $test -d $prefixexp/script && dflt=$prefixexp/script
5622 *) dflt="$scriptdir"
5627 Some installations have a separate directory just for executable scripts so
5628 that they can mount it across multiple architectures but keep the scripts in
5629 one spot. You might, for example, have a subdirectory of /usr/share for this.
5630 Or you might just lump your scripts in with all your other executables.
5634 rp='Where do you keep publicly executable scripts?'
5636 if $test "X$ansexp" != "X$scriptdirexp"; then
5640 scriptdirexp="$ansexp"
5644 Since you are running AFS, I need to distinguish the directory in which
5645 scripts reside from the directory in which they are installed (and from
5646 which they are presumably copied to the former directory by occult means).
5649 case "$installscript" in
5650 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5651 *) dflt="$installscript";;
5654 rp='Where will public scripts be installed?'
5656 installscript="$ans"
5658 installscript="$scriptdirexp"
5661 : determine where site specific libraries go.
5666 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5667 dflt="$privlib/site_$prog" ;;
5668 *) dflt="$sitelib" ;;
5672 The installation process will also create a directory for
5673 site-specific extensions and modules. Some users find it convenient
5674 to place all local files in this directory rather than in the main
5675 distribution directory.
5679 rp='Pathname for the site-specific library files?'
5681 if $test "X$sitelibexp" != "X$ansexp"; then
5685 sitelibexp="$ansexp"
5689 Since you are running AFS, I need to distinguish the directory in
5690 which site-specific files reside from the directory in which they are
5691 installed (and from which they are presumably copied to the former
5692 directory by occult means).
5695 case "$installsitelib" in
5696 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5697 *) dflt="$installsitelib";;
5700 rp='Where will site-specific files be installed?'
5702 installsitelib="$ans"
5704 installsitelib="$sitelibexp"
5707 : determine where site specific architecture-dependent libraries go.
5708 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
5709 : xxx is usuually lib/site_perl/archname.
5710 set sitearch sitearch none
5713 '') dflt="$sitelib/$archname" ;;
5714 *) dflt="$sitearch" ;;
5718 The installation process will also create a directory for
5719 architecture-dependent site-specific extensions and modules.
5723 rp='Pathname for the site-specific architecture-dependent library files?'
5725 if $test "X$sitearchexp" != "X$ansexp"; then
5729 sitearchexp="$ansexp"
5733 Since you are running AFS, I need to distinguish the directory in
5734 which site-specific architecture-dependent library files reside from
5735 the directory in which they are installed (and from which they are
5736 presumably copied to the former directory by occult means).
5739 case "$installsitearch" in
5740 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
5741 *) dflt="$installsitearch";;
5744 rp='Where will site-specific architecture-dependent files be installed?'
5746 installsitearch="$ans"
5748 installsitearch="$sitearchexp"
5753 Previous version of $package used the standard IO mechanisms as defined
5754 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
5755 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
5756 the default. This abstraction layer can use AT&T's sfio (if you already
5757 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
5758 problems with some extension modules. Using PerlIO with stdio is safe,
5759 but it is slower than plain stdio and therefore is not the default.
5761 If this doesn't make any sense to you, just accept the default 'n'.
5763 case "$useperlio" in
5764 $define|true|[yY]*) dflt='y';;
5767 rp='Use the experimental PerlIO abstraction layer?'
5774 echo "Ok, doing things the stdio way"
5781 : Check how to convert floats to strings.
5783 echo "Checking for an efficient way to convert floats to strings."
5786 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
5787 char *myname = "gconvert";
5790 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
5791 char *myname = "gcvt";
5794 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
5795 char *myname = "sprintf";
5801 checkit(expect, got)
5805 if (strcmp(expect, got)) {
5806 printf("%s oddity: Expected %s, got %s\n",
5807 myname, expect, got);
5818 /* This must be 1st test on (which?) platform */
5819 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
5820 Gconvert(0.1, 8, 0, buf);
5821 checkit("0.1", buf);
5823 Gconvert(1.0, 8, 0, buf);
5826 Gconvert(0.0, 8, 0, buf);
5829 Gconvert(-1.0, 8, 0, buf);
5832 /* Some Linux gcvt's give 1.e+5 here. */
5833 Gconvert(100000.0, 8, 0, buf);
5834 checkit("100000", buf);
5836 /* Some Linux gcvt's give -1.e+5 here. */
5837 Gconvert(-100000.0, 8, 0, buf);
5838 checkit("-100000", buf);
5843 case "$d_Gconvert" in
5844 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
5845 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
5846 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
5847 *) xxx_list='gconvert gcvt sprintf' ;;
5850 for xxx_convert in $xxx_list; do
5851 echo "Trying $xxx_convert"
5853 set try -DTRY_$xxx_convert
5854 if eval $compile; then
5855 echo "$xxx_convert" found. >&4
5857 echo "I'll use $xxx_convert to convert floats into a string." >&4
5860 echo "...But $xxx_convert didn't work as I expected."
5863 echo "$xxx_convert NOT found." >&4
5867 case "$xxx_convert" in
5868 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
5869 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
5870 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
5873 : Initialize h_fcntl
5876 : Initialize h_sysfile
5879 : access call always available on UNIX
5883 : locate the flags for 'access()'
5887 $cat >access.c <<'EOCP'
5888 #include <sys/types.h>
5893 #include <sys/file.h>
5902 : check sys/file.h first, no particular reason here
5903 if $test `./findhdr sys/file.h` && \
5904 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
5906 echo "<sys/file.h> defines the *_OK access constants." >&4
5907 elif $test `./findhdr fcntl.h` && \
5908 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
5910 echo "<fcntl.h> defines the *_OK access constants." >&4
5911 elif $test `./findhdr unistd.h` && \
5912 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
5913 echo "<unistd.h> defines the *_OK access constants." >&4
5915 echo "I can't find the four *_OK access constants--I'll use mine." >&4
5921 : see if alarm exists
5925 : Look for GNU-cc style attribute checking
5927 echo "Checking whether your compiler can handle __attribute__ ..." >&4
5928 $cat >attrib.c <<'EOCP'
5930 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
5932 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
5933 if $contains 'warning' attrib.out >/dev/null 2>&1; then
5934 echo "Your C compiler doesn't fully support __attribute__."
5937 echo "Your C compiler supports __attribute__."
5941 echo "Your C compiler doesn't seem to understand __attribute__ at all."
5948 : see if bcmp exists
5952 : see if bcopy exists
5956 : see if this is a unistd.h system
5957 set unistd.h i_unistd
5960 : see if getpgrp exists
5961 set getpgrp d_getpgrp
5964 case "$d_getpgrp" in
5967 echo "Checking to see which flavor of getpgrp is in use..."
5970 #include <sys/types.h>
5972 # include <unistd.h>
5976 if (getuid() == 0) {
5977 printf("(I see you are running Configure as super-user...)\n");
5981 if (getpgrp(1) == 0)
5990 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
5991 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
5993 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
5994 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
5997 echo "I can't seem to compile and run the test program."
5999 xxx="a USG one, i.e. you use getpgrp()."
6001 # SVR4 systems can appear rather BSD-ish.
6004 xxx="a BSD one, i.e. you use getpgrp(pid)."
6008 xxx="probably a USG one, i.e. you use getpgrp()."
6013 echo "Assuming your getpgrp is $xxx" >&4
6022 : see if setpgrp exists
6023 set setpgrp d_setpgrp
6026 case "$d_setpgrp" in
6029 echo "Checking to see which flavor of setpgrp is in use..."
6032 #include <sys/types.h>
6034 # include <unistd.h>
6038 if (getuid() == 0) {
6039 printf("(I see you are running Configure as super-user...)\n");
6043 if (-1 == setpgrp(1, 1))
6046 if (setpgrp() != -1)
6052 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6053 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6055 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6056 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6059 echo "(I can't seem to compile and run the test program.)"
6061 xxx="a USG one, i.e. you use setpgrp()."
6063 # SVR4 systems can appear rather BSD-ish.
6066 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6070 xxx="probably a USG one, i.e. you use setpgrp()."
6075 echo "Assuming your setpgrp is $xxx" >&4
6083 : see if bzero exists
6087 : check for lengths of integral types
6091 echo "Checking to see how big your integers are..." >&4
6092 $cat >intsize.c <<'EOCP'
6096 printf("intsize=%d;\n", sizeof(int));
6097 printf("longsize=%d;\n", sizeof(long));
6098 printf("shortsize=%d;\n", sizeof(short));
6103 if eval $compile_ok && ./intsize > /dev/null; then
6105 echo "Your integers are $intsize bytes long."
6106 echo "Your long integers are $longsize bytes long."
6107 echo "Your short integers are $shortsize bytes long."
6111 Help! I can't compile and run the intsize test program: please enlighten me!
6112 (This is probably a misconfiguration in your system or libraries, and
6113 you really ought to fix it. Still, I'll try anyway.)
6117 rp="What is the size of an integer (in bytes)?"
6121 rp="What is the size of a long integer (in bytes)?"
6125 rp="What is the size of a short integer (in bytes)?"
6131 $rm -f intsize intsize.*
6133 : see if signal is declared as pointer to function returning int or void
6135 xxx=`./findhdr signal.h`
6136 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6137 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6138 echo "You have int (*signal())() instead of void." >&4
6140 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6141 echo "You have void (*signal())()." >&4
6143 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6144 echo "You have int (*signal())() instead of void." >&4
6146 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6147 echo "You have void (*signal())()." >&4
6150 case "$d_voidsig" in
6152 echo "I can't determine whether signal handler returns void or int..." >&4
6154 rp="What type does your signal handler return?"
6161 echo "As you already told me, signal handler returns void." >&4
6164 *) echo "As you already told me, signal handler returns int." >&4
6171 case "$d_voidsig" in
6172 "$define") signal_t="void";;
6177 : check for ability to cast large floats to 32-bit ints.
6179 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6180 if $test "$intsize" -ge 4; then
6187 #include <sys/types.h>
6189 $signal_t blech(s) int s; { exit(3); }
6195 signal(SIGFPE, blech);
6197 /* Don't let compiler optimize the test away */
6198 sscanf("2147483647", "%lf", &f); /* f = (double) 0x7fffffff; */
6202 /* x86 processors will probably give 0x8000 0000, which is a
6203 sign change. We don't want that. We want to mimic SPARC
6204 behavior here, which is to preserve the sign and give
6207 if (i32 != ($xxx) f)
6213 if eval $compile_ok; then
6217 echo "(I can't seem to compile the test program--assuming it can't)"
6225 echo "Nope, it can't."
6232 : check for ability to cast negative floats to unsigned
6234 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6237 #include <sys/types.h>
6239 $signal_t blech(s) int s; { exit(7); }
6240 $signal_t blech_in_list(s) int s; { exit(4); }
6241 unsigned long dummy_long(p) unsigned long p; { return p; }
6242 unsigned int dummy_int(p) unsigned int p; { return p; }
6243 unsigned short dummy_short(p) unsigned short p; { return p; }
6247 unsigned long along;
6249 unsigned short ashort;
6251 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6252 a direct f = -123. assignment. gcc-2.8.0 reportedly
6253 optimized the whole file away
6255 sscanf("-123.", "%lf", &f); /* f = -123.; */
6257 signal(SIGFPE, blech);
6258 along = (unsigned long)f;
6259 aint = (unsigned int)f;
6260 ashort = (unsigned short)f;
6261 if (along != (unsigned long)-123)
6263 if (aint != (unsigned int)-123)
6265 if (ashort != (unsigned short)-123)
6267 sscanf("1073741824.", "%lf", &f); /* f = (double)0x40000000; */
6270 along = (unsigned long)f;
6271 if (along != 0x80000000)
6275 along = (unsigned long)f;
6276 if (along != 0x7fffffff)
6280 along = (unsigned long)f;
6281 if (along != 0x80000001)
6285 signal(SIGFPE, blech_in_list);
6286 sscanf("123.", "%lf", &f); /* f = 123.; */
6287 along = dummy_long((unsigned long)f);
6288 aint = dummy_int((unsigned int)f);
6289 ashort = dummy_short((unsigned short)f);
6290 if (along != (unsigned long)123)
6292 if (aint != (unsigned int)123)
6294 if (ashort != (unsigned short)123)
6301 if eval $compile_ok; then
6305 echo "(I can't seem to compile the test program--assuming it can't)"
6308 case "$castflags" in
6313 echo "Nope, it can't."
6320 : see if vprintf exists
6322 if set vprintf val -f d_vprintf; eval $csym; $val; then
6323 echo 'vprintf() found.' >&4
6325 $cat >vprintf.c <<'EOF'
6326 #include <varargs.h>
6328 main() { xxx("foo"); }
6337 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6341 if eval $compile && ./vprintf; then
6342 echo "Your vsprintf() returns (int)." >&4
6345 echo "Your vsprintf() returns (char*)." >&4
6349 echo 'vprintf() NOT found.' >&4
6359 : see if chown exists
6363 : see if chroot exists
6367 : see if chsize exists
6371 : check for const keyword
6373 echo 'Checking to see if your C compiler knows about "const"...' >&4
6374 $cat >const.c <<'EOCP'
6375 typedef struct spug { int drokk; } spug;
6382 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6384 echo "Yup, it does."
6387 echo "Nope, it doesn't."
6392 : see if crypt exists
6394 if set crypt val -f d_crypt; eval $csym; $val; then
6395 echo 'crypt() found.' >&4
6399 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6400 if $test -z "$cryptlib"; then
6401 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6405 if $test -z "$cryptlib"; then
6406 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6410 if $test -z "$cryptlib"; then
6411 cryptlib=`./loc libcrypt$_a "" $libpth`
6415 if $test -z "$cryptlib"; then
6416 echo 'crypt() NOT found.' >&4
6425 : see if cuserid exists
6426 set cuserid d_cuserid
6429 : see if this is a limits.h system
6430 set limits.h i_limits
6433 : see if this is a float.h system
6437 : See if number of significant digits in a double precision number is known
6439 $cat >dbl_dig.c <<EOM
6449 printf("Contains DBL_DIG");
6452 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6453 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6454 echo "DBL_DIG found." >&4
6457 echo "DBL_DIG NOT found." >&4
6464 : see if difftime exists
6465 set difftime d_difftime
6468 : see if this is a dirent system
6470 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6472 echo "<dirent.h> found." >&4
6475 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6476 echo "<sys/dir.h> found." >&4
6479 xinc=`./findhdr sys/ndir.h`
6481 echo "<dirent.h> NOT found." >&4
6486 : Look for type of directory structure.
6488 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6490 case "$direntrytype" in
6493 $define) guess1='struct dirent' ;;
6494 *) guess1='struct direct' ;;
6497 *) guess1="$direntrytype"
6502 'struct dirent') guess2='struct direct' ;;
6503 *) guess2='struct dirent' ;;
6506 if $contains "$guess1" try.c >/dev/null 2>&1; then
6507 direntrytype="$guess1"
6508 echo "Your directory entries are $direntrytype." >&4
6509 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6510 direntrytype="$guess2"
6511 echo "Your directory entries seem to be $direntrytype." >&4
6513 echo "I don't recognize your system's directory entries." >&4
6514 rp="What type is used for directory entries on this system?"
6522 : see if the directory entry stores field length
6524 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6525 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6526 echo "Good, your directory entry keeps length information in d_namlen." >&4
6529 echo "Your directory entry does not know about the d_namlen field." >&4
6536 : see if dlerror exists
6539 set dlerror d_dlerror
6543 : see if dlfcn is available
6551 On a few systems, the dynamically loaded modules that perl generates and uses
6552 will need a different extension than shared libs. The default will probably
6560 rp='What is the extension of dynamically loaded modules'
6569 : Check if dlsym need a leading underscore
6575 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6576 $cat >dyna.c <<'EOM'
6585 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6587 #include <sys/types.h>
6601 int mode = RTLD_LAZY ;
6603 handle = dlopen("./dyna.$dlext", mode) ;
6604 if (handle == NULL) {
6609 symbol = dlsym(handle, "fred") ;
6610 if (symbol == NULL) {
6611 /* try putting a leading underscore */
6612 symbol = dlsym(handle, "_fred") ;
6613 if (symbol == NULL) {
6626 : Call the object file tmp-dyna.o in case dlext=o.
6627 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6628 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6629 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6630 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
6633 1) echo "Test program failed using dlopen." >&4
6634 echo "Perhaps you should not use dynamic loading." >&4;;
6635 2) echo "Test program failed using dlsym." >&4
6636 echo "Perhaps you should not use dynamic loading." >&4;;
6637 3) echo "dlsym needs a leading underscore" >&4
6639 4) echo "dlsym doesn't need a leading underscore." >&4;;
6642 echo "I can't compile and run the test program." >&4
6647 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6652 : see if dup2 exists
6656 : see if endhostent exists
6657 set endhostent d_endhent
6660 : see if endnetent exists
6661 set endnetent d_endnent
6664 : see if endprotoent exists
6665 set endprotoent d_endpent
6668 : see if endservent exists
6669 set endservent d_endsent
6672 : Locate the flags for 'open()'
6674 $cat >open3.c <<'EOCP'
6675 #include <sys/types.h>
6680 #include <sys/file.h>
6691 : check sys/file.h first to get FREAD on Sun
6692 if $test `./findhdr sys/file.h` && \
6693 set open3 -DI_SYS_FILE && eval $compile; then
6695 echo "<sys/file.h> defines the O_* constants..." >&4
6697 echo "and you have the 3 argument form of open()." >&4
6700 echo "but not the 3 argument form of open(). Oh, well." >&4
6703 elif $test `./findhdr fcntl.h` && \
6704 set open3 -DI_FCNTL && eval $compile; then
6706 echo "<fcntl.h> defines the O_* constants..." >&4
6708 echo "and you have the 3 argument form of open()." >&4
6711 echo "but not the 3 argument form of open(). Oh, well." >&4
6716 echo "I can't find the O_* constant definitions! You got problems." >&4
6722 : check for non-blocking I/O stuff
6723 case "$h_sysfile" in
6724 true) echo "#include <sys/file.h>" > head.c;;
6727 true) echo "#include <fcntl.h>" > head.c;;
6728 *) echo "#include <sys/fcntl.h>" > head.c;;
6733 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
6734 case "$o_nonblock" in
6737 $cat >>try.c <<'EOCP'
6740 printf("O_NONBLOCK\n");
6744 printf("O_NDELAY\n");
6748 printf("FNDELAY\n");
6755 if eval $compile_ok; then
6757 case "$o_nonblock" in
6758 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
6759 *) echo "Seems like we can use $o_nonblock.";;
6762 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
6765 *) echo "Using $hint value $o_nonblock.";;
6767 $rm -f try try.* .out core
6770 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
6776 #include <sys/types.h>
6778 #define MY_O_NONBLOCK $o_nonblock
6779 #ifndef errno /* XXX need better Configure test */
6782 $signal_t blech(x) int x; { exit(3); }
6784 $cat >> try.c <<'EOCP'
6792 pipe(pd); /* Down: child -> parent */
6793 pipe(pu); /* Up: parent -> child */
6796 close(pd[1]); /* Parent reads from pd[0] */
6797 close(pu[0]); /* Parent writes (blocking) to pu[1] */
6798 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
6800 signal(SIGALRM, blech);
6802 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
6804 sprintf(string, "%d\n", ret);
6805 write(2, string, strlen(string));
6808 if (errno == EAGAIN) {
6814 if (errno == EWOULDBLOCK)
6815 printf("EWOULDBLOCK\n");
6818 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
6819 sleep(2); /* Give it time to close our pipe */
6821 ret = read(pd[0], buf, 1); /* Should read EOF */
6823 sprintf(string, "%d\n", ret);
6824 write(3, string, strlen(string));
6828 close(pd[0]); /* We write to pd[1] */
6829 close(pu[1]); /* We read from pu[0] */
6830 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
6831 close(pd[1]); /* Pipe pd is now fully closed! */
6832 exit(0); /* Bye bye, thank you for playing! */
6836 if eval $compile_ok; then
6837 echo "$startsh" >mtry
6838 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
6840 ./mtry >/dev/null 2>&1
6842 0) eagain=`$cat try.out`;;
6843 1) echo "Could not perform non-blocking setting!";;
6844 2) echo "I did a successful read() for something that was not there!";;
6845 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
6846 *) echo "Something terribly wrong happened during testing.";;
6848 rd_nodata=`$cat try.ret`
6849 echo "A read() system call with no data present returns $rd_nodata."
6850 case "$rd_nodata" in
6853 echo "(That's peculiar, fixing that to be -1.)"
6859 echo "Forcing errno EAGAIN on read() with no data available."
6863 echo "Your read() sets errno to $eagain when no data is available."
6866 status=`$cat try.err`
6868 0) echo "And it correctly returns 0 to signal EOF.";;
6869 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
6870 *) echo "However, your read() returns '$status' on EOF??";;
6873 if test "$status" = "$rd_nodata"; then
6874 echo "WARNING: you can't distinguish between EOF and no data!"
6878 echo "I can't compile the test program--assuming errno EAGAIN will do."
6885 echo "Using $hint value $eagain."
6886 echo "Your read() returns $rd_nodata when no data is present."
6887 case "$d_eofnblk" in
6888 "$define") echo "And you can see EOF because read() returns 0.";;
6889 "$undef") echo "But you can't see EOF status from read() returned value.";;
6891 echo "(Assuming you can't see EOF status from read anyway.)"
6897 $rm -f try try.* .out core head.c mtry
6899 : see if fchmod exists
6903 : see if fchown exists
6907 : see if this is an fcntl system
6911 : see if fgetpos exists
6912 set fgetpos d_fgetpos
6915 : see if flock exists
6919 : see if fork exists
6923 : see if pathconf exists
6924 set pathconf d_pathconf
6927 : see if fpathconf exists
6928 set fpathconf d_fpathconf
6931 : see if fsetpos exists
6932 set fsetpos d_fsetpos
6935 : see if gethostbyaddr exists
6936 set gethostbyaddr d_gethbyaddr
6939 : see if gethostbyname exists
6940 set gethostbyname d_gethbyname
6943 : see if gethostent exists
6944 set gethostent d_gethent
6947 hasproto='varname=$1; func=$2; shift; shift;
6948 while $test $# -ge 2; do
6950 $define) echo "#include <$2>";;
6954 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
6955 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
6956 echo "$func() prototype found.";
6959 echo "$func() prototype NOT found.";
6964 $rm -f try.c tryout.c'
6966 : see if this is a netdb.h system
6970 : see if prototypes for various gethostxxx netdb.h functions are available
6972 set d_gethostprotos gethostent $i_netdb netdb.h
6975 : see if getlogin exists
6976 set getlogin d_getlogin
6979 : see if getnetbyaddr exists
6980 set getnetbyaddr d_getnbyaddr
6983 : see if getnetbyname exists
6984 set getnetbyname d_getnbyname
6987 : see if getnetent exists
6988 set getnetent d_getnent
6991 : see if prototypes for various getnetxxx netdb.h functions are available
6993 set d_getnetprotos getnetent $i_netdb netdb.h
6997 : see if getprotobyname exists
6998 set getprotobyname d_getpbyname
7001 : see if getprotobynumber exists
7002 set getprotobynumber d_getpbynumber
7005 : see if getprotoent exists
7006 set getprotoent d_getpent
7009 : see if getpgid exists
7010 set getpgid d_getpgid
7013 : see if getpgrp2 exists
7014 set getpgrp2 d_getpgrp2
7017 : see if getppid exists
7018 set getppid d_getppid
7021 : see if getpriority exists
7022 set getpriority d_getprior
7025 : see if prototypes for various getprotoxxx netdb.h functions are available
7027 set d_getprotoprotos getprotoent $i_netdb netdb.h
7031 : see if getservbyname exists
7032 set getservbyname d_getsbyname
7035 : see if getservbyport exists
7036 set getservbyport d_getsbyport
7039 : see if getservent exists
7040 set getservent d_getsent
7043 : see if prototypes for various getservxxx netdb.h functions are available
7045 set d_getservprotos getservent $i_netdb netdb.h
7048 : see if gettimeofday or ftime exists
7049 set gettimeofday d_gettimeod
7051 case "$d_gettimeod" in
7057 val="$undef"; set d_ftime; eval $setvar
7060 case "$d_gettimeod$d_ftime" in
7063 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7067 : see if this is a netinet/in.h or sys/in.h system
7068 set netinet/in.h i_niin sys/in.h i_sysin
7071 : see if htonl --and friends-- exists
7076 : Maybe they are macros.
7081 #include <sys/types.h>
7082 #$i_niin I_NETINET_IN
7085 #include <netinet/in.h>
7091 printf("Defined as a macro.");
7094 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7095 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7097 echo "But it seems to be defined as a macro." >&4
7105 : see which of string.h or strings.h is needed
7107 strings=`./findhdr string.h`
7108 if $test "$strings" && $test -r "$strings"; then
7109 echo "Using <string.h> instead of <strings.h>." >&4
7113 strings=`./findhdr strings.h`
7114 if $test "$strings" && $test -r "$strings"; then
7115 echo "Using <strings.h> instead of <string.h>." >&4
7117 echo "No string header found -- You'll surely have problems." >&4
7123 "$undef") strings=`./findhdr strings.h`;;
7124 *) strings=`./findhdr string.h`;;
7129 if set index val -f; eval $csym; $val; then
7130 if set strchr val -f d_strchr; eval $csym; $val; then
7131 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7134 echo "strchr() found." >&4
7138 echo "index() found." >&4
7143 echo "index() found." >&4
7146 if set strchr val -f d_strchr; eval $csym; $val; then
7149 echo "strchr() found." >&4
7151 echo "No index() or strchr() found!" >&4
7156 set d_strchr; eval $setvar
7158 set d_index; eval $setvar
7160 : check whether inet_aton exists
7161 set inet_aton d_inetaton
7166 $cat >isascii.c <<'EOCP'
7178 if eval $compile; then
7179 echo "isascii() found." >&4
7182 echo "isascii() NOT found." >&4
7189 : see if killpg exists
7193 : see if link exists
7197 : see if localeconv exists
7198 set localeconv d_locconv
7201 : see if lockf exists
7205 : check for long doubles
7207 echo $n "Checking to see if your system supports long doubles...$c" >&4
7208 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7209 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7211 echo " Yup, it does." >&4
7214 echo " Nope, it doesn't." >&4
7220 : check for length of long double
7221 case "${d_longdbl}${longdblsize}" in
7224 $echo $n "Checking to see how big your long doubles are...$c" >&4
7225 $cat >try.c <<'EOCP'
7229 printf("%d\n", sizeof(long double));
7233 if eval $compile; then
7235 $echo " $longdblsize bytes." >&4
7239 echo "(I can't seem to compile the test program. Guessing...)" >&4
7240 rp="What is the size of a long double (in bytes)?"
7248 : check for long long
7250 echo $n "Checking to see if your system supports long long...$c" >&4
7251 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7252 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7254 echo " Yup, it does." >&4
7257 echo " Nope, it doesn't." >&4
7263 : check for length of long long
7264 case "${d_longlong}${longlongsize}" in
7267 $echo $n "Checking to see how big your long longs are...$c" >&4
7268 $cat >try.c <<'EOCP'
7272 printf("%d\n", sizeof(long long));
7276 if eval $compile_ok; then
7277 longlongsize=`./try`
7278 $echo " $longlongsize bytes." >&4
7282 echo "(I can't seem to compile the test program. Guessing...)"
7283 rp="What is the size of a long long (in bytes)?"
7291 : see if lstat exists
7295 : see if mblen exists
7299 : see if mbstowcs exists
7300 set mbstowcs d_mbstowcs
7303 : see if mbtowc exists
7307 : see if memcmp exists
7311 : see if memcpy exists
7315 : see if memmove exists
7316 set memmove d_memmove
7319 : see if memset exists
7323 : see if mkdir exists
7327 : see if mkfifo exists
7331 : see if mkstemp exists
7332 set mkstemp d_mkstemp
7335 : see if mktime exists
7339 : see if msgctl exists
7343 : see if msgget exists
7347 : see if msgsnd exists
7351 : see if msgrcv exists
7355 : see how much of the 'msg*(2)' library is present.
7358 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7359 *"$undef"*) h_msg=false;;
7361 : we could also check for sys/ipc.h ...
7362 if $h_msg && $test `./findhdr sys/msg.h`; then
7363 echo "You have the full msg*(2) library." >&4
7366 echo "You don't have the full msg*(2) library." >&4
7372 : see if this is a malloc.h system
7373 set malloc.h i_malloc
7376 : see if stdlib is available
7377 set stdlib.h i_stdlib
7380 : determine which malloc to compile in
7382 case "$usemymalloc" in
7383 ''|y*|true) dflt='y' ;;
7384 n*|false) dflt='n' ;;
7385 *) dflt="$usemymalloc" ;;
7387 rp="Do you wish to attempt to use the malloc that comes with $package?"
7393 mallocsrc='malloc.c'
7394 mallocobj="malloc$_o"
7395 d_mymalloc="$define"
7398 : Remove malloc from list of libraries to use
7399 echo "Removing unneeded -lmalloc from library list" >&4
7400 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7403 echo "libs = $libs" >&4
7415 : compute the return types of malloc and free
7417 $cat >malloc.c <<END
7421 #include <sys/types.h>
7435 case "$malloctype" in
7437 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7444 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7448 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7455 echo "Your system uses $freetype free(), it would seem." >&4
7457 : see if nice exists
7461 : see if pause exists
7465 : see if pipe exists
7469 : see if poll exists
7474 : see whether the various POSIXish _yields exist within given cccmd
7476 #include <pthread.h>
7482 : see if pthread_yield exists within given cccmd,
7483 : if we do not usethreads this may well end up undef.
7484 set try -DYIELD=pthread_yield
7485 if eval $compile; then
7487 echo 'pthread_yield() found.' >&4
7490 echo 'pthread_yield() NOT found.' >&4
7495 : see if sched_yield exists within given cccmd,
7496 : if we do not usethreads this may well end up undef.
7497 set try -DYIELD=sched_yield
7498 if eval $compile; then
7500 echo 'sched_yield() found.' >&4
7503 echo 'sched_yield() NOT found.' >&4
7509 : test whether pthreads are created in joinable -- aka undetached -- state
7510 if test "X$usethreads" = "X$define"; then
7511 echo $n "Checking whether pthreads are created joinable. $c" >&4
7512 $cat >try.c <<'EOCP'
7513 #include <pthread.h>
7516 pthread_attr_t attr;
7519 pthread_attr_init(&attr) == 0 &&
7520 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7521 detachstate == PTHREAD_CREATE_DETACHED ?
7522 "detached" : "joinable");
7527 if eval $compile; then
7530 detached) echo "Nope, they aren't." >&4 ;;
7531 *) echo "Yup, they are." >&4 ;;
7535 echo "(I can't execute the test program--assuming they are.)" >&4
7540 detached) val="$undef" ;;
7543 set d_pthreads_created_joinable
7546 d_pthreads_created_joinable="$undef"
7549 : see if this is a pwd.h system
7555 xxx=`./findhdr pwd.h`
7556 $cppstdin $cppflags $cppminus < $xxx >$$.h
7558 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7566 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7574 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7582 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7590 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7598 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7606 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7618 set d_pwquota; eval $setvar
7619 set d_pwage; eval $setvar
7620 set d_pwchange; eval $setvar
7621 set d_pwclass; eval $setvar
7622 set d_pwexpire; eval $setvar
7623 set d_pwcomment; eval $setvar
7624 set d_pwgecos; eval $setvar
7628 : see if readdir and friends exist
7629 set readdir d_readdir
7631 set seekdir d_seekdir
7633 set telldir d_telldir
7635 set rewinddir d_rewinddir
7638 : see if readlink exists
7639 set readlink d_readlink
7642 : see if rename exists
7646 : see if rmdir exists
7650 : see if memory.h is available.
7655 : See if it conflicts with string.h
7661 $cppstdin $cppflags $cppminus < $strings > mem.h
7662 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7664 echo "We won't be including <memory.h>."
7674 : can bcopy handle overlapping blocks?
7679 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
7686 $cat >>try.c <<'EOCP'
7689 # include <memory.h>
7692 # include <stdlib.h>
7695 # include <string.h>
7697 # include <strings.h>
7700 # include <unistd.h> /* Needed for NetBSD */
7704 char buf[128], abc[128];
7710 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
7712 for (align = 7; align >= 0; align--) {
7713 for (len = 36; len; len--) {
7716 for (off = 1; off <= len; off++) {
7717 bcopy(b, b+off, len);
7718 bcopy(b+off, b, len);
7719 if (bcmp(b, abc, len))
7728 if eval $compile_ok; then
7729 if ./try 2>/dev/null; then
7733 echo "It can't, sorry."
7734 case "$d_memmove" in
7735 "$define") echo "But that's Ok since you have memmove()." ;;
7739 echo "(I can't compile the test program, so we'll assume not...)"
7740 case "$d_memmove" in
7741 "$define") echo "But that's Ok since you have memmove()." ;;
7746 $rm -f try.* try core
7750 : can memcpy handle overlapping blocks?
7755 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
7762 $cat >>try.c <<'EOCP'
7765 # include <memory.h>
7768 # include <stdlib.h>
7771 # include <string.h>
7773 # include <strings.h>
7776 # include <unistd.h> /* Needed for NetBSD */
7780 char buf[128], abc[128];
7786 /* Copy "abcde..." string to char abc[] so that gcc doesn't
7787 try to store the string in read-only memory. */
7788 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
7790 for (align = 7; align >= 0; align--) {
7791 for (len = 36; len; len--) {
7793 memcpy(b, abc, len);
7794 for (off = 1; off <= len; off++) {
7795 memcpy(b+off, b, len);
7796 memcpy(b, b+off, len);
7797 if (memcmp(b, abc, len))
7806 if eval $compile_ok; then
7807 if ./try 2>/dev/null; then
7811 echo "It can't, sorry."
7812 case "$d_memmove" in
7813 "$define") echo "But that's Ok since you have memmove()." ;;
7817 echo "(I can't compile the test program, so we'll assume not...)"
7818 case "$d_memmove" in
7819 "$define") echo "But that's Ok since you have memmove()." ;;
7824 $rm -f try.* try core
7828 : can memcmp be trusted to compare relative magnitude?
7833 echo "Checking if your memcmp() can compare relative magnitude..." >&4
7840 $cat >>try.c <<'EOCP'
7843 # include <memory.h>
7846 # include <stdlib.h>
7849 # include <string.h>
7851 # include <strings.h>
7854 # include <unistd.h> /* Needed for NetBSD */
7860 if ((a < b) && memcmp(&a, &b, 1) < 0)
7866 if eval $compile_ok; then
7867 if ./try 2>/dev/null; then
7871 echo "No, it can't (it uses signed chars)."
7874 echo "(I can't compile the test program, so we'll assume not...)"
7878 $rm -f try.* try core
7882 : see if select exists
7886 : see if semctl exists
7890 : see if semget exists
7894 : see if semop exists
7898 : see how much of the 'sem*(2)' library is present.
7901 case "$d_semctl$d_semget$d_semop" in
7902 *"$undef"*) h_sem=false;;
7904 : we could also check for sys/ipc.h ...
7905 if $h_sem && $test `./findhdr sys/sem.h`; then
7906 echo "You have the full sem*(2) library." >&4
7909 echo "You don't have the full sem*(2) library." >&4
7915 : see if setegid exists
7916 set setegid d_setegid
7919 : see if seteuid exists
7920 set seteuid d_seteuid
7923 : see if sethostent exists
7924 set sethostent d_sethent
7927 : see if setlinebuf exists
7928 set setlinebuf d_setlinebuf
7931 : see if setlocale exists
7932 set setlocale d_setlocale
7935 : see if setnetent exists
7936 set setnetent d_setnent
7939 : see if setprotoent exists
7940 set setprotoent d_setpent
7943 : see if setpgid exists
7944 set setpgid d_setpgid
7947 : see if setpgrp2 exists
7948 set setpgrp2 d_setpgrp2
7951 : see if setpriority exists
7952 set setpriority d_setprior
7955 : see if setregid exists
7956 set setregid d_setregid
7958 set setresgid d_setresgid
7961 : see if setreuid exists
7962 set setreuid d_setreuid
7964 set setresuid d_setresuid
7967 : see if setrgid exists
7968 set setrgid d_setrgid
7971 : see if setruid exists
7972 set setruid d_setruid
7975 : see if setservent exists
7976 set setservent d_setsent
7979 : see if setsid exists
7983 : see if setvbuf exists
7984 set setvbuf d_setvbuf
7987 : see if sfio.h is available
7992 : see if sfio library is available
8003 : Ok, but do we want to use it.
8007 true|$define|[yY]*) dflt='y';;
8010 echo "$package can use the sfio library, but it is experimental."
8011 rp="You seem to have sfio available, do you want to try using it?"
8015 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8017 : Remove sfio from list of libraries to use
8018 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8021 echo "libs = $libs" >&4
8025 *) case "$usesfio" in
8027 echo "Sorry, cannot find sfio on this machine" >&4
8028 echo "Ignoring your setting of usesfio=$usesfio" >&4
8036 $define) usesfio='true';;
8037 *) usesfio='false';;
8040 : see if shmctl exists
8044 : see if shmget exists
8048 : see if shmat exists
8051 : see what shmat returns
8054 $cat >shmat.c <<'END'
8055 #include <sys/shm.h>
8058 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8063 echo "and it returns ($shmattype)." >&4
8064 : see if a prototype for shmat is available
8065 xxx=`./findhdr sys/shm.h`
8066 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8067 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8078 set d_shmatprototype
8081 : see if shmdt exists
8085 : see how much of the 'shm*(2)' library is present.
8088 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8089 *"$undef"*) h_shm=false;;
8091 : we could also check for sys/ipc.h ...
8092 if $h_shm && $test `./findhdr sys/shm.h`; then
8093 echo "You have the full shm*(2) library." >&4
8096 echo "You don't have the full shm*(2) library." >&4
8103 : see if we have sigaction
8104 if set sigaction val -f d_sigaction; eval $csym; $val; then
8105 echo 'sigaction() found.' >&4
8106 $cat > try.c <<'EOP'
8108 #include <sys/types.h>
8112 struct sigaction act, oact;
8116 if eval $compile_ok; then
8119 echo "But you don't seem to have a useable struct sigaction." >&4
8123 echo 'sigaction NOT found.' >&4
8126 set d_sigaction; eval $setvar
8127 $rm -f try try$_o try.c
8129 : see if sigsetjmp exists
8131 case "$d_sigsetjmp" in
8139 if (sigsetjmp(env,1))
8147 if eval $compile; then
8148 if ./try >/dev/null 2>&1; then
8149 echo "POSIX sigsetjmp found." >&4
8153 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8159 echo "sigsetjmp not found." >&4
8163 *) val="$d_sigsetjmp"
8164 case "$d_sigsetjmp" in
8165 $define) echo "POSIX sigsetjmp found." >&4;;
8166 $undef) echo "sigsetjmp not found." >&4;;
8176 : see whether socket exists
8178 $echo $n "Hmm... $c" >&4
8179 if set socket val -f d_socket; eval $csym; $val; then
8180 echo "Looks like you have Berkeley networking support." >&4
8182 if set setsockopt val -f; eval $csym; $val; then
8185 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8189 if $contains socklib libc.list >/dev/null 2>&1; then
8190 echo "Looks like you have Berkeley networking support." >&4
8192 : we will have to assume that it supports the 4.2 BSD interface
8195 echo "You don't have Berkeley networking in libc$_a..." >&4
8196 if test -f /usr/lib/libnet$_a; then
8197 ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \
8198 $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list
8199 if $contains socket libc.list >/dev/null 2>&1; then
8200 echo "...but the Wollongong group seems to have hacked it in." >&4
8202 sockethdr="-I/usr/netinclude"
8204 if $contains setsockopt libc.list >/dev/null 2>&1; then
8207 echo "...using the old 4.1c interface, rather than 4.2" >&4
8211 echo "or even in libnet$_a, which is peculiar." >&4
8216 echo "or anywhere else I see." >&4
8223 : see if socketpair exists
8224 set socketpair d_sockpair
8227 : see if stat knows about block sizes
8229 xxx=`./findhdr sys/stat.h`
8230 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
8231 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
8232 echo "Your stat() knows about block sizes." >&4
8235 echo "Your stat() doesn't know about block sizes." >&4
8239 echo "Your stat() doesn't know about block sizes." >&4
8245 : see if _ptr and _cnt from stdio act std
8247 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8248 echo "(Looks like you have stdio.h from Linux.)"
8249 case "$stdio_ptr" in
8250 '') stdio_ptr='((fp)->_IO_read_ptr)'
8253 *) ptr_lval=$d_stdio_ptr_lval;;
8255 case "$stdio_cnt" in
8256 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8259 *) cnt_lval=$d_stdio_cnt_lval;;
8261 case "$stdio_base" in
8262 '') stdio_base='((fp)->_IO_read_base)';;
8264 case "$stdio_bufsiz" in
8265 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8268 case "$stdio_ptr" in
8269 '') stdio_ptr='((fp)->_ptr)'
8272 *) ptr_lval=$d_stdio_ptr_lval;;
8274 case "$stdio_cnt" in
8275 '') stdio_cnt='((fp)->_cnt)'
8278 *) cnt_lval=$d_stdio_cnt_lval;;
8280 case "$stdio_base" in
8281 '') stdio_base='((fp)->_base)';;
8283 case "$stdio_bufsiz" in
8284 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8287 : test whether _ptr and _cnt really work
8288 echo "Checking how std your stdio is..." >&4
8291 #define FILE_ptr(fp) $stdio_ptr
8292 #define FILE_cnt(fp) $stdio_cnt
8294 FILE *fp = fopen("try.c", "r");
8297 18 <= FILE_cnt(fp) &&
8298 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8306 if eval $compile; then
8308 echo "Your stdio acts pretty std."
8311 echo "Your stdio isn't very std."
8314 echo "Your stdio doesn't appear very std."
8320 : Can _ptr be used as an lvalue?
8321 case "$d_stdstdio$ptr_lval" in
8322 $define$define) val=$define ;;
8325 set d_stdio_ptr_lval
8328 : Can _cnt be used as an lvalue?
8329 case "$d_stdstdio$cnt_lval" in
8330 $define$define) val=$define ;;
8333 set d_stdio_cnt_lval
8336 : see if _base is also standard
8338 case "$d_stdstdio" in
8342 #define FILE_base(fp) $stdio_base
8343 #define FILE_bufsiz(fp) $stdio_bufsiz
8345 FILE *fp = fopen("try.c", "r");
8348 19 <= FILE_bufsiz(fp) &&
8349 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8356 if eval $compile; then
8358 echo "And its _base field acts std."
8361 echo "But its _base field isn't std."
8364 echo "However, it seems to be lacking the _base field."
8372 : see if strcoll exists
8373 set strcoll d_strcoll
8376 : check for structure copying
8378 echo "Checking to see if your C compiler can copy structs..." >&4
8379 $cat >try.c <<'EOCP'
8389 if $cc -c try.c >/dev/null 2>&1 ; then
8394 echo "Nope, it can't."
8400 : see if strerror and/or sys_errlist[] exist
8402 if set strerror val -f d_strerror; eval $csym; $val; then
8403 echo 'strerror() found.' >&4
8404 d_strerror="$define"
8405 d_strerrm='strerror(e)'
8406 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8407 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8408 d_syserrlst="$define"
8410 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
8411 d_syserrlst="$undef"
8413 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
8414 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
8415 echo 'strerror() found in string header.' >&4
8416 d_strerror="$define"
8417 d_strerrm='strerror(e)'
8418 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8419 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
8420 d_syserrlst="$define"
8422 echo "(You don't appear to have any sys_errlist[], how can this be?)"
8423 d_syserrlst="$undef"
8425 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8426 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
8428 d_syserrlst="$define"
8429 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
8431 echo 'strerror() and sys_errlist[] NOT found.' >&4
8433 d_syserrlst="$undef"
8434 d_strerrm='"unknown"'
8437 : see if strtod exists
8441 : see if strtol exists
8445 : see if strtoul exists
8446 set strtoul d_strtoul
8449 : see if strxfrm exists
8450 set strxfrm d_strxfrm
8453 : see if symlink exists
8454 set symlink d_symlink
8457 : see if syscall exists
8458 set syscall d_syscall
8461 : see if sysconf exists
8462 set sysconf d_sysconf
8465 : see if system exists
8469 : see if tcgetpgrp exists
8470 set tcgetpgrp d_tcgetpgrp
8473 : see if tcsetpgrp exists
8474 set tcsetpgrp d_tcsetpgrp
8477 : define an is-a-typedef? function
8478 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8480 "") inclist="sys/types.h";;
8482 eval "varval=\$$var";
8486 for inc in $inclist; do
8487 echo "#include <$inc>" >>temp.c;
8489 echo "#ifdef $type" >> temp.c;
8490 echo "printf(\"We have $type\");" >> temp.c;
8491 echo "#endif" >> temp.c;
8492 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8493 if $contains $type temp.E >/dev/null 2>&1; then
8499 *) eval "$var=\$varval";;
8502 : define an is-a-typedef? function that prompts if the type is not available.
8503 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8505 "") inclist="sys/types.h";;
8507 eval "varval=\$$var";
8511 for inc in $inclist; do
8512 echo "#include <$inc>" >>temp.c;
8514 echo "#ifdef $type" >> temp.c;
8515 echo "printf(\"We have $type\");" >> temp.c;
8516 echo "#endif" >> temp.c;
8517 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8519 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8520 if $contains $type temp.E >/dev/null 2>&1; then
8521 echo "$type found." >&4;
8524 echo "$type NOT found." >&4;
8530 *) eval "$var=\$varval";;
8533 : see if this is a sys/times.h system
8534 set sys/times.h i_systimes
8537 : see if times exists
8539 if set times val -f d_times; eval $csym; $val; then
8540 echo 'times() found.' >&4
8543 case "$i_systimes" in
8544 "$define") inc='sys/times.h';;
8546 rp="What is the type returned by times() on this system?"
8547 set clock_t clocktype long stdio.h sys/types.h $inc
8550 echo 'times() NOT found, hope that will do.' >&4
8555 : see if truncate exists
8556 set truncate d_truncate
8559 : see if tzname[] exists
8561 if set tzname val -a d_tzname; eval $csym; $val; then
8563 echo 'tzname[] found.' >&4
8566 echo 'tzname[] NOT found.' >&4
8571 : see if umask exists
8575 : see how we will look up host name
8578 : dummy stub to allow use of elif
8579 elif set uname val -f d_uname; eval $csym; $val; then
8582 uname() was found, but you're running xenix, and older versions of xenix
8583 have a broken uname(). If you don't really know whether your xenix is old
8584 enough to have a broken system call, use the default answer.
8591 rp='Is your uname() broken?'
8594 n*) d_uname="$define"; call=uname;;
8597 echo 'uname() found.' >&4
8602 case "$d_gethname" in
8603 '') d_gethname="$undef";;
8606 '') d_uname="$undef";;
8608 case "$d_phostname" in
8609 '') d_phostname="$undef";;
8612 : backward compatibility for d_hvfork
8613 if test X$d_hvfork != X; then
8617 : see if there is a vfork
8622 : Ok, but do we want to use it. vfork is reportedly unreliable in
8623 : perl on Solaris 2.x, and probably elsewhere.
8631 rp="Some systems have problems with vfork(). Do you want to use it?"
8636 echo "Ok, we won't use vfork()."
8645 $define) usevfork='true';;
8646 *) usevfork='false';;
8649 : see if this is an sysdir system
8650 set sys/dir.h i_sysdir
8653 : see if this is an sysndir system
8654 set sys/ndir.h i_sysndir
8657 : see if closedir exists
8658 set closedir d_closedir
8661 case "$d_closedir" in
8664 echo "Checking whether closedir() returns a status..." >&4
8665 cat > closedir.c <<EOM
8666 #$i_dirent I_DIRENT /**/
8667 #$i_sysdir I_SYS_DIR /**/
8668 #$i_sysndir I_SYS_NDIR /**/
8670 #if defined(I_DIRENT)
8672 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
8673 #include <sys/dir.h>
8677 #include <sys/ndir.h>
8681 #include <ndir.h> /* may be wrong in the future */
8683 #include <sys/dir.h>
8688 int main() { return closedir(opendir(".")); }
8691 if eval $compile_ok; then
8692 if ./closedir > /dev/null 2>&1 ; then
8693 echo "Yes, it does."
8696 echo "No, it doesn't."
8700 echo "(I can't seem to compile the test program--assuming it doesn't)"
8711 : check for volatile keyword
8713 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
8714 $cat >try.c <<'EOCP'
8717 typedef struct _goo_struct goo_struct;
8718 goo_struct * volatile goo = ((goo_struct *)0);
8719 struct _goo_struct {
8724 typedef unsigned short foo_t;
8727 volatile foo_t blech;
8731 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
8733 echo "Yup, it does."
8736 echo "Nope, it doesn't."
8742 : see if there is a wait4
8746 : see if waitpid exists
8747 set waitpid d_waitpid
8750 : see if wcstombs exists
8751 set wcstombs d_wcstombs
8754 : see if wctomb exists
8758 : preserve RCS keywords in files with variable substitution, grrr
8763 Revision='$Revision'
8765 : check for alignment requirements
8767 case "$alignbytes" in
8768 '') echo "Checking alignment constraints..." >&4
8769 $cat >try.c <<'EOCP'
8776 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
8780 if eval $compile_ok; then
8784 echo "(I can't seem to compile the test program...)"
8787 *) dflt="$alignbytes"
8790 rp="Doubles must be aligned on a how-many-byte boundary?"
8795 : check for ordering of bytes in a long
8796 case "$byteorder" in
8800 In the following, larger digits indicate more significance. A big-endian
8801 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
8802 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
8803 machines may have weird orders like 3412. A Cray will report 87654321. If
8804 the test program works the default is probably right.
8805 I'm now running the test program...
8807 $cat >try.c <<'EOCP'
8814 char c[sizeof(long)];
8817 if (sizeof(long) > 4)
8818 u.l = (0x08070605L << 32) | 0x04030201L;
8821 for (i = 0; i < sizeof(long); i++)
8822 printf("%c", u.c[i]+'0');
8829 if eval $compile && ./try > /dev/null; then
8832 [1-4][1-4][1-4][1-4]|12345678|87654321)
8833 echo "(The test program ran ok.)"
8834 echo "byteorder=$dflt"
8837 ????|????????) echo "(The test program ran ok.)" ;;
8838 *) echo "(The test program didn't run right for some reason.)" ;;
8843 (I can't seem to compile the test program. Guessing big-endian...)
8846 case "$xxx_prompt" in
8848 rp="What is the order of bytes in a long?"
8859 : how do we catenate cpp tokens here?
8861 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
8862 $cat >cpp_stuff.c <<'EOCP'
8863 #define RCAT(a,b)a/**/b
8864 #define ACAT(a,b)a ## b
8868 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
8869 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
8870 echo "Oh! Smells like ANSI's been here." >&4
8871 echo "We can catify or stringify, separately or together!"
8873 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
8874 echo "Ah, yes! The good old days!" >&4
8875 echo "However, in the good old days we don't know how to stringify and"
8876 echo "catify at the same time."
8880 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
8881 to have to edit the values of CAT[2-5] in config.h...
8883 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
8887 : see if this is a db.h system
8895 echo "Checking Berkeley DB version ..." >&4
8901 #include <sys/types.h>
8906 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
8907 int Major, Minor, Patch ;
8908 unsigned long Version ;
8909 (void)db_version(&Major, &Minor, &Patch) ;
8910 printf("You have Berkeley DB Version 2 or greater\n");
8912 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
8913 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
8914 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
8915 Major, Minor, Patch) ;
8917 /* check that db.h & libdb are compatible */
8918 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
8919 printf("db.h and libdb are incompatible\n") ;
8923 printf("db.h and libdb are compatible\n") ;
8925 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
8926 + DB_VERSION_PATCH ;
8928 /* needs to be >= 2.3.4 */
8929 if (Version < 2003004) {
8930 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
8931 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
8937 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
8938 printf("You have Berkeley DB Version 1\n");
8939 exit(0); /* DB version < 2: the coast is clear. */
8941 exit(1); /* <db.h> not Berkeley DB? */
8947 if eval $compile && ./try; then
8948 echo 'Looks OK.' >&4
8950 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
8954 : Remove db from list of libraries to use
8955 echo "Removing unusable -ldb from library list" >&4
8956 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
8959 echo "libs = $libs" >&4
8969 : Check the return type needed for hash
8971 echo "Checking return type needed for hash for Berkeley DB ..." >&4
8977 #include <sys/types.h>
8980 #ifndef DB_VERSION_MAJOR
8981 u_int32_t hash_cb (ptr, size)
8989 info.hash = hash_cb;
8993 if $cc $ccflags -c try.c >try.out 2>&1 ; then
8994 if $contains warning try.out >>/dev/null 2>&1 ; then
8997 db_hashtype='u_int32_t'
9000 : XXX Maybe we should just give up here.
9001 db_hashtype=u_int32_t
9003 echo "Help: I can't seem to compile the db test program." >&4
9004 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9007 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9009 *) db_hashtype=u_int32_t
9014 : Check the return type needed for prefix
9016 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9022 #include <sys/types.h>
9025 #ifndef DB_VERSION_MAJOR
9026 size_t prefix_cb (key1, key2)
9034 info.prefix = prefix_cb;
9038 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9039 if $contains warning try.out >>/dev/null 2>&1 ; then
9042 db_prefixtype='size_t'
9045 db_prefixtype='size_t'
9046 : XXX Maybe we should just give up here.
9048 echo "Help: I can't seem to compile the db test program." >&4
9049 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9052 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9054 *) db_prefixtype='size_t'
9058 : check for void type
9060 echo "Checking to see how well your C compiler groks the void type..." >&4
9063 Support flag bits are:
9064 1: basic void declarations.
9065 2: arrays of pointers to functions returning void.
9066 4: operations between pointers to and addresses of void functions.
9067 8: generic void pointers.
9070 case "$voidflags" in
9072 $cat >try.c <<'EOCP'
9078 extern void moo(); /* function returning void */
9079 void (*goo)(); /* ptr to func returning void */
9081 void *hue; /* generic ptr */
9096 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9097 voidflags=$defvoidused
9098 echo "It appears to support void to the level $package wants ($defvoidused)."
9099 if $contains warning .out >/dev/null 2>&1; then
9100 echo "However, you might get some warnings that look like this:"
9104 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9105 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9106 echo "It supports 1..."
9107 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9108 echo "It also supports 2..."
9109 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9111 echo "And it supports 4 but not 8 definitely."
9113 echo "It doesn't support 4..."
9114 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9116 echo "But it supports 8."
9119 echo "Neither does it support 8."
9123 echo "It does not support 2..."
9124 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9126 echo "But it supports 4 and 8."
9128 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9130 echo "And it supports 4 but has not heard about 8."
9132 echo "However it supports 8 but not 4."
9137 echo "There is no support at all for void."
9142 case "$voidflags" in
9146 rp="Your void support flags add up to what?"
9153 : check for length of double
9155 case "$doublesize" in
9157 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9158 $cat >try.c <<'EOCP'
9162 printf("%d\n", sizeof(double));
9166 if eval $compile_ok; then
9168 $echo " $doublesize bytes." >&4
9171 echo "(I can't seem to compile the test program. Guessing...)"
9172 rp="What is the size of a double precision number (in bytes)?"
9180 : see what type file positions are declared as in the library
9181 rp="What is the type for file position used by fsetpos()?"
9182 set fpos_t fpostype long stdio.h sys/types.h
9185 : get csh whereabouts
9187 'csh') val="$undef" ;;
9192 : Respect a hint or command line value for full_csh.
9194 '') full_csh=$csh ;;
9197 : Store the full pathname to the sed program for use in the C program
9200 : see what type gids are declared as in the kernel
9202 echo "Looking for the type for group ids returned by getgid()."
9203 set gid_t gidtype xxx stdio.h sys/types.h
9207 xxx=`./findhdr sys/user.h`
9208 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9210 unsigned) dflt="$1 $2" ;;
9214 *) dflt="$gidtype";;
9217 gid_t) echo "gid_t found." ;;
9218 *) rp="What is the type for group ids returned by getgid()?"
9224 : see if getgroups exists
9225 set getgroups d_getgrps
9228 : see if setgroups exists
9229 set setgroups d_setgrps
9233 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9235 case "$d_getgrps$d_setgrps" in
9237 case "$groupstype" in
9238 '') dflt="$gidtype" ;;
9239 *) dflt="$groupstype" ;;
9242 What type of pointer is the second argument to getgroups() and setgroups()?
9243 Usually this is the same as group ids, $gidtype, but not always.
9246 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9250 *) groupstype="$gidtype";;
9253 : see what type lseek is declared as in the kernel
9254 rp="What is the type used for lseek's offset on this system?"
9255 set off_t lseektype long stdio.h sys/types.h
9259 echo "Checking if your $make program sets \$(MAKE)..." >&4
9260 case "$make_set_make" in
9262 $sed 's/^X //' > testmake.mak << 'EOF'
9264 X @echo 'maketemp="$(MAKE)"'
9266 case "`$make -f testmake.mak 2>/dev/null`" in
9267 *maketemp=*) make_set_make='#' ;;
9268 *) make_set_make="MAKE=$make" ;;
9273 case "$make_set_make" in
9274 '#') echo "Yup, it does.";;
9275 *) echo "Nope, it doesn't.";;
9278 : see what type is used for mode_t
9279 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9280 set mode_t modetype int stdio.h sys/types.h
9283 : define a fucntion to check prototypes
9284 $cat > protochk <<EOSH
9287 optimize="$optimize"
9289 prototype="$prototype"
9294 $cat >> protochk <<'EOSH'
9299 while test $# -ge 2; do
9301 $define) echo "#include <$2>" >> try.c ;;
9302 literal) echo "$2" >> try.c ;;
9306 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9307 cat >> try.c <<'EOCP'
9308 #ifdef CAN_PROTOTYPE
9309 #define _(args) args
9314 echo "$foo" >> try.c
9315 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9316 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9324 : see what type is used for size_t
9325 rp="What is the type used for the length parameter for string functions?"
9326 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9329 : check for type of arguments to gethostbyaddr.
9330 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9331 case "$d_gethbyaddr" in
9335 Checking to see what type of arguments are accepted by gethostbyaddr().
9337 hdrs="$define sys/types.h
9338 $d_socket sys/socket.h
9339 $i_niin netinet/in.h
9342 : The first arg can 'char *' or 'void *'
9343 : The second arg is some of integral type
9344 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9345 for yyy in size_t long int; do
9346 case "$netdb_host_type" in
9347 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9348 if ./protochk "$try" $hdrs; then
9349 echo "Your system accepts $xxx for the first arg."
9350 echo "...and $yyy for the second arg."
9351 netdb_host_type="$xxx"
9352 netdb_hlen_type="$yyy"
9358 : In case none of those worked, prompt the user.
9359 case "$netdb_host_type" in
9360 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9363 netdb_host_type=$ans
9364 rp='What is the type for the 2nd argument to gethostbyaddr?'
9367 netdb_hlen_type=$ans
9371 *) : no gethostbyaddr, so pick harmless defaults
9372 netdb_host_type='char *'
9373 netdb_hlen_type="$sizetype"
9376 # Remove the "const" if needed. -- but then we'll have a
9378 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
9381 : check for type of argument to gethostbyname.
9382 if test "X$netdb_name_type" = X ; then
9383 case "$d_gethbyname" in
9387 Checking to see what type of argument is accepted by gethostbyname().
9389 hdrs="$define sys/types.h
9390 $d_socket sys/socket.h
9391 $i_niin netinet/in.h
9394 for xxx in "const char *" "char *"; do
9395 case "$netdb_name_type" in
9396 '') try="extern struct hostent *gethostbyname($xxx);"
9397 if ./protochk "$try" $hdrs; then
9398 echo "Your system accepts $xxx."
9399 netdb_name_type="$xxx"
9404 : In case none of those worked, prompt the user.
9405 case "$netdb_name_type" in
9406 '') rp='What is the type for the 1st argument to gethostbyname?'
9409 netdb_name_type=$ans
9413 *) : no gethostbyname, so pick harmless default
9414 netdb_name_type='char *'
9419 : check for type of 1st argument to getnetbyaddr.
9420 if test "X$netdb_net_type" = X ; then
9421 case "$d_getnbyaddr" in
9425 Checking to see what type of 1st argument is accepted by getnetbyaddr().
9427 hdrs="$define sys/types.h
9428 $d_socket sys/socket.h
9429 $i_niin netinet/in.h
9432 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
9433 case "$netdb_net_type" in
9434 '') try="extern struct netent *getnetbyaddr($xxx, int);"
9435 if ./protochk "$try" $hdrs; then
9436 echo "Your system accepts $xxx."
9437 netdb_net_type="$xxx"
9442 : In case none of those worked, prompt the user.
9443 case "$netdb_net_type" in
9444 '') rp='What is the type for the 1st argument to getnetbyaddr?'
9451 *) : no getnetbyaddr, so pick harmless default
9452 netdb_net_type='long'
9456 : locate the preferred pager for this system
9470 '') dflt=/usr/ucb/more;;
9477 rp='What pager is used on your system?'
9481 : see what type pids are declared as in the kernel
9482 rp="What is the type of process ids on this system?"
9483 set pid_t pidtype int stdio.h sys/types.h
9486 : check for length of pointer
9490 $echo $n "Checking to see how big your pointers are...$c" >&4
9491 if test "$voidflags" -gt 7; then
9492 echo '#define VOID_PTR char *' > try.c
9494 echo '#define VOID_PTR void *' > try.c
9496 $cat >>try.c <<'EOCP'
9500 printf("%d\n", sizeof(VOID_PTR));
9505 if eval $compile_ok; then
9507 $echo " $ptrsize bytes." >&4
9510 echo "(I can't seem to compile the test program. Guessing...)" >&4
9511 rp="What is the size of a pointer (in bytes)?"
9519 : check for size of random number generator
9523 echo "Checking to see how many bits your rand function produces..." >&4
9529 # include <unistd.h>
9532 # include <stdlib.h>
9535 $cat >>try.c <<'EOCP'
9539 register unsigned long tmp;
9540 register unsigned long max = 0L;
9542 for (i = 1000; i; i--) {
9543 tmp = (unsigned long)rand();
9544 if (tmp > max) max = tmp;
9546 for (i = 0; max; i++)
9552 if eval $compile_ok; then
9556 echo "(I can't seem to compile the test program...)"
9563 rp='How many bits does your rand() function produce?'
9568 : see if ar generates random libraries by itself
9570 echo "Checking how to generate random libraries on your machine..." >&4
9571 echo 'int bar1() { return bar2(); }' > bar1.c
9572 echo 'int bar2() { return 2; }' > bar2.c
9573 $cat > foo.c <<'EOP'
9574 main() { printf("%d\n", bar1()); exit(0); }
9576 $cc $ccflags -c bar1.c >/dev/null 2>&1
9577 $cc $ccflags -c bar2.c >/dev/null 2>&1
9578 $cc $ccflags -c foo.c >/dev/null 2>&1
9579 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
9580 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9581 ./foobar >/dev/null 2>&1; then
9582 echo "$ar appears to generate random libraries itself."
9585 elif $ar ts bar$_a >/dev/null 2>&1 &&
9586 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9587 ./foobar >/dev/null 2>&1; then
9588 echo "a table of contents needs to be added with '$ar ts'."
9595 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
9596 $test -f $ranlib || ranlib=''
9599 if $test -n "$ranlib"; then
9600 echo "your system has '$ranlib'; we'll use that."
9603 echo "your system doesn't seem to support random libraries"
9604 echo "so we'll use lorder and tsort to order the libraries."
9611 : see if sys/select.h has to be included
9612 set sys/select.h i_sysselct
9615 : see if we should include time.h, sys/time.h, or both
9617 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9618 $echo $n "I'm now running the test program...$c"
9619 $cat >try.c <<'EOCP'
9620 #include <sys/types.h>
9625 #ifdef SYSTIMEKERNEL
9628 #include <sys/time.h>
9631 #include <sys/select.h>
9640 struct timezone tzp;
9642 if (foo.tm_sec == foo.tm_sec)
9645 if (bar.tv_sec == bar.tv_sec)
9652 for s_timezone in '-DS_TIMEZONE' ''; do
9654 for s_timeval in '-DS_TIMEVAL' ''; do
9655 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9656 for i_time in '' '-DI_TIME'; do
9657 for i_systime in '-DI_SYSTIME' ''; do
9660 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9661 if eval $compile; then
9662 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9666 $echo $n "Succeeded with $flags$c"
9678 *SYSTIMEKERNEL*) i_systimek="$define"
9679 timeincl=`./findhdr sys/time.h`
9680 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9681 *) i_systimek="$undef";;
9684 *I_TIME*) i_time="$define"
9685 timeincl=`./findhdr time.h`" $timeincl"
9686 echo "We'll include <time.h>." >&4;;
9687 *) i_time="$undef";;
9690 *I_SYSTIME*) i_systime="$define"
9691 timeincl=`./findhdr sys/time.h`" $timeincl"
9692 echo "We'll include <sys/time.h>." >&4;;
9693 *) i_systime="$undef";;
9697 : check for fd_set items
9700 Checking to see how well your C compiler handles fd_set and friends ...
9702 $cat >fd_set.c <<EOCP
9703 #$i_systime I_SYS_TIME
9704 #$i_sysselct I_SYS_SELECT
9705 #$d_socket HAS_SOCKET
9706 #include <sys/types.h>
9708 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9711 #include <sys/time.h>
9714 #include <sys/select.h>
9723 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9730 set fd_set -DTRYBITS
9731 if eval $compile; then
9732 d_fds_bits="$define"
9734 echo "Well, your system knows about the normal fd_set typedef..." >&4
9736 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9737 d_fd_macros="$define"
9740 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9742 d_fd_macros="$undef"
9746 Hmm, your compiler has some difficulty with fd_set. Checking further...
9749 if eval $compile; then
9752 echo "Well, your system has some sort of fd_set available..." >&4
9754 echo "and you have the normal fd_set macros." >&4
9755 d_fd_macros="$define"
9758 but not the normal fd_set macros! Gross! More work for me...
9760 d_fd_macros="$undef"
9763 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9766 d_fd_macros="$undef"
9771 : check for type of arguments to select.
9772 case "$selecttype" in
9773 '') case "$d_select" in
9776 Checking to see what type of arguments are accepted by select().
9778 hdrs="$define sys/types.h
9779 $i_systime sys/time.h
9780 $i_sysselct sys/select.h
9781 $d_socket sys/socket.h"
9782 : The first arg can be int, unsigned, or size_t
9783 : The last arg may or may not be 'const'
9785 for xxx in 'fd_set *' 'int *'; do
9786 for nfd in 'int' 'size_t' 'unsigned' ; do
9787 for tmo in 'struct timeval *' 'const struct timeval *'; do
9789 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
9790 if ./protochk "$try" $hdrs; then
9791 echo "Your system accepts $xxx."
9800 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
9802 $define) dflt="fd_set *" ;;
9811 *) : no select, so pick a harmless default
9818 : Trace out the files included by signal.h, then look for SIGxxx names.
9819 : Remove SIGARRAYSIZE used by HPUX.
9820 : Remove SIGTYP void lines used by OS2.
9821 xxx=`echo '#include <signal.h>' |
9822 $cppstdin $cppminus $cppflags 2>/dev/null |
9823 $grep '^[ ]*#.*include' |
9824 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
9825 : Check this list of files to be sure we have parsed the cpp output ok.
9826 : This will also avoid potentially non-existent files, such
9829 for xx in $xxx /dev/null ; do
9830 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
9832 : If we have found no files, at least try signal.h
9834 '') xxxfiles=`./findhdr signal.h` ;;
9837 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
9838 print substr($2, 4, 20)
9840 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
9841 print substr($3, 4, 20)
9843 : Append some common names just in case the awk scan failed.
9844 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
9845 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
9846 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
9847 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
9848 : generate a few handy files for later
9849 $cat > signal.c <<'EOCP'
9850 #include <sys/types.h>
9855 /* Strange style to avoid deeply-nested #if/#else/#endif */
9858 # define NSIG (_NSIG)
9864 # define NSIG (SIGMAX+1)
9870 # define NSIG (SIG_MAX+1)
9876 # define NSIG (MAXSIG+1)
9882 # define NSIG (MAX_SIG+1)
9887 # ifdef SIGARRAYSIZE
9888 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
9894 # define NSIG (_sys_nsig) /* Solaris 2.5 */
9898 /* Default to some arbitrary number that's big enough to get most
9899 of the common signals.
9905 printf("NSIG %d\n", NSIG);
9911 echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
9913 printf "#ifdef SIG"; printf $1; printf "\n"
9914 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
9915 printf $1; printf ");\n"
9919 printf "#endif /* JUST_NSIG */\n";
9923 $cat >signal.awk <<'EOP'
9925 $1 ~ /^NSIG$/ { nsig = $2 }
9926 ($1 !~ /^NSIG$/) && (NF == 2) {
9927 if ($2 > maxsig) { maxsig = $2 }
9929 dup_name[ndups] = $1
9940 if (nsig == 0) { nsig = maxsig + 1 }
9941 for (n = 1; n < nsig; n++) {
9943 printf("%s %d\n", sig_name[n], sig_num[n])
9946 printf("NUM%d %d\n", n, n)
9949 for (n = 0; n < ndups; n++) {
9950 printf("%s %d\n", dup_name[n], dup_num[n])
9954 $cat >signal_cmd <<EOS
9956 if $test -s signal.lst; then
9957 echo "Using your existing signal.lst file"
9962 $cat >>signal_cmd <<'EOS'
9965 if eval $compile_ok; then
9966 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
9968 echo "(I can't seem be able to compile the whole test program)" >&4
9969 echo "(I'll try it in little pieces.)" >&4
9970 set signal -DJUST_NSIG
9971 if eval $compile_ok; then
9972 ./signal$_exe > signal.nsg
9975 echo "I can't seem to figure out how many signals you have." >&4
9976 echo "Guessing 50." >&4
9977 echo 'NSIG 50' > signal.nsg
9979 : Now look at all the signal names, one at a time.
9980 for xx in `echo $xxx | $tr ' ' '\012' | $sort | $uniq`; do
9981 $cat > signal.c <<EOCP
9982 #include <sys/types.h>
9986 printf("$xx %d\n", SIG${xx});
9991 if eval $compile; then
9992 echo "SIG${xx} found."
9993 ./signal$_exe >> signal.ls1
9995 echo "SIG${xx} NOT found."
9998 if $test -s signal.ls1; then
9999 $cat signal.nsg signal.ls1 |
10000 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10004 if $test -s signal.lst; then
10007 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10008 echo 'kill -l' >signal
10009 set X `csh -f <signal`
10013 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10015 echo $@ | $tr ' ' '\012' | \
10016 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10018 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10020 chmod a+x signal_cmd
10021 $eunicefix signal_cmd
10023 : generate list of signal names
10025 case "$sig_name_init" in
10027 echo "Generating a list of signal names and numbers..." >&4
10029 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10030 sig_name="ZERO $sig_name"
10031 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10032 { printf "\"%s\", ", $1 }
10033 END { printf "0\n" }' signal.lst`
10034 sig_num=`$awk 'BEGIN { printf "0, " }
10035 { printf "%d, ", $2}
10036 END { printf "0\n"}' signal.lst`
10039 echo "The following signals are available:"
10041 echo $sig_name | $awk \
10042 'BEGIN { linelen = 0 }
10044 for (i = 1; i <= NF; i++) {
10045 name = "SIG" $i " "
10046 linelen = linelen + length(name)
10047 if (linelen > 70) {
10049 linelen = length(name)
10055 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10057 : see what type is used for signed size_t
10058 set ssize_t ssizetype int stdio.h sys/types.h
10061 $cat > ssize.c <<EOM
10063 #include <sys/types.h>
10064 #define Size_t $sizetype
10065 #define SSize_t $dflt
10068 if (sizeof(Size_t) == sizeof(SSize_t))
10070 else if (sizeof(Size_t) == sizeof(int))
10079 if eval $compile_ok && ./ssize > /dev/null; then
10080 ssizetype=`./ssize`
10081 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10084 Help! I can't compile and run the ssize_t test program: please enlighten me!
10085 (This is probably a misconfiguration in your system or libraries, and
10086 you really ought to fix it. Still, I'll try anyway.)
10088 I need a type that is the same size as $sizetype, but is guaranteed to
10089 be signed. Common values are ssize_t, int and long.
10092 rp="What signed type is the same size as $sizetype?"
10096 $rm -f ssize ssize.*
10098 : see what type of char stdio uses.
10100 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10101 echo "Your stdio uses unsigned chars." >&4
10102 stdchar="unsigned char"
10104 echo "Your stdio uses signed chars." >&4
10108 : see if time exists
10110 if set time val -f d_time; eval $csym; $val; then
10111 echo 'time() found.' >&4
10113 rp="What is the type returned by time() on this system?"
10114 set time_t timetype long stdio.h sys/types.h
10117 echo 'time() not found, hope that will do.' >&4
10124 : see what type uids are declared as in the kernel
10126 echo "Looking for the type for user ids returned by getuid()."
10127 set uid_t uidtype xxx stdio.h sys/types.h
10131 xxx=`./findhdr sys/user.h`
10132 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10134 unsigned) dflt="$1 $2" ;;
10138 *) dflt="$uidtype";;
10141 uid_t) echo "uid_t found." ;;
10142 *) rp="What is the type for user ids returned by getuid()?"
10148 : see if dbm.h is available
10149 : see if dbmclose exists
10150 set dbmclose d_dbmclose
10153 case "$d_dbmclose" in
10163 *) set rpcsvc/dbm.h i_rpcsvcdbm
10168 *) echo "We won't be including <dbm.h>"
10178 : see if this is a sys/file.h system
10183 : do we need to include sys/file.h ?
10187 if $h_sysfile; then
10189 echo "We'll be including <sys/file.h>." >&4
10192 echo "We won't be including <sys/file.h>." >&4
10202 : see if fcntl.h is there
10207 : see if we can include fcntl.h
10213 echo "We'll be including <fcntl.h>." >&4
10216 if $h_sysfile; then
10217 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10219 echo "We won't be including <fcntl.h>." >&4
10231 : see if this is an grp system
10235 : see if locale.h is available
10236 set locale.h i_locale
10239 : see if this is a math.h system
10243 : see if ndbm.h is available
10248 : see if dbm_open exists
10249 set dbm_open d_dbm_open
10251 case "$d_dbm_open" in
10254 echo "We won't be including <ndbm.h>"
10263 : see if net/errno.h is available
10265 set net/errno.h val
10268 : Unfortunately, it causes problems on some systems. Arrgh.
10271 cat > try.c <<'EOM'
10274 #include <net/errno.h>
10280 if $cc $ccflags -c try.c >/dev/null 2>&1; then
10281 echo "We'll be including <net/errno.h>." >&4
10283 echo "We won't be including <net/errno.h>." >&4
10292 : get C preprocessor symbols handy
10294 $echo $n "Hmm... $c"
10295 echo $al | $tr ' ' '\012' >Cppsym.know
10296 $cat <<EOSS >Cppsym
10304 case "\$list\$#" in
10307 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
10309 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
10312 unknown="\$unknown \$sym"
10322 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
10324 exit 0; _ _ _ _\1\\ \1\\
10327 echo "exit 1; _ _ _" >>Cppsym\$\$
10328 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
10330 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
10336 $rm -f Cppsym\$\$ Cppsym2\$\$
10341 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
10343 : now check the C compiler for additional symbols
10349 for i in \`$cc -v -c tmp.c 2>&1\`
10352 -D*) echo "\$i" | $sed 's/^-D//';;
10353 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
10360 ./ccsym | $sort | $uniq >ccsym.raw
10361 $awk '/\=/ { print $0; next }
10362 { print $0"=1" }' ccsym.raw >ccsym.list
10363 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
10364 $comm -13 ccsym.true ccsym.list >ccsym.own
10365 $comm -12 ccsym.true ccsym.list >ccsym.com
10366 $comm -23 ccsym.true ccsym.list >ccsym.cpp
10369 if $test -z ccsym.raw; then
10370 echo "Your C compiler doesn't seem to define any symbol!" >&4
10372 echo "However, your C preprocessor defines the following ones:"
10375 if $test -s ccsym.com; then
10376 echo "Your C compiler and pre-processor define these symbols:"
10377 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
10380 $test "$silent" || sleep 1
10382 if $test -s ccsym.cpp; then
10383 $test "$also" && echo " "
10384 echo "Your C pre-processor ${also}defines the following $symbols:"
10385 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
10387 $test "$silent" || sleep 1
10389 if $test -s ccsym.own; then
10390 $test "$also" && echo " "
10391 echo "Your C compiler ${also}defines the following cpp variables:"
10392 $sed -e 's/\(.*\)=1/\1/' ccsym.own
10393 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
10394 $test "$silent" || sleep 1
10399 : see if this is a termio system
10403 if $test `./findhdr termios.h`; then
10404 set tcsetattr i_termios
10410 "$define") echo "You have POSIX termios.h... good!" >&4;;
10411 *) if ./Cppsym pyr; then
10412 case "`/bin/universe`" in
10413 ucb) if $test `./findhdr sgtty.h`; then
10415 echo "<sgtty.h> found." >&4
10417 echo "System is pyramid with BSD universe."
10418 echo "<sgtty.h> not found--you could have problems." >&4
10420 *) if $test `./findhdr termio.h`; then
10422 echo "<termio.h> found." >&4
10424 echo "System is pyramid with USG universe."
10425 echo "<termio.h> not found--you could have problems." >&4
10429 if $test `./findhdr termio.h`; then
10430 echo "<termio.h> found." >&4
10432 elif $test `./findhdr sgtty.h`; then
10433 echo "<sgtty.h> found." >&4
10436 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
10439 if $test `./findhdr sgtty.h`; then
10440 echo "<sgtty.h> found." >&4
10442 elif $test `./findhdr termio.h`; then
10443 echo "<termio.h> found." >&4
10446 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
10450 set i_termio; eval $setvar
10451 val=$val2; set i_sgtty; eval $setvar
10452 val=$val3; set i_termios; eval $setvar
10454 : see if stdarg is available
10456 if $test `./findhdr stdarg.h`; then
10457 echo "<stdarg.h> found." >&4
10460 echo "<stdarg.h> NOT found." >&4
10464 : see if varags is available
10466 if $test `./findhdr varargs.h`; then
10467 echo "<varargs.h> found." >&4
10469 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10472 : set up the varargs testing programs
10473 $cat > varargs.c <<EOP
10475 #include <stdarg.h>
10478 #include <varargs.h>
10482 int f(char *p, ...)
10496 p = va_arg(ap, char *);
10501 $cat > varargs <<EOP
10503 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10512 : now check which varargs header should be included
10517 if `./varargs I_STDARG`; then
10519 elif `./varargs I_VARARGS`; then
10524 if `./varargs I_VARARGS`; then
10531 echo "I could not find the definition for va_dcl... You have problems..." >&4
10532 val="$undef"; set i_stdarg; eval $setvar
10533 val="$undef"; set i_varargs; eval $setvar
10538 case "$i_varhdr" in
10540 val="$define"; set i_stdarg; eval $setvar
10541 val="$undef"; set i_varargs; eval $setvar
10544 val="$undef"; set i_stdarg; eval $setvar
10545 val="$define"; set i_varargs; eval $setvar
10548 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10552 : see if stddef is available
10553 set stddef.h i_stddef
10556 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
10557 set sys/filio.h i_sysfilio
10560 if $test `./findhdr sys/ioctl.h`; then
10562 echo '<sys/ioctl.h> found.' >&4
10565 if $test $i_sysfilio = "$define"; then
10566 echo '<sys/ioctl.h> NOT found.' >&4
10568 $test $i_sgtty = "$define" && xxx="sgtty.h"
10569 $test $i_termio = "$define" && xxx="termio.h"
10570 $test $i_termios = "$define" && xxx="termios.h"
10571 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
10577 : see if this is a sys/param system
10578 set sys/param.h i_sysparam
10581 : see if sys/resource.h has to be included
10582 set sys/resource.h i_sysresrc
10585 : see if sys/stat.h is available
10586 set sys/stat.h i_sysstat
10589 : see if sys/types.h has to be included
10590 set sys/types.h i_systypes
10593 : see if this is a sys/un.h system
10594 set sys/un.h i_sysun
10597 : see if this is a syswait system
10598 set sys/wait.h i_syswait
10601 : see if this is an utime system
10602 set utime.h i_utime
10605 : see if this is a values.h system
10606 set values.h i_values
10609 : see if this is a vfork system
10612 set vfork.h i_vfork
10620 : see if gdbm.h is available
10625 : see if gdbm_open exists
10626 set gdbm_open d_gdbm_open
10628 case "$d_gdbm_open" in
10631 echo "We won't be including <gdbm.h>"
10641 echo "Looking for extensions..." >&4
10644 : If we are using the old config.sh, known_extensions may contain
10645 : old or inaccurate or duplicate values.
10646 known_extensions=''
10647 : We do not use find because it might not be available.
10648 : We do not just use MANIFEST because the user may have dropped
10649 : some additional extensions into the source tree and expect them
10654 *) if $test -f $xxx/$xxx.xs; then
10655 known_extensions="$known_extensions $xxx"
10657 if $test -d $xxx; then
10660 if $test -f $yyy/$yyy.xs; then
10661 known_extensions="$known_extensions $xxx/$yyy"
10670 set X $known_extensions
10672 known_extensions="$*"
10675 : Now see which are supported on this system.
10677 for xxx in $known_extensions ; do
10681 $define) avail_ext="$avail_ext $xxx" ;;
10684 GDBM_File|gdbm_fil)
10686 $define) avail_ext="$avail_ext $xxx" ;;
10689 NDBM_File|ndbm_fil)
10691 $define) avail_ext="$avail_ext $xxx" ;;
10694 ODBM_File|odbm_fil)
10695 case "${i_dbm}${i_rpcsvcdbm}" in
10696 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
10700 case "$useposix" in
10701 true|define|y) avail_ext="$avail_ext $xxx" ;;
10705 case "$useopcode" in
10706 true|define|y) avail_ext="$avail_ext $xxx" ;;
10710 case "$d_socket" in
10711 true|$define|y) avail_ext="$avail_ext $xxx" ;;
10715 case "$usethreads" in
10716 true|$define|y) avail_ext="$avail_ext $xxx" ;;
10719 *) avail_ext="$avail_ext $xxx"
10731 A number of extensions are supplied with $package. You may choose to
10732 compile these extensions for dynamic loading (the default), compile
10733 them into the $package executable (static loading), or not include
10734 them at all. Answer "none" to include no extensions.
10735 Note that DynaLoader is always built and need not be mentioned here.
10738 case "$dynamic_ext" in
10739 '') dflt="$avail_ext" ;;
10740 *) dflt="$dynamic_ext"
10741 # Perhaps we are reusing an old out-of-date config.sh.
10744 if test X"$dynamic_ext" != X"$avail_ext"; then
10746 NOTICE: Your previous config.sh list may be incorrect.
10747 The extensions now available to you are
10749 but the default list from your previous config.sh is
10761 rp="What extensions do you wish to load dynamically?"
10764 none) dynamic_ext=' ' ;;
10765 *) dynamic_ext="$ans" ;;
10768 case "$static_ext" in
10770 : Exclude those already listed in dynamic linking
10772 for xxx in $avail_ext; do
10773 case " $dynamic_ext " in
10775 *) dflt="$dflt $xxx" ;;
10782 *) dflt="$static_ext"
10789 rp="What extensions do you wish to load statically?"
10792 none) static_ext=' ' ;;
10793 *) static_ext="$ans" ;;
10798 A number of extensions are supplied with $package. Answer "none"
10799 to include no extensions.
10800 Note that DynaLoader is always built and need not be mentioned here.
10803 case "$static_ext" in
10804 '') dflt="$avail_ext" ;;
10805 *) dflt="$static_ext"
10806 # Perhaps we are reusing an old out-of-date config.sh.
10809 if test X"$static_ext" != X"$avail_ext"; then
10811 NOTICE: Your previous config.sh list may be incorrect.
10812 The extensions now available to you are
10814 but the default list from your previous config.sh is
10826 rp="What extensions do you wish to include?"
10829 none) static_ext=' ' ;;
10830 *) static_ext="$ans" ;;
10835 set X $dynamic_ext $static_ext
10839 : Remove build directory name from cppstdin so it can be used from
10840 : either the present location or the final installed location.
10842 : Get out of the UU directory to get correct path name.
10844 case "$cppstdin" in
10846 echo "Stripping down cppstdin path name"
10852 : end of configuration questions
10854 echo "End of configuration questions."
10857 : back to where it started
10858 if test -d ../UU; then
10862 : configuration may be patched via a 'config.over' file
10863 if $test -f config.over; then
10866 rp='I see a config.over file. Do you wish to load it?'
10869 n*) echo "OK, I'll ignore it.";;
10871 echo "Configuration override changes have been loaded."
10876 : in case they want portability, strip down executable paths
10877 case "$d_portable" in
10880 echo "Stripping down executable paths..." >&4
10881 for file in $loclist $trylist; do
10882 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
10883 eval $file="\$file"
10889 : create config.sh file
10891 echo "Creating config.sh..." >&4
10892 $spitshell <<EOT >config.sh
10895 # This file was produced by running the Configure script. It holds all the
10896 # definitions figured out by Configure. Should you modify one of these values,
10897 # do not forget to propagate your changes by running "Configure -der". You may
10898 # instead choose to run each of the .SH files by yourself, or "Configure -S".
10901 # Package name : $package
10902 # Source directory : $src
10903 # Configuration time: $cf_time
10904 # Configured by : $cf_by
10905 # Target system : $myuname
10915 Revision='$Revision'
10922 alignbytes='$alignbytes'
10923 ansi2knr='$ansi2knr'
10924 aphostname='$aphostname'
10927 archlibexp='$archlibexp'
10928 archname='$archname'
10929 archobjs='$archobjs'
10937 byteorder='$byteorder'
10939 castflags='$castflags'
10942 cccdlflags='$cccdlflags'
10943 ccdlflags='$ccdlflags'
10946 cf_email='$cf_email'
10951 clocktype='$clocktype'
10953 compress='$compress'
10954 contains='$contains'
10958 cpp_stuff='$cpp_stuff'
10959 cppflags='$cppflags'
10961 cppminus='$cppminus'
10963 cppstdin='$cppstdin'
10964 cryptlib='$cryptlib'
10966 d_Gconvert='$d_Gconvert'
10967 d_access='$d_access'
10969 d_archlib='$d_archlib'
10970 d_attribut='$d_attribut'
10974 d_bsdgetpgrp='$d_bsdgetpgrp'
10975 d_bsdsetpgrp='$d_bsdsetpgrp'
10977 d_casti32='$d_casti32'
10978 d_castneg='$d_castneg'
10979 d_charvspr='$d_charvspr'
10981 d_chroot='$d_chroot'
10982 d_chsize='$d_chsize'
10983 d_closedir='$d_closedir'
10987 d_cuserid='$d_cuserid'
10988 d_dbl_dig='$d_dbl_dig'
10989 d_difftime='$d_difftime'
10990 d_dirnamlen='$d_dirnamlen'
10991 d_dlerror='$d_dlerror'
10992 d_dlopen='$d_dlopen'
10993 d_dlsymun='$d_dlsymun'
10994 d_dosuid='$d_dosuid'
10996 d_endhent='$d_endhent'
10997 d_endnent='$d_endnent'
10998 d_endpent='$d_endpent'
10999 d_endsent='$d_endsent'
11000 d_eofnblk='$d_eofnblk'
11001 d_eunice='$d_eunice'
11002 d_fchmod='$d_fchmod'
11003 d_fchown='$d_fchown'
11005 d_fd_macros='$d_fd_macros'
11006 d_fd_set='$d_fd_set'
11007 d_fds_bits='$d_fds_bits'
11008 d_fgetpos='$d_fgetpos'
11009 d_flexfnam='$d_flexfnam'
11012 d_fpathconf='$d_fpathconf'
11013 d_fsetpos='$d_fsetpos'
11015 d_getgrps='$d_getgrps'
11016 d_gethbyaddr='$d_gethbyaddr'
11017 d_gethbyname='$d_gethbyname'
11018 d_gethent='$d_gethent'
11019 d_gethname='$d_gethname'
11020 d_gethostprotos='$d_gethostprotos'
11021 d_getlogin='$d_getlogin'
11022 d_getnbyaddr='$d_getnbyaddr'
11023 d_getnbyname='$d_getnbyname'
11024 d_getnent='$d_getnent'
11025 d_getnetprotos='$d_getnetprotos'
11026 d_getpbyname='$d_getpbyname'
11027 d_getpbynumber='$d_getpbynumber'
11028 d_getpent='$d_getpent'
11029 d_getpgid='$d_getpgid'
11030 d_getpgrp2='$d_getpgrp2'
11031 d_getpgrp='$d_getpgrp'
11032 d_getppid='$d_getppid'
11033 d_getprior='$d_getprior'
11034 d_getprotoprotos='$d_getprotoprotos'
11035 d_getsbyname='$d_getsbyname'
11036 d_getsbyport='$d_getsbyport'
11037 d_getsent='$d_getsent'
11038 d_getservprotos='$d_getservprotos'
11039 d_gettimeod='$d_gettimeod'
11040 d_gnulibc='$d_gnulibc'
11043 d_inetaton='$d_inetaton'
11044 d_isascii='$d_isascii'
11045 d_killpg='$d_killpg'
11047 d_locconv='$d_locconv'
11049 d_longdbl='$d_longdbl'
11050 d_longlong='$d_longlong'
11053 d_mbstowcs='$d_mbstowcs'
11054 d_mbtowc='$d_mbtowc'
11055 d_memcmp='$d_memcmp'
11056 d_memcpy='$d_memcpy'
11057 d_memmove='$d_memmove'
11058 d_memset='$d_memset'
11060 d_mkfifo='$d_mkfifo'
11061 d_mkstemp='$d_mkstemp'
11062 d_mktime='$d_mktime'
11064 d_msgctl='$d_msgctl'
11065 d_msgget='$d_msgget'
11066 d_msgrcv='$d_msgrcv'
11067 d_msgsnd='$d_msgsnd'
11068 d_mymalloc='$d_mymalloc'
11070 d_oldpthreads='$d_oldpthreads'
11071 d_oldsock='$d_oldsock'
11073 d_pathconf='$d_pathconf'
11075 d_phostname='$d_phostname'
11078 d_portable='$d_portable'
11079 d_pthread_yield='$d_pthread_yield'
11080 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11082 d_pwchange='$d_pwchange'
11083 d_pwclass='$d_pwclass'
11084 d_pwcomment='$d_pwcomment'
11085 d_pwexpire='$d_pwexpire'
11086 d_pwgecos='$d_pwgecos'
11087 d_pwquota='$d_pwquota'
11088 d_readdir='$d_readdir'
11089 d_readlink='$d_readlink'
11090 d_rename='$d_rename'
11091 d_rewinddir='$d_rewinddir'
11093 d_safebcpy='$d_safebcpy'
11094 d_safemcpy='$d_safemcpy'
11095 d_sanemcmp='$d_sanemcmp'
11096 d_sched_yield='$d_sched_yield'
11097 d_seekdir='$d_seekdir'
11098 d_select='$d_select'
11100 d_semctl='$d_semctl'
11101 d_semget='$d_semget'
11103 d_setegid='$d_setegid'
11104 d_seteuid='$d_seteuid'
11105 d_setgrps='$d_setgrps'
11106 d_sethent='$d_sethent'
11107 d_setlinebuf='$d_setlinebuf'
11108 d_setlocale='$d_setlocale'
11109 d_setnent='$d_setnent'
11110 d_setpent='$d_setpent'
11111 d_setpgid='$d_setpgid'
11112 d_setpgrp2='$d_setpgrp2'
11113 d_setpgrp='$d_setpgrp'
11114 d_setprior='$d_setprior'
11115 d_setregid='$d_setregid'
11116 d_setresgid='$d_setresgid'
11117 d_setresuid='$d_setresuid'
11118 d_setreuid='$d_setreuid'
11119 d_setrgid='$d_setrgid'
11120 d_setruid='$d_setruid'
11121 d_setsent='$d_setsent'
11122 d_setsid='$d_setsid'
11123 d_setvbuf='$d_setvbuf'
11127 d_shmatprototype='$d_shmatprototype'
11128 d_shmctl='$d_shmctl'
11130 d_shmget='$d_shmget'
11131 d_sigaction='$d_sigaction'
11132 d_sigsetjmp='$d_sigsetjmp'
11133 d_socket='$d_socket'
11134 d_sockpair='$d_sockpair'
11135 d_statblks='$d_statblks'
11136 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11137 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11138 d_stdiobase='$d_stdiobase'
11139 d_stdstdio='$d_stdstdio'
11140 d_strchr='$d_strchr'
11141 d_strcoll='$d_strcoll'
11142 d_strctcpy='$d_strctcpy'
11143 d_strerrm='$d_strerrm'
11144 d_strerror='$d_strerror'
11145 d_strtod='$d_strtod'
11146 d_strtol='$d_strtol'
11147 d_strtoul='$d_strtoul'
11148 d_strxfrm='$d_strxfrm'
11149 d_suidsafe='$d_suidsafe'
11150 d_symlink='$d_symlink'
11151 d_syscall='$d_syscall'
11152 d_sysconf='$d_sysconf'
11153 d_sysernlst='$d_sysernlst'
11154 d_syserrlst='$d_syserrlst'
11155 d_system='$d_system'
11156 d_tcgetpgrp='$d_tcgetpgrp'
11157 d_tcsetpgrp='$d_tcsetpgrp'
11158 d_telldir='$d_telldir'
11161 d_truncate='$d_truncate'
11162 d_tzname='$d_tzname'
11166 d_void_closedir='$d_void_closedir'
11167 d_voidsig='$d_voidsig'
11168 d_voidtty='$d_voidtty'
11169 d_volatile='$d_volatile'
11170 d_vprintf='$d_vprintf'
11172 d_waitpid='$d_waitpid'
11173 d_wcstombs='$d_wcstombs'
11174 d_wctomb='$d_wctomb'
11177 db_hashtype='$db_hashtype'
11178 db_prefixtype='$db_prefixtype'
11179 defvoidused='$defvoidused'
11180 direntrytype='$direntrytype'
11183 doublesize='$doublesize'
11184 dynamic_ext='$dynamic_ext'
11189 eunicefix='$eunicefix'
11192 extensions='$extensions'
11194 firstmakefile='$firstmakefile'
11196 fpostype='$fpostype'
11197 freetype='$freetype'
11198 full_csh='$full_csh'
11199 full_sed='$full_sed'
11200 gccversion='$gccversion'
11204 groupcat='$groupcat'
11205 groupstype='$groupstype'
11208 h_sysfile='$h_sysfile'
11212 i_bsdioctl='$i_bsdioctl'
11215 i_dirent='$i_dirent'
11222 i_limits='$i_limits'
11223 i_locale='$i_locale'
11224 i_malloc='$i_malloc'
11226 i_memory='$i_memory'
11229 i_neterrno='$i_neterrno'
11232 i_rpcsvcdbm='$i_rpcsvcdbm'
11235 i_stdarg='$i_stdarg'
11236 i_stddef='$i_stddef'
11237 i_stdlib='$i_stdlib'
11238 i_string='$i_string'
11239 i_sysdir='$i_sysdir'
11240 i_sysfile='$i_sysfile'
11241 i_sysfilio='$i_sysfilio'
11243 i_sysioctl='$i_sysioctl'
11244 i_sysndir='$i_sysndir'
11245 i_sysparam='$i_sysparam'
11246 i_sysresrc='$i_sysresrc'
11247 i_sysselct='$i_sysselct'
11248 i_syssockio='$i_syssockio'
11249 i_sysstat='$i_sysstat'
11250 i_systime='$i_systime'
11251 i_systimek='$i_systimek'
11252 i_systimes='$i_systimes'
11253 i_systypes='$i_systypes'
11255 i_syswait='$i_syswait'
11256 i_termio='$i_termio'
11257 i_termios='$i_termios'
11259 i_unistd='$i_unistd'
11261 i_values='$i_values'
11262 i_varargs='$i_varargs'
11263 i_varhdr='$i_varhdr'
11267 installarchlib='$installarchlib'
11268 installbin='$installbin'
11269 installman1dir='$installman1dir'
11270 installman3dir='$installman3dir'
11271 installprivlib='$installprivlib'
11272 installscript='$installscript'
11273 installsitearch='$installsitearch'
11274 installsitelib='$installsitelib'
11276 known_extensions='$known_extensions'
11280 lddlflags='$lddlflags'
11288 libswanted='$libswanted'
11294 locincpth='$locincpth'
11295 loclibpth='$loclibpth'
11296 longdblsize='$longdblsize'
11297 longlongsize='$longlongsize'
11298 longsize='$longsize'
11302 lseektype='$lseektype'
11306 make_set_make='$make_set_make'
11307 mallocobj='$mallocobj'
11308 mallocsrc='$mallocsrc'
11309 malloctype='$malloctype'
11311 man1direxp='$man1direxp'
11314 man3direxp='$man3direxp'
11318 mips_type='$mips_type'
11321 modetype='$modetype'
11324 myarchname='$myarchname'
11325 mydomain='$mydomain'
11326 myhostname='$myhostname'
11329 netdb_hlen_type='$netdb_hlen_type'
11330 netdb_host_type='$netdb_host_type'
11331 netdb_name_type='$netdb_name_type'
11332 netdb_net_type='$netdb_net_type'
11335 nm_so_opt='$nm_so_opt'
11337 o_nonblock='$o_nonblock'
11339 optimize='$optimize'
11340 orderlib='$orderlib'
11346 patchlevel='$patchlevel'
11347 path_sep='$path_sep'
11349 perladmin='$perladmin'
11350 perlpath='$perlpath'
11352 phostname='$phostname'
11358 prefixexp='$prefixexp'
11360 privlibexp='$privlibexp'
11361 prototype='$prototype'
11363 randbits='$randbits'
11365 rd_nodata='$rd_nodata'
11369 scriptdir='$scriptdir'
11370 scriptdirexp='$scriptdirexp'
11372 selecttype='$selecttype'
11373 sendmail='$sendmail'
11376 sharpbang='$sharpbang'
11377 shmattype='$shmattype'
11378 shortsize='$shortsize'
11381 sig_name='$sig_name'
11382 sig_name_init='$sig_name_init'
11384 signal_t='$signal_t'
11385 sitearch='$sitearch'
11386 sitearchexp='$sitearchexp'
11388 sitelibexp='$sitelibexp'
11389 sizetype='$sizetype'
11394 sockethdr='$sockethdr'
11395 socketlib='$socketlib'
11397 spackage='$spackage'
11398 spitshell='$spitshell'
11401 ssizetype='$ssizetype'
11402 startperl='$startperl'
11404 static_ext='$static_ext'
11406 stdio_base='$stdio_base'
11407 stdio_bufsiz='$stdio_bufsiz'
11408 stdio_cnt='$stdio_cnt'
11409 stdio_filbuf='$stdio_filbuf'
11410 stdio_ptr='$stdio_ptr'
11413 subversion='$subversion'
11420 timeincl='$timeincl'
11421 timetype='$timetype'
11429 usemymalloc='$usemymalloc'
11431 useopcode='$useopcode'
11432 useperlio='$useperlio'
11433 useposix='$useposix'
11435 useshrplib='$useshrplib'
11436 usethreads='$usethreads'
11437 usevfork='$usevfork'
11441 voidflags='$voidflags'
11447 : add special variables
11448 $test -f $src/patchlevel.h && \
11449 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
11450 echo "CONFIG=true" >>config.sh
11452 : propagate old symbols
11453 if $test -f UU/config.sh; then
11454 <UU/config.sh sort | uniq >UU/oldconfig.sh
11455 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
11456 sort | uniq -u >UU/oldsyms
11457 set X `cat UU/oldsyms`
11463 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
11465 echo "# Variables propagated from previous config.sh file." >>config.sh
11466 for sym in `cat UU/oldsyms`; do
11467 echo " Propagating $hint variable "'$'"$sym..."
11468 eval 'tmp="$'"${sym}"'"'
11470 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
11476 : Finish up by extracting the .SH files
11490 If you'd like to make any changes to the config.sh file before I begin
11491 to configure things, do it as a shell escape now (e.g. !vi config.sh).
11494 rp="Press return or use a shell escape to edit config.sh:"
11499 *) : in case they cannot read
11500 sh 1>&4 -c "$ans";;
11505 : if this fails, just run all the .SH files by hand
11512 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
11519 Now you need to generate make dependencies by running "make depend".
11520 You might prefer to run it in background: "make depend > makedepend.out &"
11521 It can take a while, so you might not want to run it right now.
11526 rp="Run make depend now?"
11530 make depend && echo "Now you must run a make."
11533 echo "You must run 'make depend' then 'make'."
11536 elif test -f [Mm]akefile; then
11538 echo "Now you must run a make."
11543 if $test -f Policy.sh; then
11546 If you compile $package on a different machine or from a different object
11547 directory, copy the Policy.sh file from this object directory to the
11548 new one before you run Configure -- this will help you with most of
11549 the policy defaults.
11553 if $test -f config.msg; then
11554 echo "Hmm. I also noted the following information while running:"
11556 $cat config.msg >&4
11559 $rm -f kit*isdone ark*isdone