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 Mon Feb 8 01:45:46 EET 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 case "$inksh/$needksh" in
118 case "$inksh/$avoidksh" in
124 case "$inksh/$needksh-$avoidksh-" in
127 (I see you are using the Korn shell. Some ksh's blow up on $me,
128 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
134 echo "(Feeding myself to $newsh $reason.)"
136 Configure|*/Configure) exec $newsh $0 "$@";;
137 *) exec $newsh Configure "$@";;
142 : if needed set CDPATH to a harmless value that is not chatty
143 : avoid bash 2.02 problems with empty CDPATH.
147 *bash*) CDPATH='.' ;;
152 : Configure runs within the UU subdirectory
153 test -d UU || mkdir UU
421 d_old_pthread_create_joinable=''
422 old_pthread_create_joinable=''
680 ignore_versioned_solibs=''
805 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
808 : We must find out about Eunice early
810 if test -f /etc/unixtovms; then
811 eunicefix=/etc/unixtovms
813 if test -f /etc/unixtovms.exe; then
814 eunicefix=/etc/unixtovms.exe
818 : change the next line if compiling for Xenix/286 on Xenix/386
819 xlibpth='/usr/lib/386 /lib/386'
821 : Possible local library directories to search.
822 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
823 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
825 : general looking path for locating libraries
826 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
827 glibpth="$glibpth /lib /usr/lib $xlibpth"
828 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
829 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
831 : Private path used by Configure to find libraries. Its value
832 : is prepended to libpth. This variable takes care of special
833 : machines, like the mips. Usually, it should be empty.
836 : Possible local include directories to search.
837 : Set locincpth to "" in a hint file to defeat local include searches.
838 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
839 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
841 : no include file wanted by default
844 : list of known cpp symbols, sorted alphabetically
845 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
846 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
847 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
848 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
849 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
850 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
851 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
852 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
853 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
854 al="$al VMS Xenix286"
855 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
856 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
857 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
858 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
859 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
860 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
861 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
862 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
863 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
864 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
865 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
866 al="$al __SVR4_2__ __UMAXV__"
867 al="$al ____386BSD____ __alpha __alpha__ __amiga"
868 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
869 al="$al __host_mips__"
870 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
871 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
872 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
873 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
874 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
875 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
876 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
877 al="$al __mc88100 __mc88100__ __mips __mips__"
878 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
879 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
880 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
881 al="$al _host_mips _mips _unix"
882 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
883 al="$al apollo ardent att386 att3b"
884 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
885 al="$al cadmus clipper concurrent convex cray ctix"
886 al="$al dmert encore gcos gcx gimpel gould"
887 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
888 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
889 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
890 al="$al i186 i286 i386 i486 i8086"
891 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
892 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
893 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
894 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
895 al="$al mc88000 mc88100 merlin mert mips mvs n16"
896 al="$al ncl_el ncl_mr"
897 al="$al news1500 news1700 news1800 news1900 news3700"
898 al="$al news700 news800 news900 ns16000 ns32000"
899 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
900 al="$al parisc pc532 pdp11 plexus posix pyr"
901 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
902 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
903 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
904 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
905 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
906 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
909 : Trailing extension. Override this in a hint file, if needed.
911 : Extra object files, if any, needed on this platform.
914 : default library list
916 : some systems want to use only the non-versioned libso:s
917 ignore_versioned_solibs=''
918 : full support for void wanted by default
921 : set useposix=false in your hint file to disable the POSIX extension.
923 : set useopcode=false in your hint file to disable the Opcode extension.
925 : set usemultiplicity on the Configure command line to enable multiplicity.
926 : set usethreads on the Configure command line to enable threads.
927 : List of libraries we want.
928 : If anyone needs -lnet, put it in a hint file.
929 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
930 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
931 libswanted="$libswanted ucb bsd BSD PW x"
932 : We probably want to search /usr/shlib before most other libraries.
933 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
934 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
935 glibpth="/usr/shlib $glibpth"
936 : Do not use vfork unless overridden by a hint file.
939 : Find the basic shell for Bourne shell scripts
943 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
946 if test -f "$xxx"; then
949 : Build up a list and do a single loop so we can 'break' out.
950 pth=`echo $PATH | sed -e "s/$p_/ /g"`
951 for xxx in sh bash ksh pdksh ash; do
953 try="$try ${p}/${xxx}"
957 if test -f "$xxx"; then
960 elif test -f "$xxx.exe"; then
971 $me: Fatal Error: I can't find a Bourne Shell anywhere.
973 Usually it's in /bin/sh. How did you even get this far?
974 Please contact me (Perl Maintainers) at perlbug@perl.com and
975 we'll try to straighten this all out.
981 : see if sh knows # comments
982 if `$sh -c '#' >/dev/null 2>&1`; then
986 test -f $xcat || xcat=/usr/bin/cat
991 if test -s today; then
994 echo "#! $xcat" > try
998 if test -s today; then
1006 echo "Your $sh doesn't grok # comments--I will strip them later on."
1009 echo "exec grep -v '^[ ]*#'" >spitshell
1011 $eunicefix spitshell
1012 spitshell=`pwd`/spitshell
1014 echo "I presume that if # doesn't work, #! won't work either!"
1019 : figure out how to guarantee sh startup
1021 '') startsh=${sharpbang}${sh} ;;
1033 : echo "Yup, it does."
1035 echo "Hmm... '$startsh' does not guarantee sh startup..."
1036 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1041 : Save command line options in file UU/cmdline.opt for later use in
1042 : generating config.sh.
1043 cat > cmdline.opt <<EOSH
1044 # Configure command line arguments.
1051 cat >>cmdline.opt <<EOSH
1052 config_arg$argn='$arg'
1054 argn=`expr $argn + 1`
1057 : produce awk script to parse command line options
1058 cat >options.awk <<'EOF'
1060 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1062 len = length(optstr);
1063 for (i = 1; i <= len; i++) {
1064 c = substr(optstr, i, 1);
1065 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1076 if (substr(str, 1, 1) != "-") {
1077 printf("'%s'\n", str);
1081 for (i = 2; i <= len; i++) {
1082 c = substr(str, i, 1);
1084 printf("-%s\n", substr(str, i));
1090 printf("'%s'\n", substr(str, i + 1));
1103 : process the command line options
1104 set X `for arg in "$@"; do echo "X$arg"; done |
1105 sed -e s/X// | awk -f options.awk`
1110 : set up default values
1121 cat >optdef.sh <<EOS
1127 while test $# -gt 0; do
1129 -d) shift; fastread=yes;;
1130 -e) shift; alldone=cont;;
1134 if test -r "$1"; then
1137 echo "$me: cannot read config file $1." >&2
1142 -h) shift; error=true;;
1143 -r) shift; reuseval=true;;
1144 -s) shift; silent=true; realsilent=true;;
1145 -E) shift; alldone=exit;;
1146 -K) shift; knowitall=true;;
1147 -O) shift; override=true;;
1148 -S) shift; silent=true; extractsh=true;;
1153 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1154 echo "$me: ignoring -D $1" >&2
1157 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1158 *) echo "$1='define'" >> optdef.sh;;
1165 *=) echo "$1" >> optdef.sh;;
1167 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1168 echo "$me: ignoring -U $1" >&2
1170 *) echo "$1='undef'" >> optdef.sh;;
1174 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1177 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1185 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1186 [-U symbol] [-U symbol=]
1187 -d : use defaults for all answers.
1188 -e : go on without questioning past the production of config.sh.
1189 -f : specify an alternate default configuration file.
1190 -h : print this help message and exit (with an error status).
1191 -r : reuse C symbols value if possible (skips costly nm extraction).
1192 -s : silent mode, only echoes questions and essential information.
1193 -D : define symbol to have some value:
1194 -D symbol symbol gets the value 'define'
1195 -D symbol=value symbol gets the value 'value'
1196 -E : stop at the end of questions, after having produced config.sh.
1197 -K : do not use unless you know what you are doing.
1198 -O : let -D and -U override definitions from loaded configuration file.
1199 -S : perform variable substitutions on all .SH files (can mix with -f)
1200 -U : undefine symbol:
1201 -U symbol symbol gets the value 'undef'
1202 -U symbol= symbol gets completely empty
1203 -V : print version number and exit (with a zero status).
1210 case "$fastread$alldone" in
1213 if test ! -t 0; then
1214 echo "Say 'sh Configure', not 'sh <Configure'"
1222 true) exec 1>/dev/null;;
1225 : run the defines and the undefines, if any, but leave the file out there...
1231 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1232 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1233 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1234 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1235 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1238 : Some greps do not return status, grrr.
1239 echo "grimblepritz" >grimble
1240 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1242 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1248 : the following should work in any shell
1252 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1253 cat >contains <<'EOSS'
1254 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1259 : Find the path to the source tree
1262 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1273 if test -f $rsrc/Configure && \
1274 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1276 : found it, so we are ok.
1279 for src in . .. ../.. ../../.. ../../../..; do
1280 if test -f ../$src/Configure && \
1281 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1292 Sorry, I can't seem to locate the source dir for $package. Please start
1293 Configure with an explicit path -- i.e. /some/path/Configure.
1301 echo "Sources for $package found in \"$src\"." >&4
1305 : script used to extract .SH files with variable substitutions
1306 cat >extract <<'EOS'
1308 echo "Doing variable substitutions on .SH files..."
1309 if test -f $src/MANIFEST; then
1310 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1312 echo "(Looking for .SH files under the source directory.)"
1313 set x `(cd $src; find . -name "*.SH" -print)`
1317 0) set x `(cd $src; echo *.SH)`; shift;;
1319 if test ! -f $src/$1; then
1325 while test $name; do
1326 if test ! -d "$name"; then
1327 create="$name $create";
1328 name=`echo $name | sed -e "s|^[^/]*$||"`;
1329 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1334 for file in $create; do
1343 dir=`expr X$file : 'X\(.*\)/'`
1344 file=`expr X$file : 'X.*/\(.*\)'`
1345 (cd $dir && . ./$file)
1355 dir=`expr X$file : 'X\(.*\)/'`
1356 file=`expr X$file : 'X.*/\(.*\)'`
1357 (set x $dir; shift; eval $mkdir_p)
1367 if test -f $src/config_h.SH; then
1368 if test ! -f config.h; then
1369 : oops, they left it out of MANIFEST, probably, so do it anyway.
1375 : extract files and exit if asked to do so
1376 case "$extractsh" in
1378 case "$realsilent" in
1382 case "$config_sh" in
1383 '') config_sh='config.sh';;
1386 echo "Fetching answers from $config_sh..."
1389 test "$override" && . ./optdef.sh
1398 : Eunice requires " " instead of "", can you believe it
1401 echo "Beginning of configuration questions for $package."
1403 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1405 : first determine how to suppress newline on echo command
1407 echo "Checking echo to see how to suppress newlines..."
1408 (echo "hi there\c" ; echo " ") >.echotmp
1409 if $contains c .echotmp >/dev/null 2>&1 ; then
1420 echo $n "The star should be here-->$c"
1424 : Now test for existence of everything in MANIFEST
1426 if test -f $rsrc/MANIFEST; then
1427 echo "First let's make sure your kit is complete. Checking..." >&4
1428 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1431 for filelist in x??; do
1432 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1434 if test -s missing; then
1438 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1440 You have the option of continuing the configuration process, despite the
1441 distinct possibility that your kit is damaged, by typing 'y'es. If you
1442 do, don't blame me if something goes wrong. I advise you to type 'n'o
1443 and contact the author (perlbug@perl.com).
1446 echo $n "Continue? [n] $c" >&4
1450 echo "Continuing..." >&4
1454 echo "ABORTING..." >&4
1459 echo "Looks good..."
1462 echo "There is no MANIFEST file. I hope your kit is complete !"
1467 : Find the appropriate value for a newline for tr
1468 if test -n "$DJGPP"; then
1471 if test X"$trnl" = X; then
1472 case "`echo foo|tr '\n' x 2>/dev/null`" in
1476 if test X"$trnl" = X; then
1477 case "`echo foo|tr '\012' x 2>/dev/null`" in
1478 foox) trnl='\012' ;;
1481 if test X"$trnl" = X; then
1484 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1490 : compute the number of columns on the terminal for proper question formatting
1495 : set up the echo used in my read
1496 myecho="case \"\$xxxm\" in
1497 '') echo $n \"\$rp $c\" >&4;;
1499 '') echo $n \"[\$xxxm] $c\";;
1501 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1503 echo $n \"[\$xxxm] $c\" >&4
1505 echo $n \"\$rp [\$xxxm] $c\" >&4
1511 : now set up to do reads with possible shell escape and default assignment
1517 case "\$fastread" in
1518 yes) case "\$dflt" in
1521 case "\$silent-\$rp" in
1526 *) case "\$silent" in
1527 true) case "\$rp" in
1532 while expr "X\$ans" : "X!" >/dev/null; do
1536 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1544 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1553 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1558 echo "(OK, I'll run with -d after this question.)" >&4
1561 echo "*** Sorry, \$1 not supported yet." >&4
1571 echo "*** Substitution done -- please confirm."
1573 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1578 echo "*** Error -- try again."
1585 case "\$ans\$xxxm\$nostick" in
1597 : create .config dir to save info across Configure sessions
1598 test -d ../.config || mkdir ../.config
1599 cat >../.config/README <<EOF
1600 This directory created by Configure to save information that should
1601 persist across sessions for $package.
1603 You may safely delete it if you wish.
1606 : general instructions
1609 user=`(logname) 2>/dev/null`
1611 '') user=`whoami 2>&1`;;
1613 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1616 rp='Would you like to see the instructions?'
1627 This installation shell script will examine your system and ask you questions
1628 to determine how the perl5 package should be installed. If you get
1629 stuck on a question, you may use a ! shell escape to start a subshell or
1630 execute a command. Many of the questions will have default answers in square
1631 brackets; typing carriage return will give you the default.
1633 On some of the questions which ask for file or directory names you are allowed
1634 to use the ~name construct to specify the login directory belonging to "name",
1635 even if you don't have a shell which knows about that. Questions where this is
1636 allowed will be marked "(~name ok)".
1640 dflt='Type carriage return to continue'
1644 The prompter used in this script allows you to use shell variables and
1645 backticks in your answers. You may use $1, $2, etc... to refer to the words
1646 in the default answer, as if the default line was a set of arguments given to a
1647 script shell. This means you may also use $* to repeat the whole default line,
1648 so you do not have to re-type everything to add something to the default.
1650 Everytime there is a substitution, you will have to confirm. If there is an
1651 error (e.g. an unmatched backtick), the default answer will remain unchanged
1652 and you will be prompted again.
1654 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1655 the questions and use the computed defaults (or the previous answers if there
1656 was already a config.sh file). Type 'Configure -h' for a list of options.
1657 You may also start interactively and then answer '& -d' at any prompt to turn
1658 on the non-interactive behaviour for the remainder of the execution.
1664 Much effort has been expended to ensure that this shell script will run on any
1665 Unix system. If despite that it blows up on yours, your best bet is to edit
1666 Configure and run it again. If you can't run Configure for some reason,
1667 you'll have to generate a config.sh file by hand. Whatever problems you
1668 have, let me (perlbug@perl.com) know how I blew it.
1670 This installation script affects things in two ways:
1672 1) it may do direct variable substitutions on some of the files included
1674 2) it builds a config.h file for inclusion in C programs. You may edit
1675 any of these files as the need arises after running this script.
1677 If you make a mistake on a question, there is no easy way to back up to it
1678 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1679 files. Configure will offer to let you do this before it runs the SH files.
1682 dflt='Type carriage return to continue'
1684 case "$firsttime" in
1685 true) echo $user >>../.config/instruct;;
1689 : find out where common programs are
1691 echo "Locating common programs..." >&4
1704 if test -d \$dir/\$thing; then
1710 for thisthing in \$dir/\$thing; do
1711 : just loop through to pick last item
1713 if test -f \$thisthing; then
1716 elif test -f \$dir/\$thing.exe; then
1717 if test -n "$DJGPP"; then
1718 echo \$dir/\$thing.exe
1720 : on Eunice apparently
1771 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1772 pth="$pth /lib /usr/lib"
1773 for file in $loclist; do
1777 if test -f "$xxx"; then
1780 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1781 xxx=`./loc $file $file $pth`
1784 '') xxx=`./loc $file $file $pth`;;
1785 *) xxx=`./loc $xxx $xxx $pth`;;
1791 echo $file is in $xxx.
1794 echo $file is in $xxx.
1797 echo "I don't know where '$file' is, and my life depends on it." >&4
1798 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1804 echo "Don't worry if any of the following aren't found..."
1806 for file in $trylist; do
1810 if test -f "$xxx"; then
1813 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1814 xxx=`./loc $file $file $pth`
1817 '') xxx=`./loc $file $file $pth`;;
1818 *) xxx=`./loc $xxx $xxx $pth`;;
1824 echo $file is in $xxx.
1827 echo $file is in $xxx.
1830 echo "I don't see $file out there, $say."
1837 echo "Substituting grep for egrep."
1843 echo "Substituting cp for ln."
1849 echo "Hopefully test is built into your sh."
1852 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1853 echo "Using the test built into your sh."
1861 echo "Hopefully echo is built into your sh."
1866 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1867 $echo $n "hi there$c" >foo1
1868 echo $n "hi there$c" >foo2
1869 if cmp foo1 foo2 >/dev/null 2>&1; then
1870 echo "They are compatible. In fact, they may be identical."
1877 They are not compatible! You are probably running ksh on a non-USG system.
1878 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1879 have echo built in and we may have to run some Bourne shell scripts. That
1880 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1883 $echo $n "The star should be here-->$c"
1890 : determine whether symbolic links are supported
1893 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1894 echo "Symbolic links are supported." >&4
1897 echo "Symbolic links are NOT supported." >&4
1902 : see whether [:lower:] and [:upper:] are supported character classes
1904 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1906 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1910 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1911 # (0xc9 and 0xd1), therefore that is a nice testing point.
1912 if test "X$up" = X -o "X$low" = X; then
1913 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1919 if test "X$up" = X -o "X$low" = X; then
1920 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1926 if test "X$up" = X -o "X$low" = X; then
1927 case "`echo IJ | od -x 2>/dev/null`" in
1929 echo "Hey, this might be EBCDIC." >&4
1930 if test "X$up" = X -o "X$low" = X; then
1931 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1932 ij) up='[A-IJ-RS-Z]'
1937 if test "X$up" = X -o "X$low" = X; then
1938 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1948 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1950 echo "Using $up and $low to convert case." >&4
1953 echo "I don't know how to translate letters from upper to lower case." >&4
1954 echo "Your tr is not acting any way I know of." >&4
1958 : set up the translation script tr, must be called with ./tr of course
1962 '[A-Z][a-z]') exec $tr '$up' '$low';;
1963 '[a-z][A-Z]') exec $tr '$low' '$up';;
1970 : Try to determine whether config.sh was made on this system
1971 case "$config_sh" in
1973 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1974 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1975 # because the A-Z/a-z are not consecutive.
1976 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1977 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1978 newmyuname="$myuname"
1980 case "$knowitall" in
1982 if test -f ../config.sh; then
1983 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1984 eval "`grep myuname= ../config.sh`"
1986 if test "X$myuname" = "X$newmyuname"; then
1994 : Get old answers from old config file if Configure was run on the
1995 : same system, otherwise use the hints.
1998 if test -f config.sh; then
2000 rp="I see a config.sh file. Shall I use it to set the defaults?"
2003 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2004 *) echo "Fetching default answers from your old config.sh file..." >&4
2012 : Older versions did not always set $sh. Catch re-use of such
2021 if test ! -f config.sh; then
2024 First time through, eh? I have some defaults handy for some systems
2025 that need some extra help getting the Configure answers right:
2028 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2030 : Half the following guesses are probably wrong... If you have better
2031 : tests or hints, please send them to perlbug@perl.com
2032 : The metaconfig authors would also appreciate a copy...
2033 $test -f /irix && osname=irix
2034 $test -f /xenix && osname=sco_xenix
2035 $test -f /dynix && osname=dynix
2036 $test -f /dnix && osname=dnix
2037 $test -f /lynx.os && osname=lynxos
2038 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2039 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2040 $test -f /bin/mips && /bin/mips && osname=mips
2041 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2042 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2043 $test -d /usr/apollo/bin && osname=apollo
2044 $test -f /etc/saf/_sactab && osname=svr4
2045 $test -d /usr/include/minix && osname=minix
2046 if $test -d /MachTen -o -d /MachTen_Folder; then
2048 if $test -x /sbin/version; then
2049 osvers=`/sbin/version | $awk '{print $2}' |
2050 $sed -e 's/[A-Za-z]$//'`
2051 elif $test -x /usr/etc/version; then
2052 osvers=`/usr/etc/version | $awk '{print $2}' |
2053 $sed -e 's/[A-Za-z]$//'`
2058 $test -f /sys/posix.dll &&
2059 $test -f /usr/bin/what &&
2060 set X `/usr/bin/what /sys/posix.dll` &&
2061 $test "$3" = UWIN &&
2064 if $test -f $uname; then
2072 umips) osname=umips ;;
2075 [23]100) osname=mips ;;
2076 next*) osname=next ;;
2078 if $test -f /etc/kconfig; then
2080 if test "$lns" = "ln -s"; then
2082 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2084 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2090 if test -n "$DJGPP"; then
2099 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2101 'not found') osvers="$4"."$3" ;;
2102 '<3240'|'<>3240') osvers=3.2.0 ;;
2103 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2104 '=3250'|'>3250') osvers=3.2.5 ;;
2108 *dc.osx) osname=dcosx
2114 domainos) osname=apollo
2120 dynixptx*) osname=dynixptx
2121 osvers=`echo "$4"|sed 's/^v//'`
2123 freebsd) osname=freebsd
2125 genix) osname=genix ;;
2127 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2143 netbsd*) osname=netbsd
2146 news-os) osvers="$3"
2148 4*) osname=newsos4 ;;
2152 bsd386) osname=bsd386
2155 POSIX-BC | posix-bc ) osname=posix-bc
2158 powerux | power_ux | powermax_os | powermaxos | \
2159 powerunix | power_unix) osname=powerux
2162 next*) osname=next ;;
2163 solaris) osname=solaris
2165 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2172 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2176 titanos) osname=titanos
2185 ultrix) osname=ultrix
2188 osf1|mls+) case "$5" in
2191 osvers=`echo "$3" | sed 's/^[xvt]//'`
2193 hp*) osname=hp_osf1 ;;
2194 mips) osname=mips_osf1 ;;
2203 $2) case "$osname" in
2207 : svr4.x or possibly later
2217 if test -f /stand/boot ; then
2218 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2219 if test -n "$INITPROG" -a -f "$INITPROG"; then
2220 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2221 if test -n "$isesix"; then
2229 *) if test -f /etc/systemid; then
2231 set `echo $3 | $sed 's/\./ /g'` $4
2232 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2234 elif $test -f $src/hints/sco_$1_$2.sh; then
2236 elif $test -f $src/hints/sco_$1.sh; then
2241 '') : Still unknown. Probably a generic Sys V.
2250 *) case "$osname" in
2251 '') : Still unknown. Probably a generic BSD.
2259 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2260 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2261 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2264 $rm -f UU/kernel.what
2265 elif test -d c:/.; then
2272 : Now look for a hint file osname_osvers, unless one has been
2273 : specified already.
2276 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2277 : Also try without trailing minor version numbers.
2278 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2279 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2280 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2281 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2284 *) case "$osvers" in
2287 *) if $test -f $src/hints/$file.sh ; then
2289 elif $test -f $src/hints/$xfile.sh ; then
2291 elif $test -f $src/hints/$xxfile.sh ; then
2293 elif $test -f $src/hints/$xxxfile.sh ; then
2295 elif $test -f $src/hints/$xxxxfile.sh ; then
2297 elif $test -f "$src/hints/${osname}.sh" ; then
2306 if $test -f Policy.sh ; then
2309 none) dflt="Policy" ;;
2310 *) dflt="Policy $dflt" ;;
2315 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2319 if $test -f Policy.sh ; then
2322 There's also a Policy hint file available, which should make the
2323 site-specific (policy) questions easier to answer.
2330 You may give one or more space-separated answers, or "none" if appropriate.
2331 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2332 is a good thing. DO NOT give a wrong version.
2336 rp="Which of these apply, if any?"
2339 for file in $tans; do
2340 if $test X$file = XPolicy -a -f Policy.sh; then
2342 $cat Policy.sh >> UU/config.sh
2343 elif $test -f $src/hints/$file.sh; then
2344 . $src/hints/$file.sh
2345 $cat $src/hints/$file.sh >> UU/config.sh
2346 elif $test X$tans = X -o X$tans = Xnone ; then
2349 : Give one chance to correct a possible typo.
2350 echo "$file.sh does not exist"
2352 rp="hint to use instead?"
2354 for file in $ans; do
2355 if $test -f "$src/hints/$file.sh"; then
2356 . $src/hints/$file.sh
2357 $cat $src/hints/$file.sh >> UU/config.sh
2358 elif $test X$ans = X -o X$ans = Xnone ; then
2361 echo "$file.sh does not exist -- ignored."
2368 : Remember our hint file for later.
2369 if $test -f "$src/hints/$file.sh" ; then
2379 echo "Fetching default answers from $config_sh..." >&4
2383 cp $config_sh config.sh 2>/dev/null
2393 test "$override" && . ./optdef.sh
2394 myuname="$newmyuname"
2396 : Restore computed paths
2397 for file in $loclist $trylist; do
2398 eval $file="\$_$file"
2403 Configure uses the operating system name and version to set some defaults.
2404 The default value is probably right if the name rings a bell. Otherwise,
2405 since spelling matters for me, either accept the default or answer "none"
2412 ''|' '|none) dflt=none ;;
2413 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2416 *) dflt="$osname" ;;
2418 rp="Operating system name?"
2422 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2428 ''|' '|none) dflt=none ;;
2429 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2430 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2432 ''|' ') dflt=none ;;
2437 *) dflt="$osvers" ;;
2439 rp="Operating system version?"
2446 : who configured the system
2447 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2448 cf_by=`(logname) 2>/dev/null`
2451 cf_by=`(whoami) 2>/dev/null`
2453 "") cf_by=unknown ;;
2457 : set up the script used to warn in case of inconsistency
2464 echo "*** WHOA THERE!!! ***" >&4
2465 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2466 rp=" Keep the $hint value?"
2469 y) td=$was; tu=$was;;
2473 : function used to set $1 to $val
2474 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2476 $define$undef) . ./whoa; eval "$var=\$td";;
2477 $undef$define) . ./whoa; eval "$var=\$tu";;
2478 *) eval "$var=$val";;
2483 Perl can be built to take advantage of threads, on some systems.
2484 To do so, Configure must be run with -Dusethreads.
2485 (See README.threads for details.)
2487 case "$usethreads" in
2488 $define|true|[yY]*) dflt='y';;
2491 rp='Build a threading Perl?'
2494 y|Y) val="$define" ;;
2500 case "$d_oldpthreads" in
2501 '') : Configure tests would be welcome here. For now, assume undef.
2503 *) val="$d_oldpthreads" ;;
2509 case "$usethreads" in
2510 "$define"|true|[yY]*)
2511 : Look for a hint-file generated 'call-back-unit'. If the
2512 : user has specified that a threading perl is to be built,
2513 : we may need to set or change some other defaults.
2514 if $test -f usethreads.cbu; then
2518 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|os2|solaris|vmesa)
2519 # Known thread-capable platforms.
2523 $osname is not known to support threads.
2524 Please let perlbug@perl.com know how to do that.
2526 Cannot continue, aborting.
2536 Perl can be built so that multiple Perl interpreters can coexist
2537 within the same Perl executable. To do so, Configure must be run with
2540 Normally you do not need this and you should answer no.
2543 case "$usemultiplicity" in
2544 $define|true|[yY]*) dflt='y';;
2547 rp='Build Perl for multiplicity?'
2550 y|Y) val="$define" ;;
2558 Perl can be built to take advantage of explicit 64-bit interfaces,
2559 on some systems. To do so, Configure must be run with -Duse64bits.
2561 If this doesn't make any sense to you, just accept the default 'n'.
2563 case "$use64bits" in
2564 $define|true|[yY]*) dflt='y';;
2567 rp='Try to use explicit 64-bit interfaces, if available?'
2580 case "$archname64" in
2581 '') archname64='' ;; # not a typo
2584 case "$use64bits" in
2585 "$define"|true|[yY]*)
2586 : Look for a hint-file generated 'call-back-unit'. If the
2587 : user has specified that a threading perl is to be built,
2588 : we may need to set or change some other defaults.
2589 if $test -f use64bits.cbu; then
2593 dec_osf|hpux|irix|solaris|unicos)
2594 # Known 64-bit capable platforms.
2598 $osname is not known to support 64-bit interfaces.
2599 Please let perlbug@perl.com know how to do that.
2601 Cannot continue, aborting.
2609 : determine the architecture name
2611 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2612 tarch=`arch`"-$osname"
2613 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2614 if uname -m > tmparch 2>&1 ; then
2615 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2616 -e 's/$/'"-$osname/" tmparch`
2624 case "$myarchname" in
2627 echo "(Your architecture name used to be $myarchname.)"
2634 *) dflt="$archname";;
2636 rp='What is your architecture name'
2639 case "$usethreads" in
2641 echo "Threads selected." >&4
2643 *-thread*) echo "...and architecture name already has -thread." >&4
2645 *) archname="$archname-thread"
2646 echo "...setting architecture name to $archname." >&4
2651 case "$usemultiplicity" in
2653 echo "Multiplicity selected." >&4
2655 *-multi*) echo "...and architecture name already has -multi." >&4
2657 *) archname="$archname-multi"
2658 echo "...setting architecture name to $archname." >&4
2663 case "$use64bits" in
2665 echo "Explicit 64-bitness selected." >&4
2666 case "$archname64" in
2671 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2673 *) archname="$archname-$archname64"
2674 echo "...setting architecture name to $archname." >&4
2684 $define|true) afs=true ;;
2685 $undef|false) afs=false ;;
2686 *) if test -d /afs; then
2694 echo "AFS may be running... I'll be extra cautious then..." >&4
2696 echo "AFS does not seem to be running..." >&4
2699 : decide how portable to be. Allow command line overrides.
2700 case "$d_portable" in
2702 *) d_portable="$define" ;;
2705 : set up shell script to do ~ expansion
2711 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2714 if $test -f /bin/csh; then
2715 /bin/csh -f -c "glob \$1"
2720 name=\`$expr x\$1 : '..\([^/]*\)'\`
2721 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2722 if $test ! -d "\$dir"; then
2724 echo "\$me: can't locate home directory for: \$name" >&2
2729 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2745 : now set up to get a file name
2749 cat <<'EOSC' >>getfile
2762 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2763 fn=`echo $fn | sed 's/(.*)//'`
2769 loc_file=`expr $fn : '.*:\(.*\)'`
2770 fn=`expr $fn : '\(.*\):.*'`
2778 */*) fullpath=true;;
2787 *e*) exp_file=true;;
2790 *p*) nopath_ok=true;;
2795 *d*) type='Directory';;
2796 *l*) type='Locate';;
2801 Locate) what='File';;
2806 case "$d_portable" in
2814 while test "$type"; do
2819 true) rp="$rp (~name ok)";;
2822 if test -f UU/getfile.ok && \
2823 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2842 value=`UU/filexp $ans`
2845 if test "$ans" != "$value"; then
2846 echo "(That expands to $value on this system.)"
2860 /*) value="$ansexp" ;;
2865 echo "I shall only accept a full path name, as in /bin/ls." >&4
2866 echo "Use a ! shell escape if you wish to check pathnames." >&4
2869 echo "Please give a full path name, starting with slash." >&4
2872 echo "Note that using ~name is ok provided it expands well." >&4
2885 if test -f "$ansexp"; then
2887 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2889 echo "($value is not a plain file, but that's ok.)"
2894 if test -d "$ansexp"; then
2899 if test -d "$ansexp"; then
2900 echo "(Looking for $loc_file in directory $value.)"
2901 value="$value/$loc_file"
2902 ansexp="$ansexp/$loc_file"
2904 if test -f "$ansexp"; then
2907 case "$nopath_ok" in
2908 true) case "$value" in
2910 *) echo "Assuming $value will be in people's path."
2926 if test "$fastread" = yes; then
2931 rp="$what $value doesn't exist. Use that name anyway?"
2952 : determine root of directory hierarchy where package will be installed.
2955 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2963 By default, $package will be installed in $dflt/bin, manual
2964 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2965 all installation directories. Typically set to /usr/local, but you
2966 may choose /usr if you wish to install $package among your system
2967 binaries. If you wish to have binaries under /bin but manual pages
2968 under /usr/local/man, that's ok: you will be prompted separately
2969 for each of the installation directories, the prefix being only used
2970 to set the defaults.
2974 rp='Installation prefix to use?'
2982 *) oldprefix="$prefix";;
2989 : set the prefixit variable, to compute a suitable default value
2990 prefixit='case "$3" in
2992 case "$oldprefix" in
2993 "") eval "$1=\"\$$2\"";;
3000 ""|" ") eval "$1=\"\$$2\"";;
3006 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3008 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3009 /*-$oldprefix/*|\~*-$oldprefix/*)
3010 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3011 *) eval "$1=\"\$$2\"";;
3015 : set the base revision
3018 : get the patchlevel
3020 echo "Getting the current patchlevel..." >&4
3021 if $test -r $rsrc/patchlevel.h;then
3022 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
3023 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3028 $echo $n "(You have $package" $c
3031 *) $echo $n " $baserev" $c ;;
3033 $echo $n " patchlevel $patchlevel" $c
3034 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3037 if test 0 -eq "$subversion"; then
3038 version=`LC_ALL=C; export LC_ALL; \
3039 echo $baserev $patchlevel | \
3040 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3042 version=`LC_ALL=C; export LC_ALL; \
3043 echo $baserev $patchlevel $subversion | \
3044 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3046 : Figure out perl API version. Perhaps this should be in patchlevel.h
3047 if test "$subversion" -lt 50; then
3048 apiversion=`LC_ALL=C; export LC_ALL; \
3049 LANGUAGE=C; export LANGUAGE; \
3050 echo $baserev $patchlevel | \
3051 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3053 apiversion="$version"
3056 : determine where private library files go
3057 : Usual default is /usr/local/lib/perl5/$version.
3058 : Also allow things like /opt/perl/lib/$version, since
3059 : /opt/perl/lib/perl5... would be redundant.
3061 *perl*) set dflt privlib lib/$version ;;
3062 *) set dflt privlib lib/$package/$version ;;
3067 There are some auxiliary files for $package that need to be put into a
3068 private library directory that is accessible by everyone.
3072 rp='Pathname where the private library files will reside?'
3074 if $test "X$privlibexp" != "X$ansexp"; then
3078 privlibexp="$ansexp"
3082 Since you are running AFS, I need to distinguish the directory in which
3083 private files reside from the directory in which they are installed (and from
3084 which they are presumably copied to the former directory by occult means).
3087 case "$installprivlib" in
3088 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3089 *) dflt="$installprivlib";;
3092 rp='Where will private files be installed?'
3094 installprivlib="$ans"
3096 installprivlib="$privlibexp"
3099 : set the prefixup variable, to restore leading tilda escape
3100 prefixup='case "$prefixexp" in
3102 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3105 : determine where public architecture dependent libraries go
3108 : privlib default is /usr/local/lib/$package/$version
3109 : archlib default is /usr/local/lib/$package/$version/$archname
3110 : privlib may have an optional trailing /share.
3111 tdflt=`echo $privlib | $sed 's,/share$,,'`
3112 tdflt=$tdflt/$archname
3121 $spackage contains architecture-dependent library files. If you are
3122 sharing libraries in a heterogeneous environment, you might store
3123 these files in a separate location. Otherwise, you can just include
3124 them with the rest of the public library files.
3128 rp='Where do you want to put the public architecture-dependent libraries?'
3131 archlibexp="$ansexp"
3136 Since you are running AFS, I need to distinguish the directory in
3137 which architecture-dependent library files reside from the directory
3138 in which they are installed (and from which they are presumably copied
3139 to the former directory by occult means).
3142 case "$installarchlib" in
3143 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3144 *) dflt="$installarchlib";;
3147 rp='Where will architecture-dependent library files be installed?'
3149 installarchlib="$ans"
3151 installarchlib="$archlibexp"
3153 if $test X"$archlib" = X"$privlib"; then
3159 : make some quick guesses about what we are up against
3161 $echo $n "Hmm... $c"
3171 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3172 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3174 echo "Looks kind of like an OSF/1 system, but we'll see..."
3176 elif test `echo abc | tr a-z A-Z` = Abc ; then
3177 xxx=`./loc addbib blurfl $pth`
3178 if $test -f $xxx; then
3179 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3183 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3184 echo "Looks kind of like an extended USG system, but we'll see..."
3186 echo "Looks kind of like a USG system, but we'll see..."
3190 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3191 echo "Looks kind of like a BSD system, but we'll see..."
3195 echo "Looks kind of like a Version 7 system, but we'll see..."
3198 case "$eunicefix" in
3201 There is, however, a strange, musty smell in the air that reminds me of
3202 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3206 : it so happens the Eunice I know will not run shell scripts in Unix format
3210 echo "Congratulations. You aren't running Eunice."
3214 : Detect OS2. The p_ variable is set above in the Head.U unit.
3219 I have the feeling something is not exactly right, however...don't tell me...
3220 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3225 if test -f /xenix; then
3226 echo "Actually, this looks more like a XENIX system..."
3231 echo "It's not Xenix..."
3236 if test -f /venix; then
3237 echo "Actually, this looks more like a VENIX system..."
3244 echo "Nor is it Venix..."
3247 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3248 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3251 : see if setuid scripts can be secure
3254 Some kernels have a bug that prevents setuid #! scripts from being
3255 secure. Some sites have disabled setuid #! scripts because of this.
3257 First let's decide if your kernel supports secure setuid #! scripts.
3258 (If setuid #! scripts would be secure but have been disabled anyway,
3259 don't say that they are secure if asked.)
3264 if $test -d /dev/fd; then
3265 echo "#!$ls" >reflect
3266 chmod +x,u+s reflect
3267 ./reflect >flect 2>&1
3268 if $contains "/dev/fd" flect >/dev/null; then
3269 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3273 If you are not sure if they are secure, I can check but I'll need a
3274 username and password different from the one you are using right now.
3275 If you don't have such a username or don't want me to test, simply
3279 rp='Other username to test security of setuid scripts with?'
3284 case "$d_suidsafe" in
3285 '') echo "I'll assume setuid scripts are *not* secure." >&4
3288 echo "Well, the $hint value is *not* secure." >&4
3290 *) echo "Well, the $hint value *is* secure." >&4
3295 $rm -f reflect flect
3296 echo "#!$ls" >reflect
3297 chmod +x,u+s reflect
3300 echo '"su" will (probably) prompt you for '"$ans's password."
3301 su $ans -c './reflect >flect'
3302 if $contains "/dev/fd" flect >/dev/null; then
3303 echo "Okay, it looks like setuid scripts are secure." >&4
3306 echo "I don't think setuid scripts are secure." >&4
3311 rp='Does your kernel have *secure* setuid scripts?'
3314 [yY]*) val="$define";;
3319 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3320 echo "(That's for file descriptors, not floppy disks.)"
3326 $rm -f reflect flect
3328 : now see if they want to do setuid emulation
3331 case "$d_suidsafe" in
3334 echo "No need to emulate SUID scripts since they are secure here." >& 4
3338 Some systems have disabled setuid scripts, especially systems where
3339 setuid scripts cannot be secure. On systems where setuid scripts have
3340 been disabled, the setuid/setgid bits on scripts are currently
3341 useless. It is possible for $package to detect those bits and emulate
3342 setuid/setgid in a secure fashion. This emulation will only work if
3343 setuid scripts have been disabled in your kernel.
3347 "$define") dflt=y ;;
3350 rp="Do you want to do setuid/setgid emulation?"
3353 [yY]*) val="$define";;
3361 : determine where manual pages are on this system
3365 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3366 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3367 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3368 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3369 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3370 sysman=`./loc . /usr/man/man1 $syspath`
3373 if $test -d "$sysman"; then
3374 echo "System manual is in $sysman." >&4
3376 echo "Could not find manual pages in source form." >&4
3379 : see what memory models we can support
3382 $cat >pdp11.c <<'EOP'
3391 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3392 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3393 dflt='unsplit split'
3395 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3398 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3403 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3406 if $test -d /lib/large || $test -d /usr/lib/large; then
3409 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3418 Some systems have different model sizes. On most systems they are called
3419 small, medium, large, and huge. On the PDP11 they are called unsplit and
3420 split. If your system doesn't support different memory models, say "none".
3421 If you wish to force everything to one memory model, say "none" here and
3422 put the appropriate flags later when it asks you for other cc and ld flags.
3423 Venix systems may wish to put "none" and let the compiler figure things out.
3424 (In the following question multiple model names should be space separated.)
3426 The default for most systems is "none".
3429 rp="Which memory models are supported?"
3444 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3445 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3452 rp="What flag indicates separate I and D space?"
3460 *large*|*small*|*medium*|*huge*)
3467 rp="What flag indicates large model?"
3477 *huge*) case "$huge" in
3481 rp="What flag indicates huge model?"
3491 *medium*) case "$medium" in
3495 rp="What flag indicates medium model?"
3502 *) medium="$large";;
3505 *small*) case "$small" in
3509 rp="What flag indicates small model?"
3520 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3523 $rm -f pdp11.* pdp11
3525 : see if we need a special compiler
3533 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3534 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3548 On some older systems the default C compiler will not resolve multiple global
3549 references that happen to have the same name. On some such systems the "Mcc"
3550 command may be used to force these to be resolved. On other systems a "cc -M"
3551 command is required. (Note that the -M flag on other systems indicates a
3552 memory model to use!) If you have the Gnu C compiler, you might wish to use
3558 rp="Use which C compiler?"
3566 rp="Use which C compiler?"
3570 : Look for a hint-file generated 'call-back-unit'. Now that the
3571 : user has specified the compiler, we may need to set or change some
3573 if $test -f cc.cbu; then
3577 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3578 $cat >gccvers.c <<EOM
3583 printf("%s\n", __VERSION__);
3585 printf("%s\n", "1");
3591 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3592 gccversion=`./gccvers`
3593 case "$gccversion" in
3594 '') echo "You are not using GNU cc." ;;
3595 *) echo "You are using GNU cc $gccversion." ;;
3599 echo "*** WHOA THERE!!! ***" >&4
3600 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3601 case "$knowitall" in
3603 echo " You'd better start hunting for one and let me know about it." >&4
3609 case "$gccversion" in
3610 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3613 : What should the include directory be ?
3615 $echo $n "Hmm... $c"
3619 if $test -f /bin/mips && /bin/mips; then
3620 echo "Looks like a MIPS system..."
3621 $cat >usr.c <<'EOCP'
3622 #ifdef SYSTYPE_BSD43
3626 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3627 dflt='/bsd43/usr/include'
3631 mips_type='System V'
3633 $rm -f usr.c usr.out
3634 echo "and you're compiling with the $mips_type compiler and libraries."
3638 echo "Doesn't look like a MIPS system."
3648 case "$xxx_prompt" in
3651 rp='Where are the include files you want to use?'
3659 : see how we invoke the C preprocessor
3661 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3662 cat <<'EOT' >testcpp.c
3668 if test ! -f cppstdin; then
3669 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3671 echo "Keeping your $hint cppstdin wrapper."
3674 wrapper=`pwd`/cppstdin
3678 if $test "X$cppstdin" != "X" && \
3679 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3682 echo "You used to use $cppstdin $cppminus so we'll use that again."
3684 '') echo "But let's see if we can live without a wrapper..." ;;
3686 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3689 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3692 echo "(However, $cpprun $cpplast does not work, let's see...)"
3700 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3707 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3708 $cc -E <testcpp.c >testcpp.out 2>&1; \
3709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3710 echo "Yup, it does."
3713 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3714 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3715 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3716 echo "Yup, it does."
3719 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3720 $cc -P <testcpp.c >testcpp.out 2>&1; \
3721 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3722 echo "Yipee, that works!"
3725 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3726 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3727 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3728 echo "At long last!"
3731 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3732 $cpp <testcpp.c >testcpp.out 2>&1; \
3733 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3737 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3738 $cpp - <testcpp.c >testcpp.out 2>&1; \
3739 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3740 echo "Hooray, it works! I was beginning to wonder."
3743 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3744 $wrapper <testcpp.c >testcpp.out 2>&1; \
3745 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3751 rp="No dice. I can't find a C preprocessor. Name one:"
3755 $x_cpp <testcpp.c >testcpp.out 2>&1
3756 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3757 echo "OK, that will do." >&4
3759 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3774 echo "Perhaps can we force $cc -E using a wrapper..."
3775 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3776 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3782 echo "Nope, we'll have to live without it..."
3796 "$wrapper"|'cppstdin') ;;
3797 *) $rm -f $wrapper;;
3799 $rm -f testcpp.c testcpp.out
3801 : Set private lib path
3804 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3809 '') dlist="$loclibpth $plibpth $glibpth";;
3810 *) dlist="$libpth";;
3813 : Now check and see which directories actually exist, avoiding duplicates
3817 if $test -d $xxx; then
3820 *) libpth="$libpth $xxx";;
3826 Some systems have incompatible or broken versions of libraries. Among
3827 the directories listed in the question below, please remove any you
3828 know not to be holding relevant libraries, and add any that are needed.
3829 Say "none" for none.
3840 rp="Directories to use for library searches?"
3847 : compute shared library extension
3850 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3860 On some systems, shared libraries may be available. Answer 'none' if
3861 you want to suppress searching of shared libraries for the remaining
3862 of this configuration.
3865 rp='What is the file extension used for shared libraries?'
3869 : Define several unixisms.
3870 : Hints files or command line option can be used to override them.
3871 : The convoluted testing is in case hints files set either the old
3874 '') case "$exe_ext" in
3876 *) _exe="$exe_ext" ;;
3881 '') case "$lib_ext" in
3888 '') case "$obj_ext" in
3895 '') case "$path_sep" in
3906 : Which makefile gets called first. This is used by make depend.
3907 case "$firstmakefile" in
3908 '') firstmakefile='makefile';;
3911 : Looking for optional libraries
3913 echo "Checking for optional libraries..." >&4
3918 case "$libswanted" in
3919 '') libswanted='c_s';;
3921 for thislib in $libswanted; do
3923 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3924 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3925 echo "Found -l$thislib (shared)."
3928 *) dflt="$dflt -l$thislib";;
3930 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3931 echo "Found -l$thislib (shared)."
3934 *) dflt="$dflt -l$thislib";;
3936 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3937 echo "Found -l$thislib."
3940 *) dflt="$dflt -l$thislib";;
3942 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3943 echo "Found -l$thislib."
3946 *) dflt="$dflt -l$thislib";;
3948 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3949 echo "Found -l${thislib}_s."
3952 *) dflt="$dflt -l${thislib}_s";;
3954 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3955 echo "Found -l$thislib."
3958 *) dflt="$dflt -l$thislib";;
3961 echo "No -l$thislib."
3972 ' '|'') dflt='none';;
3977 Some versions of Unix support shared libraries, which make executables smaller
3978 but make load time slightly longer.
3980 On some systems, mostly System V Release 3's, the shared library is included
3981 by putting the option "-lc_s" as the last thing on the cc command line when
3982 linking. Other systems use shared libraries by default. There may be other
3983 libraries needed to compile $package on your machine as well. If your system
3984 needs the "-lc_s" option, include it here. Include any other special libraries
3985 here as well. Say "none" for none.
3989 rp="Any additional libraries?"
3996 : determine optimize, if desired, or use for debug flag also
3998 ' '|$undef) dflt='none';;
4000 *) dflt="$optimize";;
4004 Some C compilers have problems with their optimizers. By default, $package
4005 compiles with the -O flag to use the optimizer. Alternately, you might want
4006 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4007 systems). Either flag can be specified here. To use neither flag, specify
4011 rp="What optimizer/debugger flag should be used?"
4015 'none') optimize=" ";;
4019 : We will not override a previous value, but we might want to
4020 : augment a hint file
4023 case "$gccversion" in
4024 1*) dflt='-fpcc-struct-return' ;;
4027 *-g*) dflt="$dflt -DDEBUGGING";;
4029 case "$gccversion" in
4030 2*) if test -d /etc/conf/kconfig.d &&
4031 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4040 case "$mips_type" in
4041 *BSD*|'') inclwanted="$locincpth $usrinc";;
4042 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4044 for thisincl in $inclwanted; do
4045 if $test -d $thisincl; then
4046 if $test x$thisincl != x$usrinc; then
4049 *) dflt="$dflt -I$thisincl";;
4055 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4057 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4065 *) dflt="$dflt -D$2";;
4070 set signal.h __LANGUAGE_C__; eval $inctest
4072 set signal.h LANGUAGE_C; eval $inctest
4076 none|recommended) dflt="$ccflags $dflt" ;;
4077 *) dflt="$ccflags";;
4085 Your C compiler may want other flags. For this question you should include
4086 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4087 but you should NOT include libraries or ld flags like -lwhatever. If you
4088 want $package to honor its debug switch, you should include -DDEBUGGING here.
4089 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4091 To use no flags, specify the word "none".
4097 rp="Any additional cc flags?"
4104 : the following weeds options from ccflags that are of no interest to cpp
4106 case "$gccversion" in
4107 1*) cppflags="$cppflags -D__GNUC__"
4109 case "$mips_type" in
4111 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4117 echo "Let me guess what the preprocessor flags are..." >&4
4131 *) ftry="$previous $flag";;
4133 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4134 >cpp1.out 2>/dev/null && \
4135 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4136 >cpp2.out 2>/dev/null && \
4137 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4138 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4140 cppflags="$cppflags $ftry"
4150 *-*) echo "They appear to be: $cppflags";;
4152 $rm -f cpp.c cpp?.out
4156 : flags used in final linking phase
4158 '') if ./venix; then
4164 *-posix*) dflt="$dflt -posix" ;;
4167 *) dflt="$ldflags";;
4170 : Try to guess additional flags to pick up local libraries.
4171 for thislibdir in $libpth; do
4172 case " $loclibpth " in
4175 *"-L$thislibdir "*) ;;
4176 *) dflt="$dflt -L$thislibdir" ;;
4188 Your C linker may need flags. For this question you should
4189 include -L/whatever and any other flags used by the C linker, but you
4190 should NOT include libraries like -lwhatever.
4192 Make sure you include the appropriate -L/path flags if your C linker
4193 does not normally search all of the directories you specified above,
4196 To use no flags, specify the word "none".
4200 rp="Any additional ld flags (NOT including libraries)?"
4206 rmlist="$rmlist pdp11"
4210 echo "Checking your choice of C compiler and flags for coherency..." >&4
4211 $cat > try.c <<'EOF'
4213 int main() { printf("Ok\n"); exit(0); }
4215 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4217 $cat >try.msg <<'EOM'
4218 I've tried to compile and run the following simple program:
4221 $cat try.c >> try.msg
4223 $cat >> try.msg <<EOM
4230 and I got the following output:
4234 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4235 if sh -c './try' >>try.msg 2>&1; then
4239 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4242 cat >> try.msg <<'EOQS'
4243 If $libs contains -lsfio, and sfio is mis-configured, then it
4244 sometimes (apparently) runs and exits with a 0 status, but with no
4245 output! It may have to do with sfio's use of _exit vs. exit.
4248 rp="You have a big problem. Shall I abort Configure"
4255 echo "The program compiled OK, but exited with status $?." >>try.msg
4256 rp="You have a problem. Shall I abort Configure"
4260 echo "I can't compile the test program." >>try.msg
4261 rp="You have a BIG problem. Shall I abort Configure"
4267 case "$knowitall" in
4269 echo "(The supplied flags or libraries might be incorrect.)"
4277 *) echo "Ok. Stopping Configure." >&4
4282 n) echo "OK, that should do.";;
4284 $rm -f try try.* core
4286 : determine filename position in cpp output
4288 echo "Computing filename position in cpp output for #include directives..." >&4
4289 echo '#include <stdio.h>' > foo.c
4292 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4293 $grep '^[ ]*#.*stdio\.h' | \
4294 while read cline; do
4297 while $test \$# -gt 0; do
4298 if $test -r \`echo \$1 | $tr -d '"'\`; then
4303 pos=\`expr \$pos + 1\`
4315 *) pos="${fieldn}th";;
4317 echo "Your cpp writes the filename in the $pos field of the line."
4319 : locate header file
4324 if test -f $usrinc/\$wanted; then
4325 echo "$usrinc/\$wanted"
4328 awkprg='{ print \$$fieldn }'
4329 echo "#include <\$wanted>" > foo\$\$.c
4330 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4331 $grep "^[ ]*#.*\$wanted" | \
4332 while read cline; do
4333 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4335 */\$wanted) echo "\$name"; exit 0;;
4346 : define an alternate in-header-list? function
4347 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4348 cont=true; xxf="echo \"<\$1> found.\" >&4";
4349 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4350 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4352 case $# in 4) instead=instead;; *) instead="at last";; esac;
4353 while $test "$cont"; do
4355 var=$2; eval "was=\$$2";
4356 if $test "$xxx" && $test -r "$xxx";
4358 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4361 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4362 set $yyy; shift; shift; yyy=$@;
4363 case $# in 0) cont="";;
4364 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4365 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4366 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4367 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4371 do set $yyy; var=$2; eval "was=\$$2";
4372 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4373 set $yyy; shift; shift; yyy=$@;
4376 : see if this is a malloc.h system
4377 set malloc.h i_malloc
4380 : see if stdlib is available
4381 set stdlib.h i_stdlib
4384 : determine which malloc to compile in
4386 case "$usemymalloc" in
4387 ''|[yY]*|true|$define) dflt='y' ;;
4390 rp="Do you wish to attempt to use the malloc that comes with $package?"
4396 mallocsrc='malloc.c'
4397 mallocobj="malloc$_o"
4398 d_mymalloc="$define"
4401 : Remove malloc from list of libraries to use
4402 echo "Removing unneeded -lmalloc from library list" >&4
4403 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4406 echo "libs = $libs" >&4
4418 : compute the return types of malloc and free
4420 $cat >malloc.c <<END
4424 #include <sys/types.h>
4438 case "$malloctype" in
4440 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4447 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4451 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4458 echo "Your system uses $freetype free(), it would seem." >&4
4460 : Cruising for prototypes
4462 echo "Checking out function prototypes..." >&4
4463 $cat >prototype.c <<'EOCP'
4464 int main(int argc, char *argv[]) {
4467 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4468 echo "Your C compiler appears to support function prototypes."
4471 echo "Your C compiler doesn't seem to understand function prototypes."
4478 case "$prototype" in
4480 *) ansi2knr='ansi2knr'
4485 This version of $package can only be compiled by a compiler that
4486 understands function prototypes. Unfortunately, your C compiler
4488 doesn't seem to understand them. Sorry about that.
4490 If GNU cc is available for your system, perhaps you could try that instead.
4492 Eventually, we hope to support building Perl with pre-ANSI compilers.
4493 If you would like to help in that effort, please contact <perlbug@perl.org>.
4495 Aborting Configure now.
4501 : determine where public executables go
4506 rp='Pathname where the public executables will reside?'
4508 if $test "X$ansexp" != "X$binexp"; then
4516 Since you are running AFS, I need to distinguish the directory in which
4517 executables reside from the directory in which they are installed (and from
4518 which they are presumably copied to the former directory by occult means).
4521 case "$installbin" in
4522 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4523 *) dflt="$installbin";;
4526 rp='Where will public executables be installed?'
4530 installbin="$binexp"
4533 : determine whether to install perl also as /usr/bin/perl
4536 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4538 Many scripts expect to perl to be installed as /usr/bin/perl.
4539 I can install the perl you are about to compile also as /usr/bin/perl
4540 (in addition to $installbin/perl).
4542 case "$installusrbinperl" in
4543 "$undef"|[nN]*) dflt='n';;
4546 rp="Do you want to install perl as /usr/bin/perl?"
4549 [yY]*) val="$define";;
4555 set installusrbinperl
4558 : define a shorthand compile call
4562 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4563 : define a shorthand compile call for compilations that should be ok.
4567 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4570 echo "Checking for GNU C Library..." >&4
4571 cat >gnulibc.c <<EOM
4583 if eval $compile_ok && ./gnulibc; then
4585 echo "You are using the GNU C Library"
4588 echo "You are not using the GNU C Library"
4594 : see if nm is to be used to determine whether a symbol is defined or not
4598 case "$d_gnulibc" in
4601 echo "nm probably won't work on the GNU C Library." >&4
4607 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4609 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4610 echo "'nm' won't be sufficient on this sytem." >&4
4616 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4617 if $test $dflt -gt 20; then
4627 true|$define) dflt=y;;
4634 I can use $nm to extract the symbols from your C libraries. This
4635 is a time consuming task which may generate huge output on the disk (up
4636 to 3 megabytes) but that should make the symbols extraction faster. The
4637 alternative is to skip the 'nm' extraction part and to compile a small
4638 test program instead to determine whether each symbol is present. If
4639 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4640 this may be the best solution.
4642 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4645 rp="Shall I use $nm to extract C symbols from the libraries?"
4648 [Nn]*) usenm=false;;
4657 : nm options which may be necessary
4659 '') if $test -f /mach_boot; then
4661 elif $test -d /usr/ccs/lib; then
4662 nm_opt='-p' # Solaris (and SunOS?)
4663 elif $test -f /dgux; then
4665 elif $test -f /lib64/rld; then
4666 nm_opt='-p' # 64-bit Irix
4672 : nm options which may be necessary for shared libraries but illegal
4673 : for archive libraries. Thank you, Linux.
4674 case "$nm_so_opt" in
4675 '') case "$myuname" in
4677 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4678 nm_so_opt='--dynamic'
4687 : get list of predefined functions in a handy place
4692 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4699 *) for thislib in $libs; do
4702 : Handle C library specially below.
4705 thislib=`echo $thislib | $sed -e 's/^-l//'`
4706 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4708 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4710 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4712 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4714 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4716 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4718 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4723 libnames="$libnames $try"
4725 *) libnames="$libnames $thislib" ;;
4734 for xxx in $libpth; do
4735 $test -r $1 || set $xxx/libc.$so
4736 : The messy sed command sorts on library version numbers.
4738 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4739 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4741 s/[0-9][0-9]*/0000&/g
4742 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4745 sort | $sed -e 's/^.* //'`
4748 $test -r $1 || set /usr/ccs/lib/libc.$so
4749 $test -r $1 || set /lib/libsys_s$_a
4755 if $test -r "$1"; then
4756 echo "Your (shared) C library seems to be in $1."
4758 elif $test -r /lib/libc && $test -r /lib/clib; then
4759 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4761 libc='/lib/clib /lib/libc'
4762 if $test -r /lib/syslib; then
4763 echo "(Your math library is in /lib/syslib.)"
4764 libc="$libc /lib/syslib"
4766 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4767 echo "Your C library seems to be in $libc, as you said before."
4768 elif $test -r $incpath/usr/lib/libc$_a; then
4769 libc=$incpath/usr/lib/libc$_a;
4770 echo "Your C library seems to be in $libc. That's fine."
4771 elif $test -r /lib/libc$_a; then
4773 echo "Your C library seems to be in $libc. You're normal."
4775 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4777 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4778 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4779 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4781 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4783 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4786 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4788 if $test -r "$tans"; then
4789 echo "Your C library seems to be in $tans, of all places."
4795 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4799 If the guess above is wrong (which it might be if you're using a strange
4800 compiler, or your machine supports multiple models), you can override it here.
4805 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4807 I can't seem to find your C library. I've looked in the following places:
4810 $sed 's/^/ /' libpath
4813 None of these seems to contain your C library. I need to get its name...
4818 rp='Where is your C library?'
4823 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4824 set X `cat libnames`
4827 case $# in 1) xxx=file; esac
4828 echo "Extracting names from the following $xxx for later perusal:" >&4
4830 $sed 's/^/ /' libnames >&4
4832 $echo $n "This may take a while...$c" >&4
4836 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4837 *) $nm $nm_opt $file 2>/dev/null;;
4842 $grep fprintf libc.tmp > libc.ptf
4843 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4844 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4846 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4848 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4850 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4852 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4854 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4856 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4858 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4860 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4862 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4864 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4866 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4868 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4870 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4871 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4873 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4875 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4877 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4879 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4881 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4883 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4885 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4887 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4889 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4891 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4893 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4895 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4897 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4899 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4901 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4904 $nm -p $* 2>/dev/null >libc.tmp
4905 $grep fprintf libc.tmp > libc.ptf
4906 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4907 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4913 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4915 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4916 for thisname in $libnames $libc; do
4917 $ar t $thisname >>libc.tmp
4919 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4921 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4922 # Repeat libc to extract forwarders to DLL entries too
4923 for thisname in $libnames $libc; do
4924 $ar tv $thisname >>libc.tmp
4925 # Revision 50 of EMX has bug in $ar.
4926 # it will not extract forwarders to DLL entries
4927 # Use emximp which will extract exactly them.
4928 emximp -o tmp.imp $thisname \
4930 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4931 < tmp.imp >>libc.tmp
4934 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4937 echo "$ar didn't seem to work right." >&4
4938 echo "Maybe this is a Cray...trying bld instead..." >&4
4939 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4941 for thisname in $libnames; do
4943 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4944 $ar t $thisname >>libc.tmp
4948 echo "That didn't work either. Giving up." >&4
4955 if $test -f /lib/syscalls.exp; then
4957 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4958 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4962 $rm -f libnames libpath
4964 : see if dld is available
4968 : is a C symbol defined?
4971 -v) tf=libc.tmp; tc=""; tdc="";;
4972 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4973 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4976 case "$reuseval-$4" in
4978 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4984 if $contains $tlook $tf >/dev/null 2>&1;
4989 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4990 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4998 $define) tval=true;;
5004 : define an is-in-libc? function
5005 inlibc='echo " "; td=$define; tu=$undef;
5006 sym=$1; var=$2; eval "was=\$$2";
5008 case "$reuseval$was" in
5018 echo "$sym() found." >&4;
5019 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5021 echo "$sym() NOT found." >&4;
5022 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5026 $define) echo "$sym() found." >&4;;
5027 *) echo "$sym() NOT found." >&4;;
5031 : see if dlopen exists
5038 : determine which dynamic loading, if any, to compile in
5040 dldir="ext/DynaLoader"
5053 $define) dflt='y' ;;
5056 $define) dflt='y' ;;
5058 : Does a dl_xxx.xs file exist for this operating system
5059 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5062 rp="Do you wish to use dynamic loading?"
5069 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5070 dflt="$dldir/dl_${osname}.xs"
5071 elif $test "$d_dlopen" = "$define" ; then
5072 dflt="$dldir/dl_dlopen.xs"
5073 elif $test "$i_dld" = "$define" ; then
5074 dflt="$dldir/dl_dld.xs"
5079 *) dflt="$dldir/$dlsrc"
5082 echo "The following dynamic loading files are available:"
5083 : Can not go over to $dldir because getfile has path hard-coded in.
5084 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5085 rp="Source file to use for dynamic loading"
5087 # XXX This getfile call will fail the existence check if you try
5088 # building away from $src (this is not supported yet).
5092 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5096 Some systems may require passing special flags to $cc -c to
5097 compile modules that will be used to create a shared library.
5098 To use no flags, say "none".
5101 case "$cccdlflags" in
5102 '') case "$gccversion" in
5103 '') case "$osname" in
5105 next) dflt='none' ;;
5106 irix*) dflt='-KPIC' ;;
5107 svr4*|esix*|solaris) dflt='-KPIC' ;;
5108 sunos) dflt='-pic' ;;
5112 *) case "$osname" in
5113 svr4*|esix*|solaris) dflt='-fPIC' ;;
5118 *) dflt="$cccdlflags" ;;
5120 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5123 none) cccdlflags=' ' ;;
5124 *) cccdlflags="$ans" ;;
5129 Some systems use ld to create libraries that can be dynamically loaded,
5130 while other systems (such as those using ELF) use $cc.
5134 '') $cat >try.c <<'EOM'
5135 /* Test for whether ELF binaries are produced */
5140 int i = open("a.out",O_RDONLY);
5143 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5144 exit(0); /* succeed (yes, it's ELF) */
5149 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5151 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5155 echo "I'll use ld to build dynamic libraries."
5164 rp="What command should be used to create dynamic libraries?"
5170 Some systems may require passing special flags to $ld to create a
5171 library that can be dynamically loaded. If your ld flags include
5172 -L/other/path options to locate libraries outside your loader's normal
5173 search path, you may need to specify those -L options here as well. To
5174 use no flags, say "none".
5177 case "$lddlflags" in
5178 '') case "$osname" in
5179 beos) dflt='-nostart' ;;
5181 linux|irix*) dflt='-shared' ;;
5182 next) dflt='none' ;;
5183 solaris) dflt='-G' ;;
5184 sunos) dflt='-assert nodefinitions' ;;
5185 svr4*|esix*) dflt="-G $ldflags" ;;
5189 *) dflt="$lddlflags" ;;
5192 : Try to guess additional flags to pick up local libraries.
5193 : Be careful not to append to a plain 'none'
5197 for thisflag in $ldflags; do
5202 *) dflt="$dflt $thisflag" ;;
5209 ''|' ') dflt='none' ;;
5212 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5215 none) lddlflags=' ' ;;
5216 *) lddlflags="$ans" ;;
5221 Some systems may require passing special flags to $cc to indicate that
5222 the resulting executable will use dynamic linking. To use no flags,
5226 case "$ccdlflags" in
5227 '') case "$osname" in
5228 hpux) dflt='-Wl,-E' ;;
5229 linux) dflt='-rdynamic' ;;
5230 next) dflt='none' ;;
5231 sunos) dflt='none' ;;
5235 *) dflt="$ccdlflags" ;;
5237 rp="Any special flags to pass to $cc to use dynamic loading?"
5240 none) ccdlflags=' ' ;;
5241 *) ccdlflags="$ans" ;;
5255 # No dynamic loading being used, so don't bother even to prompt.
5258 *) case "$useshrplib" in
5259 '') case "$osname" in
5260 svr4*|dgux|dynixptx|esix|powerux|beos)
5262 also='Building a shared libperl is required for dynamic loading to work on your system.'
5267 also='Building a shared libperl is needed for MAB support.'
5285 The perl executable is normally obtained by linking perlmain.c with
5286 libperl${_a}, any static extensions (usually just DynaLoader), and
5287 any other libraries needed on this system (such as -lm, etc.). Since
5288 your system supports dynamic loading, it is probably possible to build
5289 a shared libperl.$so. If you will have more than one executable linked
5290 to libperl.$so, this will significantly reduce the size of each
5291 executable, but it may have a noticeable affect on performance. The
5292 default is probably sensible for your system.
5296 rp="Build a shared libperl.$so (y/n)"
5301 # Why does next4 have to be so different?
5302 case "${osname}${osvers}" in
5303 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5304 os2*) xxx='' ;; # Nothing special needed.
5306 *) xxx='LD_LIBRARY_PATH' ;;
5308 if test X"$xxx" != "X"; then
5309 $cat <<EOM | $tee -a ../config.msg >&4
5311 To build perl, you must add the current working directory to your
5312 $xxx environment variable before running make. You can do
5314 $xxx=\`pwd\`:\$$xxx; export $xxx
5315 for Bourne-style shells, or
5317 for Csh-style shells. You *MUST* do this before running make.
5322 *) useshrplib='false' ;;
5327 case "$useshrplib" in
5331 # Figure out a good name for libperl.so. Since it gets stored in
5332 # a version-specific architecture-dependent library, the version
5333 # number isn't really that important, except for making cc/ld happy.
5335 # A name such as libperl.so.3.1
5336 majmin="libperl.$so.$patchlevel.$subversion"
5337 # A name such as libperl.so.301
5338 majonly=`echo $patchlevel $subversion |
5339 $awk '{printf "%d%02d", $1, $2}'`
5340 majonly=libperl.$so.$majonly
5341 # I'd prefer to keep the os-specific stuff here to a minimum, and
5342 # rely on figuring it out from the naming of libc.
5343 case "${osname}${osvers}" in
5346 # XXX How handle the --version stuff for MAB?
5348 linux*) # ld won't link with a bare -lperl otherwise.
5351 *) # Try to guess based on whether libc has major.minor.
5353 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5354 *libc.$so.[0-9]*) dflt=$majonly ;;
5355 *) dflt=libperl.$so ;;
5365 I need to select a good name for the shared libperl. If your system uses
5366 library names with major and minor numbers, then you might want something
5367 like $majmin. Alternatively, if your system uses a single version
5368 number for shared libraries, then you might want to use $majonly.
5369 Or, your system might be quite happy with a simple libperl.$so.
5371 Since the shared libperl will get installed into a version-specific
5372 architecture-dependent directory, the version number of the shared perl
5373 library probably isn't important, so the default should be o.k.
5376 rp='What name do you want to give to the shared libperl?'
5379 echo "Ok, I'll use $libperl"
5382 libperl="libperl${_a}"
5386 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5390 WARNING: Use of the shrpdir variable for the installation location of
5391 the shared $libperl is not supported. It was never documented and
5392 will not work in this version. Let me (perlbug@perl.com)
5393 know of any problems this may cause.
5399 But your current setting of $shrpdir is
5400 the default anyway, so it's harmless.
5405 Further, your current attempted setting of $shrpdir
5406 conflicts with the value of $archlibexp/CORE
5407 that installperl will use.
5414 # How will the perl executable find the installed shared $libperl?
5415 # Add $xxx to ccdlflags.
5416 # If we can't figure out a command-line option, use $shrpenv to
5417 # set env LD_RUN_PATH. The main perl makefile uses this.
5418 shrpdir=$archlibexp/CORE
5421 if "$useshrplib"; then
5424 # We'll set it in Makefile.SH...
5430 xxx="-Wl,-R$shrpdir"
5432 linux|irix*|dec_osf)
5433 xxx="-Wl,-rpath,$shrpdir"
5436 # next doesn't like the default...
5439 # beos doesn't like the default, either.
5442 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5448 # Only add $xxx if it isn't already in ccdlflags.
5449 case " $ccdlflags " in
5451 *) ccdlflags="$ccdlflags $xxx"
5454 Adding $xxx to the flags
5455 passed to $ld so that the perl executable will find the
5456 installed shared $libperl.
5464 # Respect a hint or command-line value.
5466 '') shrpenv="$tmp_shrpenv" ;;
5469 : determine where manual pages go
5470 set man1dir man1dir none
5474 $spackage has manual pages available in source form.
5478 echo "However, you don't have nroff, so they're probably useless to you."
5480 '') man1dir="none";;
5483 echo "If you don't want the manual sources installed, answer 'none'."
5488 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5489 lookpath="$lookpath $prefixexp/man/p_man/man1"
5490 lookpath="$lookpath $prefixexp/man/u_man/man1"
5491 lookpath="$lookpath $prefixexp/man/man.1"
5493 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5494 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5504 rp="Where do the main $spackage manual pages (source) go?"
5506 if $test "X$man1direxp" != "X$ansexp"; then
5510 man1direxp="$ansexp"
5518 Since you are running AFS, I need to distinguish the directory in which
5519 manual pages reside from the directory in which they are installed (and from
5520 which they are presumably copied to the former directory by occult means).
5523 case "$installman1dir" in
5524 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5525 *) dflt="$installman1dir";;
5528 rp='Where will man pages be installed?'
5530 installman1dir="$ans"
5532 installman1dir="$man1direxp"
5535 : What suffix to use on installed man pages
5542 rp="What suffix should be used for the main $spackage man pages?"
5544 '') case "$man1dir" in
5558 *) dflt="$man1ext";;
5565 : see if we can have long filenames
5567 rmlist="$rmlist /tmp/cf$$"
5568 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5569 first=123456789abcdef
5570 second=/tmp/cf$$/$first
5571 $rm -f $first $second
5572 if (echo hi >$first) 2>/dev/null; then
5573 if $test -f 123456789abcde; then
5574 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5577 if (echo hi >$second) 2>/dev/null; then
5578 if $test -f /tmp/cf$$/123456789abcde; then
5580 That's peculiar... You can have filenames longer than 14 characters, but only
5581 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5582 I shall consider your system cannot support long filenames at all.
5586 echo 'You can have filenames longer than 14 characters.' >&4
5591 How confusing! Some of your filesystems are sane enough to allow filenames
5592 longer than 14 characters but some others like /tmp can't even think about them.
5593 So, for now on, I shall assume your kernel does not allow them at all.
5600 You can't have filenames longer than 14 chars. You can't even think about them!
5606 $rm -rf /tmp/cf$$ 123456789abcde*
5608 : determine where library module manual pages go
5609 set man3dir man3dir none
5613 $spackage has manual pages for many of the library modules.
5619 However, you don't have nroff, so they're probably useless to you.
5622 '') man3dir="none";;
5626 case "$d_flexfnam" in
5629 However, your system can't handle the long file names like File::Basename.3.
5632 '') man3dir="none";;
5636 echo "If you don't want the manual sources installed, answer 'none'."
5637 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5639 '') case "$prefix" in
5640 *$prog*) dflt=`echo $man1dir |
5641 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5642 *) dflt="$privlib/man/man3" ;;
5646 *) dflt="$man3dir" ;;
5651 rp="Where do the $package library man pages (source) go?"
5653 if test "X$man3direxp" != "X$ansexp"; then
5658 man3direxp="$ansexp"
5666 Since you are running AFS, I need to distinguish the directory in which
5667 manual pages reside from the directory in which they are installed (and from
5668 which they are presumably copied to the former directory by occult means).
5671 case "$installman3dir" in
5672 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5673 *) dflt="$installman3dir";;
5676 rp='Where will man pages be installed?'
5678 installman3dir="$ans"
5680 installman3dir="$man3direxp"
5683 : What suffix to use on installed man pages
5690 rp="What suffix should be used for the $package library man pages?"
5692 '') case "$man3dir" in
5706 *) dflt="$man3ext";;
5713 : see if we have to deal with yellow pages, now NIS.
5714 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5715 if $test -f /usr/etc/nibindd; then
5717 echo "I'm fairly confident you're on a NeXT."
5719 rp='Do you get the hosts file via NetInfo?'
5728 y*) hostcat='nidump hosts .';;
5729 *) case "$hostcat" in
5730 nidump*) hostcat='';;
5740 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5748 rp='Are you getting the hosts file via yellow pages?'
5751 y*) hostcat='ypcat hosts';;
5752 *) hostcat='cat /etc/hosts';;
5758 '') hostcat='cat /etc/hosts';;
5761 '') groupcat='cat /etc/group';;
5764 '') passcat='cat /etc/passwd';;
5767 : now get the host name
5769 echo "Figuring out host name..." >&4
5770 case "$myhostname" in
5772 echo 'Maybe "hostname" will work...'
5773 if tans=`sh -c hostname 2>&1` ; then
5781 if $test "$cont"; then
5783 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5784 if tans=`cat /etc/systemid 2>&1` ; then
5786 phostname='cat /etc/systemid'
5787 echo "Whadyaknow. Xenix always was a bit strange..."
5790 elif $test -r /etc/systemid; then
5791 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5794 if $test "$cont"; then
5795 echo 'No, maybe "uuname -l" will work...'
5796 if tans=`sh -c 'uuname -l' 2>&1` ; then
5798 phostname='uuname -l'
5800 echo 'Strange. Maybe "uname -n" will work...'
5801 if tans=`sh -c 'uname -n' 2>&1` ; then
5803 phostname='uname -n'
5805 echo 'Oh well, maybe I can mine it out of whoami.h...'
5806 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5807 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5808 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5810 case "$myhostname" in
5811 '') echo "Does this machine have an identity crisis or something?"
5814 echo "Well, you said $myhostname before..."
5815 phostname='echo $myhostname';;
5821 : you do not want to know about this
5826 if $test "$myhostname" ; then
5828 rp='Your host name appears to be "'$myhostname'".'" Right?"
5836 : bad guess or no guess
5837 while $test "X$myhostname" = X ; do
5839 rp="Please type the (one word) name of your host:"
5844 : translate upper to lower if necessary
5845 case "$myhostname" in
5847 echo "(Normalizing case in your host name)"
5848 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5852 case "$myhostname" in
5854 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5855 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5856 echo "(Trimming domain name from host name--host name is now $myhostname)"
5858 *) case "$mydomain" in
5861 test "X$hostcat" = "Xypcat hosts" &&
5862 ypmatch "$myhostname" hosts 2>/dev/null |\
5863 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5866 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5867 /[ ]$myhostname[ . ]/p" > hosts
5870 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5871 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5872 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5873 hosts | $sort | $uniq | \
5874 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5875 case `$echo X$dflt` in
5876 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5879 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5884 tans=`./loc resolv.conf X /etc /usr/etc`
5885 if $test -f "$tans"; then
5886 echo "(Attempting domain name extraction from $tans)"
5887 dflt=.`$sed -n -e 's/ / /g' \
5888 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5889 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5891 .) dflt=.`$sed -n -e 's/ / /g' \
5892 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5893 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5900 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5901 dflt=.`sh -c domainname 2>/dev/null`
5904 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5909 .) echo "(Lost all hope -- silly guess then)"
5915 *) dflt="$mydomain";;
5919 rp="What is your domain name?"
5929 : translate upper to lower if necessary
5932 echo "(Normalizing case in your domain name)"
5933 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5937 : a little sanity check here
5938 case "$phostname" in
5941 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5942 $myhostname$mydomain|$myhostname) ;;
5944 case "$phostname" in
5946 echo "(That doesn't agree with your whoami.h file, by the way.)"
5949 echo "(That doesn't agree with your $phostname command, by the way.)"
5959 I need to get your e-mail address in Internet format if possible, i.e.
5960 something like user@host.domain. Please answer accurately since I have
5961 no easy means to double check it. The default value provided below
5962 is most probably close to the reality but may not be valid from outside
5963 your organization...
5967 while test "$cont"; do
5969 '') dflt="$cf_by@$myhostname$mydomain";;
5970 *) dflt="$cf_email";;
5972 rp='What is your e-mail address?'
5978 rp='Address does not look like an Internet one. Use it anyway?'
5994 If you or somebody else will be maintaining perl at your site, please
5995 fill in the correct e-mail address here so that they may be contacted
5996 if necessary. Currently, the "perlbug" program included with perl
5997 will send mail to this address in addition to perlbug@perl.com. You may
5998 enter "none" for no administrator.
6001 case "$perladmin" in
6002 '') dflt="$cf_email";;
6003 *) dflt="$perladmin";;
6005 rp='Perl administrator e-mail address'
6009 : figure out how to guarantee perl startup
6010 case "$startperl" in
6012 case "$sharpbang" in
6016 I can use the #! construct to start perl on your system. This will
6017 make startup of perl scripts faster, but may cause problems if you
6018 want to share those scripts and perl is not in a standard place
6019 ($binexp/perl) on all your platforms. The alternative is to force
6020 a shell by starting the script with a single ':' character.
6024 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6027 none) startperl=": # use perl";;
6028 *) startperl="#!$ans"
6029 if $test 30 -lt `echo "$ans" | wc -c`; then
6032 WARNING: Some systems limit the #! command to 32 characters.
6033 If you experience difficulty running Perl scripts with #!, try
6034 installing Perl in a directory with a shorter pathname.
6040 *) startperl=": # use perl"
6045 echo "I'll use $startperl to start perl scripts."
6047 : figure best path for perl in scripts
6050 perlpath="$binexp/perl"
6051 case "$startperl" in
6056 I will use the "eval 'exec'" idiom to start Perl on your system.
6057 I can use the full path of your Perl binary for this purpose, but
6058 doing so may cause problems if you want to share those scripts and
6059 Perl is not always in a standard place ($binexp/perl).
6063 rp="What path shall I use in \"eval 'exec'\"?"
6070 case "$startperl" in
6072 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6075 : determine where public executable scripts go
6076 set scriptdir scriptdir
6078 case "$scriptdir" in
6081 : guess some guesses
6082 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6083 $test -d /usr/share/bin && dflt=/usr/share/bin
6084 $test -d /usr/local/script && dflt=/usr/local/script
6085 $test -d $prefixexp/script && dflt=$prefixexp/script
6089 *) dflt="$scriptdir"
6094 Some installations have a separate directory just for executable scripts so
6095 that they can mount it across multiple architectures but keep the scripts in
6096 one spot. You might, for example, have a subdirectory of /usr/share for this.
6097 Or you might just lump your scripts in with all your other executables.
6101 rp='Where do you keep publicly executable scripts?'
6103 if $test "X$ansexp" != "X$scriptdirexp"; then
6107 scriptdirexp="$ansexp"
6111 Since you are running AFS, I need to distinguish the directory in which
6112 scripts reside from the directory in which they are installed (and from
6113 which they are presumably copied to the former directory by occult means).
6116 case "$installscript" in
6117 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6118 *) dflt="$installscript";;
6121 rp='Where will public scripts be installed?'
6123 installscript="$ans"
6125 installscript="$scriptdirexp"
6128 : determine where site specific libraries go.
6129 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
6130 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6132 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
6133 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
6138 The installation process will also create a directory for
6139 site-specific extensions and modules. Some users find it convenient
6140 to place all local files in this directory rather than in the main
6141 distribution directory.
6145 rp='Pathname for the site-specific library files?'
6147 if $test "X$sitelibexp" != "X$ansexp"; then
6151 sitelibexp="$ansexp"
6155 Since you are running AFS, I need to distinguish the directory in
6156 which site-specific files reside from the directory in which they are
6157 installed (and from which they are presumably copied to the former
6158 directory by occult means).
6161 case "$installsitelib" in
6162 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6163 *) dflt="$installsitelib";;
6166 rp='Where will site-specific files be installed?'
6168 installsitelib="$ans"
6170 installsitelib="$sitelibexp"
6173 : determine where site specific architecture-dependent libraries go.
6174 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6175 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6176 : sitelib may have an optional trailing /share.
6177 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6178 tdflt="$tdflt/$archname"
6179 set sitearch sitearch none
6182 '') dflt="$tdflt" ;;
6183 *) dflt="$sitearch" ;;
6187 The installation process will also create a directory for
6188 architecture-dependent site-specific extensions and modules.
6192 rp='Pathname for the site-specific architecture-dependent library files?'
6194 if $test "X$sitearchexp" != "X$ansexp"; then
6198 sitearchexp="$ansexp"
6202 Since you are running AFS, I need to distinguish the directory in
6203 which site-specific architecture-dependent library files reside from
6204 the directory in which they are installed (and from which they are
6205 presumably copied to the former directory by occult means).
6208 case "$installsitearch" in
6209 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6210 *) dflt="$installsitearch";;
6213 rp='Where will site-specific architecture-dependent files be installed?'
6215 installsitearch="$ans"
6217 installsitearch="$sitearchexp"
6222 Previous version of $package used the standard IO mechanisms as defined
6223 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6224 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6225 the default. This abstraction layer can use AT&T's sfio (if you already
6226 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6227 problems with some extension modules. Using PerlIO with stdio is safe,
6228 but it is slower than plain stdio and therefore is not the default.
6230 If this doesn't make any sense to you, just accept the default 'n'.
6232 case "$useperlio" in
6233 $define|true|[yY]*) dflt='y';;
6236 rp='Use the experimental PerlIO abstraction layer?'
6243 echo "Ok, doing things the stdio way"
6250 : Check how to convert floats to strings.
6251 if test "X$d_Gconvert" = X; then
6253 echo "Checking for an efficient way to convert floats to strings."
6256 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6257 char *myname = "gconvert";
6260 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6261 char *myname = "gcvt";
6264 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6265 char *myname = "sprintf";
6271 checkit(expect, got)
6275 if (strcmp(expect, got)) {
6276 printf("%s oddity: Expected %s, got %s\n",
6277 myname, expect, got);
6287 /* This must be 1st test on (which?) platform */
6288 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6289 Gconvert(0.1, 8, 0, buf);
6290 checkit("0.1", buf);
6292 Gconvert(1.0, 8, 0, buf);
6295 Gconvert(0.0, 8, 0, buf);
6298 Gconvert(-1.0, 8, 0, buf);
6301 /* Some Linux gcvt's give 1.e+5 here. */
6302 Gconvert(100000.0, 8, 0, buf);
6303 checkit("100000", buf);
6305 /* Some Linux gcvt's give -1.e+5 here. */
6306 Gconvert(-100000.0, 8, 0, buf);
6307 checkit("-100000", buf);
6312 case "$d_Gconvert" in
6313 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6314 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6315 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6316 *) xxx_list='gconvert gcvt sprintf' ;;
6319 for xxx_convert in $xxx_list; do
6320 echo "Trying $xxx_convert"
6322 set try -DTRY_$xxx_convert
6323 if eval $compile; then
6324 echo "$xxx_convert" found. >&4
6326 echo "I'll use $xxx_convert to convert floats into a string." >&4
6329 echo "...But $xxx_convert didn't work as I expected."
6332 echo "$xxx_convert NOT found." >&4
6336 case "$xxx_convert" in
6337 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6338 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6339 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6343 : Initialize h_fcntl
6346 : Initialize h_sysfile
6349 : access call always available on UNIX
6353 : locate the flags for 'access()'
6357 $cat >access.c <<'EOCP'
6358 #include <sys/types.h>
6363 #include <sys/file.h>
6372 : check sys/file.h first, no particular reason here
6373 if $test `./findhdr sys/file.h` && \
6374 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6376 echo "<sys/file.h> defines the *_OK access constants." >&4
6377 elif $test `./findhdr fcntl.h` && \
6378 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6380 echo "<fcntl.h> defines the *_OK access constants." >&4
6381 elif $test `./findhdr unistd.h` && \
6382 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6383 echo "<unistd.h> defines the *_OK access constants." >&4
6385 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6391 : see if accessx exists
6392 set accessx d_accessx
6395 : see if alarm exists
6399 : Look for GNU-cc style attribute checking
6401 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6402 $cat >attrib.c <<'EOCP'
6404 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6406 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6407 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6408 echo "Your C compiler doesn't fully support __attribute__."
6411 echo "Your C compiler supports __attribute__."
6415 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6422 : see if bcmp exists
6426 : see if bcopy exists
6430 : see if this is a unistd.h system
6431 set unistd.h i_unistd
6434 : see if getpgrp exists
6435 set getpgrp d_getpgrp
6438 case "$d_getpgrp" in
6441 echo "Checking to see which flavor of getpgrp is in use..."
6444 #include <sys/types.h>
6446 # include <unistd.h>
6450 if (getuid() == 0) {
6451 printf("(I see you are running Configure as super-user...)\n");
6455 if (getpgrp(1) == 0)
6464 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6465 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6467 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6468 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6471 echo "I can't seem to compile and run the test program."
6473 xxx="a USG one, i.e. you use getpgrp()."
6475 # SVR4 systems can appear rather BSD-ish.
6478 xxx="a BSD one, i.e. you use getpgrp(pid)."
6482 xxx="probably a USG one, i.e. you use getpgrp()."
6487 echo "Assuming your getpgrp is $xxx" >&4
6496 : see if setpgrp exists
6497 set setpgrp d_setpgrp
6500 case "$d_setpgrp" in
6503 echo "Checking to see which flavor of setpgrp is in use..."
6506 #include <sys/types.h>
6508 # include <unistd.h>
6512 if (getuid() == 0) {
6513 printf("(I see you are running Configure as super-user...)\n");
6517 if (-1 == setpgrp(1, 1))
6520 if (setpgrp() != -1)
6526 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6527 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6529 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6530 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6533 echo "(I can't seem to compile and run the test program.)"
6535 xxx="a USG one, i.e. you use setpgrp()."
6537 # SVR4 systems can appear rather BSD-ish.
6540 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6544 xxx="probably a USG one, i.e. you use setpgrp()."
6549 echo "Assuming your setpgrp is $xxx" >&4
6557 : see if bzero exists
6561 : check for lengths of integral types
6565 echo "Checking to see how big your integers are..." >&4
6566 $cat >intsize.c <<'EOCP'
6570 printf("intsize=%d;\n", sizeof(int));
6571 printf("longsize=%d;\n", sizeof(long));
6572 printf("shortsize=%d;\n", sizeof(short));
6577 if eval $compile_ok && ./intsize > /dev/null; then
6579 echo "Your integers are $intsize bytes long."
6580 echo "Your long integers are $longsize bytes long."
6581 echo "Your short integers are $shortsize bytes long."
6585 Help! I can't compile and run the intsize test program: please enlighten me!
6586 (This is probably a misconfiguration in your system or libraries, and
6587 you really ought to fix it. Still, I'll try anyway.)
6591 rp="What is the size of an integer (in bytes)?"
6595 rp="What is the size of a long integer (in bytes)?"
6599 rp="What is the size of a short integer (in bytes)?"
6605 $rm -f intsize intsize.*
6607 : see if signal is declared as pointer to function returning int or void
6609 xxx=`./findhdr signal.h`
6610 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6611 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6612 echo "You have int (*signal())() instead of void." >&4
6614 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6615 echo "You have void (*signal())()." >&4
6617 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6618 echo "You have int (*signal())() instead of void." >&4
6620 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6621 echo "You have void (*signal())()." >&4
6624 case "$d_voidsig" in
6626 echo "I can't determine whether signal handler returns void or int..." >&4
6628 rp="What type does your signal handler return?"
6635 echo "As you already told me, signal handler returns void." >&4
6638 *) echo "As you already told me, signal handler returns int." >&4
6645 case "$d_voidsig" in
6646 "$define") signal_t="void";;
6651 : check for ability to cast large floats to 32-bit ints.
6653 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6654 if $test "$intsize" -ge 4; then
6661 #include <sys/types.h>
6663 $signal_t blech(s) int s; { exit(3); }
6670 signal(SIGFPE, blech);
6672 /* Don't let compiler optimize the test away. Store the number
6673 in a writable string for gcc to pass to sscanf under HP/UX.
6675 sprintf(str, "2147483647");
6676 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6680 /* x86 processors will probably give 0x8000 0000, which is a
6681 sign change. We don't want that. We want to mimic SPARC
6682 behavior here, which is to preserve the sign and give
6685 if (i32 != ($xxx) f)
6691 if eval $compile_ok; then
6695 echo "(I can't seem to compile the test program--assuming it can't)"
6703 echo "Nope, it can't."
6710 : check for ability to cast negative floats to unsigned
6712 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6715 #include <sys/types.h>
6717 $signal_t blech(s) int s; { exit(7); }
6718 $signal_t blech_in_list(s) int s; { exit(4); }
6719 unsigned long dummy_long(p) unsigned long p; { return p; }
6720 unsigned int dummy_int(p) unsigned int p; { return p; }
6721 unsigned short dummy_short(p) unsigned short p; { return p; }
6725 unsigned long along;
6727 unsigned short ashort;
6731 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6732 a direct f = -123. assignment. gcc-2.8.0 reportedly
6733 optimized the whole file away
6735 /* Store the number in a writable string for gcc to pass to
6738 sprintf(str, "-123");
6739 sscanf(str, "%lf", &f); /* f = -123.; */
6741 signal(SIGFPE, blech);
6742 along = (unsigned long)f;
6743 aint = (unsigned int)f;
6744 ashort = (unsigned short)f;
6745 if (along != (unsigned long)-123)
6747 if (aint != (unsigned int)-123)
6749 if (ashort != (unsigned short)-123)
6751 sprintf(str, "1073741824.");
6752 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6755 along = (unsigned long)f;
6756 if (along != 0x80000000)
6760 along = (unsigned long)f;
6761 if (along != 0x7fffffff)
6765 along = (unsigned long)f;
6766 if (along != 0x80000001)
6770 signal(SIGFPE, blech_in_list);
6771 sprintf(str, "123.");
6772 sscanf(str, "%lf", &f); /* f = 123.; */
6773 along = dummy_long((unsigned long)f);
6774 aint = dummy_int((unsigned int)f);
6775 ashort = dummy_short((unsigned short)f);
6776 if (along != (unsigned long)123)
6778 if (aint != (unsigned int)123)
6780 if (ashort != (unsigned short)123)
6787 if eval $compile_ok; then
6791 echo "(I can't seem to compile the test program--assuming it can't)"
6794 case "$castflags" in
6799 echo "Nope, it can't."
6806 : see if vprintf exists
6808 if set vprintf val -f d_vprintf; eval $csym; $val; then
6809 echo 'vprintf() found.' >&4
6811 $cat >vprintf.c <<'EOF'
6812 #include <varargs.h>
6814 int main() { xxx("foo"); }
6823 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6827 if eval $compile && ./vprintf; then
6828 echo "Your vsprintf() returns (int)." >&4
6831 echo "Your vsprintf() returns (char*)." >&4
6835 echo 'vprintf() NOT found.' >&4
6845 : see if chown exists
6849 : see if chroot exists
6853 : see if chsize exists
6857 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6858 while $test $# -ge 2; do
6860 $define) echo "#include <$2>";;
6864 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6865 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6874 : see if this is a sys/uio.h system
6875 set sys/uio.h i_sysuio
6878 echo "Checking to see if your system supports struct iovec..." >&4
6879 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
6881 case "$d_iovec_s" in
6882 "$define") echo "Yup, it does." >&4
6884 *) echo "Nope, it doesn't." >&4
6890 : see whether socket exists
6892 $echo $n "Hmm... $c" >&4
6893 if set socket val -f d_socket; eval $csym; $val; then
6894 echo "Looks like you have Berkeley networking support." >&4
6896 if set setsockopt val -f; eval $csym; $val; then
6899 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
6903 if $contains socklib libc.list >/dev/null 2>&1; then
6904 echo "Looks like you have Berkeley networking support." >&4
6906 : we will have to assume that it supports the 4.2 BSD interface
6909 echo "You don't have Berkeley networking in libc$_a..." >&4
6910 if test "X$d_socket" = "X$define"; then
6911 echo "...but you seem to believe that you have sockets." >&4
6913 for net in net socket
6915 if test -f /usr/lib/lib$net$_a; then
6916 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
6917 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
6918 if $contains socket libc.list >/dev/null 2>&1; then
6923 echo "...but the Wollongong group seems to have hacked it in." >&4
6924 sockethdr="-I/usr/netinclude"
6927 echo "Found Berkeley sockets interface in lib$net." >& 4
6928 if $contains setsockopt libc.list >/dev/null 2>&1; then
6931 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
6938 if test "X$d_socket" != "X$define"; then
6939 echo "or anywhere else I see." >&4
6947 : see if socketpair exists
6948 set socketpair d_sockpair
6953 echo "Checking the availability of certain socket constants..." >& 4
6954 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
6955 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
6957 #include <sys/types.h>
6958 #include <sys/socket.h>
6964 set try; if eval $compile; then
6967 set d_${enum}; eval $setvar
6971 set sendmsg d_sendmsg
6974 set recvmsg d_recvmsg
6978 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
6979 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
6981 case "$d_msghdr_s" in
6982 "$define") echo "Yup, it does." >&4
6984 *) echo "Nope, it doesn't." >&4
6988 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
6989 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
6991 case "$d_cmsghdr_s" in
6992 "$define") echo "Yup, it does." >&4
6994 *) echo "Nope, it doesn't." >&4
6998 : check for const keyword
7000 echo 'Checking to see if your C compiler knows about "const"...' >&4
7001 $cat >const.c <<'EOCP'
7002 typedef struct spug { int drokk; } spug;
7009 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7011 echo "Yup, it does."
7014 echo "Nope, it doesn't."
7019 : see if crypt exists
7021 if set crypt val -f d_crypt; eval $csym; $val; then
7022 echo 'crypt() found.' >&4
7026 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7027 if $test -z "$cryptlib"; then
7028 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7032 if $test -z "$cryptlib"; then
7033 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7037 if $test -z "$cryptlib"; then
7038 cryptlib=`./loc libcrypt$_a "" $libpth`
7042 if $test -z "$cryptlib"; then
7043 echo 'crypt() NOT found.' >&4
7052 : get csh whereabouts
7054 'csh') val="$undef" ;;
7059 : Respect a hint or command line value for full_csh.
7061 '') full_csh=$csh ;;
7064 : see if cuserid exists
7065 set cuserid d_cuserid
7068 : see if this is a limits.h system
7069 set limits.h i_limits
7072 : see if this is a float.h system
7076 : See if number of significant digits in a double precision number is known
7078 $cat >dbl_dig.c <<EOM
7088 printf("Contains DBL_DIG");
7091 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7092 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7093 echo "DBL_DIG found." >&4
7096 echo "DBL_DIG NOT found." >&4
7104 if $test X"$use64bits" = X"$define"; then
7105 : see if dbminit64 exists
7106 set dbminit64 d_dbminit64
7109 : see if dbmclose64 exists
7110 set dbmclose64 d_dbmclose64
7113 : see if fetch64 exists
7114 set fetch64 d_fetch64
7117 : see if store64 exists
7118 set store64 d_store64
7121 : see if delete64 exists
7122 set delete64 d_delete64
7125 : see if firstkey64 exists
7126 set firstkey64 d_firstkey64
7129 : see if nextkey64 exists
7130 set nextkey64 d_nextkey64
7134 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7141 : see if difftime exists
7142 set difftime d_difftime
7145 : see if sys/stat.h is available
7146 set sys/stat.h i_sysstat
7149 : see if this is a dirent system
7151 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7153 echo "<dirent.h> found." >&4
7156 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7157 echo "<sys/dir.h> found." >&4
7160 xinc=`./findhdr sys/ndir.h`
7162 echo "<dirent.h> NOT found." >&4
7167 : Look for type of directory structure.
7169 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7171 case "$direntrytype" in
7174 $define) guess1='struct dirent' ;;
7175 *) guess1='struct direct' ;;
7178 *) guess1="$direntrytype"
7183 'struct dirent') guess2='struct direct' ;;
7184 *) guess2='struct dirent' ;;
7187 if $contains "$guess1" try.c >/dev/null 2>&1; then
7188 direntrytype="$guess1"
7189 echo "Your directory entries are $direntrytype." >&4
7190 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7191 direntrytype="$guess2"
7192 echo "Your directory entries seem to be $direntrytype." >&4
7194 echo "I don't recognize your system's directory entries." >&4
7195 rp="What type is used for directory entries on this system?"
7203 : see if the directory entry stores field length
7205 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7206 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7207 echo "Good, your directory entry keeps length information in d_namlen." >&4
7210 echo "Your directory entry does not know about the d_namlen field." >&4
7218 if $test X"$use64bits" = X"$define"; then
7219 : see if fstat64 exists
7220 set fstat64 d_fstat64
7223 : see if ftruncate64 exists
7224 set ftruncate64 d_ftruncate64
7227 : see if lockf64 exists
7228 set lockf64 d_lockf64
7231 : see if lseek64 exists
7232 set lseek64 d_lseek64
7235 : see if lstat64 exists
7236 set lstat64 d_lstat64
7239 : see if open64 exists
7243 : see if opendir64 exists
7244 set opendir64 d_opendir64
7247 : see if readdir64 exists
7248 set readdir64 d_readdir64
7251 : see if seekdir64 exists
7252 set seekdir64 d_seekdir64
7255 : see if stat64 exists
7259 : see if telldir64 exists
7260 set telldir64 d_telldir64
7263 : see if truncate64 exists
7264 set truncate64 d_truncate64
7269 echo $n "Checking to see if your system supports off64_t...$c" >&4
7271 #include <sys/types.h>
7272 off64_t foo() { off64_t x; x = 7; return x; }'
7274 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7276 echo " Yup, it does." >&4
7279 echo " Nope, it doesn't." >&4
7287 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7289 case "$i_sysstat" in
7292 #include <sys/types.h>
7293 #include <sys/stat.h>
7294 ino64_t foo() { ino64_t x; x = 7; return x; }'
7296 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7302 if $test "X$val" = X"$define"; then
7303 echo " Yup, it does." >&4
7305 echo " Nope, it doesn't." >&4
7310 : check for struct flock64
7312 echo "Checking to see if your system supports struct flock64..." >&4
7314 set d_flock64_s flock64 l_len define fcntl.h
7321 case "$d_flock64_s" in
7322 "$define") echo "Yup, it does." >&4
7324 *) echo "Nope, it doesn't." >&4
7328 : check for struct dirent64
7330 echo "Checking to see if your system supports struct dirent64..." >&4
7331 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
7333 case "$d_dirent64_s" in
7334 "$define") echo "Yup, it does." >&4
7336 *) echo "Nope, it doesn't." >&4
7342 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64_s d_dirent64_s
7349 : see if dlerror exists
7352 set dlerror d_dlerror
7356 : see if dlfcn is available
7364 On a few systems, the dynamically loaded modules that perl generates and uses
7365 will need a different extension than shared libs. The default will probably
7373 rp='What is the extension of dynamically loaded modules'
7382 : Check if dlsym need a leading underscore
7388 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7389 $cat >dyna.c <<'EOM'
7398 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7400 #include <sys/types.h>
7414 int mode = RTLD_LAZY ;
7416 handle = dlopen("./dyna.$dlext", mode) ;
7417 if (handle == NULL) {
7422 symbol = dlsym(handle, "fred") ;
7423 if (symbol == NULL) {
7424 /* try putting a leading underscore */
7425 symbol = dlsym(handle, "_fred") ;
7426 if (symbol == NULL) {
7439 : Call the object file tmp-dyna.o in case dlext=o.
7440 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7441 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7442 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7443 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7446 1) echo "Test program failed using dlopen." >&4
7447 echo "Perhaps you should not use dynamic loading." >&4;;
7448 2) echo "Test program failed using dlsym." >&4
7449 echo "Perhaps you should not use dynamic loading." >&4;;
7450 3) echo "dlsym needs a leading underscore" >&4
7452 4) echo "dlsym doesn't need a leading underscore." >&4;;
7455 echo "I can't compile and run the test program." >&4
7460 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7465 hasproto='varname=$1; func=$2; shift; shift;
7466 while $test $# -ge 2; do
7468 $define) echo "#include <$2>";;
7472 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7473 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7474 echo "$func() prototype found.";
7477 echo "$func() prototype NOT found.";
7482 $rm -f try.c tryout.c'
7484 : see if prototype for drand48 is available
7486 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7489 : see if dup2 exists
7493 : see if eaccess exists
7494 set eaccess d_eaccess
7497 : see if endgrent exists
7498 set endgrent d_endgrent
7501 : see if endhostent exists
7502 set endhostent d_endhent
7505 : see if endnetent exists
7506 set endnetent d_endnent
7509 : see if endprotoent exists
7510 set endprotoent d_endpent
7513 : see if endpwent exists
7514 set endpwent d_endpwent
7517 : see if endservent exists
7518 set endservent d_endsent
7521 : Locate the flags for 'open()'
7523 $cat >open3.c <<'EOCP'
7524 #include <sys/types.h>
7529 #include <sys/file.h>
7540 : check sys/file.h first to get FREAD on Sun
7541 if $test `./findhdr sys/file.h` && \
7542 set open3 -DI_SYS_FILE && eval $compile; then
7544 echo "<sys/file.h> defines the O_* constants..." >&4
7546 echo "and you have the 3 argument form of open()." >&4
7549 echo "but not the 3 argument form of open(). Oh, well." >&4
7552 elif $test `./findhdr fcntl.h` && \
7553 set open3 -DI_FCNTL && eval $compile; then
7555 echo "<fcntl.h> defines the O_* constants..." >&4
7557 echo "and you have the 3 argument form of open()." >&4
7560 echo "but not the 3 argument form of open(). Oh, well." >&4
7565 echo "I can't find the O_* constant definitions! You got problems." >&4
7571 : check for non-blocking I/O stuff
7572 case "$h_sysfile" in
7573 true) echo "#include <sys/file.h>" > head.c;;
7576 true) echo "#include <fcntl.h>" > head.c;;
7577 *) echo "#include <sys/fcntl.h>" > head.c;;
7582 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7583 case "$o_nonblock" in
7586 $cat >>try.c <<'EOCP'
7589 printf("O_NONBLOCK\n");
7593 printf("O_NDELAY\n");
7597 printf("FNDELAY\n");
7604 if eval $compile_ok; then
7606 case "$o_nonblock" in
7607 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7608 *) echo "Seems like we can use $o_nonblock.";;
7611 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7614 *) echo "Using $hint value $o_nonblock.";;
7616 $rm -f try try.* .out core
7619 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7625 #include <sys/types.h>
7627 #define MY_O_NONBLOCK $o_nonblock
7628 #ifndef errno /* XXX need better Configure test */
7631 $signal_t blech(x) int x; { exit(3); }
7633 $cat >> try.c <<'EOCP'
7641 pipe(pd); /* Down: child -> parent */
7642 pipe(pu); /* Up: parent -> child */
7645 close(pd[1]); /* Parent reads from pd[0] */
7646 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7647 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7649 signal(SIGALRM, blech);
7651 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7653 sprintf(string, "%d\n", ret);
7654 write(2, string, strlen(string));
7657 if (errno == EAGAIN) {
7663 if (errno == EWOULDBLOCK)
7664 printf("EWOULDBLOCK\n");
7667 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7668 sleep(2); /* Give it time to close our pipe */
7670 ret = read(pd[0], buf, 1); /* Should read EOF */
7672 sprintf(string, "%d\n", ret);
7673 write(3, string, strlen(string));
7677 close(pd[0]); /* We write to pd[1] */
7678 close(pu[1]); /* We read from pu[0] */
7679 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7680 close(pd[1]); /* Pipe pd is now fully closed! */
7681 exit(0); /* Bye bye, thank you for playing! */
7685 if eval $compile_ok; then
7686 echo "$startsh" >mtry
7687 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7689 ./mtry >/dev/null 2>&1
7691 0) eagain=`$cat try.out`;;
7692 1) echo "Could not perform non-blocking setting!";;
7693 2) echo "I did a successful read() for something that was not there!";;
7694 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7695 *) echo "Something terribly wrong happened during testing.";;
7697 rd_nodata=`$cat try.ret`
7698 echo "A read() system call with no data present returns $rd_nodata."
7699 case "$rd_nodata" in
7702 echo "(That's peculiar, fixing that to be -1.)"
7708 echo "Forcing errno EAGAIN on read() with no data available."
7712 echo "Your read() sets errno to $eagain when no data is available."
7715 status=`$cat try.err`
7717 0) echo "And it correctly returns 0 to signal EOF.";;
7718 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7719 *) echo "However, your read() returns '$status' on EOF??";;
7722 if test "$status" = "$rd_nodata"; then
7723 echo "WARNING: you can't distinguish between EOF and no data!"
7727 echo "I can't compile the test program--assuming errno EAGAIN will do."
7734 echo "Using $hint value $eagain."
7735 echo "Your read() returns $rd_nodata when no data is present."
7736 case "$d_eofnblk" in
7737 "$define") echo "And you can see EOF because read() returns 0.";;
7738 "$undef") echo "But you can't see EOF status from read() returned value.";;
7740 echo "(Assuming you can't see EOF status from read anyway.)"
7746 $rm -f try try.* .out core head.c mtry
7748 : see if fchmod exists
7752 : see if fchown exists
7756 : see if this is an fcntl system
7760 : see if sys/select.h has to be included
7761 set sys/select.h i_sysselct
7764 : see if we should include time.h, sys/time.h, or both
7766 if test "X$timeincl" = X; then
7767 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7768 $echo $n "I'm now running the test program...$c"
7769 $cat >try.c <<'EOCP'
7770 #include <sys/types.h>
7775 #ifdef SYSTIMEKERNEL
7778 #include <sys/time.h>
7781 #include <sys/select.h>
7790 struct timezone tzp;
7792 if (foo.tm_sec == foo.tm_sec)
7795 if (bar.tv_sec == bar.tv_sec)
7802 for s_timezone in '-DS_TIMEZONE' ''; do
7804 for s_timeval in '-DS_TIMEVAL' ''; do
7805 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7806 for i_time in '' '-DI_TIME'; do
7807 for i_systime in '-DI_SYSTIME' ''; do
7810 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7811 if eval $compile; then
7812 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7816 $echo $n "Succeeded with $flags$c"
7828 *SYSTIMEKERNEL*) i_systimek="$define"
7829 timeincl=`./findhdr sys/time.h`
7830 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7831 *) i_systimek="$undef";;
7834 *I_TIME*) i_time="$define"
7835 timeincl=`./findhdr time.h`" $timeincl"
7836 echo "We'll include <time.h>." >&4;;
7837 *) i_time="$undef";;
7840 *I_SYSTIME*) i_systime="$define"
7841 timeincl=`./findhdr sys/time.h`" $timeincl"
7842 echo "We'll include <sys/time.h>." >&4;;
7843 *) i_systime="$undef";;
7848 : check for fd_set items
7851 Checking to see how well your C compiler handles fd_set and friends ...
7853 $cat >fd_set.c <<EOCP
7854 #$i_systime I_SYS_TIME
7855 #$i_sysselct I_SYS_SELECT
7856 #$d_socket HAS_SOCKET
7857 #include <sys/types.h>
7859 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7862 #include <sys/time.h>
7865 #include <sys/select.h>
7874 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7881 set fd_set -DTRYBITS
7882 if eval $compile; then
7883 d_fds_bits="$define"
7885 echo "Well, your system knows about the normal fd_set typedef..." >&4
7887 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7888 d_fd_macros="$define"
7891 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7893 d_fd_macros="$undef"
7897 Hmm, your compiler has some difficulty with fd_set. Checking further...
7900 if eval $compile; then
7903 echo "Well, your system has some sort of fd_set available..." >&4
7905 echo "and you have the normal fd_set macros." >&4
7906 d_fd_macros="$define"
7909 but not the normal fd_set macros! Gross! More work for me...
7911 d_fd_macros="$undef"
7914 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7917 d_fd_macros="$undef"
7922 : see if fgetpos exists
7923 set fgetpos d_fgetpos
7927 if $test X"$use64bits" = X"$define"; then
7928 : see if fgetpos64 exists
7929 set fgetpos64 d_fgetpos64
7932 : see if fopen64 exists
7933 set freopen64 d_fopen64
7936 : see if freopen64 exists
7937 set freopen64 d_freopen64
7940 : see if fseek64 exists
7941 set fseek64 d_fseek64
7944 : see if fseeko64 exists
7945 set fseeko64 d_fseeko64
7948 : see if fsetpos64 exists
7949 set fsetpos64 d_fsetpos64
7952 : see if ftell64 exists
7953 set ftell64 d_ftell64
7956 : see if ftello64 exists
7957 set ftello64 d_ftello64
7960 : see if tmpfile64 exists
7961 set tmpfile64 d_tmpfile64
7965 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
7972 : see if flock exists
7976 : see if fork exists
7980 : see if pathconf exists
7981 set pathconf d_pathconf
7984 : see if fpathconf exists
7985 set fpathconf d_fpathconf
7988 : see if fseeko exists
7992 : see if fsetpos exists
7993 set fsetpos d_fsetpos
7996 : see if this is a sys/param system
7997 set sys/param.h i_sysparam
8000 : see if this is a sys/mount.h system
8001 set sys/mount.h i_sysmount
8005 : see if statfs exists
8009 : see if fstatfs exists
8010 set fstatfs d_fstatfs
8013 : see if statfs knows about mount flags
8014 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8018 : see if statvfs exists
8019 set statvfs d_statvfs
8022 : see if fstatvfs exists
8023 set fstatvfs d_fstatvfs
8027 : see if ftello exists
8031 : see if getgrent exists
8032 set getgrent d_getgrent
8035 : see if gethostbyaddr exists
8036 set gethostbyaddr d_gethbyaddr
8039 : see if gethostbyname exists
8040 set gethostbyname d_gethbyname
8043 : see if gethostent exists
8044 set gethostent d_gethent
8047 : see how we will look up host name
8050 : dummy stub to allow use of elif
8051 elif set gethostname val -f d_gethname; eval $csym; $val; then
8052 echo 'gethostname() found.' >&4
8053 d_gethname="$define"
8055 elif set uname val -f d_uname; eval $csym; $val; then
8058 uname() was found, but you're running xenix, and older versions of xenix
8059 have a broken uname(). If you don't really know whether your xenix is old
8060 enough to have a broken system call, use the default answer.
8067 rp='Is your uname() broken?'
8070 n*) d_uname="$define"; call=uname;;
8073 echo 'uname() found.' >&4
8078 case "$d_gethname" in
8079 '') d_gethname="$undef";;
8082 '') d_uname="$undef";;
8084 case "$d_uname$d_gethname" in
8089 Every now and then someone has a $call() that lies about the hostname
8090 but can't be fixed for political or economic reasons. If you wish, I can
8091 pretend $call() isn't there and maybe compute hostname at run-time
8092 thanks to the '$phostname' command.
8095 rp="Shall I ignore $call() from now on?"
8098 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8101 case "$phostname" in
8103 *) case "$aphostname" in
8109 file=`./loc $file $file $pth`
8110 aphostname=`echo $file $*`
8115 case "$d_uname$d_gethname" in
8118 case "$phostname" in
8120 echo "There will be no way for $package to get your hostname." >&4;;
8122 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8126 case "$d_phostname" in
8127 '') d_phostname="$undef";;
8130 : see if this is a netdb.h system
8134 : see if prototypes for various gethostxxx netdb.h functions are available
8136 set d_gethostprotos gethostent $i_netdb netdb.h
8139 : see if getlogin exists
8140 set getlogin d_getlogin
8143 : see if getnetbyaddr exists
8144 set getnetbyaddr d_getnbyaddr
8147 : see if getnetbyname exists
8148 set getnetbyname d_getnbyname
8151 : see if getnetent exists
8152 set getnetent d_getnent
8155 : see if prototypes for various getnetxxx netdb.h functions are available
8157 set d_getnetprotos getnetent $i_netdb netdb.h
8161 : see if getprotobyname exists
8162 set getprotobyname d_getpbyname
8165 : see if getprotobynumber exists
8166 set getprotobynumber d_getpbynumber
8169 : see if getprotoent exists
8170 set getprotoent d_getpent
8173 : see if getpgid exists
8174 set getpgid d_getpgid
8177 : see if getpgrp2 exists
8178 set getpgrp2 d_getpgrp2
8181 : see if getppid exists
8182 set getppid d_getppid
8185 : see if getpriority exists
8186 set getpriority d_getprior
8189 : see if prototypes for various getprotoxxx netdb.h functions are available
8191 set d_getprotoprotos getprotoent $i_netdb netdb.h
8194 : see if getpwent exists
8195 set getpwent d_getpwent
8199 : see if getservbyname exists
8200 set getservbyname d_getsbyname
8203 : see if getservbyport exists
8204 set getservbyport d_getsbyport
8207 : see if getservent exists
8208 set getservent d_getsent
8211 : see if prototypes for various getservxxx netdb.h functions are available
8213 set d_getservprotos getservent $i_netdb netdb.h
8216 : see if gettimeofday or ftime exists
8217 set gettimeofday d_gettimeod
8219 case "$d_gettimeod" in
8225 val="$undef"; set d_ftime; eval $setvar
8228 case "$d_gettimeod$d_ftime" in
8231 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8235 : see if this is an grp system
8241 xxx=`./findhdr grp.h`
8242 $cppstdin $cppflags $cppminus < $xxx >$$.h
8244 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8256 set d_grpasswd; eval $setvar
8260 : see if this is a netinet/in.h or sys/in.h system
8261 set netinet/in.h i_niin sys/in.h i_sysin
8264 : see if arpa/inet.h has to be included
8265 set arpa/inet.h i_arpainet
8268 : see if htonl --and friends-- exists
8273 : Maybe they are macros.
8278 #include <sys/types.h>
8279 #$i_niin I_NETINET_IN
8281 #$i_arpainet I_ARPA_INET
8283 #include <netinet/in.h>
8289 #include <arpa/inet.h>
8292 printf("Defined as a macro.");
8295 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8296 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8298 echo "But it seems to be defined as a macro." >&4
8306 : see which of string.h or strings.h is needed
8308 strings=`./findhdr string.h`
8309 if $test "$strings" && $test -r "$strings"; then
8310 echo "Using <string.h> instead of <strings.h>." >&4
8314 strings=`./findhdr strings.h`
8315 if $test "$strings" && $test -r "$strings"; then
8316 echo "Using <strings.h> instead of <string.h>." >&4
8318 echo "No string header found -- You'll surely have problems." >&4
8324 "$undef") strings=`./findhdr strings.h`;;
8325 *) strings=`./findhdr string.h`;;
8330 if set index val -f; eval $csym; $val; then
8331 if set strchr val -f d_strchr; eval $csym; $val; then
8332 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8335 echo "strchr() found." >&4
8339 echo "index() found." >&4
8344 echo "index() found." >&4
8347 if set strchr val -f d_strchr; eval $csym; $val; then
8350 echo "strchr() found." >&4
8352 echo "No index() or strchr() found!" >&4
8357 set d_strchr; eval $setvar
8359 set d_index; eval $setvar
8361 : check whether inet_aton exists
8362 set inet_aton d_inetaton
8365 : see if inttypes.h is available
8366 : we want a real compile instead of Inhdr because some systems
8367 : have an inttypes.h which includes non-existent headers
8370 #include <inttypes.h>
8372 static int32_t foo32 = 0x12345678;
8376 if eval $compile; then
8377 echo "<inttypes.h> found." >&4
8380 echo "<inttypes.h> NOT found." >&4
8388 case "$use64bits" in
8391 echo $n "Checking to see if your system supports int64_t...$c" >&4
8393 #include <sys/types.h>
8394 #$i_inttypes I_INTTYPES
8396 #include <inttypes.h>
8398 int64_t foo() { int64_t x; x = 7; return x; }
8400 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8402 echo " Yup, it does." >&4
8405 echo " Nope, it doesn't." >&4
8418 $cat >isascii.c <<'EOCP'
8430 if eval $compile; then
8431 echo "isascii() found." >&4
8434 echo "isascii() NOT found." >&4
8441 : see if killpg exists
8445 : see if lchown exists
8447 $cat > try.c <<'EOCP'
8448 /* System header to define __stub macros and hopefully few prototypes,
8449 which can conflict with char lchown(); below. */
8451 /* Override any gcc2 internal prototype to avoid an error. */
8452 /* We use char because int might match the return type of a gcc2
8453 builtin and then its argument prototype would still apply. */
8456 /* The GNU C library defines this for functions which it implements
8457 to always fail with ENOSYS. Some functions are actually named
8458 something starting with __ and the normal name is an alias. */
8459 #if defined (__stub_lchown) || defined (__stub___lchown)
8467 if eval $compile; then
8468 $echo "lchown() found." >&4
8471 $echo "lchown() NOT found." >&4
8477 : see if link exists
8481 : see if localeconv exists
8482 set localeconv d_locconv
8485 : see if lockf exists
8489 : check for length of double
8491 case "$doublesize" in
8493 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8494 $cat >try.c <<'EOCP'
8498 printf("%d\n", sizeof(double));
8502 if eval $compile_ok; then
8504 $echo " $doublesize bytes." >&4
8507 echo "(I can't seem to compile the test program. Guessing...)"
8508 rp="What is the size of a double precision number (in bytes)?"
8516 : check for long doubles
8518 echo $n "Checking to see if your system supports long doubles...$c" >&4
8519 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8520 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8522 echo " Yup, it does." >&4
8525 echo " Nope, it doesn't." >&4
8531 : check for length of long double
8532 case "${d_longdbl}${longdblsize}" in
8535 $echo $n "Checking to see how big your long doubles are...$c" >&4
8536 $cat >try.c <<'EOCP'
8540 printf("%d\n", sizeof(long double));
8544 if eval $compile; then
8546 $echo " $longdblsize bytes." >&4
8550 echo "(I can't seem to compile the test program. Guessing...)" >&4
8551 rp="What is the size of a long double (in bytes)?"
8555 if $test "X$doublesize" = "X$longdblsize"; then
8556 echo "(That isn't any different from an ordinary double.)"
8562 : check for long long
8564 echo $n "Checking to see if your system supports long long...$c" >&4
8565 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8566 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8568 echo " Yup, it does." >&4
8571 echo " Nope, it doesn't." >&4
8577 : check for length of long long
8578 case "${d_longlong}${longlongsize}" in
8581 $echo $n "Checking to see how big your long longs are...$c" >&4
8582 $cat >try.c <<'EOCP'
8586 printf("%d\n", sizeof(long long));
8590 if eval $compile_ok; then
8591 longlongsize=`./try`
8592 $echo " $longlongsize bytes." >&4
8596 echo "(I can't seem to compile the test program. Guessing...)"
8597 rp="What is the size of a long long (in bytes)?"
8601 if $test "X$longsize" = "X$longlongsize"; then
8602 echo "(That isn't any different from an ordinary long.)"
8608 : see if lstat exists
8612 : see if madvise exists
8613 set madvise d_madvise
8616 : see if mblen exists
8620 : see if mbstowcs exists
8621 set mbstowcs d_mbstowcs
8624 : see if mbtowc exists
8628 : see if memcmp exists
8632 : see if memcpy exists
8636 : see if memmove exists
8637 set memmove d_memmove
8640 : see if memset exists
8644 : see if mkdir exists
8648 : see if mkfifo exists
8652 : see if mktime exists
8656 : see if this is a sys/mman.h system
8657 set sys/mman.h i_sysmman
8660 : see if mmap exists
8663 : see what shmat returns
8664 : default to something harmless
8666 case "$i_sysmman$d_mmap" in
8668 $cat >mmap.c <<'END'
8669 #include <sys/mman.h>
8672 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
8677 echo "and it returns ($mmaptype)." >&4
8683 : see if mprotect exists
8684 set mprotect d_mprotect
8687 : see if msgctl exists
8691 : see if msgget exists
8695 : see if msgsnd exists
8699 : see if msgrcv exists
8703 : see how much of the 'msg*(2)' library is present.
8706 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8707 *"$undef"*) h_msg=false;;
8711 case "`ipcs 2>&1`" in
8712 "SVID messages"*"not configured"*)
8713 echo "Your $osname does not have the msg*(2) configured." >&4
8728 : we could also check for sys/ipc.h ...
8729 if $h_msg && $test `./findhdr sys/msg.h`; then
8730 echo "You have the full msg*(2) library." >&4
8733 echo "You don't have the full msg*(2) library." >&4
8739 : see if msync exists
8743 : see if munmap exists
8747 : see if nice exists
8751 : how to create joinable pthreads
8752 if test "X$usethreads" = "X$define"; then
8754 echo "Checking what constant to use for creating joinable pthreads..." >&4
8755 $cat >try.c <<'EOCP'
8756 #include <pthread.h>
8758 int detachstate = JOINABLE;
8761 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8762 if eval $compile; then
8763 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&2
8764 val="$undef" # Yes, undef.
8765 set d_old_pthread_create_joinable
8768 set old_pthread_create_joinable
8771 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8772 if eval $compile; then
8773 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&2
8775 set d_old_pthread_create_joinable
8777 val=PTHREAD_CREATE_UNDETACHED
8778 set old_pthread_create_joinable
8781 set try -DJOINABLE=__UNDETACHED
8782 if eval $compile; then
8783 echo "You seem to use __UNDETACHED." >&2
8785 set d_old_pthread_create_joinable
8788 set old_pthread_create_joinable
8791 echo "Egads, nothing obvious found. Guessing that you use 0." >&2
8793 set d_old_pthread_create_joinable
8796 set old_pthread_create_joinable
8803 d_old_pthread_create_joinable="$undef"
8804 old_pthread_create_joinable=""
8807 : see if pause exists
8811 : see if pipe exists
8815 : see if poll exists
8820 : see whether the various POSIXish _yields exist
8822 #include <pthread.h>
8828 #ifdef PTHREAD_YIELD
8831 #ifdef PTHREAD_YIELD_NULL
8832 pthread_yield(NULL);
8838 : see if sched_yield exists
8839 set try -DSCHED_YIELD
8840 if eval $compile; then
8842 sched_yield='sched_yield()'
8846 case "$usethreads" in
8849 $define) echo 'sched_yield() found.' >&4 ;;
8850 *) echo 'sched_yield() NOT found.' >&4 ;;
8856 : see if pthread_yield exists
8857 set try -DPTHREAD_YIELD
8858 if eval $compile; then
8860 case "$sched_yield" in
8861 '') sched_yield='pthread_yield()' ;;
8864 set try -DPTHREAD_YIELD_NULL
8865 if eval $compile; then
8867 case "$sched_yield" in
8868 '') sched_yield='pthread_yield(NULL)' ;;
8874 case "$usethreads" in
8877 $define) echo 'pthread_yield() found.' >&4 ;;
8878 *) echo 'pthread_yield() NOT found.' >&4 ;;
8885 case "$sched_yield" in
8886 '') sched_yield=undef ;;
8891 : see if this is a pwd.h system
8897 xxx=`./findhdr pwd.h`
8898 $cppstdin $cppflags $cppminus < $xxx >$$.h
8900 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8908 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8916 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8924 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8932 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
8940 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
8948 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
8956 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
8968 set d_pwquota; eval $setvar
8969 set d_pwage; eval $setvar
8970 set d_pwchange; eval $setvar
8971 set d_pwclass; eval $setvar
8972 set d_pwexpire; eval $setvar
8973 set d_pwcomment; eval $setvar
8974 set d_pwgecos; eval $setvar
8975 set d_pwpasswd; eval $setvar
8979 : see if readdir and friends exist
8980 set readdir d_readdir
8982 set seekdir d_seekdir
8984 set telldir d_telldir
8986 set rewinddir d_rewinddir
8989 : see if readlink exists
8990 set readlink d_readlink
8993 : see if readv exists
8997 : see if rename exists
9001 : see if rmdir exists
9005 : see if memory.h is available.
9010 : See if it conflicts with string.h
9016 $cppstdin $cppflags $cppminus < $strings > mem.h
9017 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9019 echo "We won't be including <memory.h>."
9029 : can bcopy handle overlapping blocks?
9034 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9041 $cat >>try.c <<'EOCP'
9044 # include <memory.h>
9047 # include <stdlib.h>
9050 # include <string.h>
9052 # include <strings.h>
9055 # include <unistd.h> /* Needed for NetBSD */
9059 char buf[128], abc[128];
9065 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9067 for (align = 7; align >= 0; align--) {
9068 for (len = 36; len; len--) {
9071 for (off = 1; off <= len; off++) {
9072 bcopy(b, b+off, len);
9073 bcopy(b+off, b, len);
9074 if (bcmp(b, abc, len))
9083 if eval $compile_ok; then
9084 if ./try 2>/dev/null; then
9088 echo "It can't, sorry."
9089 case "$d_memmove" in
9090 "$define") echo "But that's Ok since you have memmove()." ;;
9094 echo "(I can't compile the test program, so we'll assume not...)"
9095 case "$d_memmove" in
9096 "$define") echo "But that's Ok since you have memmove()." ;;
9101 $rm -f try.* try core
9105 : can memcpy handle overlapping blocks?
9110 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9117 $cat >>try.c <<'EOCP'
9120 # include <memory.h>
9123 # include <stdlib.h>
9126 # include <string.h>
9128 # include <strings.h>
9131 # include <unistd.h> /* Needed for NetBSD */
9135 char buf[128], abc[128];
9141 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9142 try to store the string in read-only memory. */
9143 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9145 for (align = 7; align >= 0; align--) {
9146 for (len = 36; len; len--) {
9148 memcpy(b, abc, len);
9149 for (off = 1; off <= len; off++) {
9150 memcpy(b+off, b, len);
9151 memcpy(b, b+off, len);
9152 if (memcmp(b, abc, len))
9161 if eval $compile_ok; then
9162 if ./try 2>/dev/null; then
9166 echo "It can't, sorry."
9167 case "$d_memmove" in
9168 "$define") echo "But that's Ok since you have memmove()." ;;
9172 echo "(I can't compile the test program, so we'll assume not...)"
9173 case "$d_memmove" in
9174 "$define") echo "But that's Ok since you have memmove()." ;;
9179 $rm -f try.* try core
9183 : can memcmp be trusted to compare relative magnitude?
9188 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9195 $cat >>try.c <<'EOCP'
9198 # include <memory.h>
9201 # include <stdlib.h>
9204 # include <string.h>
9206 # include <strings.h>
9209 # include <unistd.h> /* Needed for NetBSD */
9215 if ((a < b) && memcmp(&a, &b, 1) < 0)
9221 if eval $compile_ok; then
9222 if ./try 2>/dev/null; then
9226 echo "No, it can't (it uses signed chars)."
9229 echo "(I can't compile the test program, so we'll assume not...)"
9233 $rm -f try.* try core
9237 : see if select exists
9241 : see if semctl exists
9245 : see if semget exists
9249 : see if semop exists
9253 : see how much of the 'sem*(2)' library is present.
9256 case "$d_semctl$d_semget$d_semop" in
9257 *"$undef"*) h_sem=false;;
9261 case "`ipcs 2>&1`" in
9262 "SVID messages"*"not configured"*)
9263 echo "Your $osname does not have the sem*(2) configured." >&4
9276 : we could also check for sys/ipc.h ...
9277 if $h_sem && $test `./findhdr sys/sem.h`; then
9278 echo "You have the full sem*(2) library." >&4
9281 echo "You don't have the full sem*(2) library." >&4
9287 : see whether sys/sem.h defines union semun
9289 $cat > try.c <<'END'
9290 #include <sys/types.h>
9291 #include <sys/ipc.h>
9292 #include <sys/sem.h>
9293 int main () { union semun semun; semun.buf = 0; }
9296 if eval $compile; then
9297 echo "You have union semun in <sys/sem.h>." >&4
9300 echo "You do not have union semun in <sys/sem.h>." >&4
9303 $rm -f try try.c try.h
9307 : see how to do semctl IPC_STAT
9310 : see whether semctl IPC_STAT can use union semun
9315 # define S_IRUSR S_IREAD
9316 # define S_IWUSR S_IWRITE
9317 # define S_IXUSR S_IEXEC
9319 # define S_IRUSR 0400
9320 # define S_IWUSR 0200
9321 # define S_IXUSR 0100
9323 # define S_IRGRP (S_IRUSR>>3)
9324 # define S_IWGRP (S_IWUSR>>3)
9325 # define S_IXGRP (S_IXUSR>>3)
9326 # define S_IROTH (S_IRUSR>>6)
9327 # define S_IWOTH (S_IWUSR>>6)
9328 # define S_IXOTH (S_IXUSR>>6)
9331 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9332 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9333 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9338 #include <sys/types.h>
9339 #include <sys/ipc.h>
9340 #include <sys/sem.h>
9341 #include <sys/stat.h>
9348 #$d_union_semun HAS_UNION_SEMUN
9351 #ifndef HAS_UNION_SEMUN
9354 struct semid_ds *buf;
9355 unsigned short *array;
9361 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9362 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9364 struct semid_ds argbuf;
9367 st = semctl(sem, 0, IPC_STAT, arg);
9371 # endif /* IPC_STAT */
9372 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9374 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9375 # endif /* IPC_RMID */
9376 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9378 #endif /* IPC_PRIVATE && ... */
9379 printf("semget failed: errno = %d\n", errno);
9385 if eval $compile; then
9388 semun) val="$define" ;;
9394 case "$d_semctl_semun" in
9396 echo "You can use union semun for semctl IPC_STAT." >&4
9399 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9404 : see whether semctl IPC_STAT can use struct semid_ds pointer
9405 $cat > try.c <<'END'
9406 #include <sys/types.h>
9407 #include <sys/ipc.h>
9408 #include <sys/sem.h>
9409 #include <sys/stat.h>
9417 struct semid_ds arg;
9420 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9421 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9424 st = semctl(sem, 0, IPC_STAT, &arg);
9426 printf("semid_ds\n");
9428 # endif /* IPC_STAT */
9429 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9431 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9432 # endif /* IPC_RMID */
9433 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9435 #endif /* IPC_PRIVATE && ... */
9436 printf("semget failed: errno = %d\n", errno);
9443 if eval $compile; then
9446 semid_ds) val="$define" ;;
9450 set d_semctl_semid_ds
9452 case "$d_semctl_semid_ds" in
9454 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9456 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9463 # We do not have the full sem*(2) library, so assume we can not
9469 set d_semctl_semid_ds
9474 : see if setegid exists
9475 set setegid d_setegid
9478 : see if seteuid exists
9479 set seteuid d_seteuid
9482 : see if setgrent exists
9483 set setgrent d_setgrent
9486 : see if sethostent exists
9487 set sethostent d_sethent
9490 : see if setlinebuf exists
9491 set setlinebuf d_setlinebuf
9494 : see if setlocale exists
9495 set setlocale d_setlocale
9498 : see if setnetent exists
9499 set setnetent d_setnent
9502 : see if setprotoent exists
9503 set setprotoent d_setpent
9506 : see if setpgid exists
9507 set setpgid d_setpgid
9510 : see if setpgrp2 exists
9511 set setpgrp2 d_setpgrp2
9514 : see if setpriority exists
9515 set setpriority d_setprior
9518 : see if setpwent exists
9519 set setpwent d_setpwent
9522 : see if setregid exists
9523 set setregid d_setregid
9525 set setresgid d_setresgid
9528 : see if setreuid exists
9529 set setreuid d_setreuid
9531 set setresuid d_setresuid
9534 : see if setrgid exists
9535 set setrgid d_setrgid
9538 : see if setruid exists
9539 set setruid d_setruid
9542 : see if setservent exists
9543 set setservent d_setsent
9546 : see if setsid exists
9550 : see if setvbuf exists
9551 set setvbuf d_setvbuf
9554 : see if sfio.h is available
9559 : see if sfio library is available
9570 : Ok, but do we want to use it.
9574 true|$define|[yY]*) dflt='y';;
9577 echo "$package can use the sfio library, but it is experimental."
9578 rp="You seem to have sfio available, do you want to try using it?"
9582 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9584 : Remove sfio from list of libraries to use
9585 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9588 echo "libs = $libs" >&4
9592 *) case "$usesfio" in
9594 echo "Sorry, cannot find sfio on this machine" >&4
9595 echo "Ignoring your setting of usesfio=$usesfio" >&4
9603 $define) usesfio='true';;
9604 *) usesfio='false';;
9607 : see if shmctl exists
9611 : see if shmget exists
9615 : see if shmat exists
9618 : see what shmat returns
9621 $cat >shmat.c <<'END'
9622 #include <sys/shm.h>
9625 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9630 echo "and it returns ($shmattype)." >&4
9631 : see if a prototype for shmat is available
9632 xxx=`./findhdr sys/shm.h`
9633 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9634 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9645 set d_shmatprototype
9648 : see if shmdt exists
9652 : see how much of the 'shm*(2)' library is present.
9655 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9656 *"$undef"*) h_shm=false;;
9660 case "`ipcs 2>&1`" in
9661 "SVID shared memory"*"not configured"*)
9662 echo "Your $osname does not have the shm*(2) configured." >&4
9677 : we could also check for sys/ipc.h ...
9678 if $h_shm && $test `./findhdr sys/shm.h`; then
9679 echo "You have the full shm*(2) library." >&4
9682 echo "You don't have the full shm*(2) library." >&4
9689 : see if we have sigaction
9690 if set sigaction val -f d_sigaction; eval $csym; $val; then
9691 echo 'sigaction() found.' >&4
9692 $cat > try.c <<'EOP'
9694 #include <sys/types.h>
9698 struct sigaction act, oact;
9702 if eval $compile_ok; then
9705 echo "But you don't seem to have a useable struct sigaction." >&4
9709 echo 'sigaction NOT found.' >&4
9712 set d_sigaction; eval $setvar
9713 $rm -f try try$_o try.c
9715 : see if sigsetjmp exists
9717 case "$d_sigsetjmp" in
9725 if (sigsetjmp(env,1))
9733 if eval $compile; then
9734 if ./try >/dev/null 2>&1; then
9735 echo "POSIX sigsetjmp found." >&4
9739 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9745 echo "sigsetjmp not found." >&4
9749 *) val="$d_sigsetjmp"
9750 case "$d_sigsetjmp" in
9751 $define) echo "POSIX sigsetjmp found." >&4;;
9752 $undef) echo "sigsetjmp not found." >&4;;
9760 : see if stat knows about block sizes
9762 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9765 : see if _ptr and _cnt from stdio act std
9767 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9768 echo "(Looks like you have stdio.h from Linux.)"
9769 case "$stdio_ptr" in
9770 '') stdio_ptr='((fp)->_IO_read_ptr)'
9773 *) ptr_lval=$d_stdio_ptr_lval;;
9775 case "$stdio_cnt" in
9776 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9779 *) cnt_lval=$d_stdio_cnt_lval;;
9781 case "$stdio_base" in
9782 '') stdio_base='((fp)->_IO_read_base)';;
9784 case "$stdio_bufsiz" in
9785 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9788 case "$stdio_ptr" in
9789 '') stdio_ptr='((fp)->_ptr)'
9792 *) ptr_lval=$d_stdio_ptr_lval;;
9794 case "$stdio_cnt" in
9795 '') stdio_cnt='((fp)->_cnt)'
9798 *) cnt_lval=$d_stdio_cnt_lval;;
9800 case "$stdio_base" in
9801 '') stdio_base='((fp)->_base)';;
9803 case "$stdio_bufsiz" in
9804 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9807 : test whether _ptr and _cnt really work
9808 echo "Checking how std your stdio is..." >&4
9811 #define FILE_ptr(fp) $stdio_ptr
9812 #define FILE_cnt(fp) $stdio_cnt
9814 FILE *fp = fopen("try.c", "r");
9817 18 <= FILE_cnt(fp) &&
9818 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9826 if eval $compile; then
9828 echo "Your stdio acts pretty std."
9831 echo "Your stdio isn't very std."
9834 echo "Your stdio doesn't appear very std."
9840 : Can _ptr be used as an lvalue?
9841 case "$d_stdstdio$ptr_lval" in
9842 $define$define) val=$define ;;
9845 set d_stdio_ptr_lval
9848 : Can _cnt be used as an lvalue?
9849 case "$d_stdstdio$cnt_lval" in
9850 $define$define) val=$define ;;
9853 set d_stdio_cnt_lval
9856 : see if _base is also standard
9858 case "$d_stdstdio" in
9862 #define FILE_base(fp) $stdio_base
9863 #define FILE_bufsiz(fp) $stdio_bufsiz
9865 FILE *fp = fopen("try.c", "r");
9868 19 <= FILE_bufsiz(fp) &&
9869 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9876 if eval $compile; then
9878 echo "And its _base field acts std."
9881 echo "But its _base field isn't std."
9884 echo "However, it seems to be lacking the _base field."
9892 : see if strcoll exists
9893 set strcoll d_strcoll
9896 : check for structure copying
9898 echo "Checking to see if your C compiler can copy structs..." >&4
9899 $cat >try.c <<'EOCP'
9909 if $cc -c try.c >/dev/null 2>&1 ; then
9914 echo "Nope, it can't."
9920 : see if strerror and/or sys_errlist[] exist
9922 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9923 if set strerror val -f d_strerror; eval $csym; $val; then
9924 echo 'strerror() found.' >&4
9925 d_strerror="$define"
9926 d_strerrm='strerror(e)'
9927 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9928 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9929 d_syserrlst="$define"
9931 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9932 d_syserrlst="$undef"
9934 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9935 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9936 echo 'strerror() found in string header.' >&4
9937 d_strerror="$define"
9938 d_strerrm='strerror(e)'
9939 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9940 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9941 d_syserrlst="$define"
9943 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9944 d_syserrlst="$undef"
9946 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9947 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9949 d_syserrlst="$define"
9950 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9952 echo 'strerror() and sys_errlist[] NOT found.' >&4
9954 d_syserrlst="$undef"
9955 d_strerrm='"unknown"'
9959 : see if strtod exists
9963 : see if strtol exists
9967 : see if strtoul exists
9968 set strtoul d_strtoul
9971 : see if strxfrm exists
9972 set strxfrm d_strxfrm
9975 : see if symlink exists
9976 set symlink d_symlink
9979 : see if syscall exists
9980 set syscall d_syscall
9983 : see if sysconf exists
9984 set sysconf d_sysconf
9987 : see if system exists
9991 : see if tcgetpgrp exists
9992 set tcgetpgrp d_tcgetpgrp
9995 : see if tcsetpgrp exists
9996 set tcsetpgrp d_tcsetpgrp
9999 : see if sys/types.h has to be included
10000 set sys/types.h i_systypes
10003 : see if prototype for telldir is available
10005 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10008 : define an is-a-typedef? function
10009 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10011 "") inclist="sys/types.h";;
10013 eval "varval=\$$var";
10017 for inc in $inclist; do
10018 echo "#include <$inc>" >>temp.c;
10020 echo "#ifdef $type" >> temp.c;
10021 echo "printf(\"We have $type\");" >> temp.c;
10022 echo "#endif" >> temp.c;
10023 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10024 if $contains $type temp.E >/dev/null 2>&1; then
10025 eval "$var=\$type";
10030 *) eval "$var=\$varval";;
10033 : define an is-a-typedef? function that prompts if the type is not available.
10034 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10036 "") inclist="sys/types.h";;
10038 eval "varval=\$$var";
10042 for inc in $inclist; do
10043 echo "#include <$inc>" >>temp.c;
10045 echo "#ifdef $type" >> temp.c;
10046 echo "printf(\"We have $type\");" >> temp.c;
10047 echo "#endif" >> temp.c;
10048 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10050 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10051 if $contains $type temp.E >/dev/null 2>&1; then
10052 echo "$type found." >&4;
10053 eval "$var=\$type";
10055 echo "$type NOT found." >&4;
10061 *) eval "$var=\$varval";;
10064 : see if this is a sys/times.h system
10065 set sys/times.h i_systimes
10068 : see if times exists
10070 if set times val -f d_times; eval $csym; $val; then
10071 echo 'times() found.' >&4
10074 case "$i_systimes" in
10075 "$define") inc='sys/times.h';;
10077 rp="What is the type returned by times() on this system?"
10078 set clock_t clocktype long stdio.h sys/types.h $inc
10081 echo 'times() NOT found, hope that will do.' >&4
10086 : see if truncate exists
10087 set truncate d_truncate
10090 : see if tzname[] exists
10092 if set tzname val -a d_tzname; eval $csym; $val; then
10094 echo 'tzname[] found.' >&4
10097 echo 'tzname[] NOT found.' >&4
10102 : see if umask exists
10106 : backward compatibility for d_hvfork
10107 if test X$d_hvfork != X; then
10108 d_vfork="$d_hvfork"
10111 : see if there is a vfork
10116 : Ok, but do we want to use it. vfork is reportedly unreliable in
10117 : perl on Solaris 2.x, and probably elsewhere.
10121 case "$usevfork" in
10125 rp="Some systems have problems with vfork(). Do you want to use it?"
10130 echo "Ok, we won't use vfork()."
10139 $define) usevfork='true';;
10140 *) usevfork='false';;
10143 : see if this is an sysdir system
10144 set sys/dir.h i_sysdir
10147 : see if this is an sysndir system
10148 set sys/ndir.h i_sysndir
10151 : see if closedir exists
10152 set closedir d_closedir
10155 case "$d_closedir" in
10158 echo "Checking whether closedir() returns a status..." >&4
10159 cat > closedir.c <<EOM
10160 #$i_dirent I_DIRENT /**/
10161 #$i_sysdir I_SYS_DIR /**/
10162 #$i_sysndir I_SYS_NDIR /**/
10163 #$i_systypes I_SYS_TYPES /**/
10165 #if defined(I_SYS_TYPES)
10166 #include <sys/types.h>
10168 #if defined(I_DIRENT)
10169 #include <dirent.h>
10170 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10171 #include <sys/dir.h>
10175 #include <sys/ndir.h>
10179 #include <ndir.h> /* may be wrong in the future */
10181 #include <sys/dir.h>
10186 int main() { return closedir(opendir(".")); }
10189 if eval $compile_ok; then
10190 if ./closedir > /dev/null 2>&1 ; then
10191 echo "Yes, it does."
10194 echo "No, it doesn't."
10198 echo "(I can't seem to compile the test program--assuming it doesn't)"
10206 set d_void_closedir
10209 : check for volatile keyword
10211 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10212 $cat >try.c <<'EOCP'
10215 typedef struct _goo_struct goo_struct;
10216 goo_struct * volatile goo = ((goo_struct *)0);
10217 struct _goo_struct {
10222 typedef unsigned short foo_t;
10223 char *volatile foo;
10225 volatile foo_t blech;
10229 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10231 echo "Yup, it does."
10234 echo "Nope, it doesn't."
10240 : see if there is a wait4
10244 : see if waitpid exists
10245 set waitpid d_waitpid
10248 : see if wcstombs exists
10249 set wcstombs d_wcstombs
10252 : see if wctomb exists
10253 set wctomb d_wctomb
10256 : see if writev exists
10257 set writev d_writev
10260 : preserve RCS keywords in files with variable substitution, grrr
10265 Revision='$Revision'
10267 : check for alignment requirements
10269 case "$alignbytes" in
10270 '') echo "Checking alignment constraints..." >&4
10271 $cat >try.c <<'EOCP'
10278 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
10282 if eval $compile_ok; then
10286 echo "(I can't seem to compile the test program...)"
10289 *) dflt="$alignbytes"
10292 rp="Doubles must be aligned on a how-many-byte boundary?"
10297 : check for ordering of bytes in a long
10298 case "$byteorder" in
10302 In the following, larger digits indicate more significance. A big-endian
10303 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10304 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10305 machines may have weird orders like 3412. A Cray will report 87654321. If
10306 the test program works the default is probably right.
10307 I'm now running the test program...
10309 $cat >try.c <<'EOCP'
10316 char c[sizeof(long)];
10319 if (sizeof(long) > 4)
10320 u.l = (0x08070605L << 32) | 0x04030201L;
10323 for (i = 0; i < sizeof(long); i++)
10324 printf("%c", u.c[i]+'0');
10331 if eval $compile && ./try > /dev/null; then
10334 [1-4][1-4][1-4][1-4]|12345678|87654321)
10335 echo "(The test program ran ok.)"
10336 echo "byteorder=$dflt"
10339 ????|????????) echo "(The test program ran ok.)" ;;
10340 *) echo "(The test program didn't run right for some reason.)" ;;
10345 (I can't seem to compile the test program. Guessing big-endian...)
10348 case "$xxx_prompt" in
10350 rp="What is the order of bytes in a long?"
10361 : how do we catenate cpp tokens here?
10363 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10364 $cat >cpp_stuff.c <<'EOCP'
10365 #define RCAT(a,b)a/**/b
10366 #define ACAT(a,b)a ## b
10370 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10371 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10372 echo "Oh! Smells like ANSI's been here." >&4
10373 echo "We can catify or stringify, separately or together!"
10375 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10376 echo "Ah, yes! The good old days!" >&4
10377 echo "However, in the good old days we don't know how to stringify and"
10378 echo "catify at the same time."
10382 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10383 to have to edit the values of CAT[2-5] in config.h...
10385 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10389 : see if this is a db.h system
10395 : Check db version.
10397 echo "Checking Berkeley DB version ..." >&4
10403 #include <sys/types.h>
10408 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10409 int Major, Minor, Patch ;
10410 unsigned long Version ;
10411 (void)db_version(&Major, &Minor, &Patch) ;
10412 printf("You have Berkeley DB Version 2 or greater\n");
10414 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10415 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10416 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10417 Major, Minor, Patch) ;
10419 /* check that db.h & libdb are compatible */
10420 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10421 printf("db.h and libdb are incompatible\n") ;
10425 printf("db.h and libdb are compatible\n") ;
10427 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10428 + DB_VERSION_PATCH ;
10430 /* needs to be >= 2.3.4 */
10431 if (Version < 2003004) {
10432 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10433 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10439 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10440 printf("You have Berkeley DB Version 1\n");
10441 exit(0); /* DB version < 2: the coast is clear. */
10443 exit(1); /* <db.h> not Berkeley DB? */
10449 if eval $compile && ./try; then
10450 echo 'Looks OK.' >&4
10452 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10456 : Remove db from list of libraries to use
10457 echo "Removing unusable -ldb from library list" >&4
10458 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10461 echo "libs = $libs" >&4
10471 : Check the return type needed for hash
10473 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10479 #include <sys/types.h>
10482 #ifndef DB_VERSION_MAJOR
10483 u_int32_t hash_cb (ptr, size)
10491 info.hash = hash_cb;
10495 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10496 if $contains warning try.out >>/dev/null 2>&1 ; then
10499 db_hashtype='u_int32_t'
10502 : XXX Maybe we should just give up here.
10503 db_hashtype=u_int32_t
10505 echo "Help: I can't seem to compile the db test program." >&4
10506 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10509 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10511 *) db_hashtype=u_int32_t
10516 : Check the return type needed for prefix
10518 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10524 #include <sys/types.h>
10527 #ifndef DB_VERSION_MAJOR
10528 size_t prefix_cb (key1, key2)
10536 info.prefix = prefix_cb;
10540 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10541 if $contains warning try.out >>/dev/null 2>&1 ; then
10542 db_prefixtype='int'
10544 db_prefixtype='size_t'
10547 db_prefixtype='size_t'
10548 : XXX Maybe we should just give up here.
10550 echo "Help: I can't seem to compile the db test program." >&4
10551 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10554 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10556 *) db_prefixtype='size_t'
10560 : check for void type
10562 echo "Checking to see how well your C compiler groks the void type..." >&4
10563 case "$voidflags" in
10565 $cat >try.c <<'EOCP'
10571 extern void moo(); /* function returning void */
10572 void (*goo)(); /* ptr to func returning void */
10574 void *hue; /* generic ptr */
10587 int main() { sub(); }
10589 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10590 voidflags=$defvoidused
10591 echo "Good. It appears to support void to the level $package wants.">&4
10592 if $contains warning .out >/dev/null 2>&1; then
10593 echo "However, you might get some warnings that look like this:"
10597 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10598 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10599 echo "It supports 1..."
10600 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10601 echo "It also supports 2..."
10602 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10604 echo "And it supports 4 but not 8 definitely."
10606 echo "It doesn't support 4..."
10607 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10609 echo "But it supports 8."
10612 echo "Neither does it support 8."
10616 echo "It does not support 2..."
10617 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10619 echo "But it supports 4 and 8."
10621 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10623 echo "And it supports 4 but has not heard about 8."
10625 echo "However it supports 8 but not 4."
10630 echo "There is no support at all for void."
10635 case "$voidflags" in
10637 *) $cat >&4 <<'EOM'
10638 Support flag bits are:
10639 1: basic void declarations.
10640 2: arrays of pointers to functions returning void.
10641 4: operations between pointers to and addresses of void functions.
10642 8: generic void pointers.
10645 rp="Your void support flags add up to what?"
10653 : How can we generate normalized random numbers ?
10655 echo "Looking for a random number function..." >&4
10656 case "$randfunc" in
10658 if set drand48 val -f; eval $csym; $val; then
10660 echo "Good, found drand48()." >&4
10661 elif set random val -f; eval $csym; $val; then
10663 echo "OK, found random()." >&4
10666 echo "Yick, looks like I have to use rand()." >&4
10677 *-Dmy_rand=*|*-Dmy_srand=*)
10678 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10679 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10680 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10681 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10685 while $test "$cont"; do
10686 rp="Use which function to generate random numbers?"
10688 if $test "$ans" = "$dflt"; then
10694 if set $ans val -f; eval $csym; $val; then
10698 rp="I cannot find function $ans. Use that name anyway?"
10707 case "$randfunc" in
10709 drand01="drand48()"
10715 case "$randbits" in
10717 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10719 #$i_unistd I_UNISTD
10720 #$i_stdlib I_STDLIB
10723 # include <unistd.h>
10726 # include <stdlib.h>
10731 register unsigned long tmp;
10732 register unsigned long max = 0L;
10734 for (i = 1000; i; i--) {
10735 tmp = (unsigned long) $randfunc();
10736 if (tmp > max) max = tmp;
10738 for (i = 0; max; i++)
10744 if eval $compile_ok; then
10748 echo "(I can't seem to compile the test program...)"
10755 rp="How many bits does your $randfunc() function produce?"
10759 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10760 seedfunc="s$randfunc"
10761 randseedtype=unsigned
10765 rp="How many bits does your $randfunc() function produce?"
10768 seedfunc="s$randfunc"
10769 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10770 if set $seedfunc val -f; eval $csym; $val; then
10771 echo "(Using $seedfunc() to seed random generator)"
10773 echo "(Warning: no $seedfunc() to seed random generator)"
10776 randseedtype=unsigned
10784 echo "Determining whether or not we are on an EBCDIC system..." >&4
10785 $cat >tebcdic.c <<'EOM'
10788 if ('M'==0xd4) return 0;
10795 if eval $compile_ok; then
10797 echo "You have EBCDIC." >&4
10800 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
10803 echo "I'm unable to compile the test program." >&4
10804 echo "I'll assume ASCII or some ISO Latin." >&4
10806 $rm -f tebcdic.c tebcdic
10810 : see what type file positions are declared as in the library
10811 rp="What is the type for file position used by fsetpos()?"
10812 set fpos_t fpostype long stdio.h sys/types.h
10815 : Store the full pathname to the sed program for use in the C program
10818 : see what type gids are declared as in the kernel
10820 echo "Looking for the type for group ids returned by getgid()."
10821 set gid_t gidtype xxx stdio.h sys/types.h
10825 xxx=`./findhdr sys/user.h`
10826 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10828 unsigned) dflt="$1 $2" ;;
10832 *) dflt="$gidtype";;
10835 gid_t) echo "gid_t found." ;;
10836 *) rp="What is the type for group ids returned by getgid()?"
10842 : see if getgroups exists
10843 set getgroups d_getgrps
10846 : see if setgroups exists
10847 set setgroups d_setgrps
10851 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
10853 case "$d_getgrps$d_setgrps" in
10855 case "$groupstype" in
10856 '') dflt="$gidtype" ;;
10857 *) dflt="$groupstype" ;;
10860 What type of pointer is the second argument to getgroups() and setgroups()?
10861 Usually this is the same as group ids, $gidtype, but not always.
10864 rp='What type pointer is the second argument to getgroups() and setgroups()?'
10868 *) groupstype="$gidtype";;
10871 : see what type lseek is declared as in the kernel
10872 rp="What is the type used for lseek's offset on this system?"
10873 set off_t lseektype long stdio.h sys/types.h
10877 $echo $n "Checking to see how big your file offsets are...$c" >&4
10879 #include <sys/types.h>
10883 printf("%d\n", sizeof($lseektype));
10887 if eval $compile_ok; then
10889 $echo " $lseeksize bytes." >&4
10893 echo "(I can't seem to compile the test program. Guessing...)"
10894 rp="What is the size of your file offsets (in bytes)?"
10901 echo "Checking if your $make program sets \$(MAKE)..." >&4
10902 case "$make_set_make" in
10904 $sed 's/^X //' > testmake.mak << 'EOF'
10906 X @echo 'maketemp="$(MAKE)"'
10908 case "`$make -f testmake.mak 2>/dev/null`" in
10909 *maketemp=*) make_set_make='#' ;;
10910 *) make_set_make="MAKE=$make" ;;
10912 $rm -f testmake.mak
10915 case "$make_set_make" in
10916 '#') echo "Yup, it does.";;
10917 *) echo "Nope, it doesn't.";;
10920 : see what type is used for mode_t
10921 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
10922 set mode_t modetype int stdio.h sys/types.h
10925 : define a fucntion to check prototypes
10926 $cat > protochk <<EOSH
10929 optimize="$optimize"
10931 prototype="$prototype"
10936 $cat >> protochk <<'EOSH'
10941 while test $# -ge 2; do
10943 $define) echo "#include <$2>" >> try.c ;;
10944 literal) echo "$2" >> try.c ;;
10948 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10949 cat >> try.c <<'EOCP'
10950 #ifdef CAN_PROTOTYPE
10951 #define _(args) args
10956 echo "$foo" >> try.c
10957 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10958 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10964 $eunicefix protochk
10966 : see what type is used for size_t
10967 rp="What is the type used for the length parameter for string functions?"
10968 set size_t sizetype 'unsigned int' stdio.h sys/types.h
10971 : check for type of arguments to gethostbyaddr.
10972 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
10973 case "$d_gethbyaddr" in
10977 Checking to see what type of arguments are accepted by gethostbyaddr().
10979 hdrs="$define sys/types.h
10980 $d_socket sys/socket.h
10981 $i_niin netinet/in.h
10983 $i_unistd unistd.h"
10984 : The first arg can 'char *' or 'void *'
10985 : The second arg is some of integral type
10986 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
10987 for yyy in size_t long int; do
10988 case "$netdb_host_type" in
10989 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
10990 if ./protochk "$try" $hdrs; then
10991 echo "Your system accepts $xxx for the first arg."
10992 echo "...and $yyy for the second arg."
10993 netdb_host_type="$xxx"
10994 netdb_hlen_type="$yyy"
11000 : In case none of those worked, prompt the user.
11001 case "$netdb_host_type" in
11002 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11005 netdb_host_type=$ans
11006 rp='What is the type for the 2nd argument to gethostbyaddr?'
11009 netdb_hlen_type=$ans
11013 *) : no gethostbyaddr, so pick harmless defaults
11014 netdb_host_type='char *'
11015 netdb_hlen_type="$sizetype"
11018 # Remove the "const" if needed. -- but then we'll have a
11020 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11023 : check for type of argument to gethostbyname.
11024 if test "X$netdb_name_type" = X ; then
11025 case "$d_gethbyname" in
11029 Checking to see what type of argument is accepted by gethostbyname().
11031 hdrs="$define sys/types.h
11032 $d_socket sys/socket.h
11033 $i_niin netinet/in.h
11035 $i_unistd unistd.h"
11036 for xxx in "const char *" "char *"; do
11037 case "$netdb_name_type" in
11038 '') try="extern struct hostent *gethostbyname($xxx);"
11039 if ./protochk "$try" $hdrs; then
11040 echo "Your system accepts $xxx."
11041 netdb_name_type="$xxx"
11046 : In case none of those worked, prompt the user.
11047 case "$netdb_name_type" in
11048 '') rp='What is the type for the 1st argument to gethostbyname?'
11051 netdb_name_type=$ans
11055 *) : no gethostbyname, so pick harmless default
11056 netdb_name_type='char *'
11061 : check for type of 1st argument to getnetbyaddr.
11062 if test "X$netdb_net_type" = X ; then
11063 case "$d_getnbyaddr" in
11067 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11069 hdrs="$define sys/types.h
11070 $d_socket sys/socket.h
11071 $i_niin netinet/in.h
11073 $i_unistd unistd.h"
11074 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11075 case "$netdb_net_type" in
11076 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11077 if ./protochk "$try" $hdrs; then
11078 echo "Your system accepts $xxx."
11079 netdb_net_type="$xxx"
11084 : In case none of those worked, prompt the user.
11085 case "$netdb_net_type" in
11086 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11089 netdb_net_type=$ans
11093 *) : no getnetbyaddr, so pick harmless default
11094 netdb_net_type='long'
11098 : locate the preferred pager for this system
11112 '') dflt=/usr/ucb/more;;
11119 rp='What pager is used on your system?'
11123 : see what type pids are declared as in the kernel
11124 rp="What is the type of process ids on this system?"
11125 set pid_t pidtype int stdio.h sys/types.h
11128 : check for length of pointer
11132 $echo $n "Checking to see how big your pointers are...$c" >&4
11133 if test "$voidflags" -gt 7; then
11134 echo '#define VOID_PTR char *' > try.c
11136 echo '#define VOID_PTR void *' > try.c
11138 $cat >>try.c <<'EOCP'
11142 printf("%d\n", sizeof(VOID_PTR));
11147 if eval $compile_ok; then
11149 $echo " $ptrsize bytes." >&4
11152 echo "(I can't seem to compile the test program. Guessing...)" >&4
11153 rp="What is the size of a pointer (in bytes)?"
11161 : see if ar generates random libraries by itself
11163 echo "Checking how to generate random libraries on your machine..." >&4
11164 echo 'int bar1() { return bar2(); }' > bar1.c
11165 echo 'int bar2() { return 2; }' > bar2.c
11166 $cat > foo.c <<'EOP'
11167 int main() { printf("%d\n", bar1()); exit(0); }
11169 $cc $ccflags -c bar1.c >/dev/null 2>&1
11170 $cc $ccflags -c bar2.c >/dev/null 2>&1
11171 $cc $ccflags -c foo.c >/dev/null 2>&1
11172 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11173 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11174 ./foobar >/dev/null 2>&1; then
11175 echo "$ar appears to generate random libraries itself."
11178 elif $ar ts bar$_a >/dev/null 2>&1 &&
11179 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11180 ./foobar >/dev/null 2>&1; then
11181 echo "a table of contents needs to be added with '$ar ts'."
11188 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11189 $test -f $ranlib || ranlib=''
11192 if $test -n "$ranlib"; then
11193 echo "your system has '$ranlib'; we'll use that."
11196 echo "your system doesn't seem to support random libraries"
11197 echo "so we'll use lorder and tsort to order the libraries."
11204 : check for type of arguments to select.
11205 case "$selecttype" in
11206 '') case "$d_select" in
11209 Checking to see what type of arguments are accepted by select().
11211 hdrs="$define sys/types.h
11212 $i_systime sys/time.h
11213 $i_sysselct sys/select.h
11214 $d_socket sys/socket.h"
11215 : The first arg can be int, unsigned, or size_t
11216 : The last arg may or may not be 'const'
11218 : void pointer has been seen but using that
11219 : breaks the selectminbits test
11220 for xxx in 'fd_set *' 'int *'; do
11221 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11222 for tmo in 'struct timeval *' 'const struct timeval *'; do
11224 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11225 if ./protochk "$try" $hdrs; then
11226 echo "Your system accepts $xxx."
11235 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11236 case "$d_fd_set" in
11237 $define) dflt="fd_set *" ;;
11246 *) : no select, so pick a harmless default
11253 : check for the select 'width'
11254 case "$selectminbits" in
11255 '') case "$d_select" in
11259 Checking to see on how many bits at a time your select() operates...
11262 #include <sys/types.h>
11264 #$i_systime I_SYS_TIME
11265 #$i_systimek I_SYS_TIME_KERNEL
11270 # ifdef I_SYS_TIME_KERNEL
11273 # include <sys/time.h>
11274 # ifdef I_SYS_TIME_KERNEL
11278 #$i_sysselct I_SYS_SELECT
11279 #ifdef I_SYS_SELECT
11280 #include <sys/select.h>
11284 #define S sizeof(*(b))
11286 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11287 #define NBITS (NBYTES * 8)
11296 fp = fopen("try.c", "r");
11302 b = ($selecttype)s;
11303 for (i = 0; i < NBITS; i++)
11307 select(fd + 1, b, 0, 0, &t);
11308 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11309 printf("%d\n", i + 1);
11314 if eval $compile_ok; then
11315 selectminbits=`./try`
11316 case "$selectminbits" in
11318 Cannot figure out on how many bits at a time your select() operates.
11319 I'll play safe and guess it is 32 bits.
11325 *) bits="$selectminbits bits" ;;
11327 echo "Your select() operates on $bits at a time." >&4
11329 rp='What is the minimum number of bits your select() operates on?'
11330 case "$byteorder" in
11331 1234|12345678) dflt=32 ;;
11336 selectminbits="$val"
11340 *) : no select, so pick a harmless default
11347 : Trace out the files included by signal.h, then look for SIGxxx names.
11348 : Remove SIGARRAYSIZE used by HPUX.
11349 : Remove SIGTYP void lines used by OS2.
11350 xxx=`echo '#include <signal.h>' |
11351 $cppstdin $cppminus $cppflags 2>/dev/null |
11352 $grep '^[ ]*#.*include' |
11353 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11354 : Check this list of files to be sure we have parsed the cpp output ok.
11355 : This will also avoid potentially non-existent files, such
11358 for xx in $xxx /dev/null ; do
11359 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11361 : If we have found no files, at least try signal.h
11362 case "$xxxfiles" in
11363 '') xxxfiles=`./findhdr signal.h` ;;
11366 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
11367 print substr($2, 4, 20)
11369 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11370 print substr($3, 4, 20)
11372 : Append some common names just in case the awk scan failed.
11373 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11374 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11375 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11376 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11377 : generate a few handy files for later
11378 $cat > signal.c <<'EOCP'
11379 #include <sys/types.h>
11380 #include <signal.h>
11384 /* Strange style to avoid deeply-nested #if/#else/#endif */
11387 # define NSIG (_NSIG)
11393 # define NSIG (SIGMAX+1)
11399 # define NSIG (SIG_MAX+1)
11405 # define NSIG (MAXSIG+1)
11411 # define NSIG (MAX_SIG+1)
11416 # ifdef SIGARRAYSIZE
11417 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11423 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11427 /* Default to some arbitrary number that's big enough to get most
11428 of the common signals.
11434 printf("NSIG %d\n", NSIG);
11440 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11442 printf "#ifdef SIG"; printf $1; printf "\n"
11443 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11444 printf $1; printf ");\n"
11448 printf "#endif /* JUST_NSIG */\n";
11452 $cat >signal.awk <<'EOP'
11453 BEGIN { ndups = 0 }
11454 $1 ~ /^NSIG$/ { nsig = $2 }
11455 ($1 !~ /^NSIG$/) && (NF == 2) {
11456 if ($2 > maxsig) { maxsig = $2 }
11457 if (sig_name[$2]) {
11458 dup_name[ndups] = $1
11459 dup_num[ndups] = $2
11469 if (nsig == 0) { nsig = maxsig + 1 }
11470 for (n = 1; n < nsig; n++) {
11472 printf("%s %d\n", sig_name[n], sig_num[n])
11475 printf("NUM%d %d\n", n, n)
11478 for (n = 0; n < ndups; n++) {
11479 printf("%s %d\n", dup_name[n], dup_num[n])
11483 $cat >signal_cmd <<EOS
11485 if $test -s signal.lst; then
11486 echo "Using your existing signal.lst file"
11491 $cat >>signal_cmd <<'EOS'
11494 if eval $compile_ok; then
11495 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11497 echo "(I can't seem be able to compile the whole test program)" >&4
11498 echo "(I'll try it in little pieces.)" >&4
11499 set signal -DJUST_NSIG
11500 if eval $compile_ok; then
11501 ./signal$_exe > signal.nsg
11504 echo "I can't seem to figure out how many signals you have." >&4
11505 echo "Guessing 50." >&4
11506 echo 'NSIG 50' > signal.nsg
11508 : Now look at all the signal names, one at a time.
11509 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11510 $cat > signal.c <<EOCP
11511 #include <sys/types.h>
11512 #include <signal.h>
11515 printf("$xx %d\n", SIG${xx});
11520 if eval $compile; then
11521 echo "SIG${xx} found."
11522 ./signal$_exe >> signal.ls1
11524 echo "SIG${xx} NOT found."
11527 if $test -s signal.ls1; then
11528 $cat signal.nsg signal.ls1 |
11529 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11533 if $test -s signal.lst; then
11536 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11537 echo 'kill -l' >signal
11538 set X `csh -f <signal`
11542 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11544 echo $@ | $tr ' ' $trnl | \
11545 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
11547 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11549 chmod a+x signal_cmd
11550 $eunicefix signal_cmd
11552 : generate list of signal names
11554 case "$sig_name_init" in
11556 *) case "$sig_num_init" in
11557 ''|*,*) doinit=yes ;;
11562 echo "Generating a list of signal names and numbers..." >&4
11564 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
11565 sig_name="ZERO $sig_name"
11566 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11567 { printf "\"%s\", ", $1 }
11568 END { printf "0\n" }' signal.lst`
11569 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
11570 sig_num="0 $sig_num"
11571 sig_num_init=`$awk 'BEGIN { printf "0, " }
11572 { printf "%d, ", $2}
11573 END { printf "0\n"}' signal.lst`
11576 echo "The following signals are available:"
11578 echo $sig_name | $awk \
11579 'BEGIN { linelen = 0 }
11581 for (i = 1; i <= NF; i++) {
11582 name = "SIG" $i " "
11583 linelen = linelen + length(name)
11584 if (linelen > 70) {
11586 linelen = length(name)
11592 $rm -f signal signal.c signal.awk signal.lst signal_cmd
11594 : see what type is used for signed size_t
11595 set ssize_t ssizetype int stdio.h sys/types.h
11598 $cat > ssize.c <<EOM
11600 #include <sys/types.h>
11601 #define Size_t $sizetype
11602 #define SSize_t $dflt
11605 if (sizeof(Size_t) == sizeof(SSize_t))
11607 else if (sizeof(Size_t) == sizeof(int))
11616 if eval $compile_ok && ./ssize > /dev/null; then
11617 ssizetype=`./ssize`
11618 echo "I'll be using $ssizetype for functions returning a byte count." >&4
11621 Help! I can't compile and run the ssize_t test program: please enlighten me!
11622 (This is probably a misconfiguration in your system or libraries, and
11623 you really ought to fix it. Still, I'll try anyway.)
11625 I need a type that is the same size as $sizetype, but is guaranteed to
11626 be signed. Common values are ssize_t, int and long.
11629 rp="What signed type is the same size as $sizetype?"
11633 $rm -f ssize ssize.*
11635 : see what type of char stdio uses.
11637 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11638 echo "Your stdio uses unsigned chars." >&4
11639 stdchar="unsigned char"
11641 echo "Your stdio uses signed chars." >&4
11645 : see if time exists
11647 if test "X$d_time" = X -o X"$timetype" = X; then
11648 if set time val -f d_time; eval $csym; $val; then
11649 echo 'time() found.' >&4
11651 rp="What is the type returned by time() on this system?"
11652 set time_t timetype long stdio.h sys/types.h
11655 echo 'time() not found, hope that will do.' >&4
11663 : see what type uids are declared as in the kernel
11665 echo "Looking for the type for user ids returned by getuid()."
11666 set uid_t uidtype xxx stdio.h sys/types.h
11670 xxx=`./findhdr sys/user.h`
11671 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11673 unsigned) dflt="$1 $2" ;;
11677 *) dflt="$uidtype";;
11680 uid_t) echo "uid_t found." ;;
11681 *) rp="What is the type for user ids returned by getuid()?"
11687 : see if dbm.h is available
11688 : see if dbmclose exists
11689 set dbmclose d_dbmclose
11692 case "$d_dbmclose" in
11702 *) set rpcsvc/dbm.h i_rpcsvcdbm
11707 *) echo "We won't be including <dbm.h>"
11717 : see if this is a sys/file.h system
11722 : do we need to include sys/file.h ?
11726 if $h_sysfile; then
11728 echo "We'll be including <sys/file.h>." >&4
11731 echo "We won't be including <sys/file.h>." >&4
11741 : see if fcntl.h is there
11746 : see if we can include fcntl.h
11752 echo "We'll be including <fcntl.h>." >&4
11755 if $h_sysfile; then
11756 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11758 echo "We won't be including <fcntl.h>." >&4
11770 : see if locale.h is available
11771 set locale.h i_locale
11774 : see if mach cthreads are available
11775 if test "X$usethreads" = "X$define"; then
11776 set mach/cthreads.h i_machcthr
11779 i_machcthr="$undef"
11784 : see if this is a math.h system
11788 : see if this is a mntent.h system
11789 set mntent.h i_mntent
11792 : see if ndbm.h is available
11797 : see if dbm_open exists
11798 set dbm_open d_dbm_open
11800 case "$d_dbm_open" in
11803 echo "We won't be including <ndbm.h>"
11812 : see if net/errno.h is available
11814 set net/errno.h val
11817 : Unfortunately, it causes problems on some systems. Arrgh.
11820 cat > try.c <<'EOM'
11823 #include <net/errno.h>
11829 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11830 echo "We'll be including <net/errno.h>." >&4
11832 echo "We won't be including <net/errno.h>." >&4
11841 : see if this is a poll.h system
11845 : get C preprocessor symbols handy
11847 $echo $n "Hmm... $c"
11848 echo $al | $tr ' ' $trnl >Cppsym.know
11849 $cat <<EOSS >Cppsym
11857 case "\$list\$#" in
11860 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11862 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11865 unknown="\$unknown \$sym"
11875 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11877 exit 0; _ _ _ _\1\\ \1\\
11880 echo "exit 1; _ _ _" >>Cppsym\$\$
11881 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11883 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11889 $rm -f Cppsym\$\$ Cppsym2\$\$
11894 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11896 : now check the C compiler for additional symbols
11902 for i in \`$cc -v -c tmp.c 2>&1\`
11905 -D*) echo "\$i" | $sed 's/^-D//';;
11906 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11913 ./ccsym > ccsym1.raw
11914 if $test -s ccsym1.raw; then
11915 $sort ccsym1.raw | $uniq >ccsym.raw
11917 mv ccsym1.raw ccsym.raw
11920 $awk '/\=/ { print $0; next }
11921 { print $0"=1" }' ccsym.raw >ccsym.list
11922 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11923 $comm -13 ccsym.true ccsym.list >ccsym.own
11924 $comm -12 ccsym.true ccsym.list >ccsym.com
11925 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11927 if $test -z ccsym.raw; then
11928 echo "Your C compiler doesn't seem to define any symbols!" >&4
11930 echo "However, your C preprocessor defines the following symbols:"
11933 cppsymbols=`$cat Cppsym.true`
11934 cppccsymbols="$cppsymbols"
11936 if $test -s ccsym.com; then
11937 echo "Your C compiler and pre-processor define these symbols:"
11938 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11941 cppccsymbols=`$cat ccsym.com`
11942 $test "$silent" || sleep 1
11944 if $test -s ccsym.cpp; then
11945 $test "$also" && echo " "
11946 echo "Your C pre-processor ${also}defines the following symbols:"
11947 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11949 cppsymbols=`$cat ccsym.cpp`
11950 $test "$silent" || sleep 1
11952 if $test -s ccsym.own; then
11953 $test "$also" && echo " "
11954 echo "Your C compiler ${also}defines the following cpp symbols:"
11955 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11956 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11957 ccsymbols=`$cat ccsym.own`
11958 $test "$silent" || sleep 1
11963 : see if this is a termio system
11967 if $test `./findhdr termios.h`; then
11968 set tcsetattr i_termios
11974 "$define") echo "You have POSIX termios.h... good!" >&4;;
11975 *) if ./Cppsym pyr; then
11976 case "`/bin/universe`" in
11977 ucb) if $test `./findhdr sgtty.h`; then
11979 echo "<sgtty.h> found." >&4
11981 echo "System is pyramid with BSD universe."
11982 echo "<sgtty.h> not found--you could have problems." >&4
11984 *) if $test `./findhdr termio.h`; then
11986 echo "<termio.h> found." >&4
11988 echo "System is pyramid with USG universe."
11989 echo "<termio.h> not found--you could have problems." >&4
11993 if $test `./findhdr termio.h`; then
11994 echo "<termio.h> found." >&4
11996 elif $test `./findhdr sgtty.h`; then
11997 echo "<sgtty.h> found." >&4
12000 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12003 if $test `./findhdr sgtty.h`; then
12004 echo "<sgtty.h> found." >&4
12006 elif $test `./findhdr termio.h`; then
12007 echo "<termio.h> found." >&4
12010 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12014 set i_termio; eval $setvar
12015 val=$val2; set i_sgtty; eval $setvar
12016 val=$val3; set i_termios; eval $setvar
12018 : see if stdarg is available
12020 if $test `./findhdr stdarg.h`; then
12021 echo "<stdarg.h> found." >&4
12024 echo "<stdarg.h> NOT found." >&4
12028 : see if varags is available
12030 if $test `./findhdr varargs.h`; then
12031 echo "<varargs.h> found." >&4
12033 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12036 : set up the varargs testing programs
12037 $cat > varargs.c <<EOP
12039 #include <stdarg.h>
12042 #include <varargs.h>
12046 int f(char *p, ...)
12060 p = va_arg(ap, char *);
12065 $cat > varargs <<EOP
12067 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12076 : now check which varargs header should be included
12081 if `./varargs I_STDARG`; then
12083 elif `./varargs I_VARARGS`; then
12088 if `./varargs I_VARARGS`; then
12095 echo "I could not find the definition for va_dcl... You have problems..." >&4
12096 val="$undef"; set i_stdarg; eval $setvar
12097 val="$undef"; set i_varargs; eval $setvar
12102 case "$i_varhdr" in
12104 val="$define"; set i_stdarg; eval $setvar
12105 val="$undef"; set i_varargs; eval $setvar
12108 val="$undef"; set i_stdarg; eval $setvar
12109 val="$define"; set i_varargs; eval $setvar
12112 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12116 : see if stddef is available
12117 set stddef.h i_stddef
12120 : see if sys/access.h is available
12121 set sys/access.h i_sysaccess
12124 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12125 set sys/filio.h i_sysfilio
12128 if $test `./findhdr sys/ioctl.h`; then
12130 echo '<sys/ioctl.h> found.' >&4
12133 if $test $i_sysfilio = "$define"; then
12134 echo '<sys/ioctl.h> NOT found.' >&4
12136 $test $i_sgtty = "$define" && xxx="sgtty.h"
12137 $test $i_termio = "$define" && xxx="termio.h"
12138 $test $i_termios = "$define" && xxx="termios.h"
12139 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12145 : see if sys/resource.h has to be included
12146 set sys/resource.h i_sysresrc
12149 : see if sys/security.h is available
12150 set sys/security.h i_syssecrt
12153 : see if this is a sys/statvfs.h system
12154 set sys/statvfs.h i_sysstatvfs
12157 : see if this is a sys/un.h system
12158 set sys/un.h i_sysun
12161 : see if this is a syswait system
12162 set sys/wait.h i_syswait
12165 : see if this is an utime system
12166 set utime.h i_utime
12169 : see if this is a values.h system
12170 set values.h i_values
12173 : see if this is a vfork system
12176 set vfork.h i_vfork
12184 : see if gdbm.h is available
12189 : see if gdbm_open exists
12190 set gdbm_open d_gdbm_open
12192 case "$d_gdbm_open" in
12195 echo "We won't be including <gdbm.h>"
12205 echo "Looking for extensions..." >&4
12208 : If we are using the old config.sh, known_extensions may contain
12209 : old or inaccurate or duplicate values.
12210 known_extensions=''
12211 nonxs_extensions=''
12212 : We do not use find because it might not be available.
12213 : We do not just use MANIFEST because the user may have dropped
12214 : some additional extensions into the source tree and expect them
12218 DynaLoader|dynaload) ;;
12219 *) if $test -f $xxx/$xxx.xs; then
12220 known_extensions="$known_extensions $xxx"
12221 elif $test -f $xxx/Makefile.PL; then
12222 nonxs_extensions="$nonxs_extensions $xxx"
12224 if $test -d $xxx; then
12225 # Look for nested extensions, eg. Devel/Dprof.
12228 if $test -f $yyy/$yyy.xs; then
12229 known_extensions="$known_extensions $xxx/$yyy"
12230 elif $test -f $yyy/Makefile.PL; then
12231 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
12240 set X $nonxs_extensions
12242 nonxs_extensions="$*"
12243 set X $known_extensions
12245 known_extensions="$*"
12248 : Now see which are supported on this system.
12250 for xxx in $known_extensions ; do
12254 $define) avail_ext="$avail_ext $xxx" ;;
12257 GDBM_File|gdbm_fil)
12259 $define) avail_ext="$avail_ext $xxx" ;;
12262 NDBM_File|ndbm_fil)
12264 $define) avail_ext="$avail_ext $xxx" ;;
12267 ODBM_File|odbm_fil)
12268 case "${i_dbm}${i_rpcsvcdbm}" in
12269 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12273 case "$useposix" in
12274 true|define|y) avail_ext="$avail_ext $xxx" ;;
12278 case "$useopcode" in
12279 true|define|y) avail_ext="$avail_ext $xxx" ;;
12283 case "$d_socket" in
12284 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12288 case "$usethreads" in
12289 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12293 : XXX Do we need a useipcsysv variable here
12294 case "${d_msg}${d_sem}${d_shm}" in
12295 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12298 *) avail_ext="$avail_ext $xxx"
12307 : Now see which nonxs extensions are supported on this system.
12308 : For now assume all are.
12310 for xxx in $nonxs_extensions ; do
12312 *) nonxs_ext="$nonxs_ext $xxx"
12324 A number of extensions are supplied with $package. You may choose to
12325 compile these extensions for dynamic loading (the default), compile
12326 them into the $package executable (static loading), or not include
12327 them at all. Answer "none" to include no extensions.
12328 Note that DynaLoader is always built and need not be mentioned here.
12331 case "$dynamic_ext" in
12332 '') dflt="$avail_ext" ;;
12333 *) dflt="$dynamic_ext"
12334 # Perhaps we are reusing an old out-of-date config.sh.
12337 if test X"$dynamic_ext" != X"$avail_ext"; then
12339 NOTICE: Your previous config.sh list may be incorrect.
12340 The extensions now available to you are
12342 but the default list from your previous config.sh is
12354 rp="What extensions do you wish to load dynamically?"
12357 none) dynamic_ext=' ' ;;
12358 *) dynamic_ext="$ans" ;;
12361 case "$static_ext" in
12363 : Exclude those already listed in dynamic linking
12365 for xxx in $avail_ext; do
12366 case " $dynamic_ext " in
12368 *) dflt="$dflt $xxx" ;;
12375 *) dflt="$static_ext"
12382 rp="What extensions do you wish to load statically?"
12385 none) static_ext=' ' ;;
12386 *) static_ext="$ans" ;;
12391 A number of extensions are supplied with $package. Answer "none"
12392 to include no extensions.
12393 Note that DynaLoader is always built and need not be mentioned here.
12396 case "$static_ext" in
12397 '') dflt="$avail_ext" ;;
12398 *) dflt="$static_ext"
12399 # Perhaps we are reusing an old out-of-date config.sh.
12402 if test X"$static_ext" != X"$avail_ext"; then
12404 NOTICE: Your previous config.sh list may be incorrect.
12405 The extensions now available to you are
12407 but the default list from your previous config.sh is
12416 : Exclude those that are not xs extensions
12420 rp="What extensions do you wish to include?"
12423 none) static_ext=' ' ;;
12424 *) static_ext="$ans" ;;
12429 set X $dynamic_ext $static_ext $nonxs_ext
12433 : Remove build directory name from cppstdin so it can be used from
12434 : either the present location or the final installed location.
12436 : Get out of the UU directory to get correct path name.
12438 case "$cppstdin" in
12440 echo "Stripping down cppstdin path name"
12446 : end of configuration questions
12448 echo "End of configuration questions."
12451 : back to where it started
12452 if test -d ../UU; then
12456 : configuration may be patched via a 'config.over' file
12457 if $test -f config.over; then
12460 rp='I see a config.over file. Do you wish to load it?'
12463 n*) echo "OK, I'll ignore it.";;
12465 echo "Configuration override changes have been loaded."
12470 : in case they want portability, strip down executable paths
12471 case "$d_portable" in
12474 echo "Stripping down executable paths..." >&4
12475 for file in $loclist $trylist; do
12476 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12477 eval $file="\$file"
12483 : create config.sh file
12485 echo "Creating config.sh..." >&4
12486 $spitshell <<EOT >config.sh
12489 # This file was produced by running the Configure script. It holds all the
12490 # definitions figured out by Configure. Should you modify one of these values,
12491 # do not forget to propagate your changes by running "Configure -der". You may
12492 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12495 # Package name : $package
12496 # Source directory : $src
12497 # Configuration time: $cf_time
12498 # Configured by : $cf_by
12499 # Target system : $myuname
12509 Revision='$Revision'
12516 alignbytes='$alignbytes'
12517 ansi2knr='$ansi2knr'
12518 aphostname='$aphostname'
12519 apiversion='$apiversion'
12522 archlibexp='$archlibexp'
12523 archname64='$archname64'
12524 archname='$archname'
12525 archobjs='$archobjs'
12533 byteorder='$byteorder'
12535 castflags='$castflags'
12538 cccdlflags='$cccdlflags'
12539 ccdlflags='$ccdlflags'
12541 ccsymbols='$ccsymbols'
12543 cf_email='$cf_email'
12548 clocktype='$clocktype'
12550 compress='$compress'
12551 contains='$contains'
12555 cpp_stuff='$cpp_stuff'
12556 cppccsymbols='$cppccsymbols'
12557 cppflags='$cppflags'
12559 cppminus='$cppminus'
12561 cppstdin='$cppstdin'
12562 cppsymbols='$cppsymbols'
12563 cryptlib='$cryptlib'
12565 d_Gconvert='$d_Gconvert'
12566 d_access='$d_access'
12567 d_accessx='$d_accessx'
12569 d_archlib='$d_archlib'
12570 d_attribut='$d_attribut'
12574 d_bsdgetpgrp='$d_bsdgetpgrp'
12575 d_bsdsetpgrp='$d_bsdsetpgrp'
12577 d_casti32='$d_casti32'
12578 d_castneg='$d_castneg'
12579 d_charvspr='$d_charvspr'
12581 d_chroot='$d_chroot'
12582 d_chsize='$d_chsize'
12583 d_closedir='$d_closedir'
12584 d_cmsghdr_s='$d_cmsghdr_s'
12588 d_cuserid='$d_cuserid'
12589 d_dbl_dig='$d_dbl_dig'
12590 d_dbmclose64='$d_dbmclose64'
12591 d_dbminit64='$d_dbminit64'
12592 d_delete64='$d_delete64'
12593 d_difftime='$d_difftime'
12594 d_dirent64_s='$d_dirent64_s'
12595 d_dirnamlen='$d_dirnamlen'
12596 d_dlerror='$d_dlerror'
12597 d_dlopen='$d_dlopen'
12598 d_dlsymun='$d_dlsymun'
12599 d_dosuid='$d_dosuid'
12600 d_drand48proto='$d_drand48proto'
12602 d_eaccess='$d_eaccess'
12603 d_endgrent='$d_endgrent'
12604 d_endhent='$d_endhent'
12605 d_endnent='$d_endnent'
12606 d_endpent='$d_endpent'
12607 d_endpwent='$d_endpwent'
12608 d_endsent='$d_endsent'
12609 d_eofnblk='$d_eofnblk'
12610 d_eunice='$d_eunice'
12611 d_fchmod='$d_fchmod'
12612 d_fchown='$d_fchown'
12614 d_fd_macros='$d_fd_macros'
12615 d_fd_set='$d_fd_set'
12616 d_fds_bits='$d_fds_bits'
12617 d_fetch64='$d_fetch64'
12618 d_fgetpos64='$d_fgetpos64'
12619 d_fgetpos='$d_fgetpos'
12620 d_firstkey64='$d_firstkey64'
12621 d_flexfnam='$d_flexfnam'
12622 d_flock64_s='$d_flock64_s'
12624 d_fopen64='$d_fopen64'
12626 d_fpathconf='$d_fpathconf'
12627 d_freopen64='$d_freopen64'
12628 d_fseek64='$d_fseek64'
12629 d_fseeko64='$d_fseeko64'
12630 d_fseeko='$d_fseeko'
12631 d_fsetpos64='$d_fsetpos64'
12632 d_fsetpos='$d_fsetpos'
12633 d_fstat64='$d_fstat64'
12634 d_fstatfs='$d_fstatfs'
12635 d_fstatvfs='$d_fstatvfs'
12636 d_ftell64='$d_ftell64'
12637 d_ftello64='$d_ftello64'
12638 d_ftello='$d_ftello'
12640 d_ftruncate64='$d_ftruncate64'
12641 d_getgrent='$d_getgrent'
12642 d_getgrps='$d_getgrps'
12643 d_gethbyaddr='$d_gethbyaddr'
12644 d_gethbyname='$d_gethbyname'
12645 d_gethent='$d_gethent'
12646 d_gethname='$d_gethname'
12647 d_gethostprotos='$d_gethostprotos'
12648 d_getlogin='$d_getlogin'
12649 d_getnbyaddr='$d_getnbyaddr'
12650 d_getnbyname='$d_getnbyname'
12651 d_getnent='$d_getnent'
12652 d_getnetprotos='$d_getnetprotos'
12653 d_getpbyname='$d_getpbyname'
12654 d_getpbynumber='$d_getpbynumber'
12655 d_getpent='$d_getpent'
12656 d_getpgid='$d_getpgid'
12657 d_getpgrp2='$d_getpgrp2'
12658 d_getpgrp='$d_getpgrp'
12659 d_getppid='$d_getppid'
12660 d_getprior='$d_getprior'
12661 d_getprotoprotos='$d_getprotoprotos'
12662 d_getpwent='$d_getpwent'
12663 d_getsbyname='$d_getsbyname'
12664 d_getsbyport='$d_getsbyport'
12665 d_getsent='$d_getsent'
12666 d_getservprotos='$d_getservprotos'
12667 d_gettimeod='$d_gettimeod'
12668 d_gnulibc='$d_gnulibc'
12669 d_grpasswd='$d_grpasswd'
12672 d_inetaton='$d_inetaton'
12673 d_ino64t='$d_ino64t'
12674 d_int64t='$d_int64t'
12675 d_iovec_s='$d_iovec_s'
12676 d_isascii='$d_isascii'
12677 d_killpg='$d_killpg'
12678 d_lchown='$d_lchown'
12680 d_locconv='$d_locconv'
12681 d_lockf64='$d_lockf64'
12683 d_longdbl='$d_longdbl'
12684 d_longlong='$d_longlong'
12685 d_lseek64='$d_lseek64'
12686 d_lstat64='$d_lstat64'
12688 d_madvise='$d_madvise'
12690 d_mbstowcs='$d_mbstowcs'
12691 d_mbtowc='$d_mbtowc'
12692 d_memcmp='$d_memcmp'
12693 d_memcpy='$d_memcpy'
12694 d_memmove='$d_memmove'
12695 d_memset='$d_memset'
12697 d_mkfifo='$d_mkfifo'
12698 d_mktime='$d_mktime'
12700 d_mprotect='$d_mprotect'
12702 d_msg_ctrunc='$d_msg_ctrunc'
12703 d_msg_dontroute='$d_msg_dontroute'
12704 d_msg_oob='$d_msg_oob'
12705 d_msg_peek='$d_msg_peek'
12706 d_msg_proxy='$d_msg_proxy'
12707 d_msgctl='$d_msgctl'
12708 d_msgget='$d_msgget'
12709 d_msghdr_s='$d_msghdr_s'
12710 d_msgrcv='$d_msgrcv'
12711 d_msgsnd='$d_msgsnd'
12713 d_munmap='$d_munmap'
12714 d_mymalloc='$d_mymalloc'
12715 d_nextkey64='$d_nextkey64'
12717 d_off64t='$d_off64t'
12718 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
12719 d_oldpthreads='$d_oldpthreads'
12720 d_oldsock='$d_oldsock'
12722 d_open64='$d_open64'
12723 d_opendir64='$d_opendir64'
12724 d_pathconf='$d_pathconf'
12726 d_phostname='$d_phostname'
12729 d_portable='$d_portable'
12730 d_pthread_yield='$d_pthread_yield'
12732 d_pwchange='$d_pwchange'
12733 d_pwclass='$d_pwclass'
12734 d_pwcomment='$d_pwcomment'
12735 d_pwexpire='$d_pwexpire'
12736 d_pwgecos='$d_pwgecos'
12737 d_pwpasswd='$d_pwpasswd'
12738 d_pwquota='$d_pwquota'
12739 d_readdir64='$d_readdir64'
12740 d_readdir='$d_readdir'
12741 d_readlink='$d_readlink'
12743 d_recvmsg='$d_recvmsg'
12744 d_rename='$d_rename'
12745 d_rewinddir='$d_rewinddir'
12747 d_safebcpy='$d_safebcpy'
12748 d_safemcpy='$d_safemcpy'
12749 d_sanemcmp='$d_sanemcmp'
12750 d_sched_yield='$d_sched_yield'
12751 d_scm_rights='$d_scm_rights'
12752 d_seekdir64='$d_seekdir64'
12753 d_seekdir='$d_seekdir'
12754 d_select='$d_select'
12756 d_semctl='$d_semctl'
12757 d_semctl_semid_ds='$d_semctl_semid_ds'
12758 d_semctl_semun='$d_semctl_semun'
12759 d_semget='$d_semget'
12761 d_sendmsg='$d_sendmsg'
12762 d_setegid='$d_setegid'
12763 d_seteuid='$d_seteuid'
12764 d_setgrent='$d_setgrent'
12765 d_setgrps='$d_setgrps'
12766 d_sethent='$d_sethent'
12767 d_setlinebuf='$d_setlinebuf'
12768 d_setlocale='$d_setlocale'
12769 d_setnent='$d_setnent'
12770 d_setpent='$d_setpent'
12771 d_setpgid='$d_setpgid'
12772 d_setpgrp2='$d_setpgrp2'
12773 d_setpgrp='$d_setpgrp'
12774 d_setprior='$d_setprior'
12775 d_setpwent='$d_setpwent'
12776 d_setregid='$d_setregid'
12777 d_setresgid='$d_setresgid'
12778 d_setresuid='$d_setresuid'
12779 d_setreuid='$d_setreuid'
12780 d_setrgid='$d_setrgid'
12781 d_setruid='$d_setruid'
12782 d_setsent='$d_setsent'
12783 d_setsid='$d_setsid'
12784 d_setvbuf='$d_setvbuf'
12788 d_shmatprototype='$d_shmatprototype'
12789 d_shmctl='$d_shmctl'
12791 d_shmget='$d_shmget'
12792 d_sigaction='$d_sigaction'
12793 d_sigsetjmp='$d_sigsetjmp'
12794 d_socket='$d_socket'
12795 d_sockpair='$d_sockpair'
12796 d_stat64='$d_stat64'
12797 d_statblks='$d_statblks'
12798 d_statfs='$d_statfs'
12799 d_statfsflags='$d_statfsflags'
12800 d_statvfs='$d_statvfs'
12801 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12802 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12803 d_stdiobase='$d_stdiobase'
12804 d_stdstdio='$d_stdstdio'
12805 d_store64='$d_store64'
12806 d_strchr='$d_strchr'
12807 d_strcoll='$d_strcoll'
12808 d_strctcpy='$d_strctcpy'
12809 d_strerrm='$d_strerrm'
12810 d_strerror='$d_strerror'
12811 d_strtod='$d_strtod'
12812 d_strtol='$d_strtol'
12813 d_strtoul='$d_strtoul'
12814 d_strxfrm='$d_strxfrm'
12815 d_suidsafe='$d_suidsafe'
12816 d_symlink='$d_symlink'
12817 d_syscall='$d_syscall'
12818 d_sysconf='$d_sysconf'
12819 d_sysernlst='$d_sysernlst'
12820 d_syserrlst='$d_syserrlst'
12821 d_system='$d_system'
12822 d_tcgetpgrp='$d_tcgetpgrp'
12823 d_tcsetpgrp='$d_tcsetpgrp'
12824 d_telldir64='$d_telldir64'
12825 d_telldir='$d_telldir'
12826 d_telldirproto='$d_telldirproto'
12829 d_tmpfile64='$d_tmpfile64'
12830 d_truncate64='$d_truncate64'
12831 d_truncate='$d_truncate'
12832 d_tzname='$d_tzname'
12835 d_union_semun='$d_union_semun'
12837 d_void_closedir='$d_void_closedir'
12838 d_voidsig='$d_voidsig'
12839 d_voidtty='$d_voidtty'
12840 d_volatile='$d_volatile'
12841 d_vprintf='$d_vprintf'
12843 d_waitpid='$d_waitpid'
12844 d_wcstombs='$d_wcstombs'
12845 d_wctomb='$d_wctomb'
12846 d_writev='$d_writev'
12849 db_hashtype='$db_hashtype'
12850 db_prefixtype='$db_prefixtype'
12851 defvoidused='$defvoidused'
12852 direntrytype='$direntrytype'
12855 doublesize='$doublesize'
12857 dynamic_ext='$dynamic_ext'
12863 eunicefix='$eunicefix'
12866 extensions='$extensions'
12868 firstmakefile='$firstmakefile'
12870 fpostype='$fpostype'
12871 freetype='$freetype'
12872 full_csh='$full_csh'
12873 full_sed='$full_sed'
12874 gccversion='$gccversion'
12878 groupcat='$groupcat'
12879 groupstype='$groupstype'
12882 h_sysfile='$h_sysfile'
12886 i_arpainet='$i_arpainet'
12887 i_bsdioctl='$i_bsdioctl'
12890 i_dirent='$i_dirent'
12897 i_inttypes='$i_inttypes'
12898 i_limits='$i_limits'
12899 i_locale='$i_locale'
12900 i_machcthr='$i_machcthr'
12901 i_malloc='$i_malloc'
12903 i_memory='$i_memory'
12904 i_mntent='$i_mntent'
12907 i_neterrno='$i_neterrno'
12911 i_rpcsvcdbm='$i_rpcsvcdbm'
12914 i_stdarg='$i_stdarg'
12915 i_stddef='$i_stddef'
12916 i_stdlib='$i_stdlib'
12917 i_string='$i_string'
12918 i_sysaccess='$i_sysaccess'
12919 i_sysdir='$i_sysdir'
12920 i_sysfile='$i_sysfile'
12921 i_sysfilio='$i_sysfilio'
12923 i_sysioctl='$i_sysioctl'
12924 i_sysmman='$i_sysmman'
12925 i_sysmount='$i_sysmount'
12926 i_sysndir='$i_sysndir'
12927 i_sysparam='$i_sysparam'
12928 i_sysresrc='$i_sysresrc'
12929 i_syssecrt='$i_syssecrt'
12930 i_sysselct='$i_sysselct'
12931 i_syssockio='$i_syssockio'
12932 i_sysstat='$i_sysstat'
12933 i_sysstatvfs='$i_sysstatvfs'
12934 i_systime='$i_systime'
12935 i_systimek='$i_systimek'
12936 i_systimes='$i_systimes'
12937 i_systypes='$i_systypes'
12938 i_sysuio='$i_sysuio'
12940 i_syswait='$i_syswait'
12941 i_termio='$i_termio'
12942 i_termios='$i_termios'
12944 i_unistd='$i_unistd'
12946 i_values='$i_values'
12947 i_varargs='$i_varargs'
12948 i_varhdr='$i_varhdr'
12950 ignore_versioned_solibs='$ignore_versioned_solibs'
12953 installarchlib='$installarchlib'
12954 installbin='$installbin'
12955 installman1dir='$installman1dir'
12956 installman3dir='$installman3dir'
12957 installprivlib='$installprivlib'
12958 installscript='$installscript'
12959 installsitearch='$installsitearch'
12960 installsitelib='$installsitelib'
12961 installusrbinperl='$installusrbinperl'
12963 known_extensions='$known_extensions'
12967 lddlflags='$lddlflags'
12975 libswanted='$libswanted'
12981 locincpth='$locincpth'
12982 loclibpth='$loclibpth'
12983 longdblsize='$longdblsize'
12984 longlongsize='$longlongsize'
12985 longsize='$longsize'
12989 lseeksize='$lseeksize'
12990 lseektype='$lseektype'
12994 make_set_make='$make_set_make'
12995 mallocobj='$mallocobj'
12996 mallocsrc='$mallocsrc'
12997 malloctype='$malloctype'
12999 man1direxp='$man1direxp'
13002 man3direxp='$man3direxp'
13006 mips_type='$mips_type'
13008 mmaptype='$mmaptype'
13010 modetype='$modetype'
13013 myarchname='$myarchname'
13014 mydomain='$mydomain'
13015 myhostname='$myhostname'
13018 netdb_hlen_type='$netdb_hlen_type'
13019 netdb_host_type='$netdb_host_type'
13020 netdb_name_type='$netdb_name_type'
13021 netdb_net_type='$netdb_net_type'
13024 nm_so_opt='$nm_so_opt'
13025 nonxs_ext='$nonxs_ext'
13027 o_nonblock='$o_nonblock'
13029 old_pthread_create_joinable='$old_pthread_create_joinable'
13030 optimize='$optimize'
13031 orderlib='$orderlib'
13037 patchlevel='$patchlevel'
13038 path_sep='$path_sep'
13040 perladmin='$perladmin'
13041 perlpath='$perlpath'
13043 phostname='$phostname'
13049 prefixexp='$prefixexp'
13051 privlibexp='$privlibexp'
13052 prototype='$prototype'
13054 randbits='$randbits'
13055 randfunc='$randfunc'
13056 randseedtype='$randseedtype'
13058 rd_nodata='$rd_nodata'
13062 sched_yield='$sched_yield'
13063 scriptdir='$scriptdir'
13064 scriptdirexp='$scriptdirexp'
13066 seedfunc='$seedfunc'
13067 selectminbits='$selectminbits'
13068 selecttype='$selecttype'
13069 sendmail='$sendmail'
13072 sharpbang='$sharpbang'
13073 shmattype='$shmattype'
13074 shortsize='$shortsize'
13077 sig_name='$sig_name'
13078 sig_name_init='$sig_name_init'
13080 sig_num_init='$sig_num_init'
13081 signal_t='$signal_t'
13082 sitearch='$sitearch'
13083 sitearchexp='$sitearchexp'
13085 sitelibexp='$sitelibexp'
13086 sizetype='$sizetype'
13091 sockethdr='$sockethdr'
13092 socketlib='$socketlib'
13094 spackage='$spackage'
13095 spitshell='$spitshell'
13098 ssizetype='$ssizetype'
13099 startperl='$startperl'
13101 static_ext='$static_ext'
13103 stdio_base='$stdio_base'
13104 stdio_bufsiz='$stdio_bufsiz'
13105 stdio_cnt='$stdio_cnt'
13106 stdio_filbuf='$stdio_filbuf'
13107 stdio_ptr='$stdio_ptr'
13110 subversion='$subversion'
13117 timeincl='$timeincl'
13118 timetype='$timetype'
13126 use64bits='$use64bits'
13128 usemultiplicity='$usemultiplicity'
13129 usemymalloc='$usemymalloc'
13131 useopcode='$useopcode'
13132 useperlio='$useperlio'
13133 useposix='$useposix'
13135 useshrplib='$useshrplib'
13136 usethreads='$usethreads'
13137 usevfork='$usevfork'
13142 voidflags='$voidflags'
13148 : Add in command line options if available
13149 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13151 : add special variables
13152 $test -f $src/patchlevel.h && \
13153 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13154 echo "CONFIG=true" >>config.sh
13156 : propagate old symbols
13157 if $test -f UU/config.sh; then
13158 <UU/config.sh sort | uniq >UU/oldconfig.sh
13159 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13160 sort | uniq -u >UU/oldsyms
13161 set X `cat UU/oldsyms`
13167 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13169 echo "# Variables propagated from previous config.sh file." >>config.sh
13170 for sym in `cat UU/oldsyms`; do
13171 echo " Propagating $hint variable "'$'"$sym..."
13172 eval 'tmp="$'"${sym}"'"'
13174 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13180 : Finish up by extracting the .SH files
13194 If you'd like to make any changes to the config.sh file before I begin
13195 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13198 rp="Press return or use a shell escape to edit config.sh:"
13203 *) : in case they cannot read
13204 sh 1>&4 -c "$ans";;
13209 : if this fails, just run all the .SH files by hand
13216 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
13223 Now you need to generate make dependencies by running "$make depend".
13224 You might prefer to run it in background: "$make depend > makedepend.out &"
13225 It can take a while, so you might not want to run it right now.
13230 rp="Run $make depend now?"
13234 $make depend && echo "Now you must run a $make."
13237 echo "You must run '$make depend' then '$make'."
13240 elif test -f [Mm]akefile; then
13242 echo "Now you must run a $make."
13247 if $test -f Policy.sh; then
13250 If you compile $package on a different machine or from a different object
13251 directory, copy the Policy.sh file from this object directory to the
13252 new one before you run Configure -- this will help you with most of
13253 the policy defaults.
13257 if $test -f config.msg; then
13258 echo "Hmm. I also noted the following information while running:"
13260 $cat config.msg >&4
13263 $rm -f kit*isdone ark*isdone