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 Aug 2 10:49:27 EET DST 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 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
712 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
876 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
879 : We must find out about Eunice early
881 if test -f /etc/unixtovms; then
882 eunicefix=/etc/unixtovms
884 if test -f /etc/unixtovms.exe; then
885 eunicefix=/etc/unixtovms.exe
889 : Possible local include directories to search.
890 : Set locincpth to "" in a hint file to defeat local include searches.
891 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
892 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
894 : no include file wanted by default
897 : list of known cpp symbols, sorted alphabetically
898 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
899 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
900 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
901 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
902 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
903 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
904 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
905 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
906 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
907 al="$al VMS Xenix286"
908 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
909 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
910 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
911 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
912 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
913 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
914 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
915 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
916 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
917 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
918 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
919 al="$al __SVR4_2__ __UMAXV__"
920 al="$al ____386BSD____ __alpha __alpha__ __amiga"
921 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
922 al="$al __host_mips__"
923 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
924 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
925 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
926 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
927 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
928 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
929 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
930 al="$al __mc88100 __mc88100__ __mips __mips__"
931 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
932 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
933 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
934 al="$al _host_mips _mips _unix"
935 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
936 al="$al apollo ardent att386 att3b"
937 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
938 al="$al cadmus clipper concurrent convex cray ctix"
939 al="$al dmert encore gcos gcx gimpel gould"
940 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
941 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
942 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
943 al="$al i186 i286 i386 i486 i8086"
944 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
945 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
946 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
947 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
948 al="$al mc88000 mc88100 merlin mert mips mvs n16"
949 al="$al ncl_el ncl_mr"
950 al="$al news1500 news1700 news1800 news1900 news3700"
951 al="$al news700 news800 news900 ns16000 ns32000"
952 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
953 al="$al parisc pc532 pdp11 plexus posix pyr"
954 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
955 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
956 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
957 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
958 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
959 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
962 : Trailing extension. Override this in a hint file, if needed.
964 : Extra object files, if any, needed on this platform.
967 : change the next line if compiling for Xenix/286 on Xenix/386
968 xlibpth='/usr/lib/386 /lib/386'
970 : Possible local library directories to search.
971 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
972 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
974 : general looking path for locating libraries
975 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
976 glibpth="$glibpth /lib /usr/lib $xlibpth"
977 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
978 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
980 : Private path used by Configure to find libraries. Its value
981 : is prepended to libpth. This variable takes care of special
982 : machines, like the mips. Usually, it should be empty.
985 : default library list
987 : some systems want to use only the non-versioned libso:s
988 ignore_versioned_solibs=''
989 : full support for void wanted by default
992 : set useposix=false in your hint file to disable the POSIX extension.
994 : set useopcode=false in your hint file to disable the Opcode extension.
996 : set usemultiplicity on the Configure command line to enable multiplicity.
997 : set usesocks on the Configure command line to enable socks.
998 : set usethreads on the Configure command line to enable threads.
999 : List of libraries we want.
1000 : If anyone needs -lnet, put it in a hint file.
1001 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1002 libswanted="$libswanted dld ld sun m rt c cposix posix"
1003 libswanted="$libswanted ndir dir crypt sec"
1004 libswanted="$libswanted ucb bsd BSD PW x"
1005 : We probably want to search /usr/shlib before most other libraries.
1006 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1007 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1008 glibpth="/usr/shlib $glibpth"
1009 : Do not use vfork unless overridden by a hint file.
1012 : Find the basic shell for Bourne shell scripts
1016 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1019 if test -f "$xxx"; then
1022 : Build up a list and do a single loop so we can 'break' out.
1023 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1024 for xxx in sh bash ksh pdksh ash; do
1026 try="$try ${p}/${xxx}"
1030 if test -f "$xxx"; then
1033 elif test -f "$xxx.exe"; then
1044 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1046 Usually it's in /bin/sh. How did you even get this far?
1047 Please contact me (Perl Maintainers) at perlbug@perl.com and
1048 we'll try to straighten this all out.
1054 : see if sh knows # comments
1055 if `$sh -c '#' >/dev/null 2>&1`; then
1059 test -f $xcat || xcat=/usr/bin/cat
1064 if test -s today; then
1067 echo "#! $xcat" > try
1071 if test -s today; then
1079 echo "Your $sh doesn't grok # comments--I will strip them later on."
1082 echo "exec grep -v '^[ ]*#'" >spitshell
1084 $eunicefix spitshell
1085 spitshell=`pwd`/spitshell
1087 echo "I presume that if # doesn't work, #! won't work either!"
1092 : figure out how to guarantee sh startup
1094 '') startsh=${sharpbang}${sh} ;;
1106 : echo "Yup, it does."
1108 echo "Hmm... '$startsh' does not guarantee sh startup..."
1109 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1114 : Save command line options in file UU/cmdline.opt for later use in
1115 : generating config.sh.
1116 cat > cmdline.opt <<EOSH
1117 # Configure command line arguments.
1124 cat >>cmdline.opt <<EOSH
1125 config_arg$argn='$arg'
1127 argn=`expr $argn + 1`
1130 : produce awk script to parse command line options
1131 cat >options.awk <<'EOF'
1133 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1135 len = length(optstr);
1136 for (i = 1; i <= len; i++) {
1137 c = substr(optstr, i, 1);
1138 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1149 if (substr(str, 1, 1) != "-") {
1150 printf("'%s'\n", str);
1154 for (i = 2; i <= len; i++) {
1155 c = substr(str, i, 1);
1157 printf("-%s\n", substr(str, i));
1163 printf("'%s'\n", substr(str, i + 1));
1176 : process the command line options
1177 set X `for arg in "$@"; do echo "X$arg"; done |
1178 sed -e s/X// | awk -f options.awk`
1183 : set up default values
1194 cat >optdef.sh <<EOS
1200 while test $# -gt 0; do
1202 -d) shift; fastread=yes;;
1203 -e) shift; alldone=cont;;
1207 if test -r "$1"; then
1210 echo "$me: cannot read config file $1." >&2
1215 -h) shift; error=true;;
1216 -r) shift; reuseval=true;;
1217 -s) shift; silent=true; realsilent=true;;
1218 -E) shift; alldone=exit;;
1219 -K) shift; knowitall=true;;
1220 -O) shift; override=true;;
1221 -S) shift; silent=true; extractsh=true;;
1226 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1227 echo "$me: ignoring -D $1" >&2
1230 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1231 *) echo "$1='define'" >> optdef.sh;;
1238 *=) echo "$1" >> optdef.sh;;
1240 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1241 echo "$me: ignoring -U $1" >&2
1243 *) echo "$1='undef'" >> optdef.sh;;
1247 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1250 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1258 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1259 [-U symbol] [-U symbol=]
1260 -d : use defaults for all answers.
1261 -e : go on without questioning past the production of config.sh.
1262 -f : specify an alternate default configuration file.
1263 -h : print this help message and exit (with an error status).
1264 -r : reuse C symbols value if possible (skips costly nm extraction).
1265 -s : silent mode, only echoes questions and essential information.
1266 -D : define symbol to have some value:
1267 -D symbol symbol gets the value 'define'
1268 -D symbol=value symbol gets the value 'value'
1269 -E : stop at the end of questions, after having produced config.sh.
1270 -K : do not use unless you know what you are doing.
1271 -O : let -D and -U override definitions from loaded configuration file.
1272 -S : perform variable substitutions on all .SH files (can mix with -f)
1273 -U : undefine symbol:
1274 -U symbol symbol gets the value 'undef'
1275 -U symbol= symbol gets completely empty
1276 -V : print version number and exit (with a zero status).
1283 case "$fastread$alldone" in
1286 if test ! -t 0; then
1287 echo "Say 'sh Configure', not 'sh <Configure'"
1295 true) exec 1>/dev/null;;
1298 : run the defines and the undefines, if any, but leave the file out there...
1304 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1305 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1306 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1307 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1308 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1311 : Some greps do not return status, grrr.
1312 echo "grimblepritz" >grimble
1313 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1315 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1321 : the following should work in any shell
1325 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1326 cat >contains <<'EOSS'
1327 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1332 : Find the path to the source tree
1335 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1338 *) src=`cd ../$src && pwd` ;;
1351 if test -f $rsrc/Configure && \
1352 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1354 : found it, so we are ok.
1357 for src in . .. ../.. ../../.. ../../../..; do
1358 if test -f ../$src/Configure && \
1359 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1370 Sorry, I can't seem to locate the source dir for $package. Please start
1371 Configure with an explicit path -- i.e. /some/path/Configure.
1379 echo "Sources for $package found in \"$src\"." >&4
1383 : script used to extract .SH files with variable substitutions
1384 cat >extract <<'EOS'
1386 echo "Doing variable substitutions on .SH files..."
1387 if test -f $src/MANIFEST; then
1388 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1390 echo "(Looking for .SH files under the source directory.)"
1391 set x `(cd $src; find . -name "*.SH" -print)`
1395 0) set x `(cd $src; echo *.SH)`; shift;;
1397 if test ! -f $src/$1; then
1403 while test $name; do
1404 if test ! -d "$name"; then
1405 create="$name $create";
1406 name=`echo $name | sed -e "s|^[^/]*$||"`;
1407 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1412 for file in $create; do
1421 dir=`expr X$file : 'X\(.*\)/'`
1422 file=`expr X$file : 'X.*/\(.*\)'`
1423 (cd $dir && . ./$file)
1433 dir=`expr X$file : 'X\(.*\)/'`
1434 file=`expr X$file : 'X.*/\(.*\)'`
1435 (set x $dir; shift; eval $mkdir_p)
1445 if test -f $src/config_h.SH; then
1446 if test ! -f config.h; then
1447 : oops, they left it out of MANIFEST, probably, so do it anyway.
1453 : extract files and exit if asked to do so
1454 case "$extractsh" in
1456 case "$realsilent" in
1460 case "$config_sh" in
1461 '') config_sh='config.sh';;
1464 echo "Fetching answers from $config_sh..."
1467 test "$override" && . ./optdef.sh
1476 : Eunice requires " " instead of "", can you believe it
1479 echo "Beginning of configuration questions for $package."
1481 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1483 : first determine how to suppress newline on echo command
1485 echo "Checking echo to see how to suppress newlines..."
1486 (echo "hi there\c" ; echo " ") >.echotmp
1487 if $contains c .echotmp >/dev/null 2>&1 ; then
1498 echo $n "The star should be here-->$c"
1502 : Now test for existence of everything in MANIFEST
1504 if test -f $rsrc/MANIFEST; then
1505 echo "First let's make sure your kit is complete. Checking..." >&4
1506 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1509 for filelist in x??; do
1510 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1512 if test -s missing; then
1516 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1518 You have the option of continuing the configuration process, despite the
1519 distinct possibility that your kit is damaged, by typing 'y'es. If you
1520 do, don't blame me if something goes wrong. I advise you to type 'n'o
1521 and contact the author (perlbug@perl.com).
1524 echo $n "Continue? [n] $c" >&4
1528 echo "Continuing..." >&4
1532 echo "ABORTING..." >&4
1537 echo "Looks good..."
1540 echo "There is no MANIFEST file. I hope your kit is complete !"
1545 : Find the appropriate value for a newline for tr
1546 if test -n "$DJGPP"; then
1549 if test X"$trnl" = X; then
1550 case "`echo foo|tr '\n' x 2>/dev/null`" in
1554 if test X"$trnl" = X; then
1555 case "`echo foo|tr '\012' x 2>/dev/null`" in
1556 foox) trnl='\012' ;;
1559 if test X"$trnl" = X; then
1562 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1568 : compute the number of columns on the terminal for proper question formatting
1573 : set up the echo used in my read
1574 myecho="case \"\$xxxm\" in
1575 '') echo $n \"\$rp $c\" >&4;;
1577 '') echo $n \"[\$xxxm] $c\";;
1579 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1581 echo $n \"[\$xxxm] $c\" >&4
1583 echo $n \"\$rp [\$xxxm] $c\" >&4
1589 : now set up to do reads with possible shell escape and default assignment
1595 case "\$fastread" in
1596 yes) case "\$dflt" in
1599 case "\$silent-\$rp" in
1604 *) case "\$silent" in
1605 true) case "\$rp" in
1610 while expr "X\$ans" : "X!" >/dev/null; do
1614 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1622 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1631 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1636 echo "(OK, I'll run with -d after this question.)" >&4
1639 echo "*** Sorry, \$1 not supported yet." >&4
1649 echo "*** Substitution done -- please confirm."
1651 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1656 echo "*** Error -- try again."
1663 case "\$ans\$xxxm\$nostick" in
1675 : create .config dir to save info across Configure sessions
1676 test -d ../.config || mkdir ../.config
1677 cat >../.config/README <<EOF
1678 This directory created by Configure to save information that should
1679 persist across sessions for $package.
1681 You may safely delete it if you wish.
1684 : general instructions
1687 user=`(logname) 2>/dev/null`
1689 '') user=`whoami 2>&1`;;
1691 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1694 rp='Would you like to see the instructions?'
1705 This installation shell script will examine your system and ask you questions
1706 to determine how the perl5 package should be installed. If you get
1707 stuck on a question, you may use a ! shell escape to start a subshell or
1708 execute a command. Many of the questions will have default answers in square
1709 brackets; typing carriage return will give you the default.
1711 On some of the questions which ask for file or directory names you are allowed
1712 to use the ~name construct to specify the login directory belonging to "name",
1713 even if you don't have a shell which knows about that. Questions where this is
1714 allowed will be marked "(~name ok)".
1718 dflt='Type carriage return to continue'
1722 The prompter used in this script allows you to use shell variables and
1723 backticks in your answers. You may use $1, $2, etc... to refer to the words
1724 in the default answer, as if the default line was a set of arguments given to a
1725 script shell. This means you may also use $* to repeat the whole default line,
1726 so you do not have to re-type everything to add something to the default.
1728 Everytime there is a substitution, you will have to confirm. If there is an
1729 error (e.g. an unmatched backtick), the default answer will remain unchanged
1730 and you will be prompted again.
1732 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1733 the questions and use the computed defaults (or the previous answers if there
1734 was already a config.sh file). Type 'Configure -h' for a list of options.
1735 You may also start interactively and then answer '& -d' at any prompt to turn
1736 on the non-interactive behaviour for the remainder of the execution.
1742 Much effort has been expended to ensure that this shell script will run on any
1743 Unix system. If despite that it blows up on yours, your best bet is to edit
1744 Configure and run it again. If you can't run Configure for some reason,
1745 you'll have to generate a config.sh file by hand. Whatever problems you
1746 have, let me (perlbug@perl.com) know how I blew it.
1748 This installation script affects things in two ways:
1750 1) it may do direct variable substitutions on some of the files included
1752 2) it builds a config.h file for inclusion in C programs. You may edit
1753 any of these files as the need arises after running this script.
1755 If you make a mistake on a question, there is no easy way to back up to it
1756 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1757 files. Configure will offer to let you do this before it runs the SH files.
1760 dflt='Type carriage return to continue'
1762 case "$firsttime" in
1763 true) echo $user >>../.config/instruct;;
1767 : find out where common programs are
1769 echo "Locating common programs..." >&4
1782 if test -d \$dir/\$thing; then
1788 for thisthing in \$dir/\$thing; do
1789 : just loop through to pick last item
1791 if test -f \$thisthing; then
1794 elif test -f \$dir/\$thing.exe; then
1795 if test -n "$DJGPP"; then
1796 echo \$dir/\$thing.exe
1798 : on Eunice apparently
1848 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1849 pth="$pth /lib /usr/lib"
1850 for file in $loclist; do
1854 if test -f "$xxx"; then
1857 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1858 xxx=`./loc $file $file $pth`
1861 '') xxx=`./loc $file $file $pth`;;
1862 *) xxx=`./loc $xxx $xxx $pth`;;
1868 echo $file is in $xxx.
1871 echo $file is in $xxx.
1874 echo "I don't know where '$file' is, and my life depends on it." >&4
1875 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1881 echo "Don't worry if any of the following aren't found..."
1883 for file in $trylist; do
1887 if test -f "$xxx"; then
1890 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1891 xxx=`./loc $file $file $pth`
1894 '') xxx=`./loc $file $file $pth`;;
1895 *) xxx=`./loc $xxx $xxx $pth`;;
1901 echo $file is in $xxx.
1904 echo $file is in $xxx.
1907 echo "I don't see $file out there, $say."
1914 echo "Substituting grep for egrep."
1920 echo "Substituting cp for ln."
1926 echo "Hopefully test is built into your sh."
1929 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1930 echo "Using the test built into your sh."
1938 echo "Hopefully echo is built into your sh."
1943 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1944 $echo $n "hi there$c" >foo1
1945 echo $n "hi there$c" >foo2
1946 if cmp foo1 foo2 >/dev/null 2>&1; then
1947 echo "They are compatible. In fact, they may be identical."
1954 They are not compatible! You are probably running ksh on a non-USG system.
1955 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1956 have echo built in and we may have to run some Bourne shell scripts. That
1957 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1960 $echo $n "The star should be here-->$c"
1967 : determine whether symbolic links are supported
1970 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1971 echo "Symbolic links are supported." >&4
1974 echo "Symbolic links are NOT supported." >&4
1979 : see whether [:lower:] and [:upper:] are supported character classes
1981 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1983 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1987 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1988 # (0xc9 and 0xd1), therefore that is a nice testing point.
1989 if test "X$up" = X -o "X$low" = X; then
1990 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1996 if test "X$up" = X -o "X$low" = X; then
1997 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2003 if test "X$up" = X -o "X$low" = X; then
2004 case "`echo IJ | od -x 2>/dev/null`" in
2006 echo "Hey, this might be EBCDIC." >&4
2007 if test "X$up" = X -o "X$low" = X; then
2008 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2009 ij) up='[A-IJ-RS-Z]'
2014 if test "X$up" = X -o "X$low" = X; then
2015 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2025 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2027 echo "Using $up and $low to convert case." >&4
2030 echo "I don't know how to translate letters from upper to lower case." >&4
2031 echo "Your tr is not acting any way I know of." >&4
2035 : set up the translation script tr, must be called with ./tr of course
2039 '[A-Z][a-z]') exec $tr '$up' '$low';;
2040 '[a-z][A-Z]') exec $tr '$low' '$up';;
2047 : Try to determine whether config.sh was made on this system
2048 case "$config_sh" in
2050 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2051 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2052 # because the A-Z/a-z are not consecutive.
2053 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2054 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2055 newmyuname="$myuname"
2057 case "$knowitall" in
2059 if test -f ../config.sh; then
2060 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2061 eval "`grep myuname= ../config.sh`"
2063 if test "X$myuname" = "X$newmyuname"; then
2071 : Get old answers from old config file if Configure was run on the
2072 : same system, otherwise use the hints.
2075 if test -f config.sh; then
2077 rp="I see a config.sh file. Shall I use it to set the defaults?"
2080 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2081 *) echo "Fetching default answers from your old config.sh file..." >&4
2089 : Older versions did not always set $sh. Catch re-use of such
2098 if test ! -f config.sh; then
2101 First time through, eh? I have some defaults handy for some systems
2102 that need some extra help getting the Configure answers right:
2105 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2107 : Half the following guesses are probably wrong... If you have better
2108 : tests or hints, please send them to perlbug@perl.com
2109 : The metaconfig authors would also appreciate a copy...
2110 $test -f /irix && osname=irix
2111 $test -f /xenix && osname=sco_xenix
2112 $test -f /dynix && osname=dynix
2113 $test -f /dnix && osname=dnix
2114 $test -f /lynx.os && osname=lynxos
2115 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2116 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2117 $test -f /bin/mips && /bin/mips && osname=mips
2118 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2119 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2120 $test -d /usr/apollo/bin && osname=apollo
2121 $test -f /etc/saf/_sactab && osname=svr4
2122 $test -d /usr/include/minix && osname=minix
2123 if $test -d /MachTen -o -d /MachTen_Folder; then
2125 if $test -x /sbin/version; then
2126 osvers=`/sbin/version | $awk '{print $2}' |
2127 $sed -e 's/[A-Za-z]$//'`
2128 elif $test -x /usr/etc/version; then
2129 osvers=`/usr/etc/version | $awk '{print $2}' |
2130 $sed -e 's/[A-Za-z]$//'`
2135 $test -f /sys/posix.dll &&
2136 $test -f /usr/bin/what &&
2137 set X `/usr/bin/what /sys/posix.dll` &&
2138 $test "$3" = UWIN &&
2141 if $test -f $uname; then
2149 umips) osname=umips ;;
2152 [23]100) osname=mips ;;
2153 next*) osname=next ;;
2155 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2156 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2159 elif $test -f /etc/kconfig; then
2161 if test "$lns" = "$ln -s"; then
2163 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2165 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2172 if test -n "$DJGPP"; then
2181 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2183 'not found') osvers="$4"."$3" ;;
2184 '<3240'|'<>3240') osvers=3.2.0 ;;
2185 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2186 '=3250'|'>3250') osvers=3.2.5 ;;
2190 *dc.osx) osname=dcosx
2196 domainos) osname=apollo
2202 dynixptx*) osname=dynixptx
2203 osvers=`echo "$4"|sed 's/^v//'`
2205 freebsd) osname=freebsd
2207 genix) osname=genix ;;
2209 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2225 netbsd*) osname=netbsd
2228 news-os) osvers="$3"
2230 4*) osname=newsos4 ;;
2234 bsd386) osname=bsd386
2237 POSIX-BC | posix-bc ) osname=posix-bc
2240 powerux | power_ux | powermax_os | powermaxos | \
2241 powerunix | power_unix) osname=powerux
2244 next*) osname=next ;;
2245 solaris) osname=solaris
2247 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2254 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2258 titanos) osname=titanos
2267 ultrix) osname=ultrix
2270 osf1|mls+) case "$5" in
2273 osvers=`echo "$3" | sed 's/^[xvt]//'`
2275 hp*) osname=hp_osf1 ;;
2276 mips) osname=mips_osf1 ;;
2285 $2) case "$osname" in
2289 : svr4.x or possibly later
2299 if test -f /stand/boot ; then
2300 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2301 if test -n "$INITPROG" -a -f "$INITPROG"; then
2302 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2303 if test -n "$isesix"; then
2311 *) if test -f /etc/systemid; then
2313 set `echo $3 | $sed 's/\./ /g'` $4
2314 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2316 elif $test -f $src/hints/sco_$1_$2.sh; then
2318 elif $test -f $src/hints/sco_$1.sh; then
2323 '') : Still unknown. Probably a generic Sys V.
2332 *) case "$osname" in
2333 '') : Still unknown. Probably a generic BSD.
2341 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2342 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2343 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2346 $rm -f UU/kernel.what
2347 elif test -d c:/.; then
2354 : Now look for a hint file osname_osvers, unless one has been
2355 : specified already.
2358 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2359 : Also try without trailing minor version numbers.
2360 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2361 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2362 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2363 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2366 *) case "$osvers" in
2369 *) if $test -f $src/hints/$file.sh ; then
2371 elif $test -f $src/hints/$xfile.sh ; then
2373 elif $test -f $src/hints/$xxfile.sh ; then
2375 elif $test -f $src/hints/$xxxfile.sh ; then
2377 elif $test -f $src/hints/$xxxxfile.sh ; then
2379 elif $test -f "$src/hints/${osname}.sh" ; then
2388 if $test -f Policy.sh ; then
2391 none) dflt="Policy" ;;
2392 *) dflt="Policy $dflt" ;;
2397 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2401 if $test -f Policy.sh ; then
2404 There's also a Policy hint file available, which should make the
2405 site-specific (policy) questions easier to answer.
2412 You may give one or more space-separated answers, or "none" if appropriate.
2413 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2414 is a good thing. DO NOT give a wrong version or a wrong OS.
2418 rp="Which of these apply, if any?"
2421 for file in $tans; do
2422 if $test X$file = XPolicy -a -f Policy.sh; then
2424 $cat Policy.sh >> UU/config.sh
2425 elif $test -f $src/hints/$file.sh; then
2426 . $src/hints/$file.sh
2427 $cat $src/hints/$file.sh >> UU/config.sh
2428 elif $test X$tans = X -o X$tans = Xnone ; then
2431 : Give one chance to correct a possible typo.
2432 echo "$file.sh does not exist"
2434 rp="hint to use instead?"
2436 for file in $ans; do
2437 if $test -f "$src/hints/$file.sh"; then
2438 . $src/hints/$file.sh
2439 $cat $src/hints/$file.sh >> UU/config.sh
2440 elif $test X$ans = X -o X$ans = Xnone ; then
2443 echo "$file.sh does not exist -- ignored."
2450 : Remember our hint file for later.
2451 if $test -f "$src/hints/$file.sh" ; then
2461 echo "Fetching default answers from $config_sh..." >&4
2465 cp $config_sh config.sh 2>/dev/null
2475 test "$override" && . ./optdef.sh
2476 myuname="$newmyuname"
2478 : Restore computed paths
2479 for file in $loclist $trylist; do
2480 eval $file="\$_$file"
2485 Configure uses the operating system name and version to set some defaults.
2486 The default value is probably right if the name rings a bell. Otherwise,
2487 since spelling matters for me, either accept the default or answer "none"
2494 ''|' '|none) dflt=none ;;
2495 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2498 *) dflt="$osname" ;;
2500 rp="Operating system name?"
2504 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2510 ''|' '|none) dflt=none ;;
2511 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2512 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2514 ''|' ') dflt=none ;;
2519 *) dflt="$osvers" ;;
2521 rp="Operating system version?"
2528 : who configured the system
2529 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2530 cf_by=`(logname) 2>/dev/null`
2533 cf_by=`(whoami) 2>/dev/null`
2535 "") cf_by=unknown ;;
2539 : set up the script used to warn in case of inconsistency
2546 echo "*** WHOA THERE!!! ***" >&4
2547 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2548 rp=" Keep the $hint value?"
2551 y) td=$was; tu=$was;;
2555 : function used to set $1 to $val
2556 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2558 $define$undef) . ./whoa; eval "$var=\$td";;
2559 $undef$define) . ./whoa; eval "$var=\$tu";;
2560 *) eval "$var=$val";;
2565 Perl can be built to take advantage of threads, on some systems.
2566 To do so, Configure must be run with -Dusethreads.
2568 Note that threading is a highly experimental feature, and
2569 some known race conditions still remain. If you choose to try
2570 it, be very sure to not actually deploy it for production
2571 purposes. README.threads has more details, and is required
2572 reading if you enable threads.
2574 case "$usethreads" in
2575 $define|true|[yY]*) dflt='y';;
2578 rp='Build a threading Perl?'
2581 y|Y) val="$define" ;;
2587 case "$d_oldpthreads" in
2588 '') : Configure tests would be welcome here. For now, assume undef.
2590 *) val="$d_oldpthreads" ;;
2596 case "$usethreads" in
2597 "$define"|true|[yY]*)
2598 : Look for a hint-file generated 'call-back-unit'. If the
2599 : user has specified that a threading perl is to be built,
2600 : we may need to set or change some other defaults.
2601 if $test -f usethreads.cbu; then
2602 echo "Your platform has some specific hints for threaded builds, using them..."
2606 (Your platform doesn't have any specific hints for threaded builds.
2607 Assuming POSIX threads, then.)
2615 Perl can be built so that multiple Perl interpreters can coexist
2616 within the same Perl executable. To do so, Configure must be run with
2619 Normally you do not need this and you should answer no.
2622 case "$usemultiplicity" in
2623 $define|true|[yY]*) dflt='y';;
2626 rp='Build Perl for multiplicity?'
2629 y|Y) val="$define" ;;
2635 : determine where manual pages are on this system
2639 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2640 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2641 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2642 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2643 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2644 sysman=`./loc . /usr/man/man1 $syspath`
2647 if $test -d "$sysman"; then
2648 echo "System manual is in $sysman." >&4
2650 echo "Could not find manual pages in source form." >&4
2653 : see what memory models we can support
2656 $cat >pdp11.c <<'EOP'
2665 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2666 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2667 dflt='unsplit split'
2669 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2672 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2677 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2680 if $test -d /lib/large || $test -d /usr/lib/large; then
2683 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2692 Some systems have different model sizes. On most systems they are called
2693 small, medium, large, and huge. On the PDP11 they are called unsplit and
2694 split. If your system doesn't support different memory models, say "none".
2695 If you wish to force everything to one memory model, say "none" here and
2696 put the appropriate flags later when it asks you for other cc and ld flags.
2697 Venix systems may wish to put "none" and let the compiler figure things out.
2698 (In the following question multiple model names should be space separated.)
2700 The default for most systems is "none".
2703 rp="Which memory models are supported?"
2718 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2719 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2726 rp="What flag indicates separate I and D space?"
2734 *large*|*small*|*medium*|*huge*)
2741 rp="What flag indicates large model?"
2751 *huge*) case "$huge" in
2755 rp="What flag indicates huge model?"
2765 *medium*) case "$medium" in
2769 rp="What flag indicates medium model?"
2776 *) medium="$large";;
2779 *small*) case "$small" in
2783 rp="What flag indicates small model?"
2794 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2797 $rm -f pdp11.* pdp11
2799 : make some quick guesses about what we are up against
2801 $echo $n "Hmm... $c"
2811 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2812 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2814 echo "Looks kind of like an OSF/1 system, but we'll see..."
2816 elif test `echo abc | tr a-z A-Z` = Abc ; then
2817 xxx=`./loc addbib blurfl $pth`
2818 if $test -f $xxx; then
2819 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2823 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2824 echo "Looks kind of like an extended USG system, but we'll see..."
2826 echo "Looks kind of like a USG system, but we'll see..."
2830 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2831 echo "Looks kind of like a BSD system, but we'll see..."
2835 echo "Looks kind of like a Version 7 system, but we'll see..."
2838 case "$eunicefix" in
2841 There is, however, a strange, musty smell in the air that reminds me of
2842 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2846 : it so happens the Eunice I know will not run shell scripts in Unix format
2850 echo "Congratulations. You aren't running Eunice."
2854 : Detect OS2. The p_ variable is set above in the Head.U unit.
2859 I have the feeling something is not exactly right, however...don't tell me...
2860 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2865 if test -f /xenix; then
2866 echo "Actually, this looks more like a XENIX system..."
2871 echo "It's not Xenix..."
2876 if test -f /venix; then
2877 echo "Actually, this looks more like a VENIX system..."
2884 echo "Nor is it Venix..."
2887 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2888 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2891 : see if we need a special compiler
2899 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2900 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2914 On some older systems the default C compiler will not resolve multiple global
2915 references that happen to have the same name. On some such systems the "Mcc"
2916 command may be used to force these to be resolved. On other systems a "cc -M"
2917 command is required. (Note that the -M flag on other systems indicates a
2918 memory model to use!) If you have the Gnu C compiler, you might wish to use
2924 rp="Use which C compiler?"
2932 rp="Use which C compiler?"
2936 : Look for a hint-file generated 'call-back-unit'. Now that the
2937 : user has specified the compiler, we may need to set or change some
2939 if $test -f cc.cbu; then
2943 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2944 $cat >gccvers.c <<EOM
2949 printf("%s\n", __VERSION__);
2951 printf("%s\n", "1");
2957 if $cc -o gccvers gccvers.c; then
2958 gccversion=`./gccvers`
2959 case "$gccversion" in
2960 '') echo "You are not using GNU cc." ;;
2961 *) echo "You are using GNU cc $gccversion." ;;
2965 echo "*** WHOA THERE!!! ***" >&4
2966 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2967 case "$knowitall" in
2969 echo " You'd better start hunting for one and let me know about it." >&4
2975 case "$gccversion" in
2976 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2981 Perl can be built to take advantage of explicit 64-bit interfaces,
2982 on some systems. To do so, Configure must be run with -Duse64bits.
2984 If this doesn't make any sense to you, just accept the default 'n'.
2986 case "$use64bits" in
2987 $define|true|[yY]*) dflt='y';;
2990 rp='Try to use explicit 64-bit interfaces, if available?'
3003 case "$archname64" in
3004 '') archname64='' ;; # not a typo
3007 case "$use64bits" in
3008 "$define"|true|[yY]*)
3009 : Look for a hint-file generated 'call-back-unit'. If the
3010 : user has specified that a 64 bit perl is to be built,
3011 : we may need to set or change some other defaults.
3012 if $test -f use64bits.cbu; then
3013 echo "Your platform has some specific hints for 64-bit builds, using them..."
3017 (Your platform doesn't have any specific hints for 64-bit builds.
3018 This is probably okay, especially if your system is a true 64-bit system.)
3020 case "$gccversion" in
3023 But since you seem to be using gcc,
3024 I will now add -DUSE_LONG_LONG to the compilation flags.
3026 ccflags="$ccflags -DUSE_LONG_LONG"
3033 : determine the architecture name
3035 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3036 tarch=`arch`"-$osname"
3037 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3038 if uname -m > tmparch 2>&1 ; then
3039 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3040 -e 's/$/'"-$osname/" tmparch`
3048 case "$myarchname" in
3051 echo "(Your architecture name used to be $myarchname.)"
3058 *) dflt="$archname";;
3060 rp='What is your architecture name'
3063 case "$usethreads" in
3065 echo "Threads selected." >&4
3067 *-thread*) echo "...and architecture name already has -thread." >&4
3069 *) archname="$archname-thread"
3070 echo "...setting architecture name to $archname." >&4
3075 case "$usemultiplicity" in
3077 echo "Multiplicity selected." >&4
3079 *-multi*) echo "...and architecture name already has -multi." >&4
3081 *) archname="$archname-multi"
3082 echo "...setting architecture name to $archname." >&4
3087 case "$use64bits" in
3089 echo "Explicit 64-bitness selected." >&4
3090 case "$archname64" in
3095 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3097 *) archname="$archname-$archname64"
3098 echo "...setting architecture name to $archname." >&4
3105 : decide how portable to be. Allow command line overrides.
3106 case "$d_portable" in
3108 *) d_portable="$define" ;;
3111 : set up shell script to do ~ expansion
3117 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3120 if $test -f /bin/csh; then
3121 /bin/csh -f -c "glob \$1"
3126 name=\`$expr x\$1 : '..\([^/]*\)'\`
3127 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3128 if $test ! -d "\$dir"; then
3130 echo "\$me: can't locate home directory for: \$name" >&2
3135 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3151 : now set up to get a file name
3155 cat <<'EOSC' >>getfile
3171 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3172 fn=`echo $fn | sed 's/(.*)//'`
3178 loc_file=`expr $fn : '.*:\(.*\)'`
3179 fn=`expr $fn : '\(.*\):.*'`
3187 */*) fullpath=true;;
3196 *e*) exp_file=true;;
3199 *p*) nopath_ok=true;;
3204 *d*) type='Directory';;
3205 *l*) type='Locate';;
3210 Locate) what='File';;
3215 case "$d_portable" in
3223 while test "$type"; do
3228 true) rp="$rp (~name ok)";;
3231 if test -f UU/getfile.ok && \
3232 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3251 value=`UU/filexp $ans`
3254 if test "$ans" != "$value"; then
3255 echo "(That expands to $value on this system.)"
3269 /*) value="$ansexp" ;;
3274 echo "I shall only accept a full path name, as in /bin/ls." >&4
3275 echo "Use a ! shell escape if you wish to check pathnames." >&4
3278 echo "Please give a full path name, starting with slash." >&4
3281 echo "Note that using ~name is ok provided it expands well." >&4
3294 for fp in $gfpth; do
3295 if test "X$fp" = X.; then
3300 if test -f "$pf"; then
3302 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3304 echo "($value is not a plain file, but that's ok.)"
3307 if test X"$type" = X; then
3314 for fp in $gfpth; do
3315 if test "X$fp" = X.; then
3320 if test -d "$pf"; then
3328 if test -d "$ansexp"; then
3329 echo "(Looking for $loc_file in directory $value.)"
3330 value="$value/$loc_file"
3331 ansexp="$ansexp/$loc_file"
3333 if test -f "$ansexp"; then
3336 case "$nopath_ok" in
3337 true) case "$value" in
3339 *) echo "Assuming $value will be in people's path."
3355 if test "$fastread" = yes; then
3360 rp="$what $value doesn't exist. Use that name anyway?"
3379 test "X$gfpthkeep" != Xy && gfpth=""
3382 : determine root of directory hierarchy where package will be installed.
3385 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3393 By default, $package will be installed in $dflt/bin, manual pages
3394 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3395 installation directories. Typically this is something like /usr/local.
3396 If you wish to have binaries under /usr/bin but other parts of the
3397 installation under /usr/local, that's ok: you will be prompted
3398 separately for each of the installation directories, the prefix being
3399 only used to set the defaults.
3403 rp='Installation prefix to use?'
3411 *) oldprefix="$prefix";;
3421 $define|true) afs=true ;;
3422 $undef|false) afs=false ;;
3423 *) if test -d /afs; then
3431 echo "AFS may be running... I'll be extra cautious then..." >&4
3433 echo "AFS does not seem to be running..." >&4
3436 : determine installation prefix for where package is to be installed.
3440 Since you are running AFS, I need to distinguish the directory in which
3441 files will reside from the directory in which they are installed (and from
3442 which they are presumably copied to the former directory by occult means).
3445 case "$installprefix" in
3446 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3447 *) dflt="$installprefix";;
3452 In some special cases, particularly when building $package for distribution,
3453 it is convenient to distinguish between the directory in which files should
3454 be installed from the directory ($prefix) in which they
3455 will eventually reside. For most users, these two directories are the same.
3458 case "$installprefix" in
3460 *) dflt=$installprefix;;
3464 rp='What installation prefix should I use for installing files?'
3466 installprefix="$ans"
3467 installprefixexp="$ansexp"
3469 : set the prefixit variable, to compute a suitable default value
3470 prefixit='case "$3" in
3472 case "$oldprefix" in
3473 "") eval "$1=\"\$$2\"";;
3480 ""|" ") eval "$1=\"\$$2\"";;
3486 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3488 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3489 /*-$oldprefix/*|\~*-$oldprefix/*)
3490 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3491 *) eval "$1=\"\$$2\"";;
3495 : set the base revision
3498 : get the patchlevel
3500 echo "Getting the current patchlevel..." >&4
3501 if $test -r $rsrc/patchlevel.h;then
3502 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3503 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3508 $echo $n "(You have $package" $c
3511 *) $echo $n " $baserev" $c ;;
3513 $echo $n " patchlevel $patchlevel" $c
3514 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3517 if test 0 -eq "$subversion"; then
3518 version=`LC_ALL=C; export LC_ALL; \
3519 echo $baserev $patchlevel | \
3520 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3522 version=`LC_ALL=C; export LC_ALL; \
3523 echo $baserev $patchlevel $subversion | \
3524 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3526 : Figure out perl API version. Perhaps this should be in patchlevel.h
3527 if test "$subversion" -lt 50; then
3528 apiversion=`LC_ALL=C; export LC_ALL; \
3529 LANGUAGE=C; export LANGUAGE; \
3530 echo $baserev $patchlevel | \
3531 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3533 apiversion="$version"
3536 : determine installation style
3537 : For now, try to deduce it from prefix unless it is already set.
3538 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3539 case "$installstyle" in
3540 '') case "$prefix" in
3541 *perl*) dflt='lib';;
3542 *) dflt='lib/perl5' ;;
3545 *) dflt='lib/perl5' ;;
3547 : Probably not worth prompting for this since we prompt for all
3548 : the directories individually, and the prompt would be too long and
3552 : determine where private library files go
3553 : Usual default is /usr/local/lib/perl5/$version.
3554 : Also allow things like /opt/perl/lib/$version, since
3555 : /opt/perl/lib/perl5... would be redundant.
3556 : The default "style" setting is made in installstyle.U
3557 case "$installstyle" in
3558 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3559 *) set dflt privlib lib/$version ;;
3564 There are some auxiliary files for $package that need to be put into a
3565 private library directory that is accessible by everyone.
3569 rp='Pathname where the private library files will reside?'
3572 privlibexp="$ansexp"
3573 : Change installation prefix, if necessary.
3574 if $test X"$prefix" != X"$installprefix"; then
3575 installprivlib=`echo $privlibexp | sed 's#^$prefix#$installprefix#'`
3577 installprivlib="$privlibexp"
3580 : set the prefixup variable, to restore leading tilda escape
3581 prefixup='case "$prefixexp" in
3583 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3586 : determine where public architecture dependent libraries go
3589 : privlib default is /usr/local/lib/$package/$version
3590 : archlib default is /usr/local/lib/$package/$version/$archname
3591 : privlib may have an optional trailing /share.
3592 tdflt=`echo $privlib | $sed 's,/share$,,'`
3593 tdflt=$tdflt/$archname
3602 $spackage contains architecture-dependent library files. If you are
3603 sharing libraries in a heterogeneous environment, you might store
3604 these files in a separate location. Otherwise, you can just include
3605 them with the rest of the public library files.
3609 rp='Where do you want to put the public architecture-dependent libraries?'
3612 archlibexp="$ansexp"
3613 if $test X"$archlib" = X"$privlib"; then
3618 : Change installation prefix, if necessary.
3619 if $test X"$prefix" != X"$installprefix"; then
3620 installarchlib=`echo $archlibexp | sed 's#^$prefix#$installprefix#'`
3622 installarchlib="$archlibexp"
3626 : Binary compatibility with 5.005 is not possible for builds
3627 : with advanced features
3628 case "$usethreads$usemultiplicity" in
3630 bincompat5005="$undef"
3631 d_bincompat5005="$undef"
3635 Perl 5.006 can be compiled for binary compatibility with 5.005.
3636 If you decide to do so, you will be able to continue using most
3637 of the extensions that were compiled for Perl 5.005.
3640 case "$bincompat5005$d_bincompat5005" in
3641 *"$undef"*) dflt=n ;;
3644 rp='Binary compatibility with Perl 5.005?'
3647 y*) val="$define" ;;
3652 case "$d_bincompat5005" in
3654 bincompat5005="$define"
3656 *) bincompat5005="$undef"
3657 d_bincompat5005="$undef"
3664 : see if setuid scripts can be secure
3667 Some kernels have a bug that prevents setuid #! scripts from being
3668 secure. Some sites have disabled setuid #! scripts because of this.
3670 First let's decide if your kernel supports secure setuid #! scripts.
3671 (If setuid #! scripts would be secure but have been disabled anyway,
3672 don't say that they are secure if asked.)
3677 if $test -d /dev/fd; then
3678 echo "#!$ls" >reflect
3679 chmod +x,u+s reflect
3680 ./reflect >flect 2>&1
3681 if $contains "/dev/fd" flect >/dev/null; then
3682 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3686 If you are not sure if they are secure, I can check but I'll need a
3687 username and password different from the one you are using right now.
3688 If you don't have such a username or don't want me to test, simply
3692 rp='Other username to test security of setuid scripts with?'
3697 case "$d_suidsafe" in
3698 '') echo "I'll assume setuid scripts are *not* secure." >&4
3701 echo "Well, the $hint value is *not* secure." >&4
3703 *) echo "Well, the $hint value *is* secure." >&4
3708 $rm -f reflect flect
3709 echo "#!$ls" >reflect
3710 chmod +x,u+s reflect
3713 echo '"su" will (probably) prompt you for '"$ans's password."
3714 su $ans -c './reflect >flect'
3715 if $contains "/dev/fd" flect >/dev/null; then
3716 echo "Okay, it looks like setuid scripts are secure." >&4
3719 echo "I don't think setuid scripts are secure." >&4
3724 rp='Does your kernel have *secure* setuid scripts?'
3727 [yY]*) val="$define";;
3732 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3733 echo "(That's for file descriptors, not floppy disks.)"
3739 $rm -f reflect flect
3741 : now see if they want to do setuid emulation
3744 case "$d_suidsafe" in
3747 echo "No need to emulate SUID scripts since they are secure here." >& 4
3751 Some systems have disabled setuid scripts, especially systems where
3752 setuid scripts cannot be secure. On systems where setuid scripts have
3753 been disabled, the setuid/setgid bits on scripts are currently
3754 useless. It is possible for $package to detect those bits and emulate
3755 setuid/setgid in a secure fashion. This emulation will only work if
3756 setuid scripts have been disabled in your kernel.
3760 "$define") dflt=y ;;
3763 rp="Do you want to do setuid/setgid emulation?"
3766 [yY]*) val="$define";;
3774 : What should the include directory be ?
3776 $echo $n "Hmm... $c"
3780 if $test -f /bin/mips && /bin/mips; then
3781 echo "Looks like a MIPS system..."
3782 $cat >usr.c <<'EOCP'
3783 #ifdef SYSTYPE_BSD43
3787 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3788 dflt='/bsd43/usr/include'
3792 mips_type='System V'
3794 $rm -f usr.c usr.out
3795 echo "and you're compiling with the $mips_type compiler and libraries."
3799 echo "Doesn't look like a MIPS system."
3809 case "$xxx_prompt" in
3812 rp='Where are the include files you want to use?'
3820 : see how we invoke the C preprocessor
3822 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3823 cat <<'EOT' >testcpp.c
3829 if test ! -f cppstdin; then
3830 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3832 echo "Keeping your $hint cppstdin wrapper."
3835 wrapper=`pwd`/cppstdin
3839 if $test "X$cppstdin" != "X" && \
3840 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3841 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3843 echo "You used to use $cppstdin $cppminus so we'll use that again."
3845 '') echo "But let's see if we can live without a wrapper..." ;;
3847 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3850 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3853 echo "(However, $cpprun $cpplast does not work, let's see...)"
3861 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3868 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3869 $cc -E <testcpp.c >testcpp.out 2>&1; \
3870 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3871 echo "Yup, it does."
3874 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3875 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3876 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3877 echo "Yup, it does."
3880 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3881 $cc -P <testcpp.c >testcpp.out 2>&1; \
3882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3883 echo "Yipee, that works!"
3886 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3887 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3888 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3889 echo "At long last!"
3892 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3893 $cpp <testcpp.c >testcpp.out 2>&1; \
3894 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3898 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3899 $cpp - <testcpp.c >testcpp.out 2>&1; \
3900 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3901 echo "Hooray, it works! I was beginning to wonder."
3904 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3905 $wrapper <testcpp.c >testcpp.out 2>&1; \
3906 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3912 rp="No dice. I can't find a C preprocessor. Name one:"
3916 $x_cpp <testcpp.c >testcpp.out 2>&1
3917 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3918 echo "OK, that will do." >&4
3920 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3935 echo "Perhaps can we force $cc -E using a wrapper..."
3936 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3937 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3943 echo "Nope, we'll have to live without it..."
3957 "$wrapper"|'cppstdin') ;;
3958 *) $rm -f $wrapper;;
3960 $rm -f testcpp.c testcpp.out
3962 : Set private lib path
3965 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3970 '') dlist="$loclibpth $plibpth $glibpth";;
3971 *) dlist="$libpth";;
3974 : Now check and see which directories actually exist, avoiding duplicates
3978 if $test -d $xxx; then
3981 *) libpth="$libpth $xxx";;
3987 Some systems have incompatible or broken versions of libraries. Among
3988 the directories listed in the question below, please remove any you
3989 know not to be holding relevant libraries, and add any that are needed.
3990 Say "none" for none.
4001 rp="Directories to use for library searches?"
4008 : compute shared library extension
4011 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4021 On some systems, shared libraries may be available. Answer 'none' if
4022 you want to suppress searching of shared libraries for the remaining
4023 of this configuration.
4026 rp='What is the file extension used for shared libraries?'
4030 : Define several unixisms.
4031 : Hints files or command line option can be used to override them.
4032 : The convoluted testing is in case hints files set either the old
4035 '') case "$exe_ext" in
4037 *) _exe="$exe_ext" ;;
4042 '') case "$lib_ext" in
4049 '') case "$obj_ext" in
4056 '') case "$path_sep" in
4067 : Which makefile gets called first. This is used by make depend.
4068 case "$firstmakefile" in
4069 '') firstmakefile='makefile';;
4074 Perl can be built to use the SOCKS proxy protocol library. To do so,
4075 Configure must be run with -Dusesocks.
4077 Normally you do not need this and you should answer no.
4081 $define|true|[yY]*) dflt='y';;
4084 rp='Build Perl for SOCKS?'
4087 y|Y) val="$define" ;;
4093 : Looking for optional libraries
4095 echo "Checking for optional libraries..." >&4
4100 case "$libswanted" in
4101 '') libswanted='c_s';;
4105 libswanted="$libswanted socks5 socks5_sh"
4108 for thislib in $libswanted; do
4110 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4111 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4112 echo "Found -l$thislib (shared)."
4115 *) dflt="$dflt -l$thislib";;
4117 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4118 echo "Found -l$thislib (shared)."
4121 *) dflt="$dflt -l$thislib";;
4123 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4124 echo "Found -l$thislib."
4127 *) dflt="$dflt -l$thislib";;
4129 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4130 echo "Found -l$thislib."
4133 *) dflt="$dflt -l$thislib";;
4135 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4136 echo "Found -l${thislib}_s."
4139 *) dflt="$dflt -l${thislib}_s";;
4141 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4142 echo "Found -l$thislib."
4145 *) dflt="$dflt -l$thislib";;
4148 echo "No -l$thislib."
4159 ' '|'') dflt='none';;
4164 In order to compile $package on your machine, a number of libraries
4165 are usually needed. Include any other special libraries here as well.
4166 Say "none" for none. The default list is almost always right.
4170 rp="What libraries to use?"
4177 : determine optimize, if desired, or use for debug flag also
4179 ' '|$undef) dflt='none';;
4181 *) dflt="$optimize";;
4185 Some C compilers have problems with their optimizers. By default, $package
4186 compiles with the -O flag to use the optimizer. Alternately, you might want
4187 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4188 systems). Either flag can be specified here. To use neither flag, specify
4192 rp="What optimizer/debugger flag should be used?"
4196 'none') optimize=" ";;
4200 : We will not override a previous value, but we might want to
4201 : augment a hint file
4204 case "$gccversion" in
4205 1*) dflt='-fpcc-struct-return' ;;
4208 *-g*) dflt="$dflt -DDEBUGGING";;
4210 case "$gccversion" in
4211 2*) if test -d /etc/conf/kconfig.d &&
4212 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4221 case "$mips_type" in
4222 *BSD*|'') inclwanted="$locincpth $usrinc";;
4223 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4225 for thisincl in $inclwanted; do
4226 if $test -d $thisincl; then
4227 if $test x$thisincl != x$usrinc; then
4230 *) dflt="$dflt -I$thisincl";;
4236 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4238 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4246 *) dflt="$dflt -D$2";;
4250 set signal.h LANGUAGE_C; eval $inctest
4254 ccflags="$ccflags -DSOCKS"
4259 none|recommended) dflt="$ccflags $dflt" ;;
4260 *) dflt="$ccflags";;
4268 Your C compiler may want other flags. For this question you should include
4269 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4270 but you should NOT include libraries or ld flags like -lwhatever. If you
4271 want $package to honor its debug switch, you should include -DDEBUGGING here.
4272 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4274 To use no flags, specify the word "none".
4280 rp="Any additional cc flags?"
4287 : the following weeds options from ccflags that are of no interest to cpp
4289 case "$gccversion" in
4290 1*) cppflags="$cppflags -D__GNUC__"
4292 case "$mips_type" in
4294 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4300 echo "Let me guess what the preprocessor flags are..." >&4
4314 *) ftry="$previous $flag";;
4316 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4317 >cpp1.out 2>/dev/null && \
4318 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4319 >cpp2.out 2>/dev/null && \
4320 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4321 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4323 cppflags="$cppflags $ftry"
4333 *-*) echo "They appear to be: $cppflags";;
4335 $rm -f cpp.c cpp?.out
4339 : flags used in final linking phase
4341 '') if ./venix; then
4347 *-posix*) dflt="$dflt -posix" ;;
4350 *) dflt="$ldflags";;
4353 : Try to guess additional flags to pick up local libraries.
4354 for thislibdir in $libpth; do
4355 case " $loclibpth " in
4358 *"-L$thislibdir "*) ;;
4359 *) dflt="$dflt -L$thislibdir" ;;
4371 Your C linker may need flags. For this question you should
4372 include -L/whatever and any other flags used by the C linker, but you
4373 should NOT include libraries like -lwhatever.
4375 Make sure you include the appropriate -L/path flags if your C linker
4376 does not normally search all of the directories you specified above,
4379 To use no flags, specify the word "none".
4383 rp="Any additional ld flags (NOT including libraries)?"
4389 rmlist="$rmlist pdp11"
4393 echo "Checking your choice of C compiler and flags for coherency..." >&4
4394 $cat > try.c <<'EOF'
4396 int main() { printf("Ok\n"); exit(0); }
4398 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4400 $cat >try.msg <<'EOM'
4401 I've tried to compile and run the following simple program:
4404 $cat try.c >> try.msg
4406 $cat >> try.msg <<EOM
4413 and I got the following output:
4417 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4418 if sh -c './try' >>try.msg 2>&1; then
4422 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4425 cat >> try.msg <<'EOQS'
4426 If $libs contains -lsfio, and sfio is mis-configured, then it
4427 sometimes (apparently) runs and exits with a 0 status, but with no
4428 output! It may have to do with sfio's use of _exit vs. exit.
4431 rp="You have a big problem. Shall I abort Configure"
4438 echo "The program compiled OK, but exited with status $?." >>try.msg
4439 rp="You have a problem. Shall I abort Configure"
4443 echo "I can't compile the test program." >>try.msg
4444 rp="You have a BIG problem. Shall I abort Configure"
4450 case "$knowitall" in
4452 echo "(The supplied flags or libraries might be incorrect.)"
4460 *) echo "Ok. Stopping Configure." >&4
4465 n) echo "OK, that should do.";;
4467 $rm -f try try.* core
4469 : determine filename position in cpp output
4471 echo "Computing filename position in cpp output for #include directives..." >&4
4472 echo '#include <stdio.h>' > foo.c
4475 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4476 $grep '^[ ]*#.*stdio\.h' | \
4477 while read cline; do
4480 while $test \$# -gt 0; do
4481 if $test -r \`echo \$1 | $tr -d '"'\`; then
4486 pos=\`expr \$pos + 1\`
4498 *) pos="${fieldn}th";;
4500 echo "Your cpp writes the filename in the $pos field of the line."
4502 : locate header file
4507 for usrincdir in $usrinc
4509 if test -f \$usrincdir/\$wanted; then
4510 echo "\$usrincdir/\$wanted"
4514 awkprg='{ print \$$fieldn }'
4515 echo "#include <\$wanted>" > foo\$\$.c
4516 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4517 $grep "^[ ]*#.*\$wanted" | \
4518 while read cline; do
4519 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4521 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4522 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4527 # status = 0: grep returned 0 lines, case statement not executed
4528 # status = 1: headerfile found
4529 # status = 2: while loop executed, no headerfile found
4533 if test \$status -eq 1; then
4540 : define an alternate in-header-list? function
4541 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4542 cont=true; xxf="echo \"<\$1> found.\" >&4";
4543 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4544 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4546 case $# in 4) instead=instead;; *) instead="at last";; esac;
4547 while $test "$cont"; do
4549 var=$2; eval "was=\$$2";
4550 if $test "$xxx" && $test -r "$xxx";
4552 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4555 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4556 set $yyy; shift; shift; yyy=$@;
4557 case $# in 0) cont="";;
4558 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4559 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4560 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4561 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4565 do set $yyy; var=$2; eval "was=\$$2";
4566 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4567 set $yyy; shift; shift; yyy=$@;
4570 : see if this is a malloc.h system
4571 set malloc.h i_malloc
4574 : see if stdlib is available
4575 set stdlib.h i_stdlib
4578 : determine which malloc to compile in
4580 case "$usemymalloc" in
4581 ''|[yY]*|true|$define) dflt='y' ;;
4584 rp="Do you wish to attempt to use the malloc that comes with $package?"
4590 mallocsrc='malloc.c'
4591 mallocobj="malloc$_o"
4592 d_mymalloc="$define"
4595 : Remove malloc from list of libraries to use
4596 echo "Removing unneeded -lmalloc from library list" >&4
4597 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4600 echo "libs = $libs" >&4
4612 : compute the return types of malloc and free
4614 $cat >malloc.c <<END
4618 #include <sys/types.h>
4632 case "$malloctype" in
4634 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4641 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4645 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4652 echo "Your system uses $freetype free(), it would seem." >&4
4656 The installation process will also create a directory for
4657 vendor-supplied add-ons. Vendors who supply perl with their system
4658 may find it convenient to place all vendor-supplied files in this
4659 directory rather than in the main distribution directory. This will
4660 ease upgrades between binary-compatible maintenance versions of perl.
4662 Of course you may also use these directories in whatever way you see
4663 fit. For example, you might use them to access modules shared over a
4664 company-wide network.
4666 The default answer should be fine for most people.
4667 This causes further questions about vendor add-ons to be skipped
4668 and no vendor-specific directories will be configured for perl.
4671 rp='Do you want to configure vendor-specific add-on directories?'
4672 case "$usevendorprefix" in
4673 define|true|[yY]*) dflt=y ;;
4679 rp='Installation prefix to use for vendor-supplied add-ons?'
4680 case "$vendorprefix" in
4682 *) dflt=$vendorprefix ;;
4686 case "$vendorprefix" in
4690 *) oldvendorprefix="$prefix";;
4694 usevendorprefix="$define"
4696 vendorprefixexp="$ansexp"
4698 *) usevendorprefix="$undef"
4704 case "$vendorprefix" in
4705 '') d_vendorlib="$undef"
4709 *) d_vendorlib="$define"
4710 : determine where vendor-supplied modules go.
4711 : Usual default is /usr/local/lib/perl5/vendor_perl
4712 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4713 case "$installstyle" in
4714 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4715 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4718 rp='Pathname for the vendor-supplied library files?'
4721 vendorlibexp="$ansexp"
4722 : Change installation prefix, if necessary.
4723 if $test X"$prefix" != X"$installprefix"; then
4724 installvendorlib=`echo $vendorlibexp | $sed 's#^$prefix#$installprefix#'`
4726 installvendorlib="$vendorlibexp"
4731 : Cruising for prototypes
4733 echo "Checking out function prototypes..." >&4
4734 $cat >prototype.c <<'EOCP'
4735 int main(int argc, char *argv[]) {
4738 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4739 echo "Your C compiler appears to support function prototypes."
4742 echo "Your C compiler doesn't seem to understand function prototypes."
4749 case "$prototype" in
4751 *) ansi2knr='ansi2knr'
4756 This version of $package can only be compiled by a compiler that
4757 understands function prototypes. Unfortunately, your C compiler
4759 doesn't seem to understand them. Sorry about that.
4761 If GNU cc is available for your system, perhaps you could try that instead.
4763 Eventually, we hope to support building Perl with pre-ANSI compilers.
4764 If you would like to help in that effort, please contact <perlbug@perl.org>.
4766 Aborting Configure now.
4772 : determine where public executables go
4777 rp='Pathname where the public executables will reside?'
4779 if $test "X$ansexp" != "X$binexp"; then
4784 : Change installation prefix, if necessary.
4785 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4786 if $test X"$prefix" != X"$installprefix"; then
4787 installbin=`echo $binexp | sed 's#^$prefix#$installprefix#'`
4789 installbin="$binexp"
4792 : determine whether to install perl also as /usr/bin/perl
4795 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4797 Many scripts expect to perl to be installed as /usr/bin/perl.
4798 I can install the perl you are about to compile also as /usr/bin/perl
4799 (in addition to $installbin/perl).
4801 case "$installusrbinperl" in
4802 "$undef"|[nN]*) dflt='n';;
4805 rp="Do you want to install perl as /usr/bin/perl?"
4808 [yY]*) val="$define";;
4814 set installusrbinperl
4817 : define a shorthand compile call
4821 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4822 : define a shorthand compile call for compilations that should be ok.
4826 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4829 echo "Checking for GNU C Library..." >&4
4830 cat >gnulibc.c <<EOM
4842 if eval $compile_ok && ./gnulibc; then
4844 echo "You are using the GNU C Library"
4847 echo "You are not using the GNU C Library"
4853 : see if nm is to be used to determine whether a symbol is defined or not
4857 case "$d_gnulibc" in
4860 echo "nm probably won't work on the GNU C Library." >&4
4866 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4868 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4869 echo "'nm' won't be sufficient on this sytem." >&4
4875 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4876 if $test $dflt -gt 20; then
4886 true|$define) dflt=y;;
4893 I can use $nm to extract the symbols from your C libraries. This
4894 is a time consuming task which may generate huge output on the disk (up
4895 to 3 megabytes) but that should make the symbols extraction faster. The
4896 alternative is to skip the 'nm' extraction part and to compile a small
4897 test program instead to determine whether each symbol is present. If
4898 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4899 this may be the best solution.
4901 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4904 rp="Shall I use $nm to extract C symbols from the libraries?"
4907 [Nn]*) usenm=false;;
4916 : nm options which may be necessary
4918 '') if $test -f /mach_boot; then
4920 elif $test -d /usr/ccs/lib; then
4921 nm_opt='-p' # Solaris (and SunOS?)
4922 elif $test -f /dgux; then
4924 elif $test -f /lib64/rld; then
4925 nm_opt='-p' # 64-bit Irix
4931 : nm options which may be necessary for shared libraries but illegal
4932 : for archive libraries. Thank you, Linux.
4933 case "$nm_so_opt" in
4934 '') case "$myuname" in
4936 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4937 nm_so_opt='--dynamic'
4946 : get list of predefined functions in a handy place
4951 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4958 *) for thislib in $libs; do
4961 : Handle C library specially below.
4964 thislib=`echo $thislib | $sed -e 's/^-l//'`
4965 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4967 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4969 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4971 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4973 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4975 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4977 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4982 libnames="$libnames $try"
4984 *) libnames="$libnames $thislib" ;;
4993 for xxx in $libpth; do
4994 $test -r $1 || set $xxx/libc.$so
4995 : The messy sed command sorts on library version numbers.
4997 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4998 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5000 s/[0-9][0-9]*/0000&/g
5001 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5004 sort | $sed -e 's/^.* //'`
5007 $test -r $1 || set /usr/ccs/lib/libc.$so
5008 $test -r $1 || set /lib/libsys_s$_a
5014 if $test -r "$1"; then
5015 echo "Your (shared) C library seems to be in $1."
5017 elif $test -r /lib/libc && $test -r /lib/clib; then
5018 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5020 libc='/lib/clib /lib/libc'
5021 if $test -r /lib/syslib; then
5022 echo "(Your math library is in /lib/syslib.)"
5023 libc="$libc /lib/syslib"
5025 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5026 echo "Your C library seems to be in $libc, as you said before."
5027 elif $test -r $incpath/usr/lib/libc$_a; then
5028 libc=$incpath/usr/lib/libc$_a;
5029 echo "Your C library seems to be in $libc. That's fine."
5030 elif $test -r /lib/libc$_a; then
5032 echo "Your C library seems to be in $libc. You're normal."
5034 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5036 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5037 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5038 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5040 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5042 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5045 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5047 if $test -r "$tans"; then
5048 echo "Your C library seems to be in $tans, of all places."
5054 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5058 If the guess above is wrong (which it might be if you're using a strange
5059 compiler, or your machine supports multiple models), you can override it here.
5064 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5066 I can't seem to find your C library. I've looked in the following places:
5069 $sed 's/^/ /' libpath
5072 None of these seems to contain your C library. I need to get its name...
5077 rp='Where is your C library?'
5082 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5083 set X `cat libnames`
5086 case $# in 1) xxx=file; esac
5087 echo "Extracting names from the following $xxx for later perusal:" >&4
5089 $sed 's/^/ /' libnames >&4
5091 $echo $n "This may take a while...$c" >&4
5095 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5096 *) $nm $nm_opt $file 2>/dev/null;;
5101 $grep fprintf libc.tmp > libc.ptf
5102 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5103 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5105 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5107 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5109 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5111 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5113 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5115 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5117 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5119 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5121 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5123 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5125 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5127 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5129 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5130 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5132 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5134 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5136 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5138 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5140 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5142 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5144 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5146 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5148 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5150 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5152 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5154 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5156 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5158 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5160 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5163 $nm -p $* 2>/dev/null >libc.tmp
5164 $grep fprintf libc.tmp > libc.ptf
5165 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5166 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5172 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5174 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5175 for thisname in $libnames $libc; do
5176 $ar t $thisname >>libc.tmp
5178 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5180 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5181 # Repeat libc to extract forwarders to DLL entries too
5182 for thisname in $libnames $libc; do
5183 $ar tv $thisname >>libc.tmp
5184 # Revision 50 of EMX has bug in $ar.
5185 # it will not extract forwarders to DLL entries
5186 # Use emximp which will extract exactly them.
5187 emximp -o tmp.imp $thisname \
5189 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5190 < tmp.imp >>libc.tmp
5193 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5196 echo "$ar didn't seem to work right." >&4
5197 echo "Maybe this is a Cray...trying bld instead..." >&4
5198 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5200 for thisname in $libnames; do
5202 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5203 $ar t $thisname >>libc.tmp
5207 echo "That didn't work either. Giving up." >&4
5214 if $test -f /lib/syscalls.exp; then
5216 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5217 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5221 $rm -f libnames libpath
5223 : see if dld is available
5227 : is a C symbol defined?
5230 -v) tf=libc.tmp; tc=""; tdc="";;
5231 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5232 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5235 case "$reuseval-$4" in
5237 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5243 if $contains $tlook $tf >/dev/null 2>&1;
5248 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5249 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5257 $define) tval=true;;
5263 : define an is-in-libc? function
5264 inlibc='echo " "; td=$define; tu=$undef;
5265 sym=$1; var=$2; eval "was=\$$2";
5267 case "$reuseval$was" in
5277 echo "$sym() found." >&4;
5278 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5280 echo "$sym() NOT found." >&4;
5281 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5285 $define) echo "$sym() found." >&4;;
5286 *) echo "$sym() NOT found." >&4;;
5290 : see if dlopen exists
5297 : determine which dynamic loading, if any, to compile in
5299 dldir="ext/DynaLoader"
5312 $define) dflt='y' ;;
5315 $define) dflt='y' ;;
5317 : Does a dl_xxx.xs file exist for this operating system
5318 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5321 rp="Do you wish to use dynamic loading?"
5328 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5329 dflt="$dldir/dl_${osname}.xs"
5330 elif $test "$d_dlopen" = "$define" ; then
5331 dflt="$dldir/dl_dlopen.xs"
5332 elif $test "$i_dld" = "$define" ; then
5333 dflt="$dldir/dl_dld.xs"
5338 *) dflt="$dldir/$dlsrc"
5341 echo "The following dynamic loading files are available:"
5342 : Can not go over to $dldir because getfile has path hard-coded in.
5343 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5344 rp="Source file to use for dynamic loading"
5350 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5354 Some systems may require passing special flags to $cc -c to
5355 compile modules that will be used to create a shared library.
5356 To use no flags, say "none".
5359 case "$cccdlflags" in
5360 '') case "$gccversion" in
5361 '') case "$osname" in
5363 next) dflt='none' ;;
5364 irix*) dflt='-KPIC' ;;
5365 svr4*|esix*|solaris) dflt='-KPIC' ;;
5366 sunos) dflt='-pic' ;;
5370 *) case "$osname" in
5371 svr4*|esix*|solaris) dflt='-fPIC' ;;
5376 *) dflt="$cccdlflags" ;;
5378 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5381 none) cccdlflags=' ' ;;
5382 *) cccdlflags="$ans" ;;
5387 Some systems use ld to create libraries that can be dynamically loaded,
5388 while other systems (such as those using ELF) use $cc.
5392 '') $cat >try.c <<'EOM'
5393 /* Test for whether ELF binaries are produced */
5398 int i = open("a.out",O_RDONLY);
5401 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5402 exit(0); /* succeed (yes, it's ELF) */
5407 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5409 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5413 echo "I'll use ld to build dynamic libraries."
5422 rp="What command should be used to create dynamic libraries?"
5428 Some systems may require passing special flags to $ld to create a
5429 library that can be dynamically loaded. If your ld flags include
5430 -L/other/path options to locate libraries outside your loader's normal
5431 search path, you may need to specify those -L options here as well. To
5432 use no flags, say "none".
5435 case "$lddlflags" in
5436 '') case "$osname" in
5437 beos) dflt='-nostart' ;;
5439 linux|irix*) dflt='-shared' ;;
5440 next) dflt='none' ;;
5441 solaris) dflt='-G' ;;
5442 sunos) dflt='-assert nodefinitions' ;;
5443 svr4*|esix*) dflt="-G $ldflags" ;;
5447 *) dflt="$lddlflags" ;;
5450 : Try to guess additional flags to pick up local libraries.
5451 : Be careful not to append to a plain 'none'
5455 for thisflag in $ldflags; do
5460 *) dflt="$dflt $thisflag" ;;
5467 ''|' ') dflt='none' ;;
5470 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5473 none) lddlflags=' ' ;;
5474 *) lddlflags="$ans" ;;
5479 Some systems may require passing special flags to $cc to indicate that
5480 the resulting executable will use dynamic linking. To use no flags,
5484 case "$ccdlflags" in
5485 '') case "$osname" in
5486 hpux) dflt='-Wl,-E' ;;
5487 linux) dflt='-rdynamic' ;;
5488 next) dflt='none' ;;
5489 sunos) dflt='none' ;;
5493 *) dflt="$ccdlflags" ;;
5495 rp="Any special flags to pass to $cc to use dynamic loading?"
5498 none) ccdlflags=' ' ;;
5499 *) ccdlflags="$ans" ;;
5513 # No dynamic loading being used, so don't bother even to prompt.
5516 *) case "$useshrplib" in
5517 '') case "$osname" in
5518 svr4*|dgux|dynixptx|esix|powerux|beos)
5520 also='Building a shared libperl is required for dynamic loading to work on your system.'
5525 also='Building a shared libperl is needed for MAB support.'
5543 The perl executable is normally obtained by linking perlmain.c with
5544 libperl${_a}, any static extensions (usually just DynaLoader), and
5545 any other libraries needed on this system (such as -lm, etc.). Since
5546 your system supports dynamic loading, it is probably possible to build
5547 a shared libperl.$so. If you will have more than one executable linked
5548 to libperl.$so, this will significantly reduce the size of each
5549 executable, but it may have a noticeable affect on performance. The
5550 default is probably sensible for your system.
5554 rp="Build a shared libperl.$so (y/n)"
5558 useshrplib='true' ;;
5559 *) useshrplib='false' ;;
5564 case "$useshrplib" in
5568 # Figure out a good name for libperl.so. Since it gets stored in
5569 # a version-specific architecture-dependent library, the version
5570 # number isn't really that important, except for making cc/ld happy.
5572 # A name such as libperl.so.3.1
5573 majmin="libperl.$so.$patchlevel.$subversion"
5574 # A name such as libperl.so.301
5575 majonly=`echo $patchlevel $subversion |
5576 $awk '{printf "%d%02d", $1, $2}'`
5577 majonly=libperl.$so.$majonly
5578 # I'd prefer to keep the os-specific stuff here to a minimum, and
5579 # rely on figuring it out from the naming of libc.
5580 case "${osname}${osvers}" in
5583 # XXX How handle the --version stuff for MAB?
5585 linux*) # ld won't link with a bare -lperl otherwise.
5588 *) # Try to guess based on whether libc has major.minor.
5590 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5591 *libc.$so.[0-9]*) dflt=$majonly ;;
5592 *) dflt=libperl.$so ;;
5602 I need to select a good name for the shared libperl. If your system uses
5603 library names with major and minor numbers, then you might want something
5604 like $majmin. Alternatively, if your system uses a single version
5605 number for shared libraries, then you might want to use $majonly.
5606 Or, your system might be quite happy with a simple libperl.$so.
5608 Since the shared libperl will get installed into a version-specific
5609 architecture-dependent directory, the version number of the shared perl
5610 library probably isn't important, so the default should be o.k.
5613 rp='What name do you want to give to the shared libperl?'
5616 echo "Ok, I'll use $libperl"
5619 libperl="libperl${_a}"
5623 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5627 WARNING: Use of the shrpdir variable for the installation location of
5628 the shared $libperl is not supported. It was never documented and
5629 will not work in this version. Let me (perlbug@perl.com)
5630 know of any problems this may cause.
5636 But your current setting of $shrpdir is
5637 the default anyway, so it's harmless.
5642 Further, your current attempted setting of $shrpdir
5643 conflicts with the value of $archlibexp/CORE
5644 that installperl will use.
5651 # How will the perl executable find the installed shared $libperl?
5652 # Add $xxx to ccdlflags.
5653 # If we can't figure out a command-line option, use $shrpenv to
5654 # set env LD_RUN_PATH. The main perl makefile uses this.
5655 shrpdir=$archlibexp/CORE
5658 if "$useshrplib"; then
5661 # We'll set it in Makefile.SH...
5667 xxx="-Wl,-R$shrpdir"
5669 linux|irix*|dec_osf)
5670 xxx="-Wl,-rpath,$shrpdir"
5673 # next doesn't like the default...
5676 # beos doesn't like the default, either.
5679 # hpux doesn't like the default, either.
5680 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5683 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5689 # Only add $xxx if it isn't already in ccdlflags.
5690 case " $ccdlflags " in
5692 *) ccdlflags="$ccdlflags $xxx"
5695 Adding $xxx to the flags
5696 passed to $ld so that the perl executable will find the
5697 installed shared $libperl.
5705 # Fix ccdlflags in AIX for building external extensions.
5706 # (For building Perl itself bare -bE:perl.exp is needed,
5707 # Makefile.SH takes care of this.)
5709 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5711 # Respect a hint or command-line value.
5713 '') shrpenv="$tmp_shrpenv" ;;
5715 case "$ldlibpthname" in
5716 '') ldlibpthname=LD_LIBRARY_PATH ;;
5717 none) ldlibpthname='' ;;
5720 : determine where manual pages go
5721 set man1dir man1dir none
5725 $spackage has manual pages available in source form.
5729 echo "However, you don't have nroff, so they're probably useless to you."
5731 '') man1dir="none";;
5734 echo "If you don't want the manual sources installed, answer 'none'."
5739 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5740 lookpath="$lookpath $prefixexp/man/p_man/man1"
5741 lookpath="$lookpath $prefixexp/man/u_man/man1"
5742 lookpath="$lookpath $prefixexp/man/man.1"
5744 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5745 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5755 rp="Where do the main $spackage manual pages (source) go?"
5757 if $test "X$man1direxp" != "X$ansexp"; then
5761 man1direxp="$ansexp"
5767 : Change installation prefix, if necessary.
5768 if $test X"$prefix" != X"$installprefix"; then
5769 installman1dir=`echo $man1direxp | $sed 's#^$prefix#$installprefix#'`
5771 installman1dir="$man1direxp"
5774 : What suffix to use on installed man pages
5781 rp="What suffix should be used for the main $spackage man pages?"
5783 '') case "$man1dir" in
5797 *) dflt="$man1ext";;
5804 : see if we can have long filenames
5806 rmlist="$rmlist /tmp/cf$$"
5807 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5808 first=123456789abcdef
5809 second=/tmp/cf$$/$first
5810 $rm -f $first $second
5811 if (echo hi >$first) 2>/dev/null; then
5812 if $test -f 123456789abcde; then
5813 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5816 if (echo hi >$second) 2>/dev/null; then
5817 if $test -f /tmp/cf$$/123456789abcde; then
5819 That's peculiar... You can have filenames longer than 14 characters, but only
5820 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5821 I shall consider your system cannot support long filenames at all.
5825 echo 'You can have filenames longer than 14 characters.' >&4
5830 How confusing! Some of your filesystems are sane enough to allow filenames
5831 longer than 14 characters but some others like /tmp can't even think about them.
5832 So, for now on, I shall assume your kernel does not allow them at all.
5839 You can't have filenames longer than 14 chars. You can't even think about them!
5845 $rm -rf /tmp/cf$$ 123456789abcde*
5847 : determine where library module manual pages go
5848 set man3dir man3dir none
5852 $spackage has manual pages for many of the library modules.
5858 However, you don't have nroff, so they're probably useless to you.
5861 '') man3dir="none";;
5865 case "$d_flexfnam" in
5868 However, your system can't handle the long file names like File::Basename.3.
5871 '') man3dir="none";;
5875 echo "If you don't want the manual sources installed, answer 'none'."
5876 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5878 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5879 if $test -d "$privlib/man/man3"; then
5882 WARNING: Previous versions of perl installed man3 pages into
5883 $privlib/man/man3. This version will suggest a
5884 new default of $dflt.
5888 rp='Do you wish to preserve the old behavior?(y/n)'
5891 y*) dflt="$privlib/man/man3" ;;
5897 *) dflt="$man3dir" ;;
5901 rp="Where do the $package library man pages (source) go?"
5904 man3direxp="$ansexp"
5910 : Change installation prefix, if necessary.
5911 if $test X"$prefix" != X"$installprefix"; then
5912 installman3dir=`echo $man3direxp | $sed 's#^$prefix#$installprefix#'`
5914 installman3dir="$man3direxp"
5917 : What suffix to use on installed man pages
5923 rp="What suffix should be used for the $package library man pages?"
5925 '') case "$man3dir" in
5939 *) dflt="$man3ext";;
5946 : see if we have to deal with yellow pages, now NIS.
5947 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5948 if $test -f /usr/etc/nibindd; then
5950 echo "I'm fairly confident you're on a NeXT."
5952 rp='Do you get the hosts file via NetInfo?'
5961 y*) hostcat='nidump hosts .';;
5962 *) case "$hostcat" in
5963 nidump*) hostcat='';;
5973 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5981 rp='Are you getting the hosts file via yellow pages?'
5984 y*) hostcat='ypcat hosts';;
5985 *) hostcat='cat /etc/hosts';;
5991 '') hostcat='cat /etc/hosts';;
5994 '') groupcat='cat /etc/group';;
5997 '') passcat='cat /etc/passwd';;
6000 : now get the host name
6002 echo "Figuring out host name..." >&4
6003 case "$myhostname" in
6005 echo 'Maybe "hostname" will work...'
6006 if tans=`sh -c hostname 2>&1` ; then
6014 if $test "$cont"; then
6016 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6017 if tans=`cat /etc/systemid 2>&1` ; then
6019 phostname='cat /etc/systemid'
6020 echo "Whadyaknow. Xenix always was a bit strange..."
6023 elif $test -r /etc/systemid; then
6024 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6027 if $test "$cont"; then
6028 echo 'No, maybe "uuname -l" will work...'
6029 if tans=`sh -c 'uuname -l' 2>&1` ; then
6031 phostname='uuname -l'
6033 echo 'Strange. Maybe "uname -n" will work...'
6034 if tans=`sh -c 'uname -n' 2>&1` ; then
6036 phostname='uname -n'
6038 echo 'Oh well, maybe I can mine it out of whoami.h...'
6039 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6040 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6041 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6043 case "$myhostname" in
6044 '') echo "Does this machine have an identity crisis or something?"
6047 echo "Well, you said $myhostname before..."
6048 phostname='echo $myhostname';;
6054 : you do not want to know about this
6059 if $test "$myhostname" ; then
6061 rp='Your host name appears to be "'$myhostname'".'" Right?"
6069 : bad guess or no guess
6070 while $test "X$myhostname" = X ; do
6072 rp="Please type the (one word) name of your host:"
6077 : translate upper to lower if necessary
6078 case "$myhostname" in
6080 echo "(Normalizing case in your host name)"
6081 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6085 case "$myhostname" in
6087 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6088 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6089 echo "(Trimming domain name from host name--host name is now $myhostname)"
6091 *) case "$mydomain" in
6094 test "X$hostcat" = "Xypcat hosts" &&
6095 ypmatch "$myhostname" hosts 2>/dev/null |\
6096 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6099 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6100 /[ ]$myhostname[ . ]/p" > hosts
6103 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6104 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6105 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6106 hosts | $sort | $uniq | \
6107 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6108 case `$echo X$dflt` in
6109 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6112 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6117 tans=`./loc resolv.conf X /etc /usr/etc`
6118 if $test -f "$tans"; then
6119 echo "(Attempting domain name extraction from $tans)"
6120 dflt=.`$sed -n -e 's/ / /g' \
6121 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6122 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6124 .) dflt=.`$sed -n -e 's/ / /g' \
6125 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6126 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6133 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6134 dflt=.`sh -c domainname 2>/dev/null`
6137 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6142 .) echo "(Lost all hope -- silly guess then)"
6148 *) dflt="$mydomain";;
6152 rp="What is your domain name?"
6162 : translate upper to lower if necessary
6165 echo "(Normalizing case in your domain name)"
6166 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6170 : a little sanity check here
6171 case "$phostname" in
6174 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6175 $myhostname$mydomain|$myhostname) ;;
6177 case "$phostname" in
6179 echo "(That doesn't agree with your whoami.h file, by the way.)"
6182 echo "(That doesn't agree with your $phostname command, by the way.)"
6192 I need to get your e-mail address in Internet format if possible, i.e.
6193 something like user@host.domain. Please answer accurately since I have
6194 no easy means to double check it. The default value provided below
6195 is most probably close to the reality but may not be valid from outside
6196 your organization...
6200 while test "$cont"; do
6202 '') dflt="$cf_by@$myhostname$mydomain";;
6203 *) dflt="$cf_email";;
6205 rp='What is your e-mail address?'
6211 rp='Address does not look like an Internet one. Use it anyway?'
6227 If you or somebody else will be maintaining perl at your site, please
6228 fill in the correct e-mail address here so that they may be contacted
6229 if necessary. Currently, the "perlbug" program included with perl
6230 will send mail to this address in addition to perlbug@perl.com. You may
6231 enter "none" for no administrator.
6234 case "$perladmin" in
6235 '') dflt="$cf_email";;
6236 *) dflt="$perladmin";;
6238 rp='Perl administrator e-mail address'
6242 : figure out how to guarantee perl startup
6243 case "$startperl" in
6245 case "$sharpbang" in
6249 I can use the #! construct to start perl on your system. This will
6250 make startup of perl scripts faster, but may cause problems if you
6251 want to share those scripts and perl is not in a standard place
6252 ($binexp/perl) on all your platforms. The alternative is to force
6253 a shell by starting the script with a single ':' character.
6257 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6260 none) startperl=": # use perl";;
6261 *) startperl="#!$ans"
6262 if $test 30 -lt `echo "$ans" | wc -c`; then
6265 WARNING: Some systems limit the #! command to 32 characters.
6266 If you experience difficulty running Perl scripts with #!, try
6267 installing Perl in a directory with a shorter pathname.
6273 *) startperl=": # use perl"
6278 echo "I'll use $startperl to start perl scripts."
6280 : figure best path for perl in scripts
6283 perlpath="$binexp/perl"
6284 case "$startperl" in
6289 I will use the "eval 'exec'" idiom to start Perl on your system.
6290 I can use the full path of your Perl binary for this purpose, but
6291 doing so may cause problems if you want to share those scripts and
6292 Perl is not always in a standard place ($binexp/perl).
6296 rp="What path shall I use in \"eval 'exec'\"?"
6303 case "$startperl" in
6305 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6308 : determine where public executable scripts go
6309 set scriptdir scriptdir
6311 case "$scriptdir" in
6314 : guess some guesses
6315 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6316 $test -d /usr/share/bin && dflt=/usr/share/bin
6317 $test -d /usr/local/script && dflt=/usr/local/script
6318 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6319 $test -d $prefixexp/script && dflt=$prefixexp/script
6323 *) dflt="$scriptdir"
6328 Some installations have a separate directory just for executable scripts so
6329 that they can mount it across multiple architectures but keep the scripts in
6330 one spot. You might, for example, have a subdirectory of /usr/share for this.
6331 Or you might just lump your scripts in with all your other executables.
6335 rp='Where do you keep publicly executable scripts?'
6337 if $test "X$ansexp" != "X$scriptdirexp"; then
6341 scriptdirexp="$ansexp"
6342 : Change installation prefix, if necessary.
6343 if $test X"$prefix" != X"$installprefix"; then
6344 installscript=`echo $scriptdirexp | sed 's#^$prefix#$installprefix#'`
6346 installscript="$scriptdirexp"
6351 After $package is installed, you may wish to install various
6352 add-on modules and utilities. Typically, these add-ons will
6353 be installed under $prefix with the rest
6354 of this package. However, you may wish to install such add-ons
6355 elsewhere under a different prefix.
6357 If you do not wish to put everything under a single prefix, that's
6358 ok. You will be prompted for the individual locations; this siteprefix
6359 is only used to suggest the defaults.
6361 The default should be fine for most people.
6365 rp='Installation prefix to use for add-on modules and utilities?'
6366 : XXX Here might be another good place for an installstyle setting.
6367 case "$siteprefix" in
6369 *) dflt=$siteprefix ;;
6373 case "$siteprefix" in
6378 *) oldsiteprefix="$prefix";;
6383 siteprefixexp="$ansexp"
6385 : determine where site specific libraries go.
6386 : Usual default is /usr/local/lib/perl5/site_perl
6387 : The default "style" setting is made in installstyle.U
6388 : XXX No longer works with Prefixit stuff.
6389 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6390 case "$installstyle" in
6391 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6392 *) dflt=$siteprefix/lib/site_$prog ;;
6396 The installation process will create a directory for
6397 site-specific extensions and modules. Most users find it convenient
6398 to place all site-specific files in this directory rather than in the
6399 main distribution directory.
6403 rp='Pathname for the site-specific library files?'
6406 sitelibexp="$ansexp"
6407 : Change installation prefix, if necessary.
6408 if $test X"$prefix" != X"$installprefix"; then
6409 installsitelib=`echo $sitelibexp | sed 's#^$prefix#$installprefix#'`
6411 installsitelib="$sitelibexp"
6414 : determine where site specific architecture-dependent libraries go.
6415 : sitelib default is /usr/local/lib/perl5/site_perl/
6416 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6417 : sitelib may have an optional trailing /share.
6418 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6419 tdflt="$tdflt/$apiversion/$archname"
6420 set sitearch sitearch none
6423 '') dflt="$tdflt" ;;
6424 *) dflt="$sitearch" ;;
6428 The installation process will also create a directory for
6429 architecture-dependent site-specific extensions and modules.
6433 rp='Pathname for the site-specific architecture-dependent library files?'
6436 sitearchexp="$ansexp"
6437 : Change installation prefix, if necessary.
6438 if $test X"$prefix" != X"$installprefix"; then
6439 installsitearch=`echo $sitearchexp | sed 's#^$prefix#$installprefix#'`
6441 installsitearch="$sitearchexp"
6446 Previous version of $package used the standard IO mechanisms as defined
6447 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6448 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6449 the default. This abstraction layer can use AT&T's sfio (if you already
6450 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6451 problems with some extension modules. Using PerlIO with stdio is safe,
6452 but it is slower than plain stdio and therefore is not the default.
6454 If this doesn't make any sense to you, just accept the default 'n'.
6456 case "$useperlio" in
6457 $define|true|[yY]*) dflt='y';;
6460 rp='Use the experimental PerlIO abstraction layer?'
6467 echo "Ok, doing things the stdio way"
6474 : Check how to convert floats to strings.
6475 if test "X$d_Gconvert" = X; then
6477 echo "Checking for an efficient way to convert floats to strings."
6480 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6481 char *myname = "gconvert";
6484 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6485 char *myname = "gcvt";
6488 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6489 char *myname = "sprintf";
6495 checkit(expect, got)
6499 if (strcmp(expect, got)) {
6500 printf("%s oddity: Expected %s, got %s\n",
6501 myname, expect, got);
6511 /* This must be 1st test on (which?) platform */
6512 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6513 Gconvert(0.1, 8, 0, buf);
6514 checkit("0.1", buf);
6516 Gconvert(1.0, 8, 0, buf);
6519 Gconvert(0.0, 8, 0, buf);
6522 Gconvert(-1.0, 8, 0, buf);
6525 /* Some Linux gcvt's give 1.e+5 here. */
6526 Gconvert(100000.0, 8, 0, buf);
6527 checkit("100000", buf);
6529 /* Some Linux gcvt's give -1.e+5 here. */
6530 Gconvert(-100000.0, 8, 0, buf);
6531 checkit("-100000", buf);
6536 case "$d_Gconvert" in
6537 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6538 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6539 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6540 *) xxx_list='gconvert gcvt sprintf' ;;
6543 for xxx_convert in $xxx_list; do
6544 echo "Trying $xxx_convert"
6546 set try -DTRY_$xxx_convert
6547 if eval $compile; then
6548 echo "$xxx_convert" found. >&4
6550 echo "I'll use $xxx_convert to convert floats into a string." >&4
6553 echo "...But $xxx_convert didn't work as I expected."
6556 echo "$xxx_convert NOT found." >&4
6560 case "$xxx_convert" in
6561 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6562 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6563 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6567 : see if inttypes.h is available
6568 : we want a real compile instead of Inhdr because some systems
6569 : have an inttypes.h which includes non-existent headers
6572 #include <inttypes.h>
6574 static int32_t foo32 = 0x12345678;
6578 if eval $compile; then
6579 echo "<inttypes.h> found." >&4
6582 echo "<inttypes.h> NOT found." >&4
6590 case "$use64bits" in
6593 echo $n "Checking to see if your system supports int64_t...$c" >&4
6595 #include <sys/types.h>
6596 #$i_inttypes I_INTTYPES
6598 #include <inttypes.h>
6600 int64_t foo() { int64_t x; x = 7; return x; }
6602 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6604 echo " Yup, it does." >&4
6607 echo " Nope, it doesn't." >&4
6618 : check for lengths of integral types
6622 echo "Checking to see how big your integers are..." >&4
6623 $cat >intsize.c <<'EOCP'
6627 printf("intsize=%d;\n", sizeof(int));
6628 printf("longsize=%d;\n", sizeof(long));
6629 printf("shortsize=%d;\n", sizeof(short));
6634 if eval $compile_ok && ./intsize > /dev/null; then
6636 echo "Your integers are $intsize bytes long."
6637 echo "Your long integers are $longsize bytes long."
6638 echo "Your short integers are $shortsize bytes long."
6642 Help! I can't compile and run the intsize test program: please enlighten me!
6643 (This is probably a misconfiguration in your system or libraries, and
6644 you really ought to fix it. Still, I'll try anyway.)
6648 rp="What is the size of an integer (in bytes)?"
6652 rp="What is the size of a long integer (in bytes)?"
6656 rp="What is the size of a short integer (in bytes)?"
6662 $rm -f intsize intsize.*
6664 : check for long long
6666 echo $n "Checking to see if your system supports long long...$c" >&4
6667 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6668 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6670 echo " Yup, it does." >&4
6673 echo " Nope, it doesn't." >&4
6679 : check for length of long long
6680 case "${d_longlong}${longlongsize}" in
6683 $echo $n "Checking to see how big your long longs are...$c" >&4
6684 $cat >try.c <<'EOCP'
6688 printf("%d\n", sizeof(long long));
6692 if eval $compile_ok; then
6693 longlongsize=`./try`
6694 $echo " $longlongsize bytes." >&4
6698 echo "(I can't seem to compile the test program. Guessing...)"
6699 rp="What is the size of a long long (in bytes)?"
6703 if $test "X$longsize" = "X$longlongsize"; then
6704 echo "(That isn't any different from an ordinary long.)"
6712 case "$d_longlong" in
6715 echo "Checking how to print 64-bit integers..." >&4
6717 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6719 $cat >try.c <<'EOCP'
6720 #include <sys/types.h>
6723 int q = 12345678901;
6728 if eval $compile; then
6732 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6733 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6734 echo "We will use %d."
6740 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6742 $cat >try.c <<'EOCP'
6743 #include <sys/types.h>
6746 long q = 12345678901;
6751 if eval $compile; then
6755 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6756 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6757 echo "We will use %ld."
6763 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6765 $cat >try.c <<'EOCP'
6766 #include <sys/types.h>
6767 #include <inttypes.h>
6770 int64_t q = 12345678901;
6771 printf("%" PRId64 "\n", q);
6775 if eval $compile; then
6779 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6780 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6781 echo "We will use the C9X style."
6787 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6789 $cat >try.c <<'EOCP'
6790 #include <sys/types.h>
6793 long long q = 12345678901;
6794 printf("%lld\n", q);
6798 if eval $compile; then
6802 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6803 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6804 echo "We will use the %lld style."
6810 if $test X"$sPRId64" = X -a X"$quad" != X; then
6812 #include <sys/types.h>
6815 $quad q = 12345678901;
6820 if eval $compile; then
6824 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6825 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6826 echo "We will use %lld."
6832 if $test X"$sPRId64" = X -a X"$quad" != X; then
6834 #include <sys/types.h>
6837 $quad q = 12345678901;
6842 if eval $compile; then
6846 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6847 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6848 echo "We will use %qd."
6854 if $test X"$sPRId64" = X; then
6855 echo "Cannot figure out how to print 64-bit integers." >&4
6859 esac # case "$d_longlong"
6862 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6863 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6865 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6866 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6872 : check for length of double
6874 case "$doublesize" in
6876 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6877 $cat >try.c <<'EOCP'
6881 printf("%d\n", sizeof(double));
6885 if eval $compile_ok; then
6887 $echo " $doublesize bytes." >&4
6890 echo "(I can't seem to compile the test program. Guessing...)"
6891 rp="What is the size of a double precision number (in bytes)?"
6899 : check for long doubles
6901 echo $n "Checking to see if your system supports long doubles...$c" >&4
6902 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6903 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6905 echo " Yup, it does." >&4
6908 echo " Nope, it doesn't." >&4
6914 : check for length of long double
6915 case "${d_longdbl}${longdblsize}" in
6918 $echo $n "Checking to see how big your long doubles are...$c" >&4
6919 $cat >try.c <<'EOCP'
6923 printf("%d\n", sizeof(long double));
6927 if eval $compile; then
6929 $echo " $longdblsize bytes." >&4
6933 echo "(I can't seem to compile the test program. Guessing...)" >&4
6934 rp="What is the size of a long double (in bytes)?"
6938 if $test "X$doublesize" = "X$longdblsize"; then
6939 echo "(That isn't any different from an ordinary double.)"
6947 case "$d_longdbl" in
6950 echo "Checking how to print long doubles..." >&4
6952 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6953 $cat >try.c <<'EOCP'
6954 #include <sys/types.h>
6958 printf("%.3f\n", d);
6962 if eval $compile; then
6966 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6967 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6968 echo "We will use %f."
6974 if $test X"$sPRIfldbl" = X; then
6975 $cat >try.c <<'EOCP'
6976 #include <sys/types.h>
6979 long double d = 123.456;
6980 printf("%.3Lf\n", d);
6984 if eval $compile; then
6988 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6989 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
6990 echo "We will use %Lf."
6996 if $test X"$sPRIfldbl" = X; then
6997 $cat >try.c <<'EOCP'
6998 #include <sys/types.h>
7001 long double d = 123.456;
7002 printf("%.3lf\n", d);
7006 if eval $compile; then
7010 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7011 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7012 echo "We will use %lf."
7018 if $test X"$sPRIfldbl" = X; then
7019 $cat >try.c <<'EOCP'
7020 #include <sys/types.h>
7023 long double d = 123.456;
7024 printf("%.3llf\n", d);
7028 if eval $compile; then
7032 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7033 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7034 echo "We will use %llf."
7040 if $test X"$sPRIfldbl" = X; then
7041 echo "Cannot figure out how to print long doubles." >&4
7045 esac # case "$d_longdbl"
7047 case "$sPRIfldbl" in
7048 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7049 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7051 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7052 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7058 : Initialize h_fcntl
7061 : Initialize h_sysfile
7064 : access call always available on UNIX
7068 : locate the flags for 'access()'
7072 $cat >access.c <<'EOCP'
7073 #include <sys/types.h>
7078 #include <sys/file.h>
7087 : check sys/file.h first, no particular reason here
7088 if $test `./findhdr sys/file.h` && \
7089 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7091 echo "<sys/file.h> defines the *_OK access constants." >&4
7092 elif $test `./findhdr fcntl.h` && \
7093 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7095 echo "<fcntl.h> defines the *_OK access constants." >&4
7096 elif $test `./findhdr unistd.h` && \
7097 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7098 echo "<unistd.h> defines the *_OK access constants." >&4
7100 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7106 : see if accessx exists
7107 set accessx d_accessx
7110 : see if alarm exists
7114 : see if atolf exists
7118 : see if atoll exists
7122 : Look for GNU-cc style attribute checking
7124 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7125 $cat >attrib.c <<'EOCP'
7127 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7129 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7130 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7131 echo "Your C compiler doesn't fully support __attribute__."
7134 echo "Your C compiler supports __attribute__."
7138 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7145 : see if bcmp exists
7149 : see if bcopy exists
7153 : see if this is a unistd.h system
7154 set unistd.h i_unistd
7157 : see if getpgrp exists
7158 set getpgrp d_getpgrp
7161 case "$d_getpgrp" in
7164 echo "Checking to see which flavor of getpgrp is in use..."
7167 #include <sys/types.h>
7169 # include <unistd.h>
7173 if (getuid() == 0) {
7174 printf("(I see you are running Configure as super-user...)\n");
7178 if (getpgrp(1) == 0)
7187 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7188 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7190 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7191 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7194 echo "I can't seem to compile and run the test program."
7196 xxx="a USG one, i.e. you use getpgrp()."
7198 # SVR4 systems can appear rather BSD-ish.
7201 xxx="a BSD one, i.e. you use getpgrp(pid)."
7205 xxx="probably a USG one, i.e. you use getpgrp()."
7210 echo "Assuming your getpgrp is $xxx" >&4
7219 : see if setpgrp exists
7220 set setpgrp d_setpgrp
7223 case "$d_setpgrp" in
7226 echo "Checking to see which flavor of setpgrp is in use..."
7229 #include <sys/types.h>
7231 # include <unistd.h>
7235 if (getuid() == 0) {
7236 printf("(I see you are running Configure as super-user...)\n");
7240 if (-1 == setpgrp(1, 1))
7243 if (setpgrp() != -1)
7249 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7250 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7252 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7253 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7256 echo "(I can't seem to compile and run the test program.)"
7258 xxx="a USG one, i.e. you use setpgrp()."
7260 # SVR4 systems can appear rather BSD-ish.
7263 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7267 xxx="probably a USG one, i.e. you use setpgrp()."
7272 echo "Assuming your setpgrp is $xxx" >&4
7280 : see if bzero exists
7284 : see if signal is declared as pointer to function returning int or void
7286 xxx=`./findhdr signal.h`
7287 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7288 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7289 echo "You have int (*signal())() instead of void." >&4
7291 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7292 echo "You have void (*signal())()." >&4
7294 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7295 echo "You have int (*signal())() instead of void." >&4
7297 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7298 echo "You have void (*signal())()." >&4
7301 case "$d_voidsig" in
7303 echo "I can't determine whether signal handler returns void or int..." >&4
7305 rp="What type does your signal handler return?"
7312 echo "As you already told me, signal handler returns void." >&4
7315 *) echo "As you already told me, signal handler returns int." >&4
7322 case "$d_voidsig" in
7323 "$define") signal_t="void";;
7328 : check for ability to cast large floats to 32-bit ints.
7330 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7331 if $test "$intsize" -ge 4; then
7338 #include <sys/types.h>
7340 $signal_t blech(s) int s; { exit(3); }
7347 signal(SIGFPE, blech);
7349 /* Don't let compiler optimize the test away. Store the number
7350 in a writable string for gcc to pass to sscanf under HP/UX.
7352 sprintf(str, "2147483647");
7353 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7357 /* x86 processors will probably give 0x8000 0000, which is a
7358 sign change. We don't want that. We want to mimic SPARC
7359 behavior here, which is to preserve the sign and give
7362 if (i32 != ($xxx) f)
7368 if eval $compile_ok; then
7372 echo "(I can't seem to compile the test program--assuming it can't)"
7380 echo "Nope, it can't."
7387 : check for ability to cast negative floats to unsigned
7389 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7392 #include <sys/types.h>
7394 $signal_t blech(s) int s; { exit(7); }
7395 $signal_t blech_in_list(s) int s; { exit(4); }
7396 unsigned long dummy_long(p) unsigned long p; { return p; }
7397 unsigned int dummy_int(p) unsigned int p; { return p; }
7398 unsigned short dummy_short(p) unsigned short p; { return p; }
7402 unsigned long along;
7404 unsigned short ashort;
7408 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7409 a direct f = -123. assignment. gcc-2.8.0 reportedly
7410 optimized the whole file away
7412 /* Store the number in a writable string for gcc to pass to
7415 sprintf(str, "-123");
7416 sscanf(str, "%lf", &f); /* f = -123.; */
7418 signal(SIGFPE, blech);
7419 along = (unsigned long)f;
7420 aint = (unsigned int)f;
7421 ashort = (unsigned short)f;
7422 if (along != (unsigned long)-123)
7424 if (aint != (unsigned int)-123)
7426 if (ashort != (unsigned short)-123)
7428 sprintf(str, "1073741824.");
7429 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7432 along = (unsigned long)f;
7433 if (along != 0x80000000)
7437 along = (unsigned long)f;
7438 if (along != 0x7fffffff)
7442 along = (unsigned long)f;
7443 if (along != 0x80000001)
7447 signal(SIGFPE, blech_in_list);
7448 sprintf(str, "123.");
7449 sscanf(str, "%lf", &f); /* f = 123.; */
7450 along = dummy_long((unsigned long)f);
7451 aint = dummy_int((unsigned int)f);
7452 ashort = dummy_short((unsigned short)f);
7453 if (along != (unsigned long)123)
7455 if (aint != (unsigned int)123)
7457 if (ashort != (unsigned short)123)
7464 if eval $compile_ok; then
7468 echo "(I can't seem to compile the test program--assuming it can't)"
7471 case "$castflags" in
7476 echo "Nope, it can't."
7483 : see if vprintf exists
7485 if set vprintf val -f d_vprintf; eval $csym; $val; then
7486 echo 'vprintf() found.' >&4
7488 $cat >vprintf.c <<'EOF'
7489 #include <varargs.h>
7491 int main() { xxx("foo"); }
7500 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7504 if eval $compile && ./vprintf; then
7505 echo "Your vsprintf() returns (int)." >&4
7508 echo "Your vsprintf() returns (char*)." >&4
7512 echo 'vprintf() NOT found.' >&4
7522 : see if chown exists
7526 : see if chroot exists
7530 : see if chsize exists
7534 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7535 while $test $# -ge 2; do
7537 $define) echo "#include <$2>";;
7541 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7542 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7551 : see if this is a sys/uio.h system
7552 set sys/uio.h i_sysuio
7555 echo "Checking to see if your system supports struct iovec..." >&4
7556 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7558 case "$d_iovec_s" in
7559 "$define") echo "Yup, it does." >&4
7561 *) echo "Nope, it doesn't." >&4
7567 : see whether socket exists
7569 $echo $n "Hmm... $c" >&4
7570 if set socket val -f d_socket; eval $csym; $val; then
7571 echo "Looks like you have Berkeley networking support." >&4
7573 if set setsockopt val -f; eval $csym; $val; then
7576 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7580 if $contains socklib libc.list >/dev/null 2>&1; then
7581 echo "Looks like you have Berkeley networking support." >&4
7583 : we will have to assume that it supports the 4.2 BSD interface
7586 echo "You don't have Berkeley networking in libc$_a..." >&4
7587 if test "X$d_socket" = "X$define"; then
7588 echo "...but you seem to believe that you have sockets." >&4
7590 for net in net socket
7592 if test -f /usr/lib/lib$net$_a; then
7593 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7594 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7595 if $contains socket libc.list >/dev/null 2>&1; then
7600 echo "...but the Wollongong group seems to have hacked it in." >&4
7601 sockethdr="-I/usr/netinclude"
7604 echo "Found Berkeley sockets interface in lib$net." >& 4
7605 if $contains setsockopt libc.list >/dev/null 2>&1; then
7608 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7615 if test "X$d_socket" != "X$define"; then
7616 echo "or anywhere else I see." >&4
7624 : see if socketpair exists
7625 set socketpair d_sockpair
7630 echo "Checking the availability of certain socket constants..." >& 4
7631 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7632 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7634 #include <sys/types.h>
7635 #include <sys/socket.h>
7641 set try; if eval $compile; then
7644 set d_${enum}; eval $setvar
7648 set sendmsg d_sendmsg
7651 set recvmsg d_recvmsg
7655 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7656 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7658 case "$d_msghdr_s" in
7659 "$define") echo "Yup, it does." >&4
7661 *) echo "Nope, it doesn't." >&4
7665 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7666 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7668 case "$d_cmsghdr_s" in
7669 "$define") echo "Yup, it does." >&4
7671 *) echo "Nope, it doesn't." >&4
7675 : check for const keyword
7677 echo 'Checking to see if your C compiler knows about "const"...' >&4
7678 $cat >const.c <<'EOCP'
7679 typedef struct spug { int drokk; } spug;
7686 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7688 echo "Yup, it does."
7691 echo "Nope, it doesn't."
7696 : see if crypt exists
7698 if set crypt val -f d_crypt; eval $csym; $val; then
7699 echo 'crypt() found.' >&4
7703 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7704 if $test -z "$cryptlib"; then
7705 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7709 if $test -z "$cryptlib"; then
7710 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7714 if $test -z "$cryptlib"; then
7715 cryptlib=`./loc libcrypt$_a "" $libpth`
7719 if $test -z "$cryptlib"; then
7720 echo 'crypt() NOT found.' >&4
7729 : get csh whereabouts
7731 'csh') val="$undef" ;;
7736 : Respect a hint or command line value for full_csh.
7738 '') full_csh=$csh ;;
7741 : see if cuserid exists
7742 set cuserid d_cuserid
7745 : see if this is a limits.h system
7746 set limits.h i_limits
7749 : see if this is a float.h system
7753 : See if number of significant digits in a double precision number is known
7755 $cat >dbl_dig.c <<EOM
7765 printf("Contains DBL_DIG");
7768 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7769 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7770 echo "DBL_DIG found." >&4
7773 echo "DBL_DIG NOT found." >&4
7781 if $test X"$use64bits" = X"$define"; then
7782 : see if dbminit64 exists
7783 set dbminit64 d_dbminit64
7786 : see if dbmclose64 exists
7787 set dbmclose64 d_dbmclose64
7790 : see if fetch64 exists
7791 set fetch64 d_fetch64
7794 : see if store64 exists
7795 set store64 d_store64
7798 : see if delete64 exists
7799 set delete64 d_delete64
7802 : see if firstkey64 exists
7803 set firstkey64 d_firstkey64
7806 : see if nextkey64 exists
7807 set nextkey64 d_nextkey64
7811 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7818 : see if difftime exists
7819 set difftime d_difftime
7822 : see if sys/stat.h is available
7823 set sys/stat.h i_sysstat
7826 : see if this is a dirent system
7828 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7830 echo "<dirent.h> found." >&4
7833 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7834 echo "<sys/dir.h> found." >&4
7837 xinc=`./findhdr sys/ndir.h`
7839 echo "<dirent.h> NOT found." >&4
7844 : Look for type of directory structure.
7846 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7848 case "$direntrytype" in
7851 $define) guess1='struct dirent' ;;
7852 *) guess1='struct direct' ;;
7855 *) guess1="$direntrytype"
7860 'struct dirent') guess2='struct direct' ;;
7861 *) guess2='struct dirent' ;;
7864 if $contains "$guess1" try.c >/dev/null 2>&1; then
7865 direntrytype="$guess1"
7866 echo "Your directory entries are $direntrytype." >&4
7867 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7868 direntrytype="$guess2"
7869 echo "Your directory entries seem to be $direntrytype." >&4
7871 echo "I don't recognize your system's directory entries." >&4
7872 rp="What type is used for directory entries on this system?"
7880 : see if the directory entry stores field length
7882 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7883 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7884 echo "Good, your directory entry keeps length information in d_namlen." >&4
7887 echo "Your directory entry does not know about the d_namlen field." >&4
7895 if $test X"$use64bits" = X"$define"; then
7896 : see if fstat64 exists
7897 set fstat64 d_fstat64
7900 : see if ftruncate64 exists
7901 set ftruncate64 d_ftruncate64
7904 : see if lockf64 exists
7905 set lockf64 d_lockf64
7908 : see if llseek exists
7912 : see if lseek64 exists
7913 set lseek64 d_lseek64
7916 : see if lstat64 exists
7917 set lstat64 d_lstat64
7920 : see if open64 exists
7924 : see if opendir64 exists
7925 set opendir64 d_opendir64
7928 : see if readdir64 exists
7929 set readdir64 d_readdir64
7932 : see if seekdir64 exists
7933 set seekdir64 d_seekdir64
7936 : see if stat64 exists
7940 : see if telldir64 exists
7941 set telldir64 d_telldir64
7944 : see if truncate64 exists
7945 set truncate64 d_truncate64
7950 echo $n "Checking to see if your system supports off64_t...$c" >&4
7952 #include <sys/types.h>
7954 off64_t foo() { off64_t x; x = 7; return x; }'
7956 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7958 echo " Yup, it does." >&4
7961 echo " Nope, it doesn't." >&4
7967 : check for offset_t
7969 echo $n "Checking to see if your system supports offset_t...$c" >&4
7971 #include <sys/types.h>
7973 offset_t foo() { offset_t x; x = 7; return x; }'
7975 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7977 echo " Yup, it does." >&4
7980 echo " Nope, it doesn't." >&4
7988 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7990 case "$i_sysstat" in
7993 #include <sys/types.h>
7994 #include <sys/stat.h>
7995 ino64_t foo() { ino64_t x; x = 7; return x; }'
7997 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8003 if $test "X$val" = X"$define"; then
8004 echo " Yup, it does." >&4
8006 echo " Nope, it doesn't." >&4
8011 : check for struct flock64
8013 echo "Checking to see if your system supports struct flock64..." >&4
8015 set d_flock64_s flock64 l_len define fcntl.h
8022 case "$d_flock64_s" in
8023 "$define") echo "Yup, it does." >&4
8025 *) echo "Nope, it doesn't." >&4
8029 : check for struct dirent64
8031 echo "Checking to see if your system supports struct dirent64..." >&4
8032 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
8034 case "$d_dirent64_s" in
8035 "$define") echo "Yup, it does." >&4
8037 *) echo "Nope, it doesn't." >&4
8043 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_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
8050 : see if dlerror exists
8053 set dlerror d_dlerror
8057 : see if dlfcn is available
8065 On a few systems, the dynamically loaded modules that perl generates and uses
8066 will need a different extension than shared libs. The default will probably
8074 rp='What is the extension of dynamically loaded modules'
8083 : Check if dlsym need a leading underscore
8089 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8090 $cat >dyna.c <<'EOM'
8099 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8101 #include <sys/types.h>
8115 int mode = RTLD_LAZY ;
8117 handle = dlopen("./dyna.$dlext", mode) ;
8118 if (handle == NULL) {
8123 symbol = dlsym(handle, "fred") ;
8124 if (symbol == NULL) {
8125 /* try putting a leading underscore */
8126 symbol = dlsym(handle, "_fred") ;
8127 if (symbol == NULL) {
8140 : Call the object file tmp-dyna.o in case dlext=o.
8141 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8142 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8143 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8144 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8147 1) echo "Test program failed using dlopen." >&4
8148 echo "Perhaps you should not use dynamic loading." >&4;;
8149 2) echo "Test program failed using dlsym." >&4
8150 echo "Perhaps you should not use dynamic loading." >&4;;
8151 3) echo "dlsym needs a leading underscore" >&4
8153 4) echo "dlsym doesn't need a leading underscore." >&4;;
8156 echo "I can't compile and run the test program." >&4
8161 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8166 hasproto='varname=$1; func=$2; shift; shift;
8167 while $test $# -ge 2; do
8169 $define) echo "#include <$2>";;
8173 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8174 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8175 echo "$func() prototype found.";
8178 echo "$func() prototype NOT found.";
8183 $rm -f try.c tryout.c'
8185 : see if prototype for drand48 is available
8187 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8190 : see if dup2 exists
8194 : see if eaccess exists
8195 set eaccess d_eaccess
8198 : see if endgrent exists
8199 set endgrent d_endgrent
8202 : see if endhostent exists
8203 set endhostent d_endhent
8206 : see if endnetent exists
8207 set endnetent d_endnent
8210 : see if endprotoent exists
8211 set endprotoent d_endpent
8214 : see if endpwent exists
8215 set endpwent d_endpwent
8218 : see if endservent exists
8219 set endservent d_endsent
8222 : see if endspent exists
8223 set endspent d_endspent
8226 : Locate the flags for 'open()'
8228 $cat >open3.c <<'EOCP'
8229 #include <sys/types.h>
8234 #include <sys/file.h>
8245 : check sys/file.h first to get FREAD on Sun
8246 if $test `./findhdr sys/file.h` && \
8247 set open3 -DI_SYS_FILE && eval $compile; then
8249 echo "<sys/file.h> defines the O_* constants..." >&4
8251 echo "and you have the 3 argument form of open()." >&4
8254 echo "but not the 3 argument form of open(). Oh, well." >&4
8257 elif $test `./findhdr fcntl.h` && \
8258 set open3 -DI_FCNTL && eval $compile; then
8260 echo "<fcntl.h> defines the O_* constants..." >&4
8262 echo "and you have the 3 argument form of open()." >&4
8265 echo "but not the 3 argument form of open(). Oh, well." >&4
8270 echo "I can't find the O_* constant definitions! You got problems." >&4
8276 : check for non-blocking I/O stuff
8277 case "$h_sysfile" in
8278 true) echo "#include <sys/file.h>" > head.c;;
8281 true) echo "#include <fcntl.h>" > head.c;;
8282 *) echo "#include <sys/fcntl.h>" > head.c;;
8287 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8288 case "$o_nonblock" in
8291 $cat >>try.c <<'EOCP'
8294 printf("O_NONBLOCK\n");
8298 printf("O_NDELAY\n");
8302 printf("FNDELAY\n");
8309 if eval $compile_ok; then
8311 case "$o_nonblock" in
8312 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8313 *) echo "Seems like we can use $o_nonblock.";;
8316 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8319 *) echo "Using $hint value $o_nonblock.";;
8321 $rm -f try try.* .out core
8324 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8330 #include <sys/types.h>
8332 #define MY_O_NONBLOCK $o_nonblock
8333 #ifndef errno /* XXX need better Configure test */
8336 $signal_t blech(x) int x; { exit(3); }
8338 $cat >> try.c <<'EOCP'
8346 pipe(pd); /* Down: child -> parent */
8347 pipe(pu); /* Up: parent -> child */
8350 close(pd[1]); /* Parent reads from pd[0] */
8351 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8352 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8354 signal(SIGALRM, blech);
8356 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8358 sprintf(string, "%d\n", ret);
8359 write(2, string, strlen(string));
8362 if (errno == EAGAIN) {
8368 if (errno == EWOULDBLOCK)
8369 printf("EWOULDBLOCK\n");
8372 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8373 sleep(2); /* Give it time to close our pipe */
8375 ret = read(pd[0], buf, 1); /* Should read EOF */
8377 sprintf(string, "%d\n", ret);
8378 write(3, string, strlen(string));
8382 close(pd[0]); /* We write to pd[1] */
8383 close(pu[1]); /* We read from pu[0] */
8384 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8385 close(pd[1]); /* Pipe pd is now fully closed! */
8386 exit(0); /* Bye bye, thank you for playing! */
8390 if eval $compile_ok; then
8391 echo "$startsh" >mtry
8392 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8394 ./mtry >/dev/null 2>&1
8396 0) eagain=`$cat try.out`;;
8397 1) echo "Could not perform non-blocking setting!";;
8398 2) echo "I did a successful read() for something that was not there!";;
8399 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8400 *) echo "Something terribly wrong happened during testing.";;
8402 rd_nodata=`$cat try.ret`
8403 echo "A read() system call with no data present returns $rd_nodata."
8404 case "$rd_nodata" in
8407 echo "(That's peculiar, fixing that to be -1.)"
8413 echo "Forcing errno EAGAIN on read() with no data available."
8417 echo "Your read() sets errno to $eagain when no data is available."
8420 status=`$cat try.err`
8422 0) echo "And it correctly returns 0 to signal EOF.";;
8423 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8424 *) echo "However, your read() returns '$status' on EOF??";;
8427 if test "$status" = "$rd_nodata"; then
8428 echo "WARNING: you can't distinguish between EOF and no data!"
8432 echo "I can't compile the test program--assuming errno EAGAIN will do."
8439 echo "Using $hint value $eagain."
8440 echo "Your read() returns $rd_nodata when no data is present."
8441 case "$d_eofnblk" in
8442 "$define") echo "And you can see EOF because read() returns 0.";;
8443 "$undef") echo "But you can't see EOF status from read() returned value.";;
8445 echo "(Assuming you can't see EOF status from read anyway.)"
8451 $rm -f try try.* .out core head.c mtry
8453 : see if fchmod exists
8457 : see if fchown exists
8461 : see if this is an fcntl system
8465 : see if sys/select.h has to be included
8466 set sys/select.h i_sysselct
8469 : see if we should include time.h, sys/time.h, or both
8471 if test "X$timeincl" = X; then
8472 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8473 $echo $n "I'm now running the test program...$c"
8474 $cat >try.c <<'EOCP'
8475 #include <sys/types.h>
8480 #ifdef SYSTIMEKERNEL
8483 #include <sys/time.h>
8486 #include <sys/select.h>
8495 struct timezone tzp;
8497 if (foo.tm_sec == foo.tm_sec)
8500 if (bar.tv_sec == bar.tv_sec)
8507 for s_timezone in '-DS_TIMEZONE' ''; do
8509 for s_timeval in '-DS_TIMEVAL' ''; do
8510 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8511 for i_time in '' '-DI_TIME'; do
8512 for i_systime in '-DI_SYSTIME' ''; do
8515 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8516 if eval $compile; then
8517 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8521 $echo $n "Succeeded with $flags$c"
8533 *SYSTIMEKERNEL*) i_systimek="$define"
8534 timeincl=`./findhdr sys/time.h`
8535 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8536 *) i_systimek="$undef";;
8539 *I_TIME*) i_time="$define"
8540 timeincl=`./findhdr time.h`" $timeincl"
8541 echo "We'll include <time.h>." >&4;;
8542 *) i_time="$undef";;
8545 *I_SYSTIME*) i_systime="$define"
8546 timeincl=`./findhdr sys/time.h`" $timeincl"
8547 echo "We'll include <sys/time.h>." >&4;;
8548 *) i_systime="$undef";;
8553 : check for fd_set items
8556 Checking to see how well your C compiler handles fd_set and friends ...
8558 $cat >fd_set.c <<EOCP
8559 #$i_systime I_SYS_TIME
8560 #$i_sysselct I_SYS_SELECT
8561 #$d_socket HAS_SOCKET
8562 #include <sys/types.h>
8564 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8567 #include <sys/time.h>
8570 #include <sys/select.h>
8579 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8586 set fd_set -DTRYBITS
8587 if eval $compile; then
8588 d_fds_bits="$define"
8590 echo "Well, your system knows about the normal fd_set typedef..." >&4
8592 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8593 d_fd_macros="$define"
8596 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8598 d_fd_macros="$undef"
8602 Hmm, your compiler has some difficulty with fd_set. Checking further...
8605 if eval $compile; then
8608 echo "Well, your system has some sort of fd_set available..." >&4
8610 echo "and you have the normal fd_set macros." >&4
8611 d_fd_macros="$define"
8614 but not the normal fd_set macros! Gross! More work for me...
8616 d_fd_macros="$undef"
8619 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8622 d_fd_macros="$undef"
8627 : see if fgetpos exists
8628 set fgetpos d_fgetpos
8632 if $test X"$use64bits" = X"$define"; then
8633 : see if fgetpos64 exists
8634 set fgetpos64 d_fgetpos64
8637 : see if fopen64 exists
8638 set freopen64 d_fopen64
8641 : see if freopen64 exists
8642 set freopen64 d_freopen64
8645 : see if fseek64 exists
8646 set fseek64 d_fseek64
8649 : see if fseeko64 exists
8650 set fseeko64 d_fseeko64
8653 : see if fsetpos64 exists
8654 set fsetpos64 d_fsetpos64
8657 : see if ftell64 exists
8658 set ftell64 d_ftell64
8661 : see if ftello64 exists
8662 set ftello64 d_ftello64
8665 : see if tmpfile64 exists
8666 set tmpfile64 d_tmpfile64
8670 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8677 : see if flock exists
8681 : see if fork exists
8685 : see if pathconf exists
8686 set pathconf d_pathconf
8689 : see if fpathconf exists
8690 set fpathconf d_fpathconf
8693 : see if fseeko exists
8697 : see if fsetpos exists
8698 set fsetpos d_fsetpos
8701 : see if this is a sys/param system
8702 set sys/param.h i_sysparam
8705 : see if this is a sys/mount.h system
8706 set sys/mount.h i_sysmount
8710 : see if statfs exists
8714 : see if fstatfs exists
8715 set fstatfs d_fstatfs
8718 : see if statfs knows about mount flags
8719 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8723 : see if statvfs exists
8724 set statvfs d_statvfs
8727 : see if fstatvfs exists
8728 set fstatvfs d_fstatvfs
8732 : see if ftello exists
8736 : see if getgrent exists
8737 set getgrent d_getgrent
8740 : see if gethostbyaddr exists
8741 set gethostbyaddr d_gethbyaddr
8744 : see if gethostbyname exists
8745 set gethostbyname d_gethbyname
8748 : see if gethostent exists
8749 set gethostent d_gethent
8752 : see how we will look up host name
8755 if set gethostname val -f d_gethname; eval $csym; $val; then
8756 echo 'gethostname() found.' >&4
8757 d_gethname="$define"
8760 if set uname val -f d_uname; eval $csym; $val; then
8763 uname() was found, but you're running xenix, and older versions of xenix
8764 have a broken uname(). If you don't really know whether your xenix is old
8765 enough to have a broken system call, use the default answer.
8772 rp='Is your uname() broken?'
8775 n*) d_uname="$define"; call=uname;;
8778 echo 'uname() found.' >&4
8785 case "$d_gethname" in
8786 '') d_gethname="$undef";;
8789 '') d_uname="$undef";;
8791 case "$d_uname$d_gethname" in
8796 Every now and then someone has a $call() that lies about the hostname
8797 but can't be fixed for political or economic reasons. If you wish, I can
8798 pretend $call() isn't there and maybe compute hostname at run-time
8799 thanks to the '$phostname' command.
8802 rp="Shall I ignore $call() from now on?"
8805 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8808 case "$phostname" in
8810 *) case "$aphostname" in
8816 file=`./loc $file $file $pth`
8817 aphostname=`echo $file $*`
8822 case "$d_uname$d_gethname" in
8825 case "$phostname" in
8827 echo "There will be no way for $package to get your hostname." >&4;;
8829 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8833 case "$d_phostname" in
8834 '') d_phostname="$undef";;
8837 : see if this is a netdb.h system
8841 : see if prototypes for various gethostxxx netdb.h functions are available
8843 set d_gethostprotos gethostent $i_netdb netdb.h
8846 : see if getlogin exists
8847 set getlogin d_getlogin
8850 : see if getmntent exists
8851 set getmntent d_getmntent
8854 : see if getnetbyaddr exists
8855 set getnetbyaddr d_getnbyaddr
8858 : see if getnetbyname exists
8859 set getnetbyname d_getnbyname
8862 : see if getnetent exists
8863 set getnetent d_getnent
8866 : see if prototypes for various getnetxxx netdb.h functions are available
8868 set d_getnetprotos getnetent $i_netdb netdb.h
8872 : see if getprotobyname exists
8873 set getprotobyname d_getpbyname
8876 : see if getprotobynumber exists
8877 set getprotobynumber d_getpbynumber
8880 : see if getprotoent exists
8881 set getprotoent d_getpent
8884 : see if getpgid exists
8885 set getpgid d_getpgid
8888 : see if getpgrp2 exists
8889 set getpgrp2 d_getpgrp2
8892 : see if getppid exists
8893 set getppid d_getppid
8896 : see if getpriority exists
8897 set getpriority d_getprior
8900 : see if prototypes for various getprotoxxx netdb.h functions are available
8902 set d_getprotoprotos getprotoent $i_netdb netdb.h
8905 : see if getpwent exists
8906 set getpwent d_getpwent
8910 : see if getservbyname exists
8911 set getservbyname d_getsbyname
8914 : see if getservbyport exists
8915 set getservbyport d_getsbyport
8918 : see if getservent exists
8919 set getservent d_getsent
8922 : see if prototypes for various getservxxx netdb.h functions are available
8924 set d_getservprotos getservent $i_netdb netdb.h
8927 : see if getspent exists
8928 set getspent d_getspent
8931 : see if getspnam exists
8932 set getspnam d_getspnam
8935 : see if gettimeofday or ftime exists
8936 set gettimeofday d_gettimeod
8938 case "$d_gettimeod" in
8944 val="$undef"; set d_ftime; eval $setvar
8947 case "$d_gettimeod$d_ftime" in
8950 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8954 : see if this is an grp system
8960 xxx=`./findhdr grp.h`
8961 $cppstdin $cppflags $cppminus < $xxx >$$.h
8963 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8975 set d_grpasswd; eval $setvar
8979 : see if hasmntopt exists
8980 set hasmntopt d_hasmntopt
8983 : see if this is a netinet/in.h or sys/in.h system
8984 set netinet/in.h i_niin sys/in.h i_sysin
8987 : see if arpa/inet.h has to be included
8988 set arpa/inet.h i_arpainet
8991 : see if htonl --and friends-- exists
8996 : Maybe they are macros.
9001 #include <sys/types.h>
9002 #$i_niin I_NETINET_IN
9004 #$i_arpainet I_ARPA_INET
9006 #include <netinet/in.h>
9012 #include <arpa/inet.h>
9015 printf("Defined as a macro.");
9018 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9019 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9021 echo "But it seems to be defined as a macro." >&4
9029 : see which of string.h or strings.h is needed
9031 strings=`./findhdr string.h`
9032 if $test "$strings" && $test -r "$strings"; then
9033 echo "Using <string.h> instead of <strings.h>." >&4
9037 strings=`./findhdr strings.h`
9038 if $test "$strings" && $test -r "$strings"; then
9039 echo "Using <strings.h> instead of <string.h>." >&4
9041 echo "No string header found -- You'll surely have problems." >&4
9047 "$undef") strings=`./findhdr strings.h`;;
9048 *) strings=`./findhdr string.h`;;
9053 if set index val -f; eval $csym; $val; then
9054 if set strchr val -f d_strchr; eval $csym; $val; then
9055 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9058 echo "strchr() found." >&4
9062 echo "index() found." >&4
9067 echo "index() found." >&4
9070 if set strchr val -f d_strchr; eval $csym; $val; then
9073 echo "strchr() found." >&4
9075 echo "No index() or strchr() found!" >&4
9080 set d_strchr; eval $setvar
9082 set d_index; eval $setvar
9084 : check whether inet_aton exists
9085 set inet_aton d_inetaton
9090 $cat >isascii.c <<'EOCP'
9102 if eval $compile; then
9103 echo "isascii() found." >&4
9106 echo "isascii() NOT found." >&4
9113 : see if killpg exists
9117 : see if lchown exists
9119 $cat > try.c <<'EOCP'
9120 /* System header to define __stub macros and hopefully few prototypes,
9121 which can conflict with char lchown(); below. */
9123 /* Override any gcc2 internal prototype to avoid an error. */
9124 /* We use char because int might match the return type of a gcc2
9125 builtin and then its argument prototype would still apply. */
9128 /* The GNU C library defines this for functions which it implements
9129 to always fail with ENOSYS. Some functions are actually named
9130 something starting with __ and the normal name is an alias. */
9131 #if defined (__stub_lchown) || defined (__stub___lchown)
9139 if eval $compile; then
9140 $echo "lchown() found." >&4
9143 $echo "lchown() NOT found." >&4
9149 : see if link exists
9153 : see if localeconv exists
9154 set localeconv d_locconv
9157 : see if lockf exists
9161 : see if lstat exists
9165 : see if madvise exists
9166 set madvise d_madvise
9169 : see if mblen exists
9173 : see if mbstowcs exists
9174 set mbstowcs d_mbstowcs
9177 : see if mbtowc exists
9181 : see if memchr exists
9185 : see if memcmp exists
9189 : see if memcpy exists
9193 : see if memmove exists
9194 set memmove d_memmove
9197 : see if memset exists
9201 : see if mkdir exists
9205 : see if mkfifo exists
9209 : see if mktime exists
9213 : see if this is a sys/mman.h system
9214 set sys/mman.h i_sysmman
9217 : see if mmap exists
9220 : see what shmat returns
9221 : default to something harmless
9223 case "$i_sysmman$d_mmap" in
9225 $cat >mmap.c <<'END'
9226 #include <sys/mman.h>
9229 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9234 echo "and it returns ($mmaptype)." >&4
9240 : see if mprotect exists
9241 set mprotect d_mprotect
9244 : see if msgctl exists
9248 : see if msgget exists
9252 : see if msgsnd exists
9256 : see if msgrcv exists
9260 : see how much of the 'msg*(2)' library is present.
9263 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9264 *"$undef"*) h_msg=false;;
9268 case "`ipcs 2>&1`" in
9269 "SVID messages"*"not configured"*)
9270 echo "Your $osname does not have the msg*(2) configured." >&4
9285 : we could also check for sys/ipc.h ...
9286 if $h_msg && $test `./findhdr sys/msg.h`; then
9287 echo "You have the full msg*(2) library." >&4
9290 echo "You don't have the full msg*(2) library." >&4
9296 : see if msync exists
9300 : see if munmap exists
9304 : see if nice exists
9308 : see if POSIX threads are available
9309 if test "X$usethreads" = "X$define"; then
9310 set pthread.h i_pthread
9318 : how to create joinable pthreads
9319 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9321 echo "Checking what constant to use for creating joinable pthreads..." >&4
9322 $cat >try.c <<'EOCP'
9323 #include <pthread.h>
9325 int detachstate = JOINABLE;
9328 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9329 if eval $compile; then
9330 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9331 val="$undef" # Yes, undef.
9332 set d_old_pthread_create_joinable
9335 set old_pthread_create_joinable
9338 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9339 if eval $compile; then
9340 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9342 set d_old_pthread_create_joinable
9344 val=PTHREAD_CREATE_UNDETACHED
9345 set old_pthread_create_joinable
9348 set try -DJOINABLE=__UNDETACHED
9349 if eval $compile; then
9350 echo "You seem to use __UNDETACHED." >&4
9352 set d_old_pthread_create_joinable
9355 set old_pthread_create_joinable
9358 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9360 set d_old_pthread_create_joinable
9363 set old_pthread_create_joinable
9370 d_old_pthread_create_joinable="$undef"
9371 old_pthread_create_joinable=""
9374 : see if pause exists
9378 : see if pipe exists
9382 : see if poll exists
9387 : see whether the various POSIXish _yields exist
9389 #include <pthread.h>
9395 #ifdef PTHREAD_YIELD
9398 #ifdef PTHREAD_YIELD_NULL
9399 pthread_yield(NULL);
9405 : see if sched_yield exists
9406 set try -DSCHED_YIELD
9407 if eval $compile; then
9409 sched_yield='sched_yield()'
9413 case "$usethreads" in
9416 $define) echo 'sched_yield() found.' >&4 ;;
9417 *) echo 'sched_yield() NOT found.' >&4 ;;
9423 : see if pthread_yield exists
9424 set try -DPTHREAD_YIELD
9425 if eval $compile; then
9427 case "$sched_yield" in
9428 '') sched_yield='pthread_yield()' ;;
9431 set try -DPTHREAD_YIELD_NULL
9432 if eval $compile; then
9434 case "$sched_yield" in
9435 '') sched_yield='pthread_yield(NULL)' ;;
9441 case "$usethreads" in
9444 $define) echo 'pthread_yield() found.' >&4 ;;
9445 *) echo 'pthread_yield() NOT found.' >&4 ;;
9452 case "$sched_yield" in
9453 '') sched_yield=undef ;;
9458 : see if this is a pwd.h system
9464 xxx=`./findhdr pwd.h`
9465 $cppstdin $cppflags $cppminus < $xxx >$$.h
9467 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9475 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9483 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9491 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9499 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9507 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9515 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9523 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9535 set d_pwquota; eval $setvar
9536 set d_pwage; eval $setvar
9537 set d_pwchange; eval $setvar
9538 set d_pwclass; eval $setvar
9539 set d_pwexpire; eval $setvar
9540 set d_pwcomment; eval $setvar
9541 set d_pwgecos; eval $setvar
9542 set d_pwpasswd; eval $setvar
9546 : see if readdir and friends exist
9547 set readdir d_readdir
9549 set seekdir d_seekdir
9551 set telldir d_telldir
9553 set rewinddir d_rewinddir
9556 : see if readlink exists
9557 set readlink d_readlink
9560 : see if readv exists
9564 : see if rename exists
9568 : see if rmdir exists
9572 : see if memory.h is available.
9577 : See if it conflicts with string.h
9583 $cppstdin $cppflags $cppminus < $strings > mem.h
9584 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9586 echo "We won't be including <memory.h>."
9596 : can bcopy handle overlapping blocks?
9601 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9608 $cat >>try.c <<'EOCP'
9611 # include <memory.h>
9614 # include <stdlib.h>
9617 # include <string.h>
9619 # include <strings.h>
9622 # include <unistd.h> /* Needed for NetBSD */
9626 char buf[128], abc[128];
9632 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9634 for (align = 7; align >= 0; align--) {
9635 for (len = 36; len; len--) {
9638 for (off = 1; off <= len; off++) {
9639 bcopy(b, b+off, len);
9640 bcopy(b+off, b, len);
9641 if (bcmp(b, abc, len))
9650 if eval $compile_ok; then
9651 if ./try 2>/dev/null; then
9655 echo "It can't, sorry."
9656 case "$d_memmove" in
9657 "$define") echo "But that's Ok since you have memmove()." ;;
9661 echo "(I can't compile the test program, so we'll assume not...)"
9662 case "$d_memmove" in
9663 "$define") echo "But that's Ok since you have memmove()." ;;
9668 $rm -f try.* try core
9672 : can memcpy handle overlapping blocks?
9677 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9684 $cat >>try.c <<'EOCP'
9687 # include <memory.h>
9690 # include <stdlib.h>
9693 # include <string.h>
9695 # include <strings.h>
9698 # include <unistd.h> /* Needed for NetBSD */
9702 char buf[128], abc[128];
9708 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9709 try to store the string in read-only memory. */
9710 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9712 for (align = 7; align >= 0; align--) {
9713 for (len = 36; len; len--) {
9715 memcpy(b, abc, len);
9716 for (off = 1; off <= len; off++) {
9717 memcpy(b+off, b, len);
9718 memcpy(b, b+off, len);
9719 if (memcmp(b, abc, len))
9728 if eval $compile_ok; then
9729 if ./try 2>/dev/null; then
9733 echo "It can't, sorry."
9734 case "$d_memmove" in
9735 "$define") echo "But that's Ok since you have memmove()." ;;
9739 echo "(I can't compile the test program, so we'll assume not...)"
9740 case "$d_memmove" in
9741 "$define") echo "But that's Ok since you have memmove()." ;;
9746 $rm -f try.* try core
9750 : can memcmp be trusted to compare relative magnitude?
9755 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9762 $cat >>try.c <<'EOCP'
9765 # include <memory.h>
9768 # include <stdlib.h>
9771 # include <string.h>
9773 # include <strings.h>
9776 # include <unistd.h> /* Needed for NetBSD */
9782 if ((a < b) && memcmp(&a, &b, 1) < 0)
9788 if eval $compile_ok; then
9789 if ./try 2>/dev/null; then
9793 echo "No, it can't (it uses signed chars)."
9796 echo "(I can't compile the test program, so we'll assume not...)"
9800 $rm -f try.* try core
9804 : see if select exists
9808 : see if semctl exists
9812 : see if semget exists
9816 : see if semop exists
9820 : see how much of the 'sem*(2)' library is present.
9823 case "$d_semctl$d_semget$d_semop" in
9824 *"$undef"*) h_sem=false;;
9828 case "`ipcs 2>&1`" in
9829 "SVID messages"*"not configured"*)
9830 echo "Your $osname does not have the sem*(2) configured." >&4
9843 : we could also check for sys/ipc.h ...
9844 if $h_sem && $test `./findhdr sys/sem.h`; then
9845 echo "You have the full sem*(2) library." >&4
9848 echo "You don't have the full sem*(2) library." >&4
9854 : see whether sys/sem.h defines union semun
9856 $cat > try.c <<'END'
9857 #include <sys/types.h>
9858 #include <sys/ipc.h>
9859 #include <sys/sem.h>
9860 int main () { union semun semun; semun.buf = 0; }
9863 if eval $compile; then
9864 echo "You have union semun in <sys/sem.h>." >&4
9867 echo "You do not have union semun in <sys/sem.h>." >&4
9870 $rm -f try try.c try.h
9874 : see how to do semctl IPC_STAT
9877 : see whether semctl IPC_STAT can use union semun
9882 # define S_IRUSR S_IREAD
9883 # define S_IWUSR S_IWRITE
9884 # define S_IXUSR S_IEXEC
9886 # define S_IRUSR 0400
9887 # define S_IWUSR 0200
9888 # define S_IXUSR 0100
9890 # define S_IRGRP (S_IRUSR>>3)
9891 # define S_IWGRP (S_IWUSR>>3)
9892 # define S_IXGRP (S_IXUSR>>3)
9893 # define S_IROTH (S_IRUSR>>6)
9894 # define S_IWOTH (S_IWUSR>>6)
9895 # define S_IXOTH (S_IXUSR>>6)
9898 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9899 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9900 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9905 #include <sys/types.h>
9906 #include <sys/ipc.h>
9907 #include <sys/sem.h>
9908 #include <sys/stat.h>
9915 #$d_union_semun HAS_UNION_SEMUN
9918 #ifndef HAS_UNION_SEMUN
9921 struct semid_ds *buf;
9922 unsigned short *array;
9928 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9929 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9931 struct semid_ds argbuf;
9934 st = semctl(sem, 0, IPC_STAT, arg);
9938 # endif /* IPC_STAT */
9939 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9941 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9942 # endif /* IPC_RMID */
9943 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9945 #endif /* IPC_PRIVATE && ... */
9946 printf("semget failed: errno = %d\n", errno);
9952 if eval $compile; then
9955 semun) val="$define" ;;
9961 case "$d_semctl_semun" in
9963 echo "You can use union semun for semctl IPC_STAT." >&4
9966 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9971 : see whether semctl IPC_STAT can use struct semid_ds pointer
9972 $cat > try.c <<'END'
9973 #include <sys/types.h>
9974 #include <sys/ipc.h>
9975 #include <sys/sem.h>
9976 #include <sys/stat.h>
9984 struct semid_ds arg;
9987 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9988 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9991 st = semctl(sem, 0, IPC_STAT, &arg);
9993 printf("semid_ds\n");
9995 # endif /* IPC_STAT */
9996 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9998 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9999 # endif /* IPC_RMID */
10000 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10002 #endif /* IPC_PRIVATE && ... */
10003 printf("semget failed: errno = %d\n", errno);
10010 if eval $compile; then
10013 semid_ds) val="$define" ;;
10017 set d_semctl_semid_ds
10019 case "$d_semctl_semid_ds" in
10021 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10023 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10030 # We do not have the full sem*(2) library, so assume we can not
10036 set d_semctl_semid_ds
10041 : see if setegid exists
10042 set setegid d_setegid
10045 : see if seteuid exists
10046 set seteuid d_seteuid
10049 : see if setgrent exists
10050 set setgrent d_setgrent
10053 : see if sethostent exists
10054 set sethostent d_sethent
10057 : see if setlinebuf exists
10058 set setlinebuf d_setlinebuf
10061 : see if setlocale exists
10062 set setlocale d_setlocale
10065 : see if setnetent exists
10066 set setnetent d_setnent
10069 : see if setprotoent exists
10070 set setprotoent d_setpent
10073 : see if setpgid exists
10074 set setpgid d_setpgid
10077 : see if setpgrp2 exists
10078 set setpgrp2 d_setpgrp2
10081 : see if setpriority exists
10082 set setpriority d_setprior
10085 : see if setpwent exists
10086 set setpwent d_setpwent
10089 : see if setregid exists
10090 set setregid d_setregid
10092 set setresgid d_setresgid
10095 : see if setreuid exists
10096 set setreuid d_setreuid
10098 set setresuid d_setresuid
10101 : see if setrgid exists
10102 set setrgid d_setrgid
10105 : see if setruid exists
10106 set setruid d_setruid
10109 : see if setservent exists
10110 set setservent d_setsent
10113 : see if setsid exists
10114 set setsid d_setsid
10117 : see if setspent exists
10118 set setspent d_setspent
10121 : see if setvbuf exists
10122 set setvbuf d_setvbuf
10125 : see if sfio.h is available
10130 : see if sfio library is available
10141 : Ok, but do we want to use it.
10145 true|$define|[yY]*) dflt='y';;
10148 echo "$package can use the sfio library, but it is experimental."
10149 rp="You seem to have sfio available, do you want to try using it?"
10153 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10155 : Remove sfio from list of libraries to use
10156 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10159 echo "libs = $libs" >&4
10163 *) case "$usesfio" in
10164 true|$define|[yY]*)
10165 echo "Sorry, cannot find sfio on this machine" >&4
10166 echo "Ignoring your setting of usesfio=$usesfio" >&4
10174 $define) usesfio='true';;
10175 *) usesfio='false';;
10178 : see if shmctl exists
10179 set shmctl d_shmctl
10182 : see if shmget exists
10183 set shmget d_shmget
10186 : see if shmat exists
10189 : see what shmat returns
10192 $cat >shmat.c <<'END'
10193 #include <sys/shm.h>
10196 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10201 echo "and it returns ($shmattype)." >&4
10202 : see if a prototype for shmat is available
10203 xxx=`./findhdr sys/shm.h`
10204 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10205 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10216 set d_shmatprototype
10219 : see if shmdt exists
10223 : see how much of the 'shm*(2)' library is present.
10226 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10227 *"$undef"*) h_shm=false;;
10231 case "`ipcs 2>&1`" in
10232 "SVID shared memory"*"not configured"*)
10233 echo "Your $osname does not have the shm*(2) configured." >&4
10236 set shmctl d_shmctl
10238 set shmget d_shmget
10248 : we could also check for sys/ipc.h ...
10249 if $h_shm && $test `./findhdr sys/shm.h`; then
10250 echo "You have the full shm*(2) library." >&4
10253 echo "You don't have the full shm*(2) library." >&4
10260 : see if we have sigaction
10261 if set sigaction val -f d_sigaction; eval $csym; $val; then
10262 echo 'sigaction() found.' >&4
10263 $cat > try.c <<'EOP'
10265 #include <sys/types.h>
10266 #include <signal.h>
10269 struct sigaction act, oact;
10273 if eval $compile_ok; then
10276 echo "But you don't seem to have a useable struct sigaction." >&4
10280 echo 'sigaction NOT found.' >&4
10283 set d_sigaction; eval $setvar
10284 $rm -f try try$_o try.c
10286 : see if sigsetjmp exists
10288 case "$d_sigsetjmp" in
10290 $cat >try.c <<'EOP'
10291 #include <setjmp.h>
10296 if (sigsetjmp(env,1))
10299 siglongjmp(env, 1);
10304 if eval $compile; then
10305 if ./try >/dev/null 2>&1; then
10306 echo "POSIX sigsetjmp found." >&4
10310 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10316 echo "sigsetjmp not found." >&4
10320 *) val="$d_sigsetjmp"
10321 case "$d_sigsetjmp" in
10322 $define) echo "POSIX sigsetjmp found." >&4;;
10323 $undef) echo "sigsetjmp not found." >&4;;
10331 : see if stat knows about block sizes
10333 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10336 : see if _ptr and _cnt from stdio act std
10338 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10339 echo "(Looks like you have stdio.h from Linux.)"
10340 case "$stdio_ptr" in
10341 '') stdio_ptr='((fp)->_IO_read_ptr)'
10344 *) ptr_lval=$d_stdio_ptr_lval;;
10346 case "$stdio_cnt" in
10347 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10350 *) cnt_lval=$d_stdio_cnt_lval;;
10352 case "$stdio_base" in
10353 '') stdio_base='((fp)->_IO_read_base)';;
10355 case "$stdio_bufsiz" in
10356 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10359 case "$stdio_ptr" in
10360 '') stdio_ptr='((fp)->_ptr)'
10363 *) ptr_lval=$d_stdio_ptr_lval;;
10365 case "$stdio_cnt" in
10366 '') stdio_cnt='((fp)->_cnt)'
10369 *) cnt_lval=$d_stdio_cnt_lval;;
10371 case "$stdio_base" in
10372 '') stdio_base='((fp)->_base)';;
10374 case "$stdio_bufsiz" in
10375 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10378 : test whether _ptr and _cnt really work
10379 echo "Checking how std your stdio is..." >&4
10382 #define FILE_ptr(fp) $stdio_ptr
10383 #define FILE_cnt(fp) $stdio_cnt
10385 FILE *fp = fopen("try.c", "r");
10388 18 <= FILE_cnt(fp) &&
10389 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10397 if eval $compile; then
10399 echo "Your stdio acts pretty std."
10402 echo "Your stdio isn't very std."
10405 echo "Your stdio doesn't appear very std."
10411 : Can _ptr be used as an lvalue?
10412 case "$d_stdstdio$ptr_lval" in
10413 $define$define) val=$define ;;
10416 set d_stdio_ptr_lval
10419 : Can _cnt be used as an lvalue?
10420 case "$d_stdstdio$cnt_lval" in
10421 $define$define) val=$define ;;
10424 set d_stdio_cnt_lval
10427 : see if _base is also standard
10429 case "$d_stdstdio" in
10433 #define FILE_base(fp) $stdio_base
10434 #define FILE_bufsiz(fp) $stdio_bufsiz
10436 FILE *fp = fopen("try.c", "r");
10439 19 <= FILE_bufsiz(fp) &&
10440 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10447 if eval $compile; then
10449 echo "And its _base field acts std."
10452 echo "But its _base field isn't std."
10455 echo "However, it seems to be lacking the _base field."
10464 Checking how to access stdio streams by file descriptor number...
10466 case "$stdio_stream_array" in
10467 '') $cat >try.c <<EOCP
10470 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10474 for s in _iob __iob __sF
10476 set try -DSTDIO_STREAM_ARRAY=$s
10477 if eval $compile; then
10478 case "`./try$exe_ext`" in
10479 yes) stdio_stream_array=$s; break ;;
10483 $rm -f try.* try$exe_ext
10485 case "$stdio_stream_array" in
10487 I can't figure out how to access stdio streams by file descriptor number.
10489 d_stdio_stream_array="$undef"
10492 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10494 d_stdio_stream_array="$define"
10498 : see if strcoll exists
10499 set strcoll d_strcoll
10502 : check for structure copying
10504 echo "Checking to see if your C compiler can copy structs..." >&4
10505 $cat >try.c <<'EOCP'
10515 if $cc -c try.c >/dev/null 2>&1 ; then
10517 echo "Yup, it can."
10520 echo "Nope, it can't."
10526 : see if strerror and/or sys_errlist[] exist
10528 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10529 if set strerror val -f d_strerror; eval $csym; $val; then
10530 echo 'strerror() found.' >&4
10531 d_strerror="$define"
10532 d_strerrm='strerror(e)'
10533 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10534 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10535 d_syserrlst="$define"
10537 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10538 d_syserrlst="$undef"
10540 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10541 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10542 echo 'strerror() found in string header.' >&4
10543 d_strerror="$define"
10544 d_strerrm='strerror(e)'
10545 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10546 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10547 d_syserrlst="$define"
10549 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10550 d_syserrlst="$undef"
10552 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10553 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10554 d_strerror="$undef"
10555 d_syserrlst="$define"
10556 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10558 echo 'strerror() and sys_errlist[] NOT found.' >&4
10559 d_strerror="$undef"
10560 d_syserrlst="$undef"
10561 d_strerrm='"unknown"'
10565 : see if strtod exists
10566 set strtod d_strtod
10569 : see if strtol exists
10570 set strtol d_strtol
10573 : see if strtoul exists
10574 set strtoul d_strtoul
10577 : see if strtoull exists
10578 set strtoull d_strtoull
10581 : see if strxfrm exists
10582 set strxfrm d_strxfrm
10585 : see if symlink exists
10586 set symlink d_symlink
10589 : see if syscall exists
10590 set syscall d_syscall
10593 : see if sysconf exists
10594 set sysconf d_sysconf
10597 : see if system exists
10598 set system d_system
10601 : see if tcgetpgrp exists
10602 set tcgetpgrp d_tcgetpgrp
10605 : see if tcsetpgrp exists
10606 set tcsetpgrp d_tcsetpgrp
10609 : see if sys/types.h has to be included
10610 set sys/types.h i_systypes
10613 : see if prototype for telldir is available
10615 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10618 : define an is-a-typedef? function
10619 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10621 "") inclist="sys/types.h";;
10623 eval "varval=\$$var";
10627 for inc in $inclist; do
10628 echo "#include <$inc>" >>temp.c;
10630 echo "#ifdef $type" >> temp.c;
10631 echo "printf(\"We have $type\");" >> temp.c;
10632 echo "#endif" >> temp.c;
10633 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10634 if $contains $type temp.E >/dev/null 2>&1; then
10635 eval "$var=\$type";
10640 *) eval "$var=\$varval";;
10643 : define an is-a-typedef? function that prompts if the type is not available.
10644 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10646 "") inclist="sys/types.h";;
10648 eval "varval=\$$var";
10652 for inc in $inclist; do
10653 echo "#include <$inc>" >>temp.c;
10655 echo "#ifdef $type" >> temp.c;
10656 echo "printf(\"We have $type\");" >> temp.c;
10657 echo "#endif" >> temp.c;
10658 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10660 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10661 if $contains $type temp.E >/dev/null 2>&1; then
10662 echo "$type found." >&4;
10663 eval "$var=\$type";
10665 echo "$type NOT found." >&4;
10671 *) eval "$var=\$varval";;
10674 : see if this is a sys/times.h system
10675 set sys/times.h i_systimes
10678 : see if times exists
10680 if set times val -f d_times; eval $csym; $val; then
10681 echo 'times() found.' >&4
10684 case "$i_systimes" in
10685 "$define") inc='sys/times.h';;
10687 rp="What is the type returned by times() on this system?"
10688 set clock_t clocktype long stdio.h sys/types.h $inc
10691 echo 'times() NOT found, hope that will do.' >&4
10696 : see if truncate exists
10697 set truncate d_truncate
10700 : see if tzname[] exists
10702 if set tzname val -a d_tzname; eval $csym; $val; then
10704 echo 'tzname[] found.' >&4
10707 echo 'tzname[] NOT found.' >&4
10712 : see if umask exists
10716 : backward compatibility for d_hvfork
10717 if test X$d_hvfork != X; then
10718 d_vfork="$d_hvfork"
10721 : see if there is a vfork
10726 : Ok, but do we want to use it. vfork is reportedly unreliable in
10727 : perl on Solaris 2.x, and probably elsewhere.
10731 case "$usevfork" in
10737 Perl can only use a vfork() that doesn't suffer from strict
10738 restrictions on calling functions or modifying global data in
10739 the child. For example, glibc-2.1 contains such a vfork()
10740 that is unsuitable. If your system provides a proper fork()
10741 call, chances are that you do NOT want perl to use vfork().
10744 rp="Do you still want to use vfork()?"
10749 echo "Ok, we won't use vfork()."
10758 $define) usevfork='true';;
10759 *) usevfork='false';;
10762 : see if this is an sysdir system
10763 set sys/dir.h i_sysdir
10766 : see if this is an sysndir system
10767 set sys/ndir.h i_sysndir
10770 : see if closedir exists
10771 set closedir d_closedir
10774 case "$d_closedir" in
10777 echo "Checking whether closedir() returns a status..." >&4
10778 cat > closedir.c <<EOM
10779 #$i_dirent I_DIRENT /**/
10780 #$i_sysdir I_SYS_DIR /**/
10781 #$i_sysndir I_SYS_NDIR /**/
10782 #$i_systypes I_SYS_TYPES /**/
10784 #if defined(I_SYS_TYPES)
10785 #include <sys/types.h>
10787 #if defined(I_DIRENT)
10788 #include <dirent.h>
10789 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10790 #include <sys/dir.h>
10794 #include <sys/ndir.h>
10798 #include <ndir.h> /* may be wrong in the future */
10800 #include <sys/dir.h>
10805 int main() { return closedir(opendir(".")); }
10808 if eval $compile_ok; then
10809 if ./closedir > /dev/null 2>&1 ; then
10810 echo "Yes, it does."
10813 echo "No, it doesn't."
10817 echo "(I can't seem to compile the test program--assuming it doesn't)"
10825 set d_void_closedir
10828 : check for volatile keyword
10830 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10831 $cat >try.c <<'EOCP'
10834 typedef struct _goo_struct goo_struct;
10835 goo_struct * volatile goo = ((goo_struct *)0);
10836 struct _goo_struct {
10841 typedef unsigned short foo_t;
10842 char *volatile foo;
10844 volatile foo_t blech;
10848 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10850 echo "Yup, it does."
10853 echo "Nope, it doesn't."
10859 : see if there is a wait4
10863 : see if waitpid exists
10864 set waitpid d_waitpid
10867 : see if wcstombs exists
10868 set wcstombs d_wcstombs
10871 : see if wctomb exists
10872 set wctomb d_wctomb
10875 : see if writev exists
10876 set writev d_writev
10879 : preserve RCS keywords in files with variable substitution, grrr
10884 Revision='$Revision'
10886 case "$crosscompile" in
10887 ''|[nN]*) crosscompile="$undef" ;;
10891 next|rhapsody) multiarch="$define" ;;
10893 case "$multiarch" in
10894 ''|[nN]*) multiarch="$undef" ;;
10897 : check for alignment requirements
10899 case "$crosscompile$multiarch" in
10902 You seem to be either cross-compiling or doing a multiarchitecture build,
10903 skipping the memory alignment check.
10906 case "$alignbytes" in
10907 '') alignbytes=8 ;;
10911 case "$alignbytes" in
10912 '') echo "Checking alignment constraints..." >&4
10913 $cat >try.c <<'EOCP'
10920 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10924 if eval $compile_ok; then
10928 echo "(I can't seem to compile the test program...)"
10931 *) dflt="$alignbytes"
10934 rp="Doubles must be aligned on a how-many-byte boundary?"
10942 : check for ordering of bytes in a long
10944 case "$crosscompile$multiarch" in
10947 You seem to be either cross-compiling or doing a multiarchitecture build,
10948 skipping the byteorder check.
10954 case "$byteorder" in
10957 In the following, larger digits indicate more significance. A big-endian
10958 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10959 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10960 machines may have weird orders like 3412. A Cray will report 87654321. If
10961 the test program works the default is probably right.
10962 I'm now running the test program...
10964 $cat >try.c <<'EOCP'
10971 char c[sizeof(long)];
10974 if (sizeof(long) > 4)
10975 u.l = (0x08070605L << 32) | 0x04030201L;
10978 for (i = 0; i < sizeof(long); i++)
10979 printf("%c", u.c[i]+'0');
10986 if eval $compile && ./try > /dev/null; then
10989 [1-4][1-4][1-4][1-4]|12345678|87654321)
10990 echo "(The test program ran ok.)"
10991 echo "byteorder=$dflt"
10994 ????|????????) echo "(The test program ran ok.)" ;;
10995 *) echo "(The test program didn't run right for some reason.)" ;;
11000 (I can't seem to compile the test program. Guessing big-endian...)
11003 case "$xxx_prompt" in
11005 rp="What is the order of bytes in a long?"
11019 : how do we catenate cpp tokens here?
11021 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11022 $cat >cpp_stuff.c <<'EOCP'
11023 #define RCAT(a,b)a/**/b
11024 #define ACAT(a,b)a ## b
11028 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11029 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11030 echo "Oh! Smells like ANSI's been here." >&4
11031 echo "We can catify or stringify, separately or together!"
11033 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11034 echo "Ah, yes! The good old days!" >&4
11035 echo "However, in the good old days we don't know how to stringify and"
11036 echo "catify at the same time."
11040 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11041 to have to edit the values of CAT[2-5] in config.h...
11043 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11047 : see if this is a db.h system
11053 : Check db version.
11055 echo "Checking Berkeley DB version ..." >&4
11061 #include <sys/types.h>
11066 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11067 int Major, Minor, Patch ;
11068 unsigned long Version ;
11069 (void)db_version(&Major, &Minor, &Patch) ;
11070 printf("You have Berkeley DB Version 2 or greater\n");
11072 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11073 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11074 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11075 Major, Minor, Patch) ;
11077 /* check that db.h & libdb are compatible */
11078 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11079 printf("db.h and libdb are incompatible\n") ;
11083 printf("db.h and libdb are compatible\n") ;
11085 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11086 + DB_VERSION_PATCH ;
11088 /* needs to be >= 2.3.4 */
11089 if (Version < 2003004) {
11090 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11091 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11097 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11098 printf("You have Berkeley DB Version 1\n");
11099 exit(0); /* DB version < 2: the coast is clear. */
11101 exit(1); /* <db.h> not Berkeley DB? */
11107 if eval $compile && ./try; then
11108 echo 'Looks OK.' >&4
11110 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11114 : Remove db from list of libraries to use
11115 echo "Removing unusable -ldb from library list" >&4
11116 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11119 echo "libs = $libs" >&4
11129 : Check the return type needed for hash
11131 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11137 #include <sys/types.h>
11140 #ifndef DB_VERSION_MAJOR
11141 u_int32_t hash_cb (ptr, size)
11149 info.hash = hash_cb;
11153 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11154 if $contains warning try.out >>/dev/null 2>&1 ; then
11157 db_hashtype='u_int32_t'
11160 : XXX Maybe we should just give up here.
11161 db_hashtype=u_int32_t
11163 echo "Help: I can't seem to compile the db test program." >&4
11164 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11167 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11169 *) db_hashtype=u_int32_t
11174 : Check the return type needed for prefix
11176 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11182 #include <sys/types.h>
11185 #ifndef DB_VERSION_MAJOR
11186 size_t prefix_cb (key1, key2)
11194 info.prefix = prefix_cb;
11198 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11199 if $contains warning try.out >>/dev/null 2>&1 ; then
11200 db_prefixtype='int'
11202 db_prefixtype='size_t'
11205 db_prefixtype='size_t'
11206 : XXX Maybe we should just give up here.
11208 echo "Help: I can't seem to compile the db test program." >&4
11209 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11212 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11214 *) db_prefixtype='size_t'
11218 : check for void type
11220 echo "Checking to see how well your C compiler groks the void type..." >&4
11221 case "$voidflags" in
11223 $cat >try.c <<'EOCP'
11229 extern void moo(); /* function returning void */
11230 void (*goo)(); /* ptr to func returning void */
11232 void *hue; /* generic ptr */
11245 int main() { sub(); }
11247 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11248 voidflags=$defvoidused
11249 echo "Good. It appears to support void to the level $package wants.">&4
11250 if $contains warning .out >/dev/null 2>&1; then
11251 echo "However, you might get some warnings that look like this:"
11255 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11256 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11257 echo "It supports 1..."
11258 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11259 echo "It also supports 2..."
11260 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11262 echo "And it supports 4 but not 8 definitely."
11264 echo "It doesn't support 4..."
11265 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11267 echo "But it supports 8."
11270 echo "Neither does it support 8."
11274 echo "It does not support 2..."
11275 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11277 echo "But it supports 4 and 8."
11279 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11281 echo "And it supports 4 but has not heard about 8."
11283 echo "However it supports 8 but not 4."
11288 echo "There is no support at all for void."
11293 case "$voidflags" in
11295 *) $cat >&4 <<'EOM'
11296 Support flag bits are:
11297 1: basic void declarations.
11298 2: arrays of pointers to functions returning void.
11299 4: operations between pointers to and addresses of void functions.
11300 8: generic void pointers.
11303 rp="Your void support flags add up to what?"
11311 : How can we generate normalized random numbers ?
11313 echo "Looking for a random number function..." >&4
11314 case "$randfunc" in
11316 if set drand48 val -f; eval $csym; $val; then
11318 echo "Good, found drand48()." >&4
11319 elif set random val -f; eval $csym; $val; then
11321 echo "OK, found random()." >&4
11324 echo "Yick, looks like I have to use rand()." >&4
11335 *-Dmy_rand=*|*-Dmy_srand=*)
11336 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11337 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11338 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11339 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11343 while $test "$cont"; do
11344 rp="Use which function to generate random numbers?"
11346 if $test "$ans" = "$dflt"; then
11352 if set $ans val -f; eval $csym; $val; then
11356 rp="I cannot find function $ans. Use that name anyway?"
11365 case "$randfunc" in
11367 drand01="drand48()"
11373 case "$randbits" in
11375 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11377 #$i_unistd I_UNISTD
11378 #$i_stdlib I_STDLIB
11381 # include <unistd.h>
11384 # include <stdlib.h>
11389 register unsigned long tmp;
11390 register unsigned long max = 0L;
11392 for (i = 1000; i; i--) {
11393 tmp = (unsigned long) $randfunc();
11394 if (tmp > max) max = tmp;
11396 for (i = 0; max; i++)
11402 if eval $compile_ok; then
11406 echo "(I can't seem to compile the test program...)"
11413 rp="How many bits does your $randfunc() function produce?"
11417 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11418 seedfunc="s$randfunc"
11419 randseedtype=unsigned
11423 rp="How many bits does your $randfunc() function produce?"
11426 seedfunc="s$randfunc"
11427 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11428 if set $seedfunc val -f; eval $csym; $val; then
11429 echo "(Using $seedfunc() to seed random generator)"
11431 echo "(Warning: no $seedfunc() to seed random generator)"
11434 randseedtype=unsigned
11442 echo "Determining whether or not we are on an EBCDIC system..." >&4
11443 $cat >tebcdic.c <<'EOM'
11446 if ('M'==0xd4) return 0;
11453 if eval $compile_ok; then
11455 echo "You have EBCDIC." >&4
11458 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11461 echo "I'm unable to compile the test program." >&4
11462 echo "I'll assume ASCII or some ISO Latin." >&4
11464 $rm -f tebcdic.c tebcdic
11470 Checking how to flush all pending stdio output...
11472 # I only know how to find the first 32 possibly open files on SunOS.
11473 # See also hints/sunos_4_1.sh and util.c --AD
11475 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11477 $cat >>try.c <<EOCP
11479 #$i_unistd I_UNISTD
11481 # include <unistd.h>
11483 #$d_sysconf HAS_SYSCONF
11484 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11485 #ifdef HAS_STDIO_STREAM_ARRAY
11486 # define STDIO_STREAM_ARRAY $stdio_stream_array
11489 FILE* p = fopen("try.out", "w");
11493 # ifdef TRY_FPRINTF
11497 #ifdef TRY_FFLUSH_NULL
11500 #ifdef TRY_FFLUSH_ALL
11502 long open_max = -1;
11503 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11504 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11506 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11507 open_max = sysconf(_SC_OPEN_MAX);
11510 open_max = FOPEN_MAX;
11513 open_max = OPEN_MAX;
11522 # ifdef HAS_STDIO_STREAM_ARRAY
11523 if (open_max > 0) {
11525 for (i = 0; i < open_max; i++)
11526 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11527 STDIO_STREAM_ARRAY[i]._file < open_max &&
11528 STDIO_STREAM_ARRAY[i]._flag)
11529 fflush(&STDIO_STREAM_ARRAY[i]);
11537 : first we have to find out how _not_ to flush
11538 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11540 set try -DTRY_FPUTC
11541 if eval $compile; then
11543 ./try$exe_ext 2>/dev/null
11544 if $test ! -s try.out -a "X$?" = X42; then
11550 set try -DTRY_FPRINTF
11552 if eval $compile; then
11554 ./try$exe_ext 2>/dev/null
11555 if $test ! -s try.out -a "X$?" = X42; then
11556 output=-DTRY_FPRINTF
11562 : check for fflush NULL behaviour
11563 case "$fflushNULL" in
11564 '') set try -DTRY_FFLUSH_NULL $output
11565 if eval $compile; then
11567 ./try$exe_ext 2>/dev/null
11569 if $test -s try.out -a "X$code" = X42; then
11570 fflushNULL="`$cat try.out`"
11572 if $test "X$code" != X42; then
11574 (If this test failed, don't worry, we'll try another method shortly.)
11579 $rm -f core try.core core.try.*
11580 case "$fflushNULL" in
11582 Your fflush(NULL) works okay.
11584 fflushNULL="$define"
11587 Your fflush(NULL) isn't working (contrary to ANSI C).
11589 fflushNULL="$undef"
11592 Cannot figure out whether your fflush(NULL) works or not.
11593 I'm assuming it doesn't (contrary to ANSI C).
11595 fflushNULL="$undef"
11599 $define|true|[yY]*)
11600 fflushNULL="$define"
11603 fflushNULL="$undef"
11606 : check explicit looping only if NULL did not work
11607 case "$fflushNULL" in
11609 : check for fflush all behaviour
11610 case "$fflushall" in
11611 '') set try -DTRY_FFLUSH_ALL $output
11612 if eval $compile; then
11614 (Now testing the other method--but note that also this may fail.)
11617 ./try$exe_ext 2>/dev/null
11618 if $test -s try.out -a "X$?" = X42; then
11619 fflushall="`$cat try.out`"
11622 $rm -f core try.core core.try.*
11623 case "$fflushall" in
11625 Whew. Flushing explicitly all the stdio streams works.
11627 fflushall="$define"
11630 Sigh. Flushing explicitly all the stdio streams doesn't work.
11635 Cannot figure out whether flushing stdio streams explicitly works or not.
11636 I'm assuming it doesn't.
11642 "$define"|true|[yY]*)
11643 fflushall="$define"
11650 *) fflushall="$undef"
11653 case "$fflushNULL$fflushall" in
11656 I cannot figure out how to flush pending stdio output.
11660 $rm -f try.* try$exe_ext
11662 : see what type file positions are declared as in the library
11663 rp="What is the type for file position used by fsetpos()?"
11664 set fpos_t fpostype long stdio.h sys/types.h
11667 : Store the full pathname to the ar program for use in the C program
11668 : Respect a hint or command line value for full_ar.
11673 : Store the full pathname to the sed program for use in the C program
11676 : see what type gids are declared as in the kernel
11678 echo "Looking for the type for group ids returned by getgid()."
11679 set gid_t gidtype xxx stdio.h sys/types.h
11683 xxx=`./findhdr sys/user.h`
11684 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11686 unsigned) dflt="$1 $2" ;;
11690 *) dflt="$gidtype";;
11693 gid_t) echo "gid_t found." ;;
11694 *) rp="What is the type for group ids returned by getgid()?"
11700 : see if getgroups exists
11701 set getgroups d_getgrps
11704 : see if setgroups exists
11705 set setgroups d_setgrps
11709 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11711 case "$d_getgrps$d_setgrps" in
11713 case "$groupstype" in
11714 '') dflt="$gidtype" ;;
11715 *) dflt="$groupstype" ;;
11718 What type of pointer is the second argument to getgroups() and setgroups()?
11719 Usually this is the same as group ids, $gidtype, but not always.
11722 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11726 *) groupstype="$gidtype";;
11729 : see what type lseek is declared as in the kernel
11730 rp="What is the type used for lseek's offset on this system?"
11731 set off_t lseektype long stdio.h sys/types.h
11735 $echo $n "Checking to see how big your file offsets are...$c" >&4
11737 #include <sys/types.h>
11741 printf("%d\n", sizeof($lseektype));
11745 if eval $compile_ok; then
11747 $echo " $lseeksize bytes." >&4
11751 echo "(I can't seem to compile the test program. Guessing...)"
11752 rp="What is the size of your file offsets (in bytes)?"
11759 echo "Checking if your $make program sets \$(MAKE)..." >&4
11760 case "$make_set_make" in
11762 $sed 's/^X //' > testmake.mak << 'EOF'
11764 X @echo 'maketemp="$(MAKE)"'
11766 case "`$make -f testmake.mak 2>/dev/null`" in
11767 *maketemp=*) make_set_make='#' ;;
11768 *) make_set_make="MAKE=$make" ;;
11770 $rm -f testmake.mak
11773 case "$make_set_make" in
11774 '#') echo "Yup, it does.";;
11775 *) echo "Nope, it doesn't.";;
11778 : see what type is used for mode_t
11779 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11780 set mode_t modetype int stdio.h sys/types.h
11783 : define a fucntion to check prototypes
11784 $cat > protochk <<EOSH
11787 optimize="$optimize"
11789 prototype="$prototype"
11794 $cat >> protochk <<'EOSH'
11799 while test $# -ge 2; do
11801 $define) echo "#include <$2>" >> try.c ;;
11802 literal) echo "$2" >> try.c ;;
11806 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11807 cat >> try.c <<'EOCP'
11808 #ifdef CAN_PROTOTYPE
11809 #define _(args) args
11814 echo "$foo" >> try.c
11815 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11816 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11822 $eunicefix protochk
11824 : see what type is used for size_t
11825 rp="What is the type used for the length parameter for string functions?"
11826 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11829 : check for type of arguments to gethostbyaddr.
11830 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11831 case "$d_gethbyaddr" in
11835 Checking to see what type of arguments are accepted by gethostbyaddr().
11837 hdrs="$define sys/types.h
11838 $d_socket sys/socket.h
11839 $i_niin netinet/in.h
11841 $i_unistd unistd.h"
11842 : The first arg can 'char *' or 'void *'
11843 : The second arg is some of integral type
11844 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11845 for yyy in size_t long int; do
11846 case "$netdb_host_type" in
11847 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11848 if ./protochk "$try" $hdrs; then
11849 echo "Your system accepts $xxx for the first arg."
11850 echo "...and $yyy for the second arg."
11851 netdb_host_type="$xxx"
11852 netdb_hlen_type="$yyy"
11858 : In case none of those worked, prompt the user.
11859 case "$netdb_host_type" in
11860 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11863 netdb_host_type=$ans
11864 rp='What is the type for the 2nd argument to gethostbyaddr?'
11867 netdb_hlen_type=$ans
11871 *) : no gethostbyaddr, so pick harmless defaults
11872 netdb_host_type='char *'
11873 netdb_hlen_type="$sizetype"
11876 # Remove the "const" if needed. -- but then we'll have a
11878 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11881 : check for type of argument to gethostbyname.
11882 if test "X$netdb_name_type" = X ; then
11883 case "$d_gethbyname" in
11887 Checking to see what type of argument is accepted by gethostbyname().
11889 hdrs="$define sys/types.h
11890 $d_socket sys/socket.h
11891 $i_niin netinet/in.h
11893 $i_unistd unistd.h"
11894 for xxx in "const char *" "char *"; do
11895 case "$netdb_name_type" in
11896 '') try="extern struct hostent *gethostbyname($xxx);"
11897 if ./protochk "$try" $hdrs; then
11898 echo "Your system accepts $xxx."
11899 netdb_name_type="$xxx"
11904 : In case none of those worked, prompt the user.
11905 case "$netdb_name_type" in
11906 '') rp='What is the type for the 1st argument to gethostbyname?'
11909 netdb_name_type=$ans
11913 *) : no gethostbyname, so pick harmless default
11914 netdb_name_type='char *'
11919 : check for type of 1st argument to getnetbyaddr.
11920 if test "X$netdb_net_type" = X ; then
11921 case "$d_getnbyaddr" in
11925 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11927 hdrs="$define sys/types.h
11928 $d_socket sys/socket.h
11929 $i_niin netinet/in.h
11931 $i_unistd unistd.h"
11932 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11933 case "$netdb_net_type" in
11934 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11935 if ./protochk "$try" $hdrs; then
11936 echo "Your system accepts $xxx."
11937 netdb_net_type="$xxx"
11942 : In case none of those worked, prompt the user.
11943 case "$netdb_net_type" in
11944 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11947 netdb_net_type=$ans
11951 *) : no getnetbyaddr, so pick harmless default
11952 netdb_net_type='long'
11956 : locate the preferred pager for this system
11970 '') dflt=/usr/ucb/more;;
11977 rp='What pager is used on your system?'
11981 : see what type pids are declared as in the kernel
11982 rp="What is the type of process ids on this system?"
11983 set pid_t pidtype int stdio.h sys/types.h
11986 : check for length of pointer
11990 $echo $n "Checking to see how big your pointers are...$c" >&4
11991 if test "$voidflags" -gt 7; then
11992 echo '#define VOID_PTR char *' > try.c
11994 echo '#define VOID_PTR void *' > try.c
11996 $cat >>try.c <<'EOCP'
12000 printf("%d\n", sizeof(VOID_PTR));
12005 if eval $compile_ok; then
12007 $echo " $ptrsize bytes." >&4
12010 echo "(I can't seem to compile the test program. Guessing...)" >&4
12011 rp="What is the size of a pointer (in bytes)?"
12019 : see if ar generates random libraries by itself
12021 echo "Checking how to generate random libraries on your machine..." >&4
12022 echo 'int bar1() { return bar2(); }' > bar1.c
12023 echo 'int bar2() { return 2; }' > bar2.c
12024 $cat > foo.c <<'EOP'
12025 int main() { printf("%d\n", bar1()); exit(0); }
12027 $cc $ccflags -c bar1.c >/dev/null 2>&1
12028 $cc $ccflags -c bar2.c >/dev/null 2>&1
12029 $cc $ccflags -c foo.c >/dev/null 2>&1
12030 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12031 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12032 ./foobar >/dev/null 2>&1; then
12033 echo "$ar appears to generate random libraries itself."
12036 elif $ar ts bar$_a >/dev/null 2>&1 &&
12037 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12038 ./foobar >/dev/null 2>&1; then
12039 echo "a table of contents needs to be added with '$ar ts'."
12046 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12047 $test -f $ranlib || ranlib=''
12050 if $test -n "$ranlib"; then
12051 echo "your system has '$ranlib'; we'll use that."
12054 echo "your system doesn't seem to support random libraries"
12055 echo "so we'll use lorder and tsort to order the libraries."
12062 : check for type of arguments to select.
12063 case "$selecttype" in
12064 '') case "$d_select" in
12067 Checking to see what type of arguments are accepted by select().
12069 hdrs="$define sys/types.h
12070 $i_systime sys/time.h
12071 $i_sysselct sys/select.h
12072 $d_socket sys/socket.h"
12073 : The first arg can be int, unsigned, or size_t
12074 : The last arg may or may not be 'const'
12076 : void pointer has been seen but using that
12077 : breaks the selectminbits test
12078 for xxx in 'fd_set *' 'int *'; do
12079 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12080 for tmo in 'struct timeval *' 'const struct timeval *'; do
12082 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12083 if ./protochk "$try" $hdrs; then
12084 echo "Your system accepts $xxx."
12093 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12094 case "$d_fd_set" in
12095 $define) dflt="fd_set *" ;;
12104 *) : no select, so pick a harmless default
12111 : check for the select 'width'
12112 case "$selectminbits" in
12113 '') case "$d_select" in
12117 Checking to see on how many bits at a time your select() operates...
12120 #include <sys/types.h>
12122 #$i_systime I_SYS_TIME
12123 #$i_systimek I_SYS_TIME_KERNEL
12128 # ifdef I_SYS_TIME_KERNEL
12131 # include <sys/time.h>
12132 # ifdef I_SYS_TIME_KERNEL
12136 #$i_sysselct I_SYS_SELECT
12137 #ifdef I_SYS_SELECT
12138 #include <sys/select.h>
12140 #$d_socket HAS_SOCKET
12142 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12146 #define S sizeof(*(b))
12148 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12149 #define NBITS (NBYTES * 8)
12158 fp = fopen("try.c", "r");
12164 b = ($selecttype)s;
12165 for (i = 0; i < NBITS; i++)
12169 select(fd + 1, b, 0, 0, &t);
12170 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12171 printf("%d\n", i + 1);
12176 if eval $compile_ok; then
12177 selectminbits=`./try`
12178 case "$selectminbits" in
12180 Cannot figure out on how many bits at a time your select() operates.
12181 I'll play safe and guess it is 32 bits.
12187 *) bits="$selectminbits bits" ;;
12189 echo "Your select() operates on $bits at a time." >&4
12191 rp='What is the minimum number of bits your select() operates on?'
12192 case "$byteorder" in
12193 1234|12345678) dflt=32 ;;
12198 selectminbits="$val"
12202 *) : no select, so pick a harmless default
12209 : Trace out the files included by signal.h, then look for SIGxxx names.
12210 : Remove SIGARRAYSIZE used by HPUX.
12211 : Remove SIGSTKSIZE used by Linux.
12212 : Remove SIGSTKSZ used by Posix.
12213 : Remove SIGTYP void lines used by OS2.
12214 xxx=`echo '#include <signal.h>' |
12215 $cppstdin $cppminus $cppflags 2>/dev/null |
12216 $grep '^[ ]*#.*include' |
12217 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12218 : Check this list of files to be sure we have parsed the cpp output ok.
12219 : This will also avoid potentially non-existent files, such
12222 for xx in $xxx /dev/null ; do
12223 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12225 : If we have found no files, at least try signal.h
12226 case "$xxxfiles" in
12227 '') xxxfiles=`./findhdr signal.h` ;;
12230 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12231 print substr($2, 4, 20)
12233 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12234 print substr($3, 4, 20)
12236 : Append some common names just in case the awk scan failed.
12237 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12238 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12239 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12240 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12241 : generate a few handy files for later
12242 $cat > signal.c <<'EOCP'
12243 #include <sys/types.h>
12244 #include <signal.h>
12248 /* Strange style to avoid deeply-nested #if/#else/#endif */
12251 # define NSIG (_NSIG)
12257 # define NSIG (SIGMAX+1)
12263 # define NSIG (SIG_MAX+1)
12269 # define NSIG (MAXSIG+1)
12275 # define NSIG (MAX_SIG+1)
12280 # ifdef SIGARRAYSIZE
12281 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12287 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12291 /* Default to some arbitrary number that's big enough to get most
12292 of the common signals.
12298 printf("NSIG %d\n", NSIG);
12304 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12306 printf "#ifdef SIG"; printf $1; printf "\n"
12307 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12308 printf $1; printf ");\n"
12312 printf "#endif /* JUST_NSIG */\n";
12316 $cat >signal.awk <<'EOP'
12317 BEGIN { ndups = 0 }
12318 $1 ~ /^NSIG$/ { nsig = $2 }
12319 ($1 !~ /^NSIG$/) && (NF == 2) {
12320 if ($2 > maxsig) { maxsig = $2 }
12321 if (sig_name[$2]) {
12322 dup_name[ndups] = $1
12323 dup_num[ndups] = $2
12335 printf("NSIG %d\n", nsig);
12336 for (n = 1; n < nsig; n++) {
12338 printf("%s %d\n", sig_name[n], sig_num[n])
12341 printf("NUM%d %d\n", n, n)
12344 for (n = 0; n < ndups; n++) {
12345 printf("%s %d\n", dup_name[n], dup_num[n])
12349 $cat >signal_cmd <<EOS
12351 if $test -s signal.lst; then
12352 echo "Using your existing signal.lst file"
12357 $cat >>signal_cmd <<'EOS'
12360 if eval $compile_ok; then
12361 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12363 echo "(I can't seem be able to compile the whole test program)" >&4
12364 echo "(I'll try it in little pieces.)" >&4
12365 set signal -DJUST_NSIG
12366 if eval $compile_ok; then
12367 ./signal$_exe > signal.nsg
12370 echo "I can't seem to figure out how many signals you have." >&4
12371 echo "Guessing 50." >&4
12372 echo 'NSIG 50' > signal.nsg
12374 : Now look at all the signal names, one at a time.
12375 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12376 $cat > signal.c <<EOCP
12377 #include <sys/types.h>
12378 #include <signal.h>
12381 printf("$xx %d\n", SIG${xx});
12386 if eval $compile; then
12387 echo "SIG${xx} found."
12388 ./signal$_exe >> signal.ls1
12390 echo "SIG${xx} NOT found."
12393 if $test -s signal.ls1; then
12394 $cat signal.nsg signal.ls1 |
12395 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12399 if $test -s signal.lst; then
12402 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12403 echo 'kill -l' >signal
12404 set X `csh -f <signal`
12408 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12410 echo $@ | $tr ' ' $trnl | \
12411 $awk '{ printf "%s %d\n", $1, ++s; }
12412 END { printf "NSIG %d\n", ++s }' >signal.lst
12414 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12416 chmod a+x signal_cmd
12417 $eunicefix signal_cmd
12419 : generate list of signal names
12421 case "$sig_name_init" in
12423 *) case "$sig_num_init" in
12424 ''|*,*) doinit=yes ;;
12429 echo "Generating a list of signal names and numbers..." >&4
12431 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12432 sig_name=`$awk 'BEGIN { printf "ZERO " }
12433 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12434 sig_num=`$awk 'BEGIN { printf "0 " }
12435 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12436 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12437 !/^NSIG/ { printf "\"%s\", ", $1 }
12438 END { printf "0\n" }' signal.lst`
12439 sig_num_init=`$awk 'BEGIN { printf "0, " }
12440 !/^NSIG/ { printf "%d, ", $2}
12441 END { printf "0\n"}' signal.lst`
12444 echo "The following $sig_count signals are available:"
12446 echo $sig_name | $awk \
12447 'BEGIN { linelen = 0 }
12449 for (i = 1; i <= NF; i++) {
12450 name = "SIG" $i " "
12451 linelen = linelen + length(name)
12452 if (linelen > 70) {
12454 linelen = length(name)
12460 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12462 : see what type is used for signed size_t
12463 set ssize_t ssizetype int stdio.h sys/types.h
12466 $cat > ssize.c <<EOM
12468 #include <sys/types.h>
12469 #define Size_t $sizetype
12470 #define SSize_t $dflt
12473 if (sizeof(Size_t) == sizeof(SSize_t))
12475 else if (sizeof(Size_t) == sizeof(int))
12484 if eval $compile_ok && ./ssize > /dev/null; then
12485 ssizetype=`./ssize`
12486 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12489 Help! I can't compile and run the ssize_t test program: please enlighten me!
12490 (This is probably a misconfiguration in your system or libraries, and
12491 you really ought to fix it. Still, I'll try anyway.)
12493 I need a type that is the same size as $sizetype, but is guaranteed to
12494 be signed. Common values are ssize_t, int and long.
12497 rp="What signed type is the same size as $sizetype?"
12501 $rm -f ssize ssize.*
12503 : see what type of char stdio uses.
12505 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12506 echo "Your stdio uses unsigned chars." >&4
12507 stdchar="unsigned char"
12509 echo "Your stdio uses signed chars." >&4
12513 : see if time exists
12515 if test "X$d_time" = X -o X"$timetype" = X; then
12516 if set time val -f d_time; eval $csym; $val; then
12517 echo 'time() found.' >&4
12519 rp="What is the type returned by time() on this system?"
12520 set time_t timetype long stdio.h sys/types.h
12523 echo 'time() not found, hope that will do.' >&4
12531 : see what type uids are declared as in the kernel
12533 echo "Looking for the type for user ids returned by getuid()."
12534 set uid_t uidtype xxx stdio.h sys/types.h
12538 xxx=`./findhdr sys/user.h`
12539 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12541 unsigned) dflt="$1 $2" ;;
12545 *) dflt="$uidtype";;
12548 uid_t) echo "uid_t found." ;;
12549 *) rp="What is the type for user ids returned by getuid()?"
12555 : see if dbm.h is available
12556 : see if dbmclose exists
12557 set dbmclose d_dbmclose
12560 case "$d_dbmclose" in
12570 *) set rpcsvc/dbm.h i_rpcsvcdbm
12575 *) echo "We won't be including <dbm.h>"
12585 : see if this is a sys/file.h system
12590 : do we need to include sys/file.h ?
12594 if $h_sysfile; then
12596 echo "We'll be including <sys/file.h>." >&4
12599 echo "We won't be including <sys/file.h>." >&4
12609 : see if fcntl.h is there
12614 : see if we can include fcntl.h
12620 echo "We'll be including <fcntl.h>." >&4
12623 if $h_sysfile; then
12624 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12626 echo "We won't be including <fcntl.h>." >&4
12638 : see if locale.h is available
12639 set locale.h i_locale
12642 : see if mach cthreads are available
12643 if test "X$usethreads" = "X$define"; then
12644 set mach/cthreads.h i_machcthr
12647 i_machcthr="$undef"
12652 : see if this is a math.h system
12656 : see if this is a mntent.h system
12657 set mntent.h i_mntent
12660 : see if ndbm.h is available
12665 : see if dbm_open exists
12666 set dbm_open d_dbm_open
12668 case "$d_dbm_open" in
12671 echo "We won't be including <ndbm.h>"
12680 : see if net/errno.h is available
12682 set net/errno.h val
12685 : Unfortunately, it causes problems on some systems. Arrgh.
12688 cat > try.c <<'EOM'
12691 #include <net/errno.h>
12697 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12698 echo "We'll be including <net/errno.h>." >&4
12700 echo "We won't be including <net/errno.h>." >&4
12709 : see if netinet/tcp.h is available
12710 set netinet/tcp.h i_netinettcp
12713 : see if this is a poll.h system
12717 : get C preprocessor symbols handy
12719 $echo $n "Hmm... $c"
12720 echo $al | $tr ' ' $trnl >Cppsym.know
12721 $cat <<EOSS >Cppsym
12729 case "\$list\$#" in
12732 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12734 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12737 unknown="\$unknown \$sym"
12747 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12749 exit 0; _ _ _ _\1\\ \1\\
12752 echo "exit 1; _ _ _" >>Cppsym\$\$
12753 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12755 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12761 $rm -f Cppsym\$\$ Cppsym2\$\$
12766 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12768 : now check the C compiler for additional symbols
12769 postprocess_cc_v=''
12771 aix) postprocess_cc_v="|$tr , ' '" ;;
12778 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12781 -D*) echo "\$i" | $sed 's/^-D//';;
12782 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12787 postprocess_cc_v=''
12790 ./ccsym > ccsym1.raw
12791 if $test -s ccsym1.raw; then
12792 $sort ccsym1.raw | $uniq >ccsym.raw
12794 mv ccsym1.raw ccsym.raw
12797 $awk '/\=/ { print $0; next }
12798 { print $0"=1" }' ccsym.raw >ccsym.list
12799 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12800 $comm -13 ccsym.true ccsym.list >ccsym.own
12801 $comm -12 ccsym.true ccsym.list >ccsym.com
12802 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12804 if $test -z ccsym.raw; then
12805 echo "Your C compiler doesn't seem to define any symbols!" >&4
12807 echo "However, your C preprocessor defines the following symbols:"
12810 cppsymbols=`$cat Cppsym.true`
12811 cppsymbols=`echo $cppsymbols`
12812 cppccsymbols="$cppsymbols"
12814 if $test -s ccsym.com; then
12815 echo "Your C compiler and pre-processor define these symbols:"
12816 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12819 cppccsymbols=`$cat ccsym.com`
12820 cppccsymbols=`echo $cppccsymbols`
12821 $test "$silent" || sleep 1
12823 if $test -s ccsym.cpp; then
12824 $test "$also" && echo " "
12825 echo "Your C pre-processor ${also}defines the following symbols:"
12826 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12828 cppsymbols=`$cat ccsym.cpp`
12829 cppsymbols=`echo $cppsymbols`
12830 $test "$silent" || sleep 1
12832 if $test -s ccsym.own; then
12833 $test "$also" && echo " "
12834 echo "Your C compiler ${also}defines the following cpp symbols:"
12835 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12836 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12837 ccsymbols=`$cat ccsym.own`
12838 ccsymbols=`echo $ccsymbols`
12839 $test "$silent" || sleep 1
12844 : see if this is a termio system
12848 if $test `./findhdr termios.h`; then
12849 set tcsetattr i_termios
12855 "$define") echo "You have POSIX termios.h... good!" >&4;;
12856 *) if ./Cppsym pyr; then
12857 case "`/bin/universe`" in
12858 ucb) if $test `./findhdr sgtty.h`; then
12860 echo "<sgtty.h> found." >&4
12862 echo "System is pyramid with BSD universe."
12863 echo "<sgtty.h> not found--you could have problems." >&4
12865 *) if $test `./findhdr termio.h`; then
12867 echo "<termio.h> found." >&4
12869 echo "System is pyramid with USG universe."
12870 echo "<termio.h> not found--you could have problems." >&4
12874 if $test `./findhdr termio.h`; then
12875 echo "<termio.h> found." >&4
12877 elif $test `./findhdr sgtty.h`; then
12878 echo "<sgtty.h> found." >&4
12881 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12884 if $test `./findhdr sgtty.h`; then
12885 echo "<sgtty.h> found." >&4
12887 elif $test `./findhdr termio.h`; then
12888 echo "<termio.h> found." >&4
12891 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12895 set i_termio; eval $setvar
12896 val=$val2; set i_sgtty; eval $setvar
12897 val=$val3; set i_termios; eval $setvar
12899 : see if this is a shadow.h system
12900 set shadow.h i_shadow
12903 : see if this is a socks.h system
12904 set socks.h i_socks
12907 : see if stdarg is available
12909 if $test `./findhdr stdarg.h`; then
12910 echo "<stdarg.h> found." >&4
12913 echo "<stdarg.h> NOT found." >&4
12917 : see if varags is available
12919 if $test `./findhdr varargs.h`; then
12920 echo "<varargs.h> found." >&4
12922 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12925 : set up the varargs testing programs
12926 $cat > varargs.c <<EOP
12928 #include <stdarg.h>
12931 #include <varargs.h>
12935 int f(char *p, ...)
12949 p = va_arg(ap, char *);
12954 $cat > varargs <<EOP
12956 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12965 : now check which varargs header should be included
12970 if `./varargs I_STDARG`; then
12972 elif `./varargs I_VARARGS`; then
12977 if `./varargs I_VARARGS`; then
12984 echo "I could not find the definition for va_dcl... You have problems..." >&4
12985 val="$undef"; set i_stdarg; eval $setvar
12986 val="$undef"; set i_varargs; eval $setvar
12991 case "$i_varhdr" in
12993 val="$define"; set i_stdarg; eval $setvar
12994 val="$undef"; set i_varargs; eval $setvar
12997 val="$undef"; set i_stdarg; eval $setvar
12998 val="$define"; set i_varargs; eval $setvar
13001 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13005 : see if stddef is available
13006 set stddef.h i_stddef
13009 : see if sys/access.h is available
13010 set sys/access.h i_sysaccess
13013 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13014 set sys/filio.h i_sysfilio
13017 if $test `./findhdr sys/ioctl.h`; then
13019 echo '<sys/ioctl.h> found.' >&4
13022 if $test $i_sysfilio = "$define"; then
13023 echo '<sys/ioctl.h> NOT found.' >&4
13025 $test $i_sgtty = "$define" && xxx="sgtty.h"
13026 $test $i_termio = "$define" && xxx="termio.h"
13027 $test $i_termios = "$define" && xxx="termios.h"
13028 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13034 : see if sys/resource.h has to be included
13035 set sys/resource.h i_sysresrc
13038 : see if sys/security.h is available
13039 set sys/security.h i_syssecrt
13042 : see if this is a sys/statvfs.h system
13043 set sys/statvfs.h i_sysstatvfs
13046 : see if this is a sys/un.h system
13047 set sys/un.h i_sysun
13050 : see if this is a syswait system
13051 set sys/wait.h i_syswait
13054 : see if this is an utime system
13055 set utime.h i_utime
13058 : see if this is a values.h system
13059 set values.h i_values
13062 : see if this is a vfork system
13065 set vfork.h i_vfork
13073 : see if gdbm.h is available
13078 : see if gdbm_open exists
13079 set gdbm_open d_gdbm_open
13081 case "$d_gdbm_open" in
13084 echo "We won't be including <gdbm.h>"
13094 echo "Looking for extensions..." >&4
13095 : If we are using the old config.sh, known_extensions may contain
13096 : old or inaccurate or duplicate values.
13097 known_extensions=''
13098 nonxs_extensions=''
13099 : We do not use find because it might not be available.
13100 : We do not just use MANIFEST because the user may have dropped
13101 : some additional extensions into the source tree and expect them
13104 : Function to recursively find available extensions, ignoring DynaLoader
13105 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13109 DynaLoader|dynaload) ;;
13111 if $test -f $xxx/$xxx.xs; then
13112 known_extensions="$known_extensions $1$xxx";
13113 elif $test -f $xxx/Makefile.PL; then
13114 nonxs_extensions="$nonxs_extensions $1$xxx";
13116 if $test -d $xxx -a $# -lt 10; then
13119 eval $find_extensions;
13131 eval $find_extensions
13132 set X $nonxs_extensions
13134 nonxs_extensions="$*"
13135 set X $known_extensions
13137 known_extensions="$*"
13140 : Now see which are supported on this system.
13142 for xxx in $known_extensions ; do
13146 $define) avail_ext="$avail_ext $xxx" ;;
13149 GDBM_File|gdbm_fil)
13151 $define) avail_ext="$avail_ext $xxx" ;;
13154 NDBM_File|ndbm_fil)
13156 $define) avail_ext="$avail_ext $xxx" ;;
13159 ODBM_File|odbm_fil)
13160 case "${i_dbm}${i_rpcsvcdbm}" in
13161 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13165 case "$useposix" in
13166 true|define|y) avail_ext="$avail_ext $xxx" ;;
13170 case "$useopcode" in
13171 true|define|y) avail_ext="$avail_ext $xxx" ;;
13175 case "$d_socket" in
13176 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13180 case "$usethreads" in
13181 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13185 : XXX Do we need a useipcsysv variable here
13186 case "${d_msg}${d_sem}${d_shm}" in
13187 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13190 *) avail_ext="$avail_ext $xxx"
13199 : Now see which nonxs extensions are supported on this system.
13200 : For now assume all are.
13202 for xxx in $nonxs_extensions ; do
13204 *) nonxs_ext="$nonxs_ext $xxx"
13216 A number of extensions are supplied with $package. You may choose to
13217 compile these extensions for dynamic loading (the default), compile
13218 them into the $package executable (static loading), or not include
13219 them at all. Answer "none" to include no extensions.
13220 Note that DynaLoader is always built and need not be mentioned here.
13223 case "$dynamic_ext" in
13224 '') dflt="$avail_ext" ;;
13225 *) dflt="$dynamic_ext"
13226 # Perhaps we are reusing an old out-of-date config.sh.
13229 if test X"$dynamic_ext" != X"$avail_ext"; then
13231 NOTICE: Your previous config.sh list may be incorrect.
13232 The extensions now available to you are
13234 but the default list from your previous config.sh is
13246 rp="What extensions do you wish to load dynamically?"
13249 none) dynamic_ext=' ' ;;
13250 *) dynamic_ext="$ans" ;;
13253 case "$static_ext" in
13255 : Exclude those already listed in dynamic linking
13257 for xxx in $avail_ext; do
13258 case " $dynamic_ext " in
13260 *) dflt="$dflt $xxx" ;;
13267 *) dflt="$static_ext"
13274 rp="What extensions do you wish to load statically?"
13277 none) static_ext=' ' ;;
13278 *) static_ext="$ans" ;;
13283 A number of extensions are supplied with $package. Answer "none"
13284 to include no extensions.
13285 Note that DynaLoader is always built and need not be mentioned here.
13288 case "$static_ext" in
13289 '') dflt="$avail_ext" ;;
13290 *) dflt="$static_ext"
13291 # Perhaps we are reusing an old out-of-date config.sh.
13294 if test X"$static_ext" != X"$avail_ext"; then
13296 NOTICE: Your previous config.sh list may be incorrect.
13297 The extensions now available to you are
13299 but the default list from your previous config.sh is
13308 : Exclude those that are not xs extensions
13312 rp="What extensions do you wish to include?"
13315 none) static_ext=' ' ;;
13316 *) static_ext="$ans" ;;
13321 set X $dynamic_ext $static_ext $nonxs_ext
13325 : Remove build directory name from cppstdin so it can be used from
13326 : either the present location or the final installed location.
13328 : Get out of the UU directory to get correct path name.
13330 case "$cppstdin" in
13332 echo "Stripping down cppstdin path name"
13338 : end of configuration questions
13340 echo "End of configuration questions."
13343 : back to where it started
13344 if test -d ../UU; then
13348 : configuration may be patched via a 'config.over' file
13349 if $test -f config.over; then
13352 rp='I see a config.over file. Do you wish to load it?'
13355 n*) echo "OK, I'll ignore it.";;
13357 echo "Configuration override changes have been loaded."
13362 : in case they want portability, strip down executable paths
13363 case "$d_portable" in
13366 echo "Stripping down executable paths..." >&4
13367 for file in $loclist $trylist; do
13368 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
13369 eval $file="\$file"
13375 : create config.sh file
13377 echo "Creating config.sh..." >&4
13378 $spitshell <<EOT >config.sh
13381 # This file was produced by running the Configure script. It holds all the
13382 # definitions figured out by Configure. Should you modify one of these values,
13383 # do not forget to propagate your changes by running "Configure -der". You may
13384 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13387 # Package name : $package
13388 # Source directory : $src
13389 # Configuration time: $cf_time
13390 # Configured by : $cf_by
13391 # Target system : $myuname
13401 Revision='$Revision'
13408 alignbytes='$alignbytes'
13409 ansi2knr='$ansi2knr'
13410 aphostname='$aphostname'
13411 apiversion='$apiversion'
13414 archlibexp='$archlibexp'
13415 archname64='$archname64'
13416 archname='$archname'
13417 archobjs='$archobjs'
13422 bincompat5005='$bincompat5005'
13426 byteorder='$byteorder'
13428 castflags='$castflags'
13431 cccdlflags='$cccdlflags'
13432 ccdlflags='$ccdlflags'
13434 ccsymbols='$ccsymbols'
13436 cf_email='$cf_email'
13441 clocktype='$clocktype'
13443 compress='$compress'
13444 contains='$contains'
13448 cpp_stuff='$cpp_stuff'
13449 cppccsymbols='$cppccsymbols'
13450 cppflags='$cppflags'
13452 cppminus='$cppminus'
13454 cppstdin='$cppstdin'
13455 cppsymbols='$cppsymbols'
13456 crosscompile='$crosscompile'
13457 cryptlib='$cryptlib'
13459 d_Gconvert='$d_Gconvert'
13460 d_PRIEldbl='$d_PRIEldbl'
13461 d_PRIFldbl='$d_PRIFldbl'
13462 d_PRIGldbl='$d_PRIGldbl'
13463 d_PRIX64='$d_PRIX64'
13464 d_PRId64='$d_PRId64'
13465 d_PRIeldbl='$d_PRIeldbl'
13466 d_PRIfldbl='$d_PRIfldbl'
13467 d_PRIgldbl='$d_PRIgldbl'
13468 d_PRIi64='$d_PRIi64'
13469 d_PRIo64='$d_PRIo64'
13470 d_PRIu64='$d_PRIu64'
13471 d_PRIx64='$d_PRIx64'
13472 d_access='$d_access'
13473 d_accessx='$d_accessx'
13475 d_archlib='$d_archlib'
13478 d_attribut='$d_attribut'
13481 d_bincompat5005='$d_bincompat5005'
13483 d_bsdgetpgrp='$d_bsdgetpgrp'
13484 d_bsdsetpgrp='$d_bsdsetpgrp'
13486 d_casti32='$d_casti32'
13487 d_castneg='$d_castneg'
13488 d_charvspr='$d_charvspr'
13490 d_chroot='$d_chroot'
13491 d_chsize='$d_chsize'
13492 d_closedir='$d_closedir'
13493 d_cmsghdr_s='$d_cmsghdr_s'
13497 d_cuserid='$d_cuserid'
13498 d_dbl_dig='$d_dbl_dig'
13499 d_dbmclose64='$d_dbmclose64'
13500 d_dbminit64='$d_dbminit64'
13501 d_delete64='$d_delete64'
13502 d_difftime='$d_difftime'
13503 d_dirent64_s='$d_dirent64_s'
13504 d_dirnamlen='$d_dirnamlen'
13505 d_dlerror='$d_dlerror'
13506 d_dlopen='$d_dlopen'
13507 d_dlsymun='$d_dlsymun'
13508 d_dosuid='$d_dosuid'
13509 d_drand48proto='$d_drand48proto'
13511 d_eaccess='$d_eaccess'
13512 d_endgrent='$d_endgrent'
13513 d_endhent='$d_endhent'
13514 d_endnent='$d_endnent'
13515 d_endpent='$d_endpent'
13516 d_endpwent='$d_endpwent'
13517 d_endsent='$d_endsent'
13518 d_endspent='$d_endspent'
13519 d_eofnblk='$d_eofnblk'
13520 d_eunice='$d_eunice'
13521 d_fchmod='$d_fchmod'
13522 d_fchown='$d_fchown'
13524 d_fd_macros='$d_fd_macros'
13525 d_fd_set='$d_fd_set'
13526 d_fds_bits='$d_fds_bits'
13527 d_fetch64='$d_fetch64'
13528 d_fgetpos64='$d_fgetpos64'
13529 d_fgetpos='$d_fgetpos'
13530 d_firstkey64='$d_firstkey64'
13531 d_flexfnam='$d_flexfnam'
13532 d_flock64_s='$d_flock64_s'
13534 d_fopen64='$d_fopen64'
13536 d_fpathconf='$d_fpathconf'
13537 d_freopen64='$d_freopen64'
13538 d_fseek64='$d_fseek64'
13539 d_fseeko64='$d_fseeko64'
13540 d_fseeko='$d_fseeko'
13541 d_fsetpos64='$d_fsetpos64'
13542 d_fsetpos='$d_fsetpos'
13543 d_fstat64='$d_fstat64'
13544 d_fstatfs='$d_fstatfs'
13545 d_fstatvfs='$d_fstatvfs'
13546 d_ftell64='$d_ftell64'
13547 d_ftello64='$d_ftello64'
13548 d_ftello='$d_ftello'
13550 d_ftruncate64='$d_ftruncate64'
13551 d_getgrent='$d_getgrent'
13552 d_getgrps='$d_getgrps'
13553 d_gethbyaddr='$d_gethbyaddr'
13554 d_gethbyname='$d_gethbyname'
13555 d_gethent='$d_gethent'
13556 d_gethname='$d_gethname'
13557 d_gethostprotos='$d_gethostprotos'
13558 d_getlogin='$d_getlogin'
13559 d_getmntent='$d_getmntent'
13560 d_getnbyaddr='$d_getnbyaddr'
13561 d_getnbyname='$d_getnbyname'
13562 d_getnent='$d_getnent'
13563 d_getnetprotos='$d_getnetprotos'
13564 d_getpbyname='$d_getpbyname'
13565 d_getpbynumber='$d_getpbynumber'
13566 d_getpent='$d_getpent'
13567 d_getpgid='$d_getpgid'
13568 d_getpgrp2='$d_getpgrp2'
13569 d_getpgrp='$d_getpgrp'
13570 d_getppid='$d_getppid'
13571 d_getprior='$d_getprior'
13572 d_getprotoprotos='$d_getprotoprotos'
13573 d_getpwent='$d_getpwent'
13574 d_getsbyname='$d_getsbyname'
13575 d_getsbyport='$d_getsbyport'
13576 d_getsent='$d_getsent'
13577 d_getservprotos='$d_getservprotos'
13578 d_getspent='$d_getspent'
13579 d_getspnam='$d_getspnam'
13580 d_gettimeod='$d_gettimeod'
13581 d_gnulibc='$d_gnulibc'
13582 d_grpasswd='$d_grpasswd'
13583 d_hasmntopt='$d_hasmntopt'
13586 d_inetaton='$d_inetaton'
13587 d_ino64_t='$d_ino64_t'
13588 d_int64t='$d_int64t'
13589 d_iovec_s='$d_iovec_s'
13590 d_isascii='$d_isascii'
13591 d_killpg='$d_killpg'
13592 d_lchown='$d_lchown'
13594 d_llseek='$d_llseek'
13595 d_locconv='$d_locconv'
13596 d_lockf64='$d_lockf64'
13598 d_longdbl='$d_longdbl'
13599 d_longlong='$d_longlong'
13600 d_lseek64='$d_lseek64'
13601 d_lstat64='$d_lstat64'
13603 d_madvise='$d_madvise'
13605 d_mbstowcs='$d_mbstowcs'
13606 d_mbtowc='$d_mbtowc'
13607 d_memchr='$d_memchr'
13608 d_memcmp='$d_memcmp'
13609 d_memcpy='$d_memcpy'
13610 d_memmove='$d_memmove'
13611 d_memset='$d_memset'
13613 d_mkfifo='$d_mkfifo'
13614 d_mktime='$d_mktime'
13616 d_mprotect='$d_mprotect'
13618 d_msg_ctrunc='$d_msg_ctrunc'
13619 d_msg_dontroute='$d_msg_dontroute'
13620 d_msg_oob='$d_msg_oob'
13621 d_msg_peek='$d_msg_peek'
13622 d_msg_proxy='$d_msg_proxy'
13623 d_msgctl='$d_msgctl'
13624 d_msgget='$d_msgget'
13625 d_msghdr_s='$d_msghdr_s'
13626 d_msgrcv='$d_msgrcv'
13627 d_msgsnd='$d_msgsnd'
13629 d_munmap='$d_munmap'
13630 d_mymalloc='$d_mymalloc'
13631 d_nextkey64='$d_nextkey64'
13633 d_off64_t='$d_off64_t'
13634 d_offset_t='$d_offset_t'
13635 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13636 d_oldpthreads='$d_oldpthreads'
13637 d_oldsock='$d_oldsock'
13639 d_open64='$d_open64'
13640 d_opendir64='$d_opendir64'
13641 d_pathconf='$d_pathconf'
13643 d_phostname='$d_phostname'
13646 d_portable='$d_portable'
13647 d_pthread_yield='$d_pthread_yield'
13649 d_pwchange='$d_pwchange'
13650 d_pwclass='$d_pwclass'
13651 d_pwcomment='$d_pwcomment'
13652 d_pwexpire='$d_pwexpire'
13653 d_pwgecos='$d_pwgecos'
13654 d_pwpasswd='$d_pwpasswd'
13655 d_pwquota='$d_pwquota'
13656 d_readdir64='$d_readdir64'
13657 d_readdir='$d_readdir'
13658 d_readlink='$d_readlink'
13660 d_recvmsg='$d_recvmsg'
13661 d_rename='$d_rename'
13662 d_rewinddir='$d_rewinddir'
13664 d_safebcpy='$d_safebcpy'
13665 d_safemcpy='$d_safemcpy'
13666 d_sanemcmp='$d_sanemcmp'
13667 d_sched_yield='$d_sched_yield'
13668 d_scm_rights='$d_scm_rights'
13669 d_seekdir64='$d_seekdir64'
13670 d_seekdir='$d_seekdir'
13671 d_select='$d_select'
13673 d_semctl='$d_semctl'
13674 d_semctl_semid_ds='$d_semctl_semid_ds'
13675 d_semctl_semun='$d_semctl_semun'
13676 d_semget='$d_semget'
13678 d_sendmsg='$d_sendmsg'
13679 d_setegid='$d_setegid'
13680 d_seteuid='$d_seteuid'
13681 d_setgrent='$d_setgrent'
13682 d_setgrps='$d_setgrps'
13683 d_sethent='$d_sethent'
13684 d_setlinebuf='$d_setlinebuf'
13685 d_setlocale='$d_setlocale'
13686 d_setnent='$d_setnent'
13687 d_setpent='$d_setpent'
13688 d_setpgid='$d_setpgid'
13689 d_setpgrp2='$d_setpgrp2'
13690 d_setpgrp='$d_setpgrp'
13691 d_setprior='$d_setprior'
13692 d_setpwent='$d_setpwent'
13693 d_setregid='$d_setregid'
13694 d_setresgid='$d_setresgid'
13695 d_setresuid='$d_setresuid'
13696 d_setreuid='$d_setreuid'
13697 d_setrgid='$d_setrgid'
13698 d_setruid='$d_setruid'
13699 d_setsent='$d_setsent'
13700 d_setsid='$d_setsid'
13701 d_setspent='$d_setspent'
13702 d_setvbuf='$d_setvbuf'
13706 d_shmatprototype='$d_shmatprototype'
13707 d_shmctl='$d_shmctl'
13709 d_shmget='$d_shmget'
13710 d_sigaction='$d_sigaction'
13711 d_sigsetjmp='$d_sigsetjmp'
13712 d_socket='$d_socket'
13713 d_sockpair='$d_sockpair'
13714 d_stat64='$d_stat64'
13715 d_statblks='$d_statblks'
13716 d_statfs='$d_statfs'
13717 d_statfsflags='$d_statfsflags'
13718 d_statvfs='$d_statvfs'
13719 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13720 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13721 d_stdio_stream_array='$d_stdio_stream_array'
13722 d_stdiobase='$d_stdiobase'
13723 d_stdstdio='$d_stdstdio'
13724 d_store64='$d_store64'
13725 d_strchr='$d_strchr'
13726 d_strcoll='$d_strcoll'
13727 d_strctcpy='$d_strctcpy'
13728 d_strerrm='$d_strerrm'
13729 d_strerror='$d_strerror'
13730 d_strtod='$d_strtod'
13731 d_strtol='$d_strtol'
13732 d_strtoul='$d_strtoul'
13733 d_strtoull='$d_strtoull'
13734 d_strxfrm='$d_strxfrm'
13735 d_suidsafe='$d_suidsafe'
13736 d_symlink='$d_symlink'
13737 d_syscall='$d_syscall'
13738 d_sysconf='$d_sysconf'
13739 d_sysernlst='$d_sysernlst'
13740 d_syserrlst='$d_syserrlst'
13741 d_system='$d_system'
13742 d_tcgetpgrp='$d_tcgetpgrp'
13743 d_tcsetpgrp='$d_tcsetpgrp'
13744 d_telldir64='$d_telldir64'
13745 d_telldir='$d_telldir'
13746 d_telldirproto='$d_telldirproto'
13749 d_tmpfile64='$d_tmpfile64'
13750 d_truncate64='$d_truncate64'
13751 d_truncate='$d_truncate'
13752 d_tzname='$d_tzname'
13755 d_union_semun='$d_union_semun'
13756 d_vendorlib='$d_vendorlib'
13758 d_void_closedir='$d_void_closedir'
13759 d_voidsig='$d_voidsig'
13760 d_voidtty='$d_voidtty'
13761 d_volatile='$d_volatile'
13762 d_vprintf='$d_vprintf'
13764 d_waitpid='$d_waitpid'
13765 d_wcstombs='$d_wcstombs'
13766 d_wctomb='$d_wctomb'
13767 d_writev='$d_writev'
13770 db_hashtype='$db_hashtype'
13771 db_prefixtype='$db_prefixtype'
13772 defvoidused='$defvoidused'
13773 direntrytype='$direntrytype'
13776 doublesize='$doublesize'
13778 dynamic_ext='$dynamic_ext'
13784 eunicefix='$eunicefix'
13787 extensions='$extensions'
13788 fflushNULL='$fflushNULL'
13789 fflushall='$fflushall'
13791 firstmakefile='$firstmakefile'
13793 fpostype='$fpostype'
13794 freetype='$freetype'
13796 full_csh='$full_csh'
13797 full_sed='$full_sed'
13798 gccversion='$gccversion'
13802 groupcat='$groupcat'
13803 groupstype='$groupstype'
13806 h_sysfile='$h_sysfile'
13810 i_arpainet='$i_arpainet'
13811 i_bsdioctl='$i_bsdioctl'
13814 i_dirent='$i_dirent'
13821 i_inttypes='$i_inttypes'
13822 i_limits='$i_limits'
13823 i_locale='$i_locale'
13824 i_machcthr='$i_machcthr'
13825 i_malloc='$i_malloc'
13827 i_memory='$i_memory'
13828 i_mntent='$i_mntent'
13831 i_neterrno='$i_neterrno'
13832 i_netinettcp='$i_netinettcp'
13835 i_pthread='$i_pthread'
13837 i_rpcsvcdbm='$i_rpcsvcdbm'
13840 i_shadow='$i_shadow'
13842 i_stdarg='$i_stdarg'
13843 i_stddef='$i_stddef'
13844 i_stdlib='$i_stdlib'
13845 i_string='$i_string'
13846 i_sysaccess='$i_sysaccess'
13847 i_sysdir='$i_sysdir'
13848 i_sysfile='$i_sysfile'
13849 i_sysfilio='$i_sysfilio'
13851 i_sysioctl='$i_sysioctl'
13852 i_sysmman='$i_sysmman'
13853 i_sysmount='$i_sysmount'
13854 i_sysndir='$i_sysndir'
13855 i_sysparam='$i_sysparam'
13856 i_sysresrc='$i_sysresrc'
13857 i_syssecrt='$i_syssecrt'
13858 i_sysselct='$i_sysselct'
13859 i_syssockio='$i_syssockio'
13860 i_sysstat='$i_sysstat'
13861 i_sysstatvfs='$i_sysstatvfs'
13862 i_systime='$i_systime'
13863 i_systimek='$i_systimek'
13864 i_systimes='$i_systimes'
13865 i_systypes='$i_systypes'
13866 i_sysuio='$i_sysuio'
13868 i_syswait='$i_syswait'
13869 i_termio='$i_termio'
13870 i_termios='$i_termios'
13872 i_unistd='$i_unistd'
13874 i_values='$i_values'
13875 i_varargs='$i_varargs'
13876 i_varhdr='$i_varhdr'
13878 ignore_versioned_solibs='$ignore_versioned_solibs'
13881 installarchlib='$installarchlib'
13882 installbin='$installbin'
13883 installman1dir='$installman1dir'
13884 installman3dir='$installman3dir'
13885 installprefix='$installprefix'
13886 installprefixexp='$installprefixexp'
13887 installprivlib='$installprivlib'
13888 installscript='$installscript'
13889 installsitearch='$installsitearch'
13890 installsitelib='$installsitelib'
13891 installstyle='$installstyle'
13892 installusrbinperl='$installusrbinperl'
13893 installvendorlib='$installvendorlib'
13895 known_extensions='$known_extensions'
13899 lddlflags='$lddlflags'
13901 ldlibpthname='$ldlibpthname'
13908 libswanted='$libswanted'
13914 locincpth='$locincpth'
13915 loclibpth='$loclibpth'
13916 longdblsize='$longdblsize'
13917 longlongsize='$longlongsize'
13918 longsize='$longsize'
13922 lseeksize='$lseeksize'
13923 lseektype='$lseektype'
13927 make_set_make='$make_set_make'
13928 mallocobj='$mallocobj'
13929 mallocsrc='$mallocsrc'
13930 malloctype='$malloctype'
13932 man1direxp='$man1direxp'
13935 man3direxp='$man3direxp'
13939 mips_type='$mips_type'
13941 mmaptype='$mmaptype'
13943 modetype='$modetype'
13945 multiarch='$multiarch'
13947 myarchname='$myarchname'
13948 mydomain='$mydomain'
13949 myhostname='$myhostname'
13952 netdb_hlen_type='$netdb_hlen_type'
13953 netdb_host_type='$netdb_host_type'
13954 netdb_name_type='$netdb_name_type'
13955 netdb_net_type='$netdb_net_type'
13958 nm_so_opt='$nm_so_opt'
13959 nonxs_ext='$nonxs_ext'
13961 o_nonblock='$o_nonblock'
13963 old_pthread_create_joinable='$old_pthread_create_joinable'
13964 optimize='$optimize'
13965 orderlib='$orderlib'
13971 patchlevel='$patchlevel'
13972 path_sep='$path_sep'
13974 perladmin='$perladmin'
13975 perlpath='$perlpath'
13977 phostname='$phostname'
13983 prefixexp='$prefixexp'
13985 privlibexp='$privlibexp'
13986 prototype='$prototype'
13988 randbits='$randbits'
13989 randfunc='$randfunc'
13990 randseedtype='$randseedtype'
13992 rd_nodata='$rd_nodata'
13996 sPRIEldbl='$sPRIEldbl'
13997 sPRIFldbl='$sPRIFldbl'
13998 sPRIGldbl='$sPRIGldbl'
14001 sPRIeldbl='$sPRIeldbl'
14002 sPRIfldbl='$sPRIfldbl'
14003 sPRIgldbl='$sPRIgldbl'
14008 sched_yield='$sched_yield'
14009 scriptdir='$scriptdir'
14010 scriptdirexp='$scriptdirexp'
14012 seedfunc='$seedfunc'
14013 selectminbits='$selectminbits'
14014 selecttype='$selecttype'
14015 sendmail='$sendmail'
14018 sharpbang='$sharpbang'
14019 shmattype='$shmattype'
14020 shortsize='$shortsize'
14023 sig_count='$sig_count'
14024 sig_name='$sig_name'
14025 sig_name_init='$sig_name_init'
14027 sig_num_init='$sig_num_init'
14028 signal_t='$signal_t'
14029 sitearch='$sitearch'
14030 sitearchexp='$sitearchexp'
14032 sitelibexp='$sitelibexp'
14033 siteprefix='$siteprefix'
14034 siteprefixexp='$siteprefixexp'
14035 sizetype='$sizetype'
14040 sockethdr='$sockethdr'
14041 socketlib='$socketlib'
14043 spackage='$spackage'
14044 spitshell='$spitshell'
14047 ssizetype='$ssizetype'
14048 startperl='$startperl'
14050 static_ext='$static_ext'
14052 stdio_base='$stdio_base'
14053 stdio_bufsiz='$stdio_bufsiz'
14054 stdio_cnt='$stdio_cnt'
14055 stdio_filbuf='$stdio_filbuf'
14056 stdio_ptr='$stdio_ptr'
14057 stdio_stream_array='$stdio_stream_array'
14060 subversion='$subversion'
14067 timeincl='$timeincl'
14068 timetype='$timetype'
14076 use64bits='$use64bits'
14078 usemultiplicity='$usemultiplicity'
14079 usemymalloc='$usemymalloc'
14081 useopcode='$useopcode'
14082 useperlio='$useperlio'
14083 useposix='$useposix'
14085 useshrplib='$useshrplib'
14086 usesocks='$usesocks'
14087 usethreads='$usethreads'
14088 usevendorprefix='$usevendorprefix'
14089 usevfork='$usevfork'
14092 vendorlib='$vendorlib'
14093 vendorlibexp='$vendorlibexp'
14094 vendorprefix='$vendorprefix'
14095 vendorprefixexp='$vendorprefixexp'
14098 voidflags='$voidflags'
14104 : Add in command line options if available
14105 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14107 : add special variables
14108 $test -f $src/patchlevel.h && \
14109 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14110 echo "CONFIGDOTSH=true" >>config.sh
14112 : propagate old symbols
14113 if $test -f UU/config.sh; then
14114 <UU/config.sh sort | uniq >UU/oldconfig.sh
14115 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14116 sort | uniq -u >UU/oldsyms
14117 set X `cat UU/oldsyms`
14123 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14125 echo "# Variables propagated from previous config.sh file." >>config.sh
14126 for sym in `cat UU/oldsyms`; do
14127 echo " Propagating $hint variable "'$'"$sym..."
14128 eval 'tmp="$'"${sym}"'"'
14130 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14136 : Finish up by extracting the .SH files
14150 If you'd like to make any changes to the config.sh file before I begin
14151 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14154 rp="Press return or use a shell escape to edit config.sh:"
14159 *) : in case they cannot read
14160 sh 1>&4 -c "$ans";;
14165 : if this fails, just run all the .SH files by hand
14172 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14179 Now you need to generate make dependencies by running "$make depend".
14180 You might prefer to run it in background: "$make depend > makedepend.out &"
14181 It can take a while, so you might not want to run it right now.
14186 rp="Run $make depend now?"
14190 $make depend && echo "Now you must run a $make."
14193 echo "You must run '$make depend' then '$make'."
14196 elif test -f [Mm]akefile; then
14198 echo "Now you must run a $make."
14203 if $test -f Policy.sh; then
14206 If you compile $package on a different machine or from a different object
14207 directory, copy the Policy.sh file from this object directory to the
14208 new one before you run Configure -- this will help you with most of
14209 the policy defaults.
14213 if $test -f config.msg; then
14214 echo "Hmm. I also noted the following information while running:"
14216 $cat config.msg >&4
14219 $rm -f kit*isdone ark*isdone