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 Sat Oct 30 02:37:12 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
439 d_old_pthread_create_joinable=''
440 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
841 d_stdio_stream_array=''
842 stdio_stream_array=''
887 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
890 : We must find out about Eunice early
892 if test -f /etc/unixtovms; then
893 eunicefix=/etc/unixtovms
895 if test -f /etc/unixtovms.exe; then
896 eunicefix=/etc/unixtovms.exe
900 : Possible local include directories to search.
901 : Set locincpth to "" in a hint file to defeat local include searches.
902 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
903 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
905 : no include file wanted by default
908 : list of known cpp symbols, sorted alphabetically
909 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
910 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
911 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
912 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
913 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
914 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
915 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
916 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
917 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
918 al="$al VMS Xenix286"
919 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
920 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
921 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
922 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
923 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
924 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
925 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
926 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
927 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
928 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
929 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
930 al="$al __SVR4_2__ __UMAXV__"
931 al="$al ____386BSD____ __alpha __alpha__ __amiga"
932 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
933 al="$al __host_mips__"
934 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
935 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
936 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
937 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
938 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
939 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
940 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
941 al="$al __mc88100 __mc88100__ __mips __mips__"
942 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
943 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
944 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
945 al="$al _host_mips _mips _unix"
946 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
947 al="$al apollo ardent att386 att3b"
948 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
949 al="$al cadmus clipper concurrent convex cray ctix"
950 al="$al dmert encore gcos gcx gimpel gould"
951 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
952 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
953 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
954 al="$al i186 i286 i386 i486 i8086"
955 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
956 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
957 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
958 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
959 al="$al mc88000 mc88100 merlin mert mips mvs n16"
960 al="$al ncl_el ncl_mr"
961 al="$al news1500 news1700 news1800 news1900 news3700"
962 al="$al news700 news800 news900 ns16000 ns32000"
963 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
964 al="$al parisc pc532 pdp11 plexus posix pyr"
965 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
966 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
967 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
968 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
969 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
970 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
973 : Trailing extension. Override this in a hint file, if needed.
975 : Extra object files, if any, needed on this platform.
978 : change the next line if compiling for Xenix/286 on Xenix/386
979 xlibpth='/usr/lib/386 /lib/386'
981 : Possible local library directories to search.
982 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
983 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
985 : general looking path for locating libraries
986 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
987 glibpth="$glibpth /lib /usr/lib $xlibpth"
988 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
989 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
991 : Private path used by Configure to find libraries. Its value
992 : is prepended to libpth. This variable takes care of special
993 : machines, like the mips. Usually, it should be empty.
996 : default library list
998 : some systems want to use only the non-versioned libso:s
999 ignore_versioned_solibs=''
1000 : full support for void wanted by default
1003 : set useposix=false in your hint file to disable the POSIX extension.
1005 : set useopcode=false in your hint file to disable the Opcode extension.
1007 : set usemultiplicity on the Configure command line to enable multiplicity.
1008 : set usesocks on the Configure command line to enable socks.
1009 : set usethreads on the Configure command line to enable threads.
1010 : List of libraries we want.
1011 : If anyone needs -lnet, put it in a hint file.
1012 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1013 libswanted="$libswanted dld ld sun m c cposix posix"
1014 libswanted="$libswanted ndir dir crypt sec"
1015 libswanted="$libswanted ucb bsd BSD PW x"
1016 : We probably want to search /usr/shlib before most other libraries.
1017 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1018 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1019 glibpth="/usr/shlib $glibpth"
1020 : Do not use vfork unless overridden by a hint file.
1023 : Find the basic shell for Bourne shell scripts
1027 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1030 if test -f "$xxx"; then
1033 : Build up a list and do a single loop so we can 'break' out.
1034 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1035 for xxx in sh bash ksh pdksh ash; do
1037 try="$try ${p}/${xxx}"
1041 if test -f "$xxx"; then
1044 elif test -f "$xxx.exe"; then
1055 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1057 Usually it's in /bin/sh. How did you even get this far?
1058 Please contact me (Perl Maintainers) at perlbug@perl.com and
1059 we'll try to straighten this all out.
1065 : see if sh knows # comments
1066 if `$sh -c '#' >/dev/null 2>&1`; then
1070 test -f $xcat || xcat=/usr/bin/cat
1075 if test -s today; then
1078 echo "#! $xcat" > try
1082 if test -s today; then
1090 echo "Your $sh doesn't grok # comments--I will strip them later on."
1093 echo "exec grep -v '^[ ]*#'" >spitshell
1095 $eunicefix spitshell
1096 spitshell=`pwd`/spitshell
1098 echo "I presume that if # doesn't work, #! won't work either!"
1103 : figure out how to guarantee sh startup
1105 '') startsh=${sharpbang}${sh} ;;
1117 : echo "Yup, it does."
1119 echo "Hmm... '$startsh' does not guarantee sh startup..."
1120 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1125 : Save command line options in file UU/cmdline.opt for later use in
1126 : generating config.sh.
1127 cat > cmdline.opt <<EOSH
1128 # Configure command line arguments.
1135 cat >>cmdline.opt <<EOSH
1136 config_arg$argn='$arg'
1138 argn=`expr $argn + 1`
1141 : produce awk script to parse command line options
1142 cat >options.awk <<'EOF'
1144 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1146 len = length(optstr);
1147 for (i = 1; i <= len; i++) {
1148 c = substr(optstr, i, 1);
1149 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1160 if (substr(str, 1, 1) != "-") {
1161 printf("'%s'\n", str);
1165 for (i = 2; i <= len; i++) {
1166 c = substr(str, i, 1);
1168 printf("-%s\n", substr(str, i));
1174 printf("'%s'\n", substr(str, i + 1));
1187 : process the command line options
1188 set X `for arg in "$@"; do echo "X$arg"; done |
1189 sed -e s/X// | awk -f options.awk`
1194 : set up default values
1204 rm -f optdef.sh posthint.sh
1205 cat >optdef.sh <<EOS
1211 while test $# -gt 0; do
1213 -d) shift; fastread=yes;;
1214 -e) shift; alldone=cont;;
1218 if test -r "$1"; then
1221 echo "$me: cannot read config file $1." >&2
1226 -h) shift; error=true;;
1227 -r) shift; reuseval=true;;
1228 -s) shift; silent=true; realsilent=true;;
1229 -E) shift; alldone=exit;;
1230 -K) shift; knowitall=true;;
1231 -O) shift; override=true;;
1232 -S) shift; silent=true; extractsh=true;;
1237 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1238 echo "$me: ignoring -D $1" >&2
1241 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1242 *) echo "$1='define'" >> optdef.sh;;
1249 *=) echo "$1" >> optdef.sh;;
1251 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1252 echo "$me: ignoring -U $1" >&2
1254 *) echo "$1='undef'" >> optdef.sh;;
1265 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1269 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1270 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1276 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1277 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1278 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1279 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1280 *) xxx=`echo $yyy|sed 's!:.*!!'`
1281 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1287 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1289 echo "$yyy=''" >> posthint.sh ;;
1294 echo "$yyy='$zzz'" >> posthint.sh ;;
1296 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1298 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1303 echo "$yyy=$zzz" >> posthint.sh ;;
1304 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1307 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1310 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1318 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1319 [-U symbol] [-U symbol=] [-A command:symbol...]
1320 -d : use defaults for all answers.
1321 -e : go on without questioning past the production of config.sh.
1322 -f : specify an alternate default configuration file.
1323 -h : print this help message and exit (with an error status).
1324 -r : reuse C symbols value if possible (skips costly nm extraction).
1325 -s : silent mode, only echoes questions and essential information.
1326 -D : define symbol to have some value:
1327 -D symbol symbol gets the value 'define'
1328 -D symbol=value symbol gets the value 'value'
1329 -E : stop at the end of questions, after having produced config.sh.
1330 -K : do not use unless you know what you are doing.
1331 -O : let -D and -U override definitions from loaded configuration file.
1332 -S : perform variable substitutions on all .SH files (can mix with -f)
1333 -U : undefine symbol:
1334 -U symbol symbol gets the value 'undef'
1335 -U symbol= symbol gets completely empty
1336 -A : manipulate symbol after the platform specific hints have been applied:
1337 -A symbol=value append " "value to symbol
1338 -A append:symbol=value append value to symbol
1339 -A define:symbol=value define symbol to have value
1340 -A clear:symbol define symbol to be ''
1341 -A define:symbol define symbol to be 'define'
1342 -A eval:symbol=value define symbol to be eval of value
1343 -A prepend:symbol=value prepend value to symbol
1344 -A undef:symbol define symbol to be 'undef'
1345 -A undef:symbol= define symbol to be ''
1346 -V : print version number and exit (with a zero status).
1353 case "$fastread$alldone" in
1356 if test ! -t 0; then
1357 echo "Say 'sh Configure', not 'sh <Configure'"
1365 true) exec 1>/dev/null;;
1368 : run the defines and the undefines, if any, but leave the file out there...
1371 : create the posthint manipulation script and leave the file out there...
1376 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1377 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1378 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1379 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1380 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1383 : Some greps do not return status, grrr.
1384 echo "grimblepritz" >grimble
1385 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1387 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1393 : the following should work in any shell
1397 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1398 cat >contains <<'EOSS'
1399 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1404 : Find the path to the source tree
1407 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1410 *) src=`cd ../$src && pwd` ;;
1423 if test -f $rsrc/Configure && \
1424 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1426 : found it, so we are ok.
1429 for src in . .. ../.. ../../.. ../../../..; do
1430 if test -f ../$src/Configure && \
1431 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1442 Sorry, I can't seem to locate the source dir for $package. Please start
1443 Configure with an explicit path -- i.e. /some/path/Configure.
1451 echo "Sources for $package found in \"$src\"." >&4
1455 : script used to extract .SH files with variable substitutions
1456 cat >extract <<'EOS'
1458 echo "Doing variable substitutions on .SH files..."
1459 if test -f $src/MANIFEST; then
1460 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1462 echo "(Looking for .SH files under the source directory.)"
1463 set x `(cd $src; find . -name "*.SH" -print)`
1467 0) set x `(cd $src; echo *.SH)`; shift;;
1469 if test ! -f $src/$1; then
1475 while test $name; do
1476 if test ! -d "$name"; then
1477 create="$name $create";
1478 name=`echo $name | sed -e "s|^[^/]*$||"`;
1479 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1484 for file in $create; do
1493 dir=`expr X$file : 'X\(.*\)/'`
1494 file=`expr X$file : 'X.*/\(.*\)'`
1495 (cd $dir && . ./$file)
1505 dir=`expr X$file : 'X\(.*\)/'`
1506 file=`expr X$file : 'X.*/\(.*\)'`
1507 (set x $dir; shift; eval $mkdir_p)
1517 if test -f $src/config_h.SH; then
1518 if test ! -f config.h; then
1519 : oops, they left it out of MANIFEST, probably, so do it anyway.
1525 : extract files and exit if asked to do so
1526 case "$extractsh" in
1528 case "$realsilent" in
1532 case "$config_sh" in
1533 '') config_sh='config.sh';;
1536 echo "Fetching answers from $config_sh..."
1539 test "$override" && . ./optdef.sh
1548 : Eunice requires " " instead of "", can you believe it
1551 echo "Beginning of configuration questions for $package."
1553 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1555 : first determine how to suppress newline on echo command
1557 echo "Checking echo to see how to suppress newlines..."
1558 (echo "hi there\c" ; echo " ") >.echotmp
1559 if $contains c .echotmp >/dev/null 2>&1 ; then
1570 echo $n "The star should be here-->$c"
1574 : Now test for existence of everything in MANIFEST
1576 if test -f $rsrc/MANIFEST; then
1577 echo "First let's make sure your kit is complete. Checking..." >&4
1578 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1581 for filelist in x??; do
1582 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1584 if test -s missing; then
1588 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1590 You have the option of continuing the configuration process, despite the
1591 distinct possibility that your kit is damaged, by typing 'y'es. If you
1592 do, don't blame me if something goes wrong. I advise you to type 'n'o
1593 and contact the author (perlbug@perl.com).
1596 echo $n "Continue? [n] $c" >&4
1600 echo "Continuing..." >&4
1604 echo "ABORTING..." >&4
1609 echo "Looks good..."
1612 echo "There is no MANIFEST file. I hope your kit is complete !"
1617 : Find the appropriate value for a newline for tr
1618 if test -n "$DJGPP"; then
1621 if test X"$trnl" = X; then
1622 case "`echo foo|tr '\n' x 2>/dev/null`" in
1626 if test X"$trnl" = X; then
1627 case "`echo foo|tr '\012' x 2>/dev/null`" in
1628 foox) trnl='\012' ;;
1631 if test X"$trnl" = X; then
1634 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1640 : compute the number of columns on the terminal for proper question formatting
1645 : set up the echo used in my read
1646 myecho="case \"\$xxxm\" in
1647 '') echo $n \"\$rp $c\" >&4;;
1649 '') echo $n \"[\$xxxm] $c\";;
1651 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1653 echo $n \"[\$xxxm] $c\" >&4
1655 echo $n \"\$rp [\$xxxm] $c\" >&4
1661 : now set up to do reads with possible shell escape and default assignment
1667 case "\$fastread" in
1668 yes) case "\$dflt" in
1671 case "\$silent-\$rp" in
1676 *) case "\$silent" in
1677 true) case "\$rp" in
1682 while expr "X\$ans" : "X!" >/dev/null; do
1686 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1694 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1703 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1708 echo "(OK, I'll run with -d after this question.)" >&4
1711 echo "*** Sorry, \$1 not supported yet." >&4
1721 echo "*** Substitution done -- please confirm."
1723 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1728 echo "*** Error -- try again."
1735 case "\$ans\$xxxm\$nostick" in
1747 : create .config dir to save info across Configure sessions
1748 test -d ../.config || mkdir ../.config
1749 cat >../.config/README <<EOF
1750 This directory created by Configure to save information that should
1751 persist across sessions for $package.
1753 You may safely delete it if you wish.
1756 : general instructions
1759 user=`(logname) 2>/dev/null`
1761 '') user=`whoami 2>&1`;;
1763 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1766 rp='Would you like to see the instructions?'
1777 This installation shell script will examine your system and ask you questions
1778 to determine how the perl5 package should be installed. If you get
1779 stuck on a question, you may use a ! shell escape to start a subshell or
1780 execute a command. Many of the questions will have default answers in square
1781 brackets; typing carriage return will give you the default.
1783 On some of the questions which ask for file or directory names you are allowed
1784 to use the ~name construct to specify the login directory belonging to "name",
1785 even if you don't have a shell which knows about that. Questions where this is
1786 allowed will be marked "(~name ok)".
1790 dflt='Type carriage return to continue'
1794 The prompter used in this script allows you to use shell variables and
1795 backticks in your answers. You may use $1, $2, etc... to refer to the words
1796 in the default answer, as if the default line was a set of arguments given to a
1797 script shell. This means you may also use $* to repeat the whole default line,
1798 so you do not have to re-type everything to add something to the default.
1800 Everytime there is a substitution, you will have to confirm. If there is an
1801 error (e.g. an unmatched backtick), the default answer will remain unchanged
1802 and you will be prompted again.
1804 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1805 the questions and use the computed defaults (or the previous answers if there
1806 was already a config.sh file). Type 'Configure -h' for a list of options.
1807 You may also start interactively and then answer '& -d' at any prompt to turn
1808 on the non-interactive behaviour for the remainder of the execution.
1814 Much effort has been expended to ensure that this shell script will run on any
1815 Unix system. If despite that it blows up on yours, your best bet is to edit
1816 Configure and run it again. If you can't run Configure for some reason,
1817 you'll have to generate a config.sh file by hand. Whatever problems you
1818 have, let me (perlbug@perl.com) know how I blew it.
1820 This installation script affects things in two ways:
1822 1) it may do direct variable substitutions on some of the files included
1824 2) it builds a config.h file for inclusion in C programs. You may edit
1825 any of these files as the need arises after running this script.
1827 If you make a mistake on a question, there is no easy way to back up to it
1828 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1829 files. Configure will offer to let you do this before it runs the SH files.
1832 dflt='Type carriage return to continue'
1834 case "$firsttime" in
1835 true) echo $user >>../.config/instruct;;
1839 : find out where common programs are
1841 echo "Locating common programs..." >&4
1854 if test -d \$dir/\$thing; then
1860 for thisthing in \$dir/\$thing; do
1861 : just loop through to pick last item
1863 if test -f \$thisthing; then
1866 elif test -f \$dir/\$thing.exe; then
1867 if test -n "$DJGPP"; then
1868 echo \$dir/\$thing.exe
1870 : on Eunice apparently
1920 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1921 pth="$pth /lib /usr/lib"
1922 for file in $loclist; do
1926 if test -f "$xxx"; then
1929 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1930 xxx=`./loc $file $file $pth`
1933 '') xxx=`./loc $file $file $pth`;;
1934 *) xxx=`./loc $xxx $xxx $pth`;;
1940 echo $file is in $xxx.
1943 echo $file is in $xxx.
1946 echo "I don't know where '$file' is, and my life depends on it." >&4
1947 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1953 echo "Don't worry if any of the following aren't found..."
1955 for file in $trylist; do
1959 if test -f "$xxx"; then
1962 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1963 xxx=`./loc $file $file $pth`
1966 '') xxx=`./loc $file $file $pth`;;
1967 *) xxx=`./loc $xxx $xxx $pth`;;
1973 echo $file is in $xxx.
1976 echo $file is in $xxx.
1979 echo "I don't see $file out there, $say."
1986 echo "Substituting grep for egrep."
1992 echo "Substituting cp for ln."
1998 echo "Hopefully test is built into your sh."
2001 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2002 echo "Using the test built into your sh."
2010 echo "Hopefully echo is built into your sh."
2015 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2016 $echo $n "hi there$c" >foo1
2017 echo $n "hi there$c" >foo2
2018 if cmp foo1 foo2 >/dev/null 2>&1; then
2019 echo "They are compatible. In fact, they may be identical."
2026 They are not compatible! You are probably running ksh on a non-USG system.
2027 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2028 have echo built in and we may have to run some Bourne shell scripts. That
2029 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2032 $echo $n "The star should be here-->$c"
2039 : determine whether symbolic links are supported
2042 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2043 echo "Symbolic links are supported." >&4
2046 echo "Symbolic links are NOT supported." >&4
2051 : see whether [:lower:] and [:upper:] are supported character classes
2053 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2055 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2059 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2060 # (0xc9 and 0xd1), therefore that is a nice testing point.
2061 if test "X$up" = X -o "X$low" = X; then
2062 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2068 if test "X$up" = X -o "X$low" = X; then
2069 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2075 if test "X$up" = X -o "X$low" = X; then
2076 case "`echo IJ | od -x 2>/dev/null`" in
2078 echo "Hey, this might be EBCDIC." >&4
2079 if test "X$up" = X -o "X$low" = X; then
2080 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2081 ij) up='[A-IJ-RS-Z]'
2086 if test "X$up" = X -o "X$low" = X; then
2087 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2097 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2099 echo "Using $up and $low to convert case." >&4
2102 echo "I don't know how to translate letters from upper to lower case." >&4
2103 echo "Your tr is not acting any way I know of." >&4
2107 : set up the translation script tr, must be called with ./tr of course
2111 '[A-Z][a-z]') exec $tr '$up' '$low';;
2112 '[a-z][A-Z]') exec $tr '$low' '$up';;
2119 : Try to determine whether config.sh was made on this system
2120 case "$config_sh" in
2122 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2123 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2124 # because the A-Z/a-z are not consecutive.
2125 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2126 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2127 newmyuname="$myuname"
2129 case "$knowitall" in
2131 if test -f ../config.sh; then
2132 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2133 eval "`grep myuname= ../config.sh`"
2135 if test "X$myuname" = "X$newmyuname"; then
2143 : Get old answers from old config file if Configure was run on the
2144 : same system, otherwise use the hints.
2147 if test -f config.sh; then
2149 rp="I see a config.sh file. Shall I use it to set the defaults?"
2152 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2153 *) echo "Fetching default answers from your old config.sh file..." >&4
2161 : Older versions did not always set $sh. Catch re-use of such
2170 if test ! -f config.sh; then
2173 First time through, eh? I have some defaults handy for some systems
2174 that need some extra help getting the Configure answers right:
2177 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2179 : Half the following guesses are probably wrong... If you have better
2180 : tests or hints, please send them to perlbug@perl.com
2181 : The metaconfig authors would also appreciate a copy...
2182 $test -f /irix && osname=irix
2183 $test -f /xenix && osname=sco_xenix
2184 $test -f /dynix && osname=dynix
2185 $test -f /dnix && osname=dnix
2186 $test -f /lynx.os && osname=lynxos
2187 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2188 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2189 $test -f /bin/mips && /bin/mips && osname=mips
2190 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2191 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2192 $test -d /usr/apollo/bin && osname=apollo
2193 $test -f /etc/saf/_sactab && osname=svr4
2194 $test -d /usr/include/minix && osname=minix
2195 if $test -d /MachTen -o -d /MachTen_Folder; then
2197 if $test -x /sbin/version; then
2198 osvers=`/sbin/version | $awk '{print $2}' |
2199 $sed -e 's/[A-Za-z]$//'`
2200 elif $test -x /usr/etc/version; then
2201 osvers=`/usr/etc/version | $awk '{print $2}' |
2202 $sed -e 's/[A-Za-z]$//'`
2207 $test -f /sys/posix.dll &&
2208 $test -f /usr/bin/what &&
2209 set X `/usr/bin/what /sys/posix.dll` &&
2210 $test "$3" = UWIN &&
2213 if $test -f $uname; then
2221 umips) osname=umips ;;
2224 [23]100) osname=mips ;;
2225 next*) osname=next ;;
2227 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2228 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2231 elif $test -f /etc/kconfig; then
2233 if test "$lns" = "$ln -s"; then
2235 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2237 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2244 if test -n "$DJGPP"; then
2253 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2255 'not found') osvers="$4"."$3" ;;
2256 '<3240'|'<>3240') osvers=3.2.0 ;;
2257 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2258 '=3250'|'>3250') osvers=3.2.5 ;;
2262 *dc.osx) osname=dcosx
2268 domainos) osname=apollo
2274 dynixptx*) osname=dynixptx
2275 osvers=`echo "$4"|sed 's/^v//'`
2277 freebsd) osname=freebsd
2279 genix) osname=genix ;;
2281 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2297 netbsd*) osname=netbsd
2300 news-os) osvers="$3"
2302 4*) osname=newsos4 ;;
2306 bsd386) osname=bsd386
2309 POSIX-BC | posix-bc ) osname=posix-bc
2312 powerux | power_ux | powermax_os | powermaxos | \
2313 powerunix | power_unix) osname=powerux
2316 next*) osname=next ;;
2317 solaris) osname=solaris
2319 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2326 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2330 titanos) osname=titanos
2339 ultrix) osname=ultrix
2342 osf1|mls+) case "$5" in
2345 osvers=`echo "$3" | sed 's/^[xvt]//'`
2347 hp*) osname=hp_osf1 ;;
2348 mips) osname=mips_osf1 ;;
2351 unixware) osname=svr5
2360 $2) case "$osname" in
2364 : svr4.x or possibly later
2374 if test -f /stand/boot ; then
2375 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2376 if test -n "$INITPROG" -a -f "$INITPROG"; then
2377 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2378 if test -n "$isesix"; then
2386 *) if test -f /etc/systemid; then
2388 set `echo $3 | $sed 's/\./ /g'` $4
2389 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2391 elif $test -f $src/hints/sco_$1_$2.sh; then
2393 elif $test -f $src/hints/sco_$1.sh; then
2398 '') : Still unknown. Probably a generic Sys V.
2407 *) case "$osname" in
2408 '') : Still unknown. Probably a generic BSD.
2416 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2417 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2418 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2421 $rm -f UU/kernel.what
2422 elif test -d c:/.; then
2429 : Now look for a hint file osname_osvers, unless one has been
2430 : specified already.
2433 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2434 : Also try without trailing minor version numbers.
2435 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2436 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2437 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2438 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2441 *) case "$osvers" in
2444 *) if $test -f $src/hints/$file.sh ; then
2446 elif $test -f $src/hints/$xfile.sh ; then
2448 elif $test -f $src/hints/$xxfile.sh ; then
2450 elif $test -f $src/hints/$xxxfile.sh ; then
2452 elif $test -f $src/hints/$xxxxfile.sh ; then
2454 elif $test -f "$src/hints/${osname}.sh" ; then
2463 if $test -f Policy.sh ; then
2466 none) dflt="Policy" ;;
2467 *) dflt="Policy $dflt" ;;
2472 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2476 if $test -f Policy.sh ; then
2479 There's also a Policy hint file available, which should make the
2480 site-specific (policy) questions easier to answer.
2487 You may give one or more space-separated answers, or "none" if appropriate.
2488 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2489 is a good thing. DO NOT give a wrong version or a wrong OS.
2493 rp="Which of these apply, if any?"
2496 for file in $tans; do
2497 if $test X$file = XPolicy -a -f Policy.sh; then
2499 $cat Policy.sh >> UU/config.sh
2500 elif $test -f $src/hints/$file.sh; then
2501 . $src/hints/$file.sh
2502 $cat $src/hints/$file.sh >> UU/config.sh
2503 elif $test X$tans = X -o X$tans = Xnone ; then
2506 : Give one chance to correct a possible typo.
2507 echo "$file.sh does not exist"
2509 rp="hint to use instead?"
2511 for file in $ans; do
2512 if $test -f "$src/hints/$file.sh"; then
2513 . $src/hints/$file.sh
2514 $cat $src/hints/$file.sh >> UU/config.sh
2515 elif $test X$ans = X -o X$ans = Xnone ; then
2518 echo "$file.sh does not exist -- ignored."
2525 : Remember our hint file for later.
2526 if $test -f "$src/hints/$file.sh" ; then
2536 echo "Fetching default answers from $config_sh..." >&4
2540 cp $config_sh config.sh 2>/dev/null
2550 test "$override" && . ./optdef.sh
2551 myuname="$newmyuname"
2553 : Restore computed paths
2554 for file in $loclist $trylist; do
2555 eval $file="\$_$file"
2560 Configure uses the operating system name and version to set some defaults.
2561 The default value is probably right if the name rings a bell. Otherwise,
2562 since spelling matters for me, either accept the default or answer "none"
2569 ''|' '|none) dflt=none ;;
2570 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2573 *) dflt="$osname" ;;
2575 rp="Operating system name?"
2579 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2585 ''|' '|none) dflt=none ;;
2586 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2587 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2589 ''|' ') dflt=none ;;
2594 *) dflt="$osvers" ;;
2596 rp="Operating system version?"
2606 : who configured the system
2607 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2608 cf_by=`(logname) 2>/dev/null`
2611 cf_by=`(whoami) 2>/dev/null`
2613 "") cf_by=unknown ;;
2617 : set up the script used to warn in case of inconsistency
2624 echo "*** WHOA THERE!!! ***" >&4
2625 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2626 rp=" Keep the $hint value?"
2629 y) td=$was; tu=$was;;
2633 : function used to set $1 to $val
2634 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2636 $define$undef) . ./whoa; eval "$var=\$td";;
2637 $undef$define) . ./whoa; eval "$var=\$tu";;
2638 *) eval "$var=$val";;
2643 Perl can be built to take advantage of threads, on some systems.
2644 To do so, Configure must be run with -Dusethreads.
2646 Note that threading is a highly experimental feature, and
2647 some known race conditions still remain. If you choose to try
2648 it, be very sure to not actually deploy it for production
2649 purposes. README.threads has more details, and is required
2650 reading if you enable threads.
2652 case "$usethreads" in
2653 $define|true|[yY]*) dflt='y';;
2656 rp='Build a threading Perl?'
2659 y|Y) val="$define" ;;
2665 case "$d_oldpthreads" in
2666 '') : Configure tests would be welcome here. For now, assume undef.
2668 *) val="$d_oldpthreads" ;;
2674 case "$usethreads" in
2675 "$define"|true|[yY]*)
2676 : Look for a hint-file generated 'call-back-unit'. If the
2677 : user has specified that a threading perl is to be built,
2678 : we may need to set or change some other defaults.
2679 if $test -f usethreads.cbu; then
2680 echo "Your platform has some specific hints for threaded builds, using them..."
2684 (Your platform doesn't have any specific hints for threaded builds.
2685 Assuming POSIX threads, then.)
2693 Perl can be built so that multiple Perl interpreters can coexist
2694 within the same Perl executable. To do so, Configure must be run with
2697 Normally you do not need this and you should answer no.
2700 case "$usemultiplicity" in
2701 $define|true|[yY]*) dflt='y';;
2704 rp='Build Perl for multiplicity?'
2707 y|Y) val="$define" ;;
2713 : determine where manual pages are on this system
2717 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2718 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2719 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2720 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2721 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2722 sysman=`./loc . /usr/man/man1 $syspath`
2725 if $test -d "$sysman"; then
2726 echo "System manual is in $sysman." >&4
2728 echo "Could not find manual pages in source form." >&4
2731 : see what memory models we can support
2734 $cat >pdp11.c <<'EOP'
2743 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2744 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2745 dflt='unsplit split'
2747 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2750 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2755 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2758 if $test -d /lib/large || $test -d /usr/lib/large; then
2761 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2770 Some systems have different model sizes. On most systems they are called
2771 small, medium, large, and huge. On the PDP11 they are called unsplit and
2772 split. If your system doesn't support different memory models, say "none".
2773 If you wish to force everything to one memory model, say "none" here and
2774 put the appropriate flags later when it asks you for other cc and ld flags.
2775 Venix systems may wish to put "none" and let the compiler figure things out.
2776 (In the following question multiple model names should be space separated.)
2778 The default for most systems is "none".
2781 rp="Which memory models are supported?"
2796 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2797 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2804 rp="What flag indicates separate I and D space?"
2812 *large*|*small*|*medium*|*huge*)
2819 rp="What flag indicates large model?"
2829 *huge*) case "$huge" in
2833 rp="What flag indicates huge model?"
2843 *medium*) case "$medium" in
2847 rp="What flag indicates medium model?"
2854 *) medium="$large";;
2857 *small*) case "$small" in
2861 rp="What flag indicates small model?"
2872 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2875 $rm -f pdp11.* pdp11
2877 : make some quick guesses about what we are up against
2879 $echo $n "Hmm... $c"
2889 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2890 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2892 echo "Looks kind of like an OSF/1 system, but we'll see..."
2894 elif test `echo abc | tr a-z A-Z` = Abc ; then
2895 xxx=`./loc addbib blurfl $pth`
2896 if $test -f $xxx; then
2897 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2901 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2902 echo "Looks kind of like an extended USG system, but we'll see..."
2904 echo "Looks kind of like a USG system, but we'll see..."
2908 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2909 echo "Looks kind of like a BSD system, but we'll see..."
2913 echo "Looks kind of like a Version 7 system, but we'll see..."
2916 case "$eunicefix" in
2919 There is, however, a strange, musty smell in the air that reminds me of
2920 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2924 : it so happens the Eunice I know will not run shell scripts in Unix format
2928 echo "Congratulations. You aren't running Eunice."
2932 : Detect OS2. The p_ variable is set above in the Head.U unit.
2937 I have the feeling something is not exactly right, however...don't tell me...
2938 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2943 if test -f /xenix; then
2944 echo "Actually, this looks more like a XENIX system..."
2949 echo "It's not Xenix..."
2954 if test -f /venix; then
2955 echo "Actually, this looks more like a VENIX system..."
2962 echo "Nor is it Venix..."
2965 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2966 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2969 : see if we need a special compiler
2977 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2978 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2992 On some older systems the default C compiler will not resolve multiple global
2993 references that happen to have the same name. On some such systems the "Mcc"
2994 command may be used to force these to be resolved. On other systems a "cc -M"
2995 command is required. (Note that the -M flag on other systems indicates a
2996 memory model to use!) If you have the Gnu C compiler, you might wish to use
3002 rp="Use which C compiler?"
3010 rp="Use which C compiler?"
3014 : Look for a hint-file generated 'call-back-unit'. Now that the
3015 : user has specified the compiler, we may need to set or change some
3017 if $test -f cc.cbu; then
3021 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3022 $cat >gccvers.c <<EOM
3027 printf("%s\n", __VERSION__);
3029 printf("%s\n", "1");
3035 if $cc -o gccvers gccvers.c; then
3036 gccversion=`./gccvers`
3037 case "$gccversion" in
3038 '') echo "You are not using GNU cc." ;;
3039 *) echo "You are using GNU cc $gccversion." ;;
3043 echo "*** WHOA THERE!!! ***" >&4
3044 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3045 case "$knowitall" in
3047 echo " You'd better start hunting for one and let me know about it." >&4
3053 case "$gccversion" in
3054 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3058 case "$usemorebits" in
3059 "$define"|true|[yY]*)
3061 uselongdouble="$define"
3062 usemorebits="$define"
3064 *) usemorebits="$undef"
3071 Perl can be built to understand large files (files larger than 2 gigabytes)
3072 on some systems. To do so, Configure must be run with -Duselargefiles.
3074 If this doesn't make any sense to you, just accept the default.
3076 case "$uselargefiles" in
3077 "$define"|true|[yY]*) dflt='y' ;;
3080 rp='Try to understand large files?'
3083 y|Y) val="$define" ;;
3088 case "$uselargefiles" in
3089 "$define") use64bits="$define" ;;
3094 Perl can be built to take advantage of explicit 64-bit interfaces,
3095 on some systems. To do so, Configure must be run with -Duse64bits.
3097 If this doesn't make any sense to you, just accept the default.
3099 case "$use64bits" in
3100 $define|true|[yY]*) dflt='y';;
3103 rp='Try to use explicit 64-bit interfaces, if available?'
3116 case "$archname64" in
3117 '') archname64='' ;; # not a typo
3120 case "$use64bits" in
3121 "$define"|true|[yY]*)
3122 : Look for a hint-file generated 'call-back-unit'. If the
3123 : user has specified that a 64 bit perl is to be built,
3124 : we may need to set or change some other defaults.
3125 if $test -f use64bits.cbu; then
3126 echo "Your platform has some specific hints for 64-bit builds, using them..."
3130 (Your platform doesn't have any specific hints for 64-bit builds.
3131 This is probably okay, especially if your system is a true 64-bit system.)
3133 case "$gccversion" in
3136 But since you seem to be using gcc,
3137 I will now add -DUSE_LONG_LONG to the compilation flags.
3139 ccflags="$ccflags -DUSE_LONG_LONG"
3146 : determine the architecture name
3148 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3149 tarch=`arch`"-$osname"
3150 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3151 if uname -m > tmparch 2>&1 ; then
3152 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3153 -e 's/$/'"-$osname/" tmparch`
3161 case "$myarchname" in
3164 echo "(Your architecture name used to be $myarchname.)"
3171 *) dflt="$archname";;
3173 rp='What is your architecture name'
3176 case "$usethreads" in
3178 echo "Threads selected." >&4
3180 *-thread*) echo "...and architecture name already has -thread." >&4
3182 *) archname="$archname-thread"
3183 echo "...setting architecture name to $archname." >&4
3188 case "$usemultiplicity" in
3190 echo "Multiplicity selected." >&4
3192 *-multi*) echo "...and architecture name already has -multi." >&4
3194 *) archname="$archname-multi"
3195 echo "...setting architecture name to $archname." >&4
3200 case "$use64bits" in
3202 echo "Explicit 64-bitness selected." >&4
3203 case "$archname64" in
3208 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3210 *) archname="$archname-$archname64"
3211 echo "...setting architecture name to $archname." >&4
3218 : decide how portable to be. Allow command line overrides.
3219 case "$d_portable" in
3221 *) d_portable="$define" ;;
3224 : set up shell script to do ~ expansion
3230 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3233 if $test -f /bin/csh; then
3234 /bin/csh -f -c "glob \$1"
3239 name=\`$expr x\$1 : '..\([^/]*\)'\`
3240 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3241 if $test ! -d "\$dir"; then
3243 echo "\$me: can't locate home directory for: \$name" >&2
3248 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3264 : now set up to get a file name
3268 cat <<'EOSC' >>getfile
3284 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3285 fn=`echo $fn | sed 's/(.*)//'`
3291 loc_file=`expr $fn : '.*:\(.*\)'`
3292 fn=`expr $fn : '\(.*\):.*'`
3300 */*) fullpath=true;;
3309 *e*) exp_file=true;;
3312 *p*) nopath_ok=true;;
3317 *d*) type='Directory';;
3318 *l*) type='Locate';;
3323 Locate) what='File';;
3328 case "$d_portable" in
3336 while test "$type"; do
3341 true) rp="$rp (~name ok)";;
3344 if test -f UU/getfile.ok && \
3345 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3364 value=`UU/filexp $ans`
3367 if test "$ans" != "$value"; then
3368 echo "(That expands to $value on this system.)"
3382 /*) value="$ansexp" ;;
3387 echo "I shall only accept a full path name, as in /bin/ls." >&4
3388 echo "Use a ! shell escape if you wish to check pathnames." >&4
3391 echo "Please give a full path name, starting with slash." >&4
3394 echo "Note that using ~name is ok provided it expands well." >&4
3407 for fp in $gfpth; do
3408 if test "X$fp" = X.; then
3413 if test -f "$pf"; then
3415 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3417 echo "($value is not a plain file, but that's ok.)"
3420 if test X"$type" = X; then
3427 for fp in $gfpth; do
3428 if test "X$fp" = X.; then
3433 if test -d "$pf"; then
3441 if test -d "$ansexp"; then
3442 echo "(Looking for $loc_file in directory $value.)"
3443 value="$value/$loc_file"
3444 ansexp="$ansexp/$loc_file"
3446 if test -f "$ansexp"; then
3449 case "$nopath_ok" in
3450 true) case "$value" in
3452 *) echo "Assuming $value will be in people's path."
3468 if test "$fastread" = yes; then
3473 rp="$what $value doesn't exist. Use that name anyway?"
3492 test "X$gfpthkeep" != Xy && gfpth=""
3495 : determine root of directory hierarchy where package will be installed.
3498 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3506 By default, $package will be installed in $dflt/bin, manual pages
3507 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3508 installation directories. Typically this is something like /usr/local.
3509 If you wish to have binaries under /usr/bin but other parts of the
3510 installation under /usr/local, that's ok: you will be prompted
3511 separately for each of the installation directories, the prefix being
3512 only used to set the defaults.
3516 rp='Installation prefix to use?'
3524 *) oldprefix="$prefix";;
3534 $define|true) afs=true ;;
3535 $undef|false) afs=false ;;
3536 *) if test -d /afs; then
3544 echo "AFS may be running... I'll be extra cautious then..." >&4
3546 echo "AFS does not seem to be running..." >&4
3549 : determine installation prefix for where package is to be installed.
3553 Since you are running AFS, I need to distinguish the directory in which
3554 files will reside from the directory in which they are installed (and from
3555 which they are presumably copied to the former directory by occult means).
3558 case "$installprefix" in
3559 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3560 *) dflt="$installprefix";;
3565 In some special cases, particularly when building $package for distribution,
3566 it is convenient to distinguish between the directory in which files should
3567 be installed from the directory ($prefix) in which they
3568 will eventually reside. For most users, these two directories are the same.
3571 case "$installprefix" in
3573 *) dflt=$installprefix;;
3577 rp='What installation prefix should I use for installing files?'
3579 installprefix="$ans"
3580 installprefixexp="$ansexp"
3582 : set the prefixit variable, to compute a suitable default value
3583 prefixit='case "$3" in
3585 case "$oldprefix" in
3586 "") eval "$1=\"\$$2\"";;
3593 ""|" ") eval "$1=\"\$$2\"";;
3599 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3601 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3602 /*-$oldprefix/*|\~*-$oldprefix/*)
3603 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3604 *) eval "$1=\"\$$2\"";;
3608 : set the base revision
3611 : get the patchlevel
3613 echo "Getting the current patchlevel..." >&4
3614 if $test -r $rsrc/patchlevel.h;then
3615 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3616 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3617 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3623 $echo $n "(You have $package" $c
3626 *) $echo $n " $baserev" $c ;;
3628 $echo $n " patchlevel $patchlevel" $c
3629 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3632 if test 0 -eq "$subversion"; then
3633 version=`LC_ALL=C; export LC_ALL; \
3634 echo $baserev $patchlevel | \
3635 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3637 version=`LC_ALL=C; export LC_ALL; \
3638 echo $baserev $patchlevel $subversion | \
3639 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3642 : determine installation style
3643 : For now, try to deduce it from prefix unless it is already set.
3644 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3645 case "$installstyle" in
3646 '') case "$prefix" in
3647 *perl*) dflt='lib';;
3648 *) dflt='lib/perl5' ;;
3651 *) dflt='lib/perl5' ;;
3653 : Probably not worth prompting for this since we prompt for all
3654 : the directories individually, and the prompt would be too long and
3658 : determine where private library files go
3659 : Usual default is /usr/local/lib/perl5/$version.
3660 : Also allow things like /opt/perl/lib/$version, since
3661 : /opt/perl/lib/perl5... would be redundant.
3662 : The default "style" setting is made in installstyle.U
3663 case "$installstyle" in
3664 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3665 *) set dflt privlib lib/$version ;;
3670 There are some auxiliary files for $package that need to be put into a
3671 private library directory that is accessible by everyone.
3675 rp='Pathname where the private library files will reside?'
3678 privlibexp="$ansexp"
3679 : Change installation prefix, if necessary.
3680 if $test X"$prefix" != X"$installprefix"; then
3681 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3683 installprivlib="$privlibexp"
3686 : set the prefixup variable, to restore leading tilda escape
3687 prefixup='case "$prefixexp" in
3689 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3692 : determine where public architecture dependent libraries go
3695 : privlib default is /usr/local/lib/$package/$version
3696 : archlib default is /usr/local/lib/$package/$version/$archname
3697 : privlib may have an optional trailing /share.
3698 tdflt=`echo $privlib | $sed 's,/share$,,'`
3699 tdflt=$tdflt/$archname
3708 $spackage contains architecture-dependent library files. If you are
3709 sharing libraries in a heterogeneous environment, you might store
3710 these files in a separate location. Otherwise, you can just include
3711 them with the rest of the public library files.
3715 rp='Where do you want to put the public architecture-dependent libraries?'
3718 archlibexp="$ansexp"
3719 if $test X"$archlib" = X"$privlib"; then
3724 : Change installation prefix, if necessary.
3725 if $test X"$prefix" != X"$installprefix"; then
3726 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3728 installarchlib="$archlibexp"
3732 : Binary compatibility with 5.005 is not possible for builds
3733 : with advanced features
3734 case "$usethreads$usemultiplicity" in
3736 bincompat5005="$undef"
3737 d_bincompat5005="$undef"
3741 Perl 5.006 can be compiled for binary compatibility with 5.005.
3742 If you decide to do so, you will be able to continue using most
3743 of the extensions that were compiled for Perl 5.005.
3746 case "$bincompat5005$d_bincompat5005" in
3747 *"$undef"*) dflt=n ;;
3750 rp='Binary compatibility with Perl 5.005?'
3753 y*) val="$define" ;;
3758 case "$d_bincompat5005" in
3760 bincompat5005="$define"
3762 *) bincompat5005="$undef"
3763 d_bincompat5005="$undef"
3770 : see if setuid scripts can be secure
3773 Some kernels have a bug that prevents setuid #! scripts from being
3774 secure. Some sites have disabled setuid #! scripts because of this.
3776 First let's decide if your kernel supports secure setuid #! scripts.
3777 (If setuid #! scripts would be secure but have been disabled anyway,
3778 don't say that they are secure if asked.)
3783 if $test -d /dev/fd; then
3784 echo "#!$ls" >reflect
3785 chmod +x,u+s reflect
3786 ./reflect >flect 2>&1
3787 if $contains "/dev/fd" flect >/dev/null; then
3788 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3792 If you are not sure if they are secure, I can check but I'll need a
3793 username and password different from the one you are using right now.
3794 If you don't have such a username or don't want me to test, simply
3798 rp='Other username to test security of setuid scripts with?'
3803 case "$d_suidsafe" in
3804 '') echo "I'll assume setuid scripts are *not* secure." >&4
3807 echo "Well, the $hint value is *not* secure." >&4
3809 *) echo "Well, the $hint value *is* secure." >&4
3814 $rm -f reflect flect
3815 echo "#!$ls" >reflect
3816 chmod +x,u+s reflect
3819 echo '"su" will (probably) prompt you for '"$ans's password."
3820 su $ans -c './reflect >flect'
3821 if $contains "/dev/fd" flect >/dev/null; then
3822 echo "Okay, it looks like setuid scripts are secure." >&4
3825 echo "I don't think setuid scripts are secure." >&4
3830 rp='Does your kernel have *secure* setuid scripts?'
3833 [yY]*) val="$define";;
3838 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3839 echo "(That's for file descriptors, not floppy disks.)"
3845 $rm -f reflect flect
3847 : now see if they want to do setuid emulation
3850 case "$d_suidsafe" in
3853 echo "No need to emulate SUID scripts since they are secure here." >& 4
3857 Some systems have disabled setuid scripts, especially systems where
3858 setuid scripts cannot be secure. On systems where setuid scripts have
3859 been disabled, the setuid/setgid bits on scripts are currently
3860 useless. It is possible for $package to detect those bits and emulate
3861 setuid/setgid in a secure fashion. This emulation will only work if
3862 setuid scripts have been disabled in your kernel.
3866 "$define") dflt=y ;;
3869 rp="Do you want to do setuid/setgid emulation?"
3872 [yY]*) val="$define";;
3880 : What should the include directory be ?
3882 $echo $n "Hmm... $c"
3886 if $test -f /bin/mips && /bin/mips; then
3887 echo "Looks like a MIPS system..."
3888 $cat >usr.c <<'EOCP'
3889 #ifdef SYSTYPE_BSD43
3893 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3894 dflt='/bsd43/usr/include'
3898 mips_type='System V'
3900 $rm -f usr.c usr.out
3901 echo "and you're compiling with the $mips_type compiler and libraries."
3905 echo "Doesn't look like a MIPS system."
3915 case "$xxx_prompt" in
3918 rp='Where are the include files you want to use?'
3926 : see how we invoke the C preprocessor
3928 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3929 cat <<'EOT' >testcpp.c
3935 if test ! -f cppstdin; then
3936 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3937 # AIX cc -E doesn't show the absolute headerfile
3938 # locations but we'll cheat by using the -M flag.
3939 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
3941 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3944 echo "Keeping your $hint cppstdin wrapper."
3947 wrapper=`pwd`/cppstdin
3951 if $test "X$cppstdin" != "X" && \
3952 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3953 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3955 echo "You used to use $cppstdin $cppminus so we'll use that again."
3957 '') echo "But let's see if we can live without a wrapper..." ;;
3959 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3960 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3962 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3965 echo "(However, $cpprun $cpplast does not work, let's see...)"
3973 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3980 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3981 $cc -E <testcpp.c >testcpp.out 2>&1; \
3982 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3983 echo "Yup, it does."
3986 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3987 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3988 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3989 echo "Yup, it does."
3992 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3993 $cc -P <testcpp.c >testcpp.out 2>&1; \
3994 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3995 echo "Yipee, that works!"
3998 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3999 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4000 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4001 echo "At long last!"
4004 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4005 $cpp <testcpp.c >testcpp.out 2>&1; \
4006 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4010 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4011 $cpp - <testcpp.c >testcpp.out 2>&1; \
4012 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4013 echo "Hooray, it works! I was beginning to wonder."
4016 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4017 $wrapper <testcpp.c >testcpp.out 2>&1; \
4018 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4024 rp="No dice. I can't find a C preprocessor. Name one:"
4028 $x_cpp <testcpp.c >testcpp.out 2>&1
4029 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4030 echo "OK, that will do." >&4
4032 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4047 echo "Perhaps can we force $cc -E using a wrapper..."
4048 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4049 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4055 echo "Nope, we'll have to live without it..."
4069 "$wrapper"|'cppstdin') ;;
4070 *) $rm -f $wrapper;;
4072 $rm -f testcpp.c testcpp.out
4074 : Set private lib path
4077 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4082 '') dlist="$loclibpth $plibpth $glibpth";;
4083 *) dlist="$libpth";;
4086 : Now check and see which directories actually exist, avoiding duplicates
4090 if $test -d $xxx; then
4093 *) libpth="$libpth $xxx";;
4099 Some systems have incompatible or broken versions of libraries. Among
4100 the directories listed in the question below, please remove any you
4101 know not to be holding relevant libraries, and add any that are needed.
4102 Say "none" for none.
4113 rp="Directories to use for library searches?"
4120 : compute shared library extension
4123 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4133 On some systems, shared libraries may be available. Answer 'none' if
4134 you want to suppress searching of shared libraries for the remaining
4135 of this configuration.
4138 rp='What is the file extension used for shared libraries?'
4142 : Define several unixisms.
4143 : Hints files or command line option can be used to override them.
4144 : The convoluted testing is in case hints files set either the old
4147 '') case "$exe_ext" in
4149 *) _exe="$exe_ext" ;;
4154 '') case "$lib_ext" in
4161 '') case "$obj_ext" in
4168 '') case "$path_sep" in
4179 : Which makefile gets called first. This is used by make depend.
4180 case "$firstmakefile" in
4181 '') firstmakefile='makefile';;
4186 Perl can be built to use the SOCKS proxy protocol library. To do so,
4187 Configure must be run with -Dusesocks.
4189 Normally you do not need this and you should answer no.
4193 $define|true|[yY]*) dflt='y';;
4196 rp='Build Perl for SOCKS?'
4199 y|Y) val="$define" ;;
4205 : Looking for optional libraries
4207 echo "Checking for optional libraries..." >&4
4212 case "$libswanted" in
4213 '') libswanted='c_s';;
4217 libswanted="$libswanted socks5 socks5_sh"
4220 for thislib in $libswanted; do
4222 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4223 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4224 echo "Found -l$thislib (shared)."
4227 *) dflt="$dflt -l$thislib";;
4229 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4230 echo "Found -l$thislib (shared)."
4233 *) dflt="$dflt -l$thislib";;
4235 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4236 echo "Found -l$thislib."
4239 *) dflt="$dflt -l$thislib";;
4241 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4242 echo "Found -l$thislib."
4245 *) dflt="$dflt -l$thislib";;
4247 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4248 echo "Found -l${thislib}_s."
4251 *) dflt="$dflt -l${thislib}_s";;
4253 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4254 echo "Found -l$thislib."
4257 *) dflt="$dflt -l$thislib";;
4260 echo "No -l$thislib."
4271 ' '|'') dflt='none';;
4276 In order to compile $package on your machine, a number of libraries
4277 are usually needed. Include any other special libraries here as well.
4278 Say "none" for none. The default list is almost always right.
4282 rp="What libraries to use?"
4289 : determine optimization, if desired, or use for debug flag also
4291 ' '|$undef) dflt='none';;
4293 *) dflt="$optimize";;
4297 By default, $package compiles with the -O flag to use the optimizer.
4298 Alternately, you might want to use the symbolic debugger, which uses
4299 the -g flag (on traditional Unix systems). Either flag can be
4300 specified here. To use neither flag, specify the word "none".
4303 rp="What optimizer/debugger flag should be used?"
4307 'none') optimize=" ";;
4311 : We will not override a previous value, but we might want to
4312 : augment a hint file
4314 default|recommended)
4315 case "$gccversion" in
4316 1*) dflt='-fpcc-struct-return' ;;
4319 *-g*) dflt="$dflt -DDEBUGGING";;
4321 case "$gccversion" in
4322 2*) if test -d /etc/conf/kconfig.d &&
4323 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4329 case "$gccversion" in
4333 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4334 echo 'int main(void) { return 0; }' > gcctest.c
4335 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4336 echo "Yes, it does." 2>&1
4339 echo "Leaving current flags $ccflags alone." 2>&1
4341 *) dflt="$dflt -fno-strict-aliasing" ;;
4344 echo "Nope, it doesn't, but that's ok." 2>&1
4351 case "$mips_type" in
4352 *BSD*|'') inclwanted="$locincpth $usrinc";;
4353 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4355 for thisincl in $inclwanted; do
4356 if $test -d $thisincl; then
4357 if $test x$thisincl != x$usrinc; then
4360 *) dflt="$dflt -I$thisincl";;
4366 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4368 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4376 *) dflt="$dflt -D$2";;
4380 set signal.h LANGUAGE_C; eval $inctest
4384 ccflags="$ccflags -DSOCKS"
4389 default|recommended) dflt="$ccflags $dflt" ;;
4390 *) dflt="$ccflags";;
4398 Your C compiler may want other flags. For this question you should include
4399 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4400 but you should NOT include libraries or ld flags like -lwhatever. If you
4401 want $package to honor its debug switch, you should include -DDEBUGGING here.
4402 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4404 To use no flags, specify the word "none".
4410 rp="Any additional cc flags?"
4417 : the following weeds options from ccflags that are of no interest to cpp
4419 case "$gccversion" in
4420 1*) cppflags="$cppflags -D__GNUC__"
4422 case "$mips_type" in
4424 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4430 echo "Let me guess what the preprocessor flags are..." >&4
4444 *) ftry="$previous $flag";;
4446 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4447 >cpp1.out 2>/dev/null && \
4448 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4449 >cpp2.out 2>/dev/null && \
4450 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4451 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4453 cppflags="$cppflags $ftry"
4463 *-*) echo "They appear to be: $cppflags";;
4465 $rm -f cpp.c cpp?.out
4469 : flags used in final linking phase
4471 '') if ./venix; then
4477 *-posix*) dflt="$dflt -posix" ;;
4480 *) dflt="$ldflags";;
4483 : Try to guess additional flags to pick up local libraries.
4484 for thislibdir in $libpth; do
4485 case " $loclibpth " in
4488 *"-L$thislibdir "*) ;;
4489 *) dflt="$dflt -L$thislibdir" ;;
4501 Your C linker may need flags. For this question you should
4502 include -L/whatever and any other flags used by the C linker, but you
4503 should NOT include libraries like -lwhatever.
4505 Make sure you include the appropriate -L/path flags if your C linker
4506 does not normally search all of the directories you specified above,
4509 To use no flags, specify the word "none".
4513 rp="Any additional ld flags (NOT including libraries)?"
4519 rmlist="$rmlist pdp11"
4523 echo "Checking your choice of C compiler and flags for coherency..." >&4
4524 $cat > try.c <<'EOF'
4526 int main() { printf("Ok\n"); exit(0); }
4528 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4530 $cat >try.msg <<'EOM'
4531 I've tried to compile and run the following simple program:
4534 $cat try.c >> try.msg
4536 $cat >> try.msg <<EOM
4543 and I got the following output:
4547 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4548 if sh -c './try' >>try.msg 2>&1; then
4552 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4555 cat >> try.msg <<'EOQS'
4556 If $libs contains -lsfio, and sfio is mis-configured, then it
4557 sometimes (apparently) runs and exits with a 0 status, but with no
4558 output! It may have to do with sfio's use of _exit vs. exit.
4561 rp="You have a big problem. Shall I abort Configure"
4568 echo "The program compiled OK, but exited with status $?." >>try.msg
4569 rp="You have a problem. Shall I abort Configure"
4573 echo "I can't compile the test program." >>try.msg
4574 rp="You have a BIG problem. Shall I abort Configure"
4580 case "$knowitall" in
4582 echo "(The supplied flags or libraries might be incorrect.)"
4590 *) echo "Ok. Stopping Configure." >&4
4595 n) echo "OK, that should do.";;
4597 $rm -f try try.* core
4599 : determine filename position in cpp output
4601 echo "Computing filename position in cpp output for #include directives..." >&4
4602 echo '#include <stdio.h>' > foo.c
4605 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4606 $grep '^[ ]*#.*stdio\.h' | \
4607 while read cline; do
4610 while $test \$# -gt 0; do
4611 if $test -r \`echo \$1 | $tr -d '"'\`; then
4616 pos=\`expr \$pos + 1\`
4628 *) pos="${fieldn}th";;
4630 echo "Your cpp writes the filename in the $pos field of the line."
4632 : locate header file
4637 for usrincdir in $usrinc
4639 if test -f \$usrincdir/\$wanted; then
4640 echo "\$usrincdir/\$wanted"
4644 awkprg='{ print \$$fieldn }'
4645 echo "#include <\$wanted>" > foo\$\$.c
4646 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4647 $grep "^[ ]*#.*\$wanted" | \
4648 while read cline; do
4649 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4651 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4652 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4657 # status = 0: grep returned 0 lines, case statement not executed
4658 # status = 1: headerfile found
4659 # status = 2: while loop executed, no headerfile found
4663 if test \$status -eq 1; then
4670 : define an alternate in-header-list? function
4671 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4672 cont=true; xxf="echo \"<\$1> found.\" >&4";
4673 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4674 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4676 case $# in 4) instead=instead;; *) instead="at last";; esac;
4677 while $test "$cont"; do
4679 var=$2; eval "was=\$$2";
4680 if $test "$xxx" && $test -r "$xxx";
4682 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4685 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4686 set $yyy; shift; shift; yyy=$@;
4687 case $# in 0) cont="";;
4688 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4689 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4690 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4691 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4695 do set $yyy; var=$2; eval "was=\$$2";
4696 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4697 set $yyy; shift; shift; yyy=$@;
4700 : see if this is a malloc.h system
4701 set malloc.h i_malloc
4704 : see if stdlib is available
4705 set stdlib.h i_stdlib
4708 : determine which malloc to compile in
4710 case "$usemymalloc" in
4711 ''|[yY]*|true|$define) dflt='y' ;;
4714 rp="Do you wish to attempt to use the malloc that comes with $package?"
4720 mallocsrc='malloc.c'
4721 mallocobj="malloc$_o"
4722 d_mymalloc="$define"
4725 : Remove malloc from list of libraries to use
4726 echo "Removing unneeded -lmalloc from library list" >&4
4727 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4730 echo "libs = $libs" >&4
4742 : compute the return types of malloc and free
4744 $cat >malloc.c <<END
4748 #include <sys/types.h>
4762 case "$malloctype" in
4764 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4771 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4775 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4782 echo "Your system uses $freetype free(), it would seem." >&4
4786 The installation process will also create a directory for
4787 vendor-supplied add-ons. Vendors who supply perl with their system
4788 may find it convenient to place all vendor-supplied files in this
4789 directory rather than in the main distribution directory. This will
4790 ease upgrades between binary-compatible maintenance versions of perl.
4792 Of course you may also use these directories in whatever way you see
4793 fit. For example, you might use them to access modules shared over a
4794 company-wide network.
4796 The default answer should be fine for most people.
4797 This causes further questions about vendor add-ons to be skipped
4798 and no vendor-specific directories will be configured for perl.
4801 rp='Do you want to configure vendor-specific add-on directories?'
4802 case "$usevendorprefix" in
4803 define|true|[yY]*) dflt=y ;;
4809 rp='Installation prefix to use for vendor-supplied add-ons?'
4810 case "$vendorprefix" in
4812 *) dflt=$vendorprefix ;;
4816 case "$vendorprefix" in
4820 *) oldvendorprefix="$prefix";;
4824 usevendorprefix="$define"
4826 vendorprefixexp="$ansexp"
4828 *) usevendorprefix="$undef"
4834 case "$vendorprefix" in
4835 '') d_vendorlib="$undef"
4839 *) d_vendorlib="$define"
4840 : determine where vendor-supplied modules go.
4841 : Usual default is /usr/local/lib/perl5/vendor_perl
4842 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4843 case "$installstyle" in
4844 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4845 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4848 rp='Pathname for the vendor-supplied library files?'
4851 vendorlibexp="$ansexp"
4852 : Change installation prefix, if necessary.
4853 if $test X"$prefix" != X"$installprefix"; then
4854 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4856 installvendorlib="$vendorlibexp"
4861 : Cruising for prototypes
4863 echo "Checking out function prototypes..." >&4
4864 $cat >prototype.c <<'EOCP'
4865 int main(int argc, char *argv[]) {
4868 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4869 echo "Your C compiler appears to support function prototypes."
4872 echo "Your C compiler doesn't seem to understand function prototypes."
4879 case "$prototype" in
4881 *) ansi2knr='ansi2knr'
4886 This version of $package can only be compiled by a compiler that
4887 understands function prototypes. Unfortunately, your C compiler
4889 doesn't seem to understand them. Sorry about that.
4891 If GNU cc is available for your system, perhaps you could try that instead.
4893 Eventually, we hope to support building Perl with pre-ANSI compilers.
4894 If you would like to help in that effort, please contact <perlbug@perl.org>.
4896 Aborting Configure now.
4902 : determine where public executables go
4907 rp='Pathname where the public executables will reside?'
4909 if $test "X$ansexp" != "X$binexp"; then
4914 : Change installation prefix, if necessary.
4915 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4916 if $test X"$prefix" != X"$installprefix"; then
4917 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4919 installbin="$binexp"
4922 : determine whether to install perl also as /usr/bin/perl
4925 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4927 Many scripts expect to perl to be installed as /usr/bin/perl.
4928 I can install the perl you are about to compile also as /usr/bin/perl
4929 (in addition to $installbin/perl).
4931 case "$installusrbinperl" in
4932 "$undef"|[nN]*) dflt='n';;
4935 rp="Do you want to install perl as /usr/bin/perl?"
4938 [yY]*) val="$define";;
4944 set installusrbinperl
4947 : define a shorthand compile call
4951 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4952 : define a shorthand compile call for compilations that should be ok.
4956 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4959 echo "Checking for GNU C Library..." >&4
4960 cat >gnulibc.c <<EOM
4972 if eval $compile_ok && ./gnulibc; then
4974 echo "You are using the GNU C Library"
4977 echo "You are not using the GNU C Library"
4983 : see if nm is to be used to determine whether a symbol is defined or not
4987 case "$d_gnulibc" in
4990 echo "nm probably won't work on the GNU C Library." >&4
4996 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4998 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4999 echo "'nm' won't be sufficient on this sytem." >&4
5005 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5006 if $test $dflt -gt 20; then
5016 true|$define) dflt=y;;
5023 I can use $nm to extract the symbols from your C libraries. This
5024 is a time consuming task which may generate huge output on the disk (up
5025 to 3 megabytes) but that should make the symbols extraction faster. The
5026 alternative is to skip the 'nm' extraction part and to compile a small
5027 test program instead to determine whether each symbol is present. If
5028 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5029 this may be the best solution.
5031 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5034 rp="Shall I use $nm to extract C symbols from the libraries?"
5037 [Nn]*) usenm=false;;
5046 : nm options which may be necessary
5048 '') if $test -f /mach_boot; then
5050 elif $test -d /usr/ccs/lib; then
5051 nm_opt='-p' # Solaris (and SunOS?)
5052 elif $test -f /dgux; then
5054 elif $test -f /lib64/rld; then
5055 nm_opt='-p' # 64-bit Irix
5061 : nm options which may be necessary for shared libraries but illegal
5062 : for archive libraries. Thank you, Linux.
5063 case "$nm_so_opt" in
5064 '') case "$myuname" in
5066 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5067 nm_so_opt='--dynamic'
5076 : get list of predefined functions in a handy place
5081 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5088 *) for thislib in $libs; do
5091 : Handle C library specially below.
5094 thislib=`echo $thislib | $sed -e 's/^-l//'`
5095 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5097 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5099 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5101 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5103 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5105 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5107 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5112 libnames="$libnames $try"
5114 *) libnames="$libnames $thislib" ;;
5123 for xxx in $libpth; do
5124 $test -r $1 || set $xxx/libc.$so
5125 : The messy sed command sorts on library version numbers.
5127 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5128 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5130 s/[0-9][0-9]*/0000&/g
5131 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5134 sort | $sed -e 's/^.* //'`
5137 $test -r $1 || set /usr/ccs/lib/libc.$so
5138 $test -r $1 || set /lib/libsys_s$_a
5144 if $test -r "$1"; then
5145 echo "Your (shared) C library seems to be in $1."
5147 elif $test -r /lib/libc && $test -r /lib/clib; then
5148 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5150 libc='/lib/clib /lib/libc'
5151 if $test -r /lib/syslib; then
5152 echo "(Your math library is in /lib/syslib.)"
5153 libc="$libc /lib/syslib"
5155 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5156 echo "Your C library seems to be in $libc, as you said before."
5157 elif $test -r $incpath/usr/lib/libc$_a; then
5158 libc=$incpath/usr/lib/libc$_a;
5159 echo "Your C library seems to be in $libc. That's fine."
5160 elif $test -r /lib/libc$_a; then
5162 echo "Your C library seems to be in $libc. You're normal."
5164 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5166 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5167 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5168 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5170 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5172 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5175 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5177 if $test -r "$tans"; then
5178 echo "Your C library seems to be in $tans, of all places."
5184 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5188 If the guess above is wrong (which it might be if you're using a strange
5189 compiler, or your machine supports multiple models), you can override it here.
5194 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5196 I can't seem to find your C library. I've looked in the following places:
5199 $sed 's/^/ /' libpath
5202 None of these seems to contain your C library. I need to get its name...
5207 rp='Where is your C library?'
5212 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5213 set X `cat libnames`
5216 case $# in 1) xxx=file; esac
5217 echo "Extracting names from the following $xxx for later perusal:" >&4
5219 $sed 's/^/ /' libnames >&4
5221 $echo $n "This may take a while...$c" >&4
5225 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5226 *) $nm $nm_opt $file 2>/dev/null;;
5231 $grep fprintf libc.tmp > libc.ptf
5232 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5233 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5235 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5237 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5239 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5241 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5243 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5245 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5247 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5249 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5251 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5253 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5255 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5257 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5259 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5260 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5262 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5264 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5266 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5268 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5270 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5272 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5274 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5276 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5278 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5280 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5282 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5284 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5286 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5288 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5290 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5293 $nm -p $* 2>/dev/null >libc.tmp
5294 $grep fprintf libc.tmp > libc.ptf
5295 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5296 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5302 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5304 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5305 for thisname in $libnames $libc; do
5306 $ar t $thisname >>libc.tmp
5308 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5310 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5311 # Repeat libc to extract forwarders to DLL entries too
5312 for thisname in $libnames $libc; do
5313 $ar tv $thisname >>libc.tmp
5314 # Revision 50 of EMX has bug in $ar.
5315 # it will not extract forwarders to DLL entries
5316 # Use emximp which will extract exactly them.
5317 emximp -o tmp.imp $thisname \
5319 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5320 < tmp.imp >>libc.tmp
5323 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5326 echo "$ar didn't seem to work right." >&4
5327 echo "Maybe this is a Cray...trying bld instead..." >&4
5328 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5330 for thisname in $libnames; do
5332 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5333 $ar t $thisname >>libc.tmp
5337 echo "That didn't work either. Giving up." >&4
5344 if $test -f /lib/syscalls.exp; then
5346 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5347 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5351 $rm -f libnames libpath
5353 : see if dld is available
5357 : is a C symbol defined?
5360 -v) tf=libc.tmp; tc=""; tdc="";;
5361 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5362 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5365 case "$reuseval-$4" in
5367 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5373 if $contains $tlook $tf >/dev/null 2>&1;
5378 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5379 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5387 $define) tval=true;;
5393 : define an is-in-libc? function
5394 inlibc='echo " "; td=$define; tu=$undef;
5395 sym=$1; var=$2; eval "was=\$$2";
5397 case "$reuseval$was" in
5407 echo "$sym() found." >&4;
5408 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5410 echo "$sym() NOT found." >&4;
5411 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5415 $define) echo "$sym() found." >&4;;
5416 *) echo "$sym() NOT found." >&4;;
5420 : see if dlopen exists
5427 : determine which dynamic loading, if any, to compile in
5429 dldir="ext/DynaLoader"
5442 $define) dflt='y' ;;
5445 $define) dflt='y' ;;
5447 : Does a dl_xxx.xs file exist for this operating system
5448 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5451 rp="Do you wish to use dynamic loading?"
5458 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5459 dflt="$dldir/dl_${osname}.xs"
5460 elif $test "$d_dlopen" = "$define" ; then
5461 dflt="$dldir/dl_dlopen.xs"
5462 elif $test "$i_dld" = "$define" ; then
5463 dflt="$dldir/dl_dld.xs"
5468 *) dflt="$dldir/$dlsrc"
5471 echo "The following dynamic loading files are available:"
5472 : Can not go over to $dldir because getfile has path hard-coded in.
5473 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5474 rp="Source file to use for dynamic loading"
5480 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5484 Some systems may require passing special flags to $cc -c to
5485 compile modules that will be used to create a shared library.
5486 To use no flags, say "none".
5489 case "$cccdlflags" in
5490 '') case "$gccversion" in
5491 '') case "$osname" in
5493 next) dflt='none' ;;
5494 irix*) dflt='-KPIC' ;;
5495 svr4*|esix*|solaris) dflt='-KPIC' ;;
5496 sunos) dflt='-pic' ;;
5500 *) case "$osname" in
5501 svr4*|esix*|solaris) dflt='-fPIC' ;;
5506 *) dflt="$cccdlflags" ;;
5508 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5511 none) cccdlflags=' ' ;;
5512 *) cccdlflags="$ans" ;;
5517 Some systems use ld to create libraries that can be dynamically loaded,
5518 while other systems (such as those using ELF) use $cc.
5522 '') $cat >try.c <<'EOM'
5523 /* Test for whether ELF binaries are produced */
5528 int i = open("a.out",O_RDONLY);
5531 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5532 exit(0); /* succeed (yes, it's ELF) */
5537 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5539 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5543 echo "I'll use ld to build dynamic libraries."
5552 rp="What command should be used to create dynamic libraries?"
5558 Some systems may require passing special flags to $ld to create a
5559 library that can be dynamically loaded. If your ld flags include
5560 -L/other/path options to locate libraries outside your loader's normal
5561 search path, you may need to specify those -L options here as well. To
5562 use no flags, say "none".
5565 case "$lddlflags" in
5566 '') case "$osname" in
5567 beos) dflt='-nostart' ;;
5569 linux|irix*) dflt='-shared' ;;
5570 next) dflt='none' ;;
5571 solaris) dflt='-G' ;;
5572 sunos) dflt='-assert nodefinitions' ;;
5573 svr4*|esix*) dflt="-G $ldflags" ;;
5577 *) dflt="$lddlflags" ;;
5580 : Try to guess additional flags to pick up local libraries.
5581 : Be careful not to append to a plain 'none'
5585 for thisflag in $ldflags; do
5590 *) dflt="$dflt $thisflag" ;;
5597 ''|' ') dflt='none' ;;
5600 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5603 none) lddlflags=' ' ;;
5604 *) lddlflags="$ans" ;;
5609 Some systems may require passing special flags to $cc to indicate that
5610 the resulting executable will use dynamic linking. To use no flags,
5614 case "$ccdlflags" in
5615 '') case "$osname" in
5616 hpux) dflt='-Wl,-E' ;;
5617 linux) dflt='-rdynamic' ;;
5618 next) dflt='none' ;;
5619 sunos) dflt='none' ;;
5623 *) dflt="$ccdlflags" ;;
5625 rp="Any special flags to pass to $cc to use dynamic loading?"
5628 none) ccdlflags=' ' ;;
5629 *) ccdlflags="$ans" ;;
5643 # No dynamic loading being used, so don't bother even to prompt.
5646 *) case "$useshrplib" in
5647 '') case "$osname" in
5648 svr4*|dgux|dynixptx|esix|powerux|beos)
5650 also='Building a shared libperl is required for dynamic loading to work on your system.'
5655 also='Building a shared libperl is needed for MAB support.'
5673 The perl executable is normally obtained by linking perlmain.c with
5674 libperl${_a}, any static extensions (usually just DynaLoader), and
5675 any other libraries needed on this system (such as -lm, etc.). Since
5676 your system supports dynamic loading, it is probably possible to build
5677 a shared libperl.$so. If you will have more than one executable linked
5678 to libperl.$so, this will significantly reduce the size of each
5679 executable, but it may have a noticeable affect on performance. The
5680 default is probably sensible for your system.
5684 rp="Build a shared libperl.$so (y/n)"
5688 useshrplib='true' ;;
5689 *) useshrplib='false' ;;
5694 case "$useshrplib" in
5698 # Figure out a good name for libperl.so. Since it gets stored in
5699 # a version-specific architecture-dependent library, the version
5700 # number isn't really that important, except for making cc/ld happy.
5702 # A name such as libperl.so.3.1
5703 majmin="libperl.$so.$patchlevel.$subversion"
5704 # A name such as libperl.so.301
5705 majonly=`echo $patchlevel $subversion |
5706 $awk '{printf "%d%02d", $1, $2}'`
5707 majonly=libperl.$so.$majonly
5708 # I'd prefer to keep the os-specific stuff here to a minimum, and
5709 # rely on figuring it out from the naming of libc.
5710 case "${osname}${osvers}" in
5713 # XXX How handle the --version stuff for MAB?
5715 linux*) # ld won't link with a bare -lperl otherwise.
5718 *) # Try to guess based on whether libc has major.minor.
5720 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5721 *libc.$so.[0-9]*) dflt=$majonly ;;
5722 *) dflt=libperl.$so ;;
5732 I need to select a good name for the shared libperl. If your system uses
5733 library names with major and minor numbers, then you might want something
5734 like $majmin. Alternatively, if your system uses a single version
5735 number for shared libraries, then you might want to use $majonly.
5736 Or, your system might be quite happy with a simple libperl.$so.
5738 Since the shared libperl will get installed into a version-specific
5739 architecture-dependent directory, the version number of the shared perl
5740 library probably isn't important, so the default should be o.k.
5743 rp='What name do you want to give to the shared libperl?'
5746 echo "Ok, I'll use $libperl"
5749 libperl="libperl${_a}"
5753 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5757 WARNING: Use of the shrpdir variable for the installation location of
5758 the shared $libperl is not supported. It was never documented and
5759 will not work in this version. Let me (perlbug@perl.com)
5760 know of any problems this may cause.
5766 But your current setting of $shrpdir is
5767 the default anyway, so it's harmless.
5772 Further, your current attempted setting of $shrpdir
5773 conflicts with the value of $archlibexp/CORE
5774 that installperl will use.
5781 # How will the perl executable find the installed shared $libperl?
5782 # Add $xxx to ccdlflags.
5783 # If we can't figure out a command-line option, use $shrpenv to
5784 # set env LD_RUN_PATH. The main perl makefile uses this.
5785 shrpdir=$archlibexp/CORE
5788 if "$useshrplib"; then
5791 # We'll set it in Makefile.SH...
5797 xxx="-Wl,-R$shrpdir"
5799 linux|irix*|dec_osf)
5800 xxx="-Wl,-rpath,$shrpdir"
5803 # next doesn't like the default...
5806 # beos doesn't like the default, either.
5809 # hpux doesn't like the default, either.
5810 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5813 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5819 # Only add $xxx if it isn't already in ccdlflags.
5820 case " $ccdlflags " in
5822 *) ccdlflags="$ccdlflags $xxx"
5825 Adding $xxx to the flags
5826 passed to $ld so that the perl executable will find the
5827 installed shared $libperl.
5835 # Fix ccdlflags in AIX for building external extensions.
5836 # (For building Perl itself bare -bE:perl.exp is needed,
5837 # Makefile.SH takes care of this.)
5839 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5841 # Respect a hint or command-line value.
5843 '') shrpenv="$tmp_shrpenv" ;;
5845 case "$ldlibpthname" in
5846 '') ldlibpthname=LD_LIBRARY_PATH ;;
5847 none) ldlibpthname='' ;;
5850 : determine where manual pages go
5851 set man1dir man1dir none
5855 $spackage has manual pages available in source form.
5859 echo "However, you don't have nroff, so they're probably useless to you."
5861 '') man1dir="none";;
5864 echo "If you don't want the manual sources installed, answer 'none'."
5869 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5870 lookpath="$lookpath $prefixexp/man/p_man/man1"
5871 lookpath="$lookpath $prefixexp/man/u_man/man1"
5872 lookpath="$lookpath $prefixexp/man/man.1"
5874 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5875 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5885 rp="Where do the main $spackage manual pages (source) go?"
5887 if $test "X$man1direxp" != "X$ansexp"; then
5891 man1direxp="$ansexp"
5897 : Change installation prefix, if necessary.
5898 if $test X"$prefix" != X"$installprefix"; then
5899 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5901 installman1dir="$man1direxp"
5904 : What suffix to use on installed man pages
5911 rp="What suffix should be used for the main $spackage man pages?"
5913 '') case "$man1dir" in
5927 *) dflt="$man1ext";;
5934 : see if we can have long filenames
5936 rmlist="$rmlist /tmp/cf$$"
5937 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5938 first=123456789abcdef
5939 second=/tmp/cf$$/$first
5940 $rm -f $first $second
5941 if (echo hi >$first) 2>/dev/null; then
5942 if $test -f 123456789abcde; then
5943 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5946 if (echo hi >$second) 2>/dev/null; then
5947 if $test -f /tmp/cf$$/123456789abcde; then
5949 That's peculiar... You can have filenames longer than 14 characters, but only
5950 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5951 I shall consider your system cannot support long filenames at all.
5955 echo 'You can have filenames longer than 14 characters.' >&4
5960 How confusing! Some of your filesystems are sane enough to allow filenames
5961 longer than 14 characters but some others like /tmp can't even think about them.
5962 So, for now on, I shall assume your kernel does not allow them at all.
5969 You can't have filenames longer than 14 chars. You can't even think about them!
5975 $rm -rf /tmp/cf$$ 123456789abcde*
5977 : determine where library module manual pages go
5978 set man3dir man3dir none
5982 $spackage has manual pages for many of the library modules.
5988 However, you don't have nroff, so they're probably useless to you.
5991 '') man3dir="none";;
5995 case "$d_flexfnam" in
5998 However, your system can't handle the long file names like File::Basename.3.
6001 '') man3dir="none";;
6005 echo "If you don't want the manual sources installed, answer 'none'."
6006 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6008 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6009 if $test -d "$privlib/man/man3"; then
6012 WARNING: Previous versions of perl installed man3 pages into
6013 $privlib/man/man3. This version will suggest a
6014 new default of $dflt.
6018 rp='Do you wish to preserve the old behavior?(y/n)'
6021 y*) dflt="$privlib/man/man3" ;;
6027 *) dflt="$man3dir" ;;
6031 rp="Where do the $package library man pages (source) go?"
6034 man3direxp="$ansexp"
6040 : Change installation prefix, if necessary.
6041 if $test X"$prefix" != X"$installprefix"; then
6042 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6044 installman3dir="$man3direxp"
6047 : What suffix to use on installed man pages
6053 rp="What suffix should be used for the $package library man pages?"
6055 '') case "$man3dir" in
6069 *) dflt="$man3ext";;
6076 : see if we have to deal with yellow pages, now NIS.
6077 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6078 if $test -f /usr/etc/nibindd; then
6080 echo "I'm fairly confident you're on a NeXT."
6082 rp='Do you get the hosts file via NetInfo?'
6091 y*) hostcat='nidump hosts .';;
6092 *) case "$hostcat" in
6093 nidump*) hostcat='';;
6103 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6111 rp='Are you getting the hosts file via yellow pages?'
6114 y*) hostcat='ypcat hosts';;
6115 *) hostcat='cat /etc/hosts';;
6121 '') hostcat='cat /etc/hosts';;
6124 '') groupcat='cat /etc/group';;
6127 '') passcat='cat /etc/passwd';;
6130 : now get the host name
6132 echo "Figuring out host name..." >&4
6133 case "$myhostname" in
6135 echo 'Maybe "hostname" will work...'
6136 if tans=`sh -c hostname 2>&1` ; then
6144 if $test "$cont"; then
6146 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6147 if tans=`cat /etc/systemid 2>&1` ; then
6149 phostname='cat /etc/systemid'
6150 echo "Whadyaknow. Xenix always was a bit strange..."
6153 elif $test -r /etc/systemid; then
6154 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6157 if $test "$cont"; then
6158 echo 'No, maybe "uuname -l" will work...'
6159 if tans=`sh -c 'uuname -l' 2>&1` ; then
6161 phostname='uuname -l'
6163 echo 'Strange. Maybe "uname -n" will work...'
6164 if tans=`sh -c 'uname -n' 2>&1` ; then
6166 phostname='uname -n'
6168 echo 'Oh well, maybe I can mine it out of whoami.h...'
6169 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6170 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6171 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6173 case "$myhostname" in
6174 '') echo "Does this machine have an identity crisis or something?"
6177 echo "Well, you said $myhostname before..."
6178 phostname='echo $myhostname';;
6184 : you do not want to know about this
6189 if $test "$myhostname" ; then
6191 rp='Your host name appears to be "'$myhostname'".'" Right?"
6199 : bad guess or no guess
6200 while $test "X$myhostname" = X ; do
6202 rp="Please type the (one word) name of your host:"
6207 : translate upper to lower if necessary
6208 case "$myhostname" in
6210 echo "(Normalizing case in your host name)"
6211 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6215 case "$myhostname" in
6217 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6218 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6219 echo "(Trimming domain name from host name--host name is now $myhostname)"
6221 *) case "$mydomain" in
6224 test "X$hostcat" = "Xypcat hosts" &&
6225 ypmatch "$myhostname" hosts 2>/dev/null |\
6226 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6229 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6230 /[ ]$myhostname[ . ]/p" > hosts
6233 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6234 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6235 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6236 hosts | $sort | $uniq | \
6237 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6238 case `$echo X$dflt` in
6239 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6242 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6247 tans=`./loc resolv.conf X /etc /usr/etc`
6248 if $test -f "$tans"; then
6249 echo "(Attempting domain name extraction from $tans)"
6250 dflt=.`$sed -n -e 's/ / /g' \
6251 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6252 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6254 .) dflt=.`$sed -n -e 's/ / /g' \
6255 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6256 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6263 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6264 dflt=.`sh -c domainname 2>/dev/null`
6267 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6272 .) echo "(Lost all hope -- silly guess then)"
6278 *) dflt="$mydomain";;
6282 rp="What is your domain name?"
6292 : translate upper to lower if necessary
6295 echo "(Normalizing case in your domain name)"
6296 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6300 : a little sanity check here
6301 case "$phostname" in
6304 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6305 $myhostname$mydomain|$myhostname) ;;
6307 case "$phostname" in
6309 echo "(That doesn't agree with your whoami.h file, by the way.)"
6312 echo "(That doesn't agree with your $phostname command, by the way.)"
6322 I need to get your e-mail address in Internet format if possible, i.e.
6323 something like user@host.domain. Please answer accurately since I have
6324 no easy means to double check it. The default value provided below
6325 is most probably close to the reality but may not be valid from outside
6326 your organization...
6330 while test "$cont"; do
6332 '') dflt="$cf_by@$myhostname$mydomain";;
6333 *) dflt="$cf_email";;
6335 rp='What is your e-mail address?'
6341 rp='Address does not look like an Internet one. Use it anyway?'
6357 If you or somebody else will be maintaining perl at your site, please
6358 fill in the correct e-mail address here so that they may be contacted
6359 if necessary. Currently, the "perlbug" program included with perl
6360 will send mail to this address in addition to perlbug@perl.com. You may
6361 enter "none" for no administrator.
6364 case "$perladmin" in
6365 '') dflt="$cf_email";;
6366 *) dflt="$perladmin";;
6368 rp='Perl administrator e-mail address'
6372 : figure out how to guarantee perl startup
6373 case "$startperl" in
6375 case "$sharpbang" in
6379 I can use the #! construct to start perl on your system. This will
6380 make startup of perl scripts faster, but may cause problems if you
6381 want to share those scripts and perl is not in a standard place
6382 ($binexp/perl) on all your platforms. The alternative is to force
6383 a shell by starting the script with a single ':' character.
6387 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6390 none) startperl=": # use perl";;
6391 *) startperl="#!$ans"
6392 if $test 30 -lt `echo "$ans" | wc -c`; then
6395 WARNING: Some systems limit the #! command to 32 characters.
6396 If you experience difficulty running Perl scripts with #!, try
6397 installing Perl in a directory with a shorter pathname.
6403 *) startperl=": # use perl"
6408 echo "I'll use $startperl to start perl scripts."
6410 : figure best path for perl in scripts
6413 perlpath="$binexp/perl"
6414 case "$startperl" in
6419 I will use the "eval 'exec'" idiom to start Perl on your system.
6420 I can use the full path of your Perl binary for this purpose, but
6421 doing so may cause problems if you want to share those scripts and
6422 Perl is not always in a standard place ($binexp/perl).
6426 rp="What path shall I use in \"eval 'exec'\"?"
6433 case "$startperl" in
6435 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6438 : determine where public executable scripts go
6439 set scriptdir scriptdir
6441 case "$scriptdir" in
6444 : guess some guesses
6445 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6446 $test -d /usr/share/bin && dflt=/usr/share/bin
6447 $test -d /usr/local/script && dflt=/usr/local/script
6448 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6449 $test -d $prefixexp/script && dflt=$prefixexp/script
6453 *) dflt="$scriptdir"
6458 Some installations have a separate directory just for executable scripts so
6459 that they can mount it across multiple architectures but keep the scripts in
6460 one spot. You might, for example, have a subdirectory of /usr/share for this.
6461 Or you might just lump your scripts in with all your other executables.
6465 rp='Where do you keep publicly executable scripts?'
6467 if $test "X$ansexp" != "X$scriptdirexp"; then
6471 scriptdirexp="$ansexp"
6472 : Change installation prefix, if necessary.
6473 if $test X"$prefix" != X"$installprefix"; then
6474 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6476 installscript="$scriptdirexp"
6481 After $package is installed, you may wish to install various
6482 add-on modules and utilities. Typically, these add-ons will
6483 be installed under $prefix with the rest
6484 of this package. However, you may wish to install such add-ons
6485 elsewhere under a different prefix.
6487 If you do not wish to put everything under a single prefix, that's
6488 ok. You will be prompted for the individual locations; this siteprefix
6489 is only used to suggest the defaults.
6491 The default should be fine for most people.
6495 rp='Installation prefix to use for add-on modules and utilities?'
6496 : XXX Here might be another good place for an installstyle setting.
6497 case "$siteprefix" in
6499 *) dflt=$siteprefix ;;
6503 case "$siteprefix" in
6508 *) oldsiteprefix="$prefix";;
6513 siteprefixexp="$ansexp"
6515 : determine where site specific libraries go.
6516 : Usual default is /usr/local/lib/perl5/site_perl
6517 : The default "style" setting is made in installstyle.U
6518 : XXX No longer works with Prefixit stuff.
6519 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6520 case "$installstyle" in
6521 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6522 *) dflt=$siteprefix/lib/site_$prog ;;
6526 The installation process will create a directory for
6527 site-specific extensions and modules. Most users find it convenient
6528 to place all site-specific files in this directory rather than in the
6529 main distribution directory.
6533 rp='Pathname for the site-specific library files?'
6536 sitelibexp="$ansexp"
6537 : Change installation prefix, if necessary.
6538 if $test X"$prefix" != X"$installprefix"; then
6539 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6541 installsitelib="$sitelibexp"
6544 : determine where site specific architecture-dependent libraries go.
6545 : sitelib default is /usr/local/lib/perl5/site_perl/
6546 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6547 : sitelib may have an optional trailing /share.
6548 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6549 tdflt="$tdflt/$apiversion/$archname"
6550 set sitearch sitearch none
6553 '') dflt="$tdflt" ;;
6554 *) dflt="$sitearch" ;;
6558 The installation process will also create a directory for
6559 architecture-dependent site-specific extensions and modules.
6563 rp='Pathname for the site-specific architecture-dependent library files?'
6566 sitearchexp="$ansexp"
6567 : Change installation prefix, if necessary.
6568 if $test X"$prefix" != X"$installprefix"; then
6569 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6571 installsitearch="$sitearchexp"
6574 : determine where add-on public executables go
6576 '') dflt=$siteprefix/bin ;;
6580 rp='Pathname where the add-on public executables should be installed?'
6583 sitebinexp="$ansexp"
6584 : Change installation prefix, if necessary.
6585 if $test X"$prefix" != X"$installprefix"; then
6586 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6588 installsitebin="$sitebinexp"
6593 Perl can be built to take advantage of long doubles which
6594 (if available) may give more accuracy and range for floating point numbers.
6596 If this doesn't make any sense to you, just accept the default 'n'.
6600 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6603 case "$uselongdouble" in
6604 $define|true|[yY]*) dflt='y';;
6607 rp='Try to use long doubles if available?'
6610 y|Y) val="$define" ;;
6616 case "$uselongdouble" in
6617 true|[yY]*) uselongdouble="$define" ;;
6620 case "$uselongdouble" in
6622 : Look for a hint-file generated 'call-back-unit'. If the
6623 : user has specified that long doubles should be used,
6624 : we may need to set or change some other defaults.
6625 if $test -f uselongdouble.cbu; then
6626 echo "Your platform has some specific hints for long doubles, using them..."
6627 . ./uselongdouble.cbu
6630 (Your platform doesn't have any specific hints for long doubles.)
6638 Perl can be built to take advantage of long longs which
6639 (if available) may give more range for integer numbers.
6641 If this doesn't make any sense to you, just accept the default 'n'.
6645 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6648 case "$uselonglong" in
6649 $define|true|[yY]*) dflt='y';;
6652 rp='Try to use long longs if available?'
6655 y|Y) val="$define" ;;
6661 case "$uselonglong" in
6662 true|[yY]*) uselonglong="$define" ;;
6665 case "$uselonglong" in
6667 : Look for a hint-file generated 'call-back-unit'. If the
6668 : user has specified that long longs should be used,
6669 : we may need to set or change some other defaults.
6670 if $test -f uselonglong.cbu; then
6671 echo "Your platform has some specific hints for long longs, using them..."
6675 (Your platform doesn't have any specific hints for long longs.)
6683 Previous version of $package used the standard IO mechanisms as defined
6684 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6685 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6686 the default. This abstraction layer can use AT&T's sfio (if you already
6687 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6688 problems with some extension modules. Using PerlIO with stdio is safe,
6689 but it is slower than plain stdio and therefore is not the default.
6691 If this doesn't make any sense to you, just accept the default 'n'.
6693 case "$useperlio" in
6694 $define|true|[yY]*) dflt='y';;
6697 rp='Use the experimental PerlIO abstraction layer?'
6704 echo "Ok, doing things the stdio way"
6711 case "$vendorprefix" in
6712 '') d_vendorbin="$undef"
6716 *) d_vendorbin="$define"
6717 : determine where vendor-supplied executables go.
6718 dflt=$vendorprefix/bin
6720 rp='Pathname for the vendor-supplied executables directory?'
6723 vendorbinexp="$ansexp"
6724 : Change installation prefix, if necessary.
6725 if $test X"$prefix" != X"$installprefix"; then
6726 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6728 installvendorbin="$vendorbinexp"
6733 : Check how to convert floats to strings.
6734 if test "X$d_Gconvert" = X; then
6736 echo "Checking for an efficient way to convert floats to strings."
6739 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6740 char *myname = "gconvert";
6743 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6744 char *myname = "gcvt";
6747 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6748 char *myname = "sprintf";
6754 checkit(expect, got)
6758 if (strcmp(expect, got)) {
6759 printf("%s oddity: Expected %s, got %s\n",
6760 myname, expect, got);
6770 /* This must be 1st test on (which?) platform */
6771 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6772 Gconvert(0.1, 8, 0, buf);
6773 checkit("0.1", buf);
6775 Gconvert(1.0, 8, 0, buf);
6778 Gconvert(0.0, 8, 0, buf);
6781 Gconvert(-1.0, 8, 0, buf);
6784 /* Some Linux gcvt's give 1.e+5 here. */
6785 Gconvert(100000.0, 8, 0, buf);
6786 checkit("100000", buf);
6788 /* Some Linux gcvt's give -1.e+5 here. */
6789 Gconvert(-100000.0, 8, 0, buf);
6790 checkit("-100000", buf);
6795 case "$d_Gconvert" in
6796 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6797 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6798 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6799 *) xxx_list='gconvert gcvt sprintf' ;;
6802 for xxx_convert in $xxx_list; do
6803 echo "Trying $xxx_convert"
6805 set try -DTRY_$xxx_convert
6806 if eval $compile; then
6807 echo "$xxx_convert" found. >&4
6809 echo "I'll use $xxx_convert to convert floats into a string." >&4
6812 echo "...But $xxx_convert didn't work as I expected."
6815 echo "$xxx_convert NOT found." >&4
6819 case "$xxx_convert" in
6820 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6821 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6822 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6826 : check for length of double
6828 case "$doublesize" in
6830 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6831 $cat >try.c <<'EOCP'
6835 printf("%d\n", sizeof(double));
6839 if eval $compile_ok; then
6841 $echo " $doublesize bytes." >&4
6844 echo "(I can't seem to compile the test program. Guessing...)"
6845 rp="What is the size of a double precision number (in bytes)?"
6853 : check for long doubles
6855 $echo $n "Checking to see if your system supports long double..." $c >&4
6856 echo 'int main() { long double x = 7.0; }' > try.c
6858 if eval $compile; then
6860 echo " Yes, it does." >&4
6863 echo " No, it doesn't." >&4
6869 : check for length of long double
6870 case "${d_longdbl}${longdblsize}" in
6873 $echo $n "Checking to see how big your long doubles are..." $c >&4
6874 $cat >try.c <<'EOCP'
6878 printf("%d\n", sizeof(long double));
6883 if eval $compile; then
6884 longdblsize=`./try$exe_ext`
6885 $echo " $longdblsize bytes." >&4
6889 echo "(I can't seem to compile the test program. Guessing...)" >&4
6890 rp="What is the size of a long double (in bytes)?"
6894 if $test "X$doublesize" = "X$longdblsize"; then
6895 echo "(That isn't any different from an ordinary double.)"
6903 if $test X"$d_longdbl" = X"$define"; then
6905 echo "Checking how to print long doubles..." >&4
6907 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6908 $cat >try.c <<'EOCP'
6909 #include <sys/types.h>
6913 printf("%.3f\n", d);
6917 if eval $compile; then
6921 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6922 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6923 echo "We will use %f."
6929 if $test X"$sPRIfldbl" = X; then
6930 $cat >try.c <<'EOCP'
6931 #include <sys/types.h>
6934 long double d = 123.456;
6935 printf("%.3llf\n", d);
6939 if eval $compile; then
6943 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6944 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
6945 echo "We will use %llf."
6951 if $test X"$sPRIfldbl" = X; then
6952 $cat >try.c <<'EOCP'
6953 #include <sys/types.h>
6956 long double d = 123.456;
6957 printf("%.3Lf\n", d);
6961 if eval $compile; then
6965 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6966 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
6967 echo "We will use %Lf."
6973 if $test X"$sPRIfldbl" = X; then
6974 $cat >try.c <<'EOCP'
6975 #include <sys/types.h>
6978 long double d = 123.456;
6979 printf("%.3lf\n", d);
6983 if eval $compile; then
6987 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6988 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
6989 echo "We will use %lf."
6995 if $test X"$sPRIfldbl" = X; then
6996 echo "Cannot figure out how to print long doubles." >&4
7003 case "$sPRIfldbl" in
7004 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7005 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7007 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7008 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7012 : Initialize h_fcntl
7015 : Initialize h_sysfile
7018 : access call always available on UNIX
7022 : locate the flags for 'access()'
7026 $cat >access.c <<'EOCP'
7027 #include <sys/types.h>
7032 #include <sys/file.h>
7041 : check sys/file.h first, no particular reason here
7042 if $test `./findhdr sys/file.h` && \
7043 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7045 echo "<sys/file.h> defines the *_OK access constants." >&4
7046 elif $test `./findhdr fcntl.h` && \
7047 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7049 echo "<fcntl.h> defines the *_OK access constants." >&4
7050 elif $test `./findhdr unistd.h` && \
7051 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7052 echo "<unistd.h> defines the *_OK access constants." >&4
7054 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7060 : see if accessx exists
7061 set accessx d_accessx
7064 : see if alarm exists
7068 : see if atolf exists
7072 : see if atoll exists
7076 : Look for GNU-cc style attribute checking
7078 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7079 $cat >attrib.c <<'EOCP'
7081 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7083 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7084 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7085 echo "Your C compiler doesn't fully support __attribute__."
7088 echo "Your C compiler supports __attribute__."
7092 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7099 : see if bcmp exists
7103 : see if bcopy exists
7107 : see if this is a unistd.h system
7108 set unistd.h i_unistd
7111 : see if getpgrp exists
7112 set getpgrp d_getpgrp
7115 case "$d_getpgrp" in
7118 echo "Checking to see which flavor of getpgrp is in use..."
7121 #include <sys/types.h>
7123 # include <unistd.h>
7127 if (getuid() == 0) {
7128 printf("(I see you are running Configure as super-user...)\n");
7132 if (getpgrp(1) == 0)
7141 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7142 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7144 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7145 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7148 echo "I can't seem to compile and run the test program."
7150 xxx="a USG one, i.e. you use getpgrp()."
7152 # SVR4 systems can appear rather BSD-ish.
7155 xxx="a BSD one, i.e. you use getpgrp(pid)."
7159 xxx="probably a USG one, i.e. you use getpgrp()."
7164 echo "Assuming your getpgrp is $xxx" >&4
7173 : see if setpgrp exists
7174 set setpgrp d_setpgrp
7177 case "$d_setpgrp" in
7180 echo "Checking to see which flavor of setpgrp is in use..."
7183 #include <sys/types.h>
7185 # include <unistd.h>
7189 if (getuid() == 0) {
7190 printf("(I see you are running Configure as super-user...)\n");
7194 if (-1 == setpgrp(1, 1))
7197 if (setpgrp() != -1)
7203 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7204 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7206 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7207 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7210 echo "(I can't seem to compile and run the test program.)"
7212 xxx="a USG one, i.e. you use setpgrp()."
7214 # SVR4 systems can appear rather BSD-ish.
7217 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7221 xxx="probably a USG one, i.e. you use setpgrp()."
7226 echo "Assuming your setpgrp is $xxx" >&4
7234 : see if bzero exists
7238 : check for lengths of integral types
7242 echo "Checking to see how big your integers are..." >&4
7243 $cat >intsize.c <<'EOCP'
7247 printf("intsize=%d;\n", sizeof(int));
7248 printf("longsize=%d;\n", sizeof(long));
7249 printf("shortsize=%d;\n", sizeof(short));
7254 if eval $compile_ok && ./intsize > /dev/null; then
7256 echo "Your integers are $intsize bytes long."
7257 echo "Your long integers are $longsize bytes long."
7258 echo "Your short integers are $shortsize bytes long."
7262 Help! I can't compile and run the intsize test program: please enlighten me!
7263 (This is probably a misconfiguration in your system or libraries, and
7264 you really ought to fix it. Still, I'll try anyway.)
7268 rp="What is the size of an integer (in bytes)?"
7272 rp="What is the size of a long integer (in bytes)?"
7276 rp="What is the size of a short integer (in bytes)?"
7282 $rm -f intsize intsize.*
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 : check for const keyword
7536 echo 'Checking to see if your C compiler knows about "const"...' >&4
7537 $cat >const.c <<'EOCP'
7538 typedef struct spug { int drokk; } spug;
7545 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7547 echo "Yup, it does."
7550 echo "Nope, it doesn't."
7555 : see if crypt exists
7557 if set crypt val -f d_crypt; eval $csym; $val; then
7558 echo 'crypt() found.' >&4
7562 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7563 if $test -z "$cryptlib"; then
7564 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7568 if $test -z "$cryptlib"; then
7569 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7573 if $test -z "$cryptlib"; then
7574 cryptlib=`./loc libcrypt$_a "" $libpth`
7578 if $test -z "$cryptlib"; then
7579 echo 'crypt() NOT found.' >&4
7588 : get csh whereabouts
7590 'csh') val="$undef" ;;
7595 : Respect a hint or command line value for full_csh.
7597 '') full_csh=$csh ;;
7600 : see if cuserid exists
7601 set cuserid d_cuserid
7604 : see if this is a limits.h system
7605 set limits.h i_limits
7608 : see if this is a float.h system
7612 : See if number of significant digits in a double precision number is known
7614 $cat >dbl_dig.c <<EOM
7624 printf("Contains DBL_DIG");
7627 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7628 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7629 echo "DBL_DIG found." >&4
7632 echo "DBL_DIG NOT found." >&4
7639 : see if difftime exists
7640 set difftime d_difftime
7643 : see if this is a dirent system
7645 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7647 echo "<dirent.h> found." >&4
7650 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7651 echo "<sys/dir.h> found." >&4
7654 xinc=`./findhdr sys/ndir.h`
7656 echo "<dirent.h> NOT found." >&4
7661 : Look for type of directory structure.
7663 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7665 case "$direntrytype" in
7668 $define) guess1='struct dirent' ;;
7669 *) guess1='struct direct' ;;
7672 *) guess1="$direntrytype"
7677 'struct dirent') guess2='struct direct' ;;
7678 *) guess2='struct dirent' ;;
7681 if $contains "$guess1" try.c >/dev/null 2>&1; then
7682 direntrytype="$guess1"
7683 echo "Your directory entries are $direntrytype." >&4
7684 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7685 direntrytype="$guess2"
7686 echo "Your directory entries seem to be $direntrytype." >&4
7688 echo "I don't recognize your system's directory entries." >&4
7689 rp="What type is used for directory entries on this system?"
7697 : see if the directory entry stores field length
7699 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7700 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7701 echo "Good, your directory entry keeps length information in d_namlen." >&4
7704 echo "Your directory entry does not know about the d_namlen field." >&4
7711 : see if dlerror exists
7714 set dlerror d_dlerror
7718 : see if dlfcn is available
7726 On a few systems, the dynamically loaded modules that perl generates and uses
7727 will need a different extension than shared libs. The default will probably
7735 rp='What is the extension of dynamically loaded modules'
7744 : Check if dlsym need a leading underscore
7750 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7751 $cat >dyna.c <<'EOM'
7760 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7762 #include <sys/types.h>
7776 int mode = RTLD_LAZY ;
7778 handle = dlopen("./dyna.$dlext", mode) ;
7779 if (handle == NULL) {
7784 symbol = dlsym(handle, "fred") ;
7785 if (symbol == NULL) {
7786 /* try putting a leading underscore */
7787 symbol = dlsym(handle, "_fred") ;
7788 if (symbol == NULL) {
7801 : Call the object file tmp-dyna.o in case dlext=o.
7802 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7803 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7804 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7805 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7808 1) echo "Test program failed using dlopen." >&4
7809 echo "Perhaps you should not use dynamic loading." >&4;;
7810 2) echo "Test program failed using dlsym." >&4
7811 echo "Perhaps you should not use dynamic loading." >&4;;
7812 3) echo "dlsym needs a leading underscore" >&4
7814 4) echo "dlsym doesn't need a leading underscore." >&4;;
7817 echo "I can't compile and run the test program." >&4
7818 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7823 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7828 hasproto='varname=$1; func=$2; shift; shift;
7829 while $test $# -ge 2; do
7831 $define) echo "#include <$2>";;
7835 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7836 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7837 echo "$func() prototype found.";
7840 echo "$func() prototype NOT found.";
7845 $rm -f try.c tryout.c'
7847 : see if prototype for drand48 is available
7849 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7852 : see if dup2 exists
7856 : see if eaccess exists
7857 set eaccess d_eaccess
7860 : see if endgrent exists
7861 set endgrent d_endgrent
7864 : see if endhostent exists
7865 set endhostent d_endhent
7868 : see if endnetent exists
7869 set endnetent d_endnent
7872 : see if endprotoent exists
7873 set endprotoent d_endpent
7876 : see if endpwent exists
7877 set endpwent d_endpwent
7880 : see if endservent exists
7881 set endservent d_endsent
7884 : see if endspent exists
7885 set endspent d_endspent
7888 : Locate the flags for 'open()'
7890 $cat >open3.c <<'EOCP'
7891 #include <sys/types.h>
7896 #include <sys/file.h>
7907 : check sys/file.h first to get FREAD on Sun
7908 if $test `./findhdr sys/file.h` && \
7909 set open3 -DI_SYS_FILE && eval $compile; then
7911 echo "<sys/file.h> defines the O_* constants..." >&4
7913 echo "and you have the 3 argument form of open()." >&4
7916 echo "but not the 3 argument form of open(). Oh, well." >&4
7919 elif $test `./findhdr fcntl.h` && \
7920 set open3 -DI_FCNTL && eval $compile; then
7922 echo "<fcntl.h> defines the O_* constants..." >&4
7924 echo "and you have the 3 argument form of open()." >&4
7927 echo "but not the 3 argument form of open(). Oh, well." >&4
7932 echo "I can't find the O_* constant definitions! You got problems." >&4
7938 : check for non-blocking I/O stuff
7939 case "$h_sysfile" in
7940 true) echo "#include <sys/file.h>" > head.c;;
7943 true) echo "#include <fcntl.h>" > head.c;;
7944 *) echo "#include <sys/fcntl.h>" > head.c;;
7949 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7950 case "$o_nonblock" in
7953 $cat >>try.c <<'EOCP'
7956 printf("O_NONBLOCK\n");
7960 printf("O_NDELAY\n");
7964 printf("FNDELAY\n");
7971 if eval $compile_ok; then
7973 case "$o_nonblock" in
7974 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7975 *) echo "Seems like we can use $o_nonblock.";;
7978 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7981 *) echo "Using $hint value $o_nonblock.";;
7983 $rm -f try try.* .out core
7986 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7992 #include <sys/types.h>
7994 #define MY_O_NONBLOCK $o_nonblock
7995 #ifndef errno /* XXX need better Configure test */
7998 $signal_t blech(x) int x; { exit(3); }
8000 $cat >> try.c <<'EOCP'
8008 pipe(pd); /* Down: child -> parent */
8009 pipe(pu); /* Up: parent -> child */
8012 close(pd[1]); /* Parent reads from pd[0] */
8013 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8014 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8016 signal(SIGALRM, blech);
8018 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8020 sprintf(string, "%d\n", ret);
8021 write(2, string, strlen(string));
8024 if (errno == EAGAIN) {
8030 if (errno == EWOULDBLOCK)
8031 printf("EWOULDBLOCK\n");
8034 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8035 sleep(2); /* Give it time to close our pipe */
8037 ret = read(pd[0], buf, 1); /* Should read EOF */
8039 sprintf(string, "%d\n", ret);
8040 write(3, string, strlen(string));
8044 close(pd[0]); /* We write to pd[1] */
8045 close(pu[1]); /* We read from pu[0] */
8046 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8047 close(pd[1]); /* Pipe pd is now fully closed! */
8048 exit(0); /* Bye bye, thank you for playing! */
8052 if eval $compile_ok; then
8053 echo "$startsh" >mtry
8054 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8056 ./mtry >/dev/null 2>&1
8058 0) eagain=`$cat try.out`;;
8059 1) echo "Could not perform non-blocking setting!";;
8060 2) echo "I did a successful read() for something that was not there!";;
8061 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8062 *) echo "Something terribly wrong happened during testing.";;
8064 rd_nodata=`$cat try.ret`
8065 echo "A read() system call with no data present returns $rd_nodata."
8066 case "$rd_nodata" in
8069 echo "(That's peculiar, fixing that to be -1.)"
8075 echo "Forcing errno EAGAIN on read() with no data available."
8079 echo "Your read() sets errno to $eagain when no data is available."
8082 status=`$cat try.err`
8084 0) echo "And it correctly returns 0 to signal EOF.";;
8085 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8086 *) echo "However, your read() returns '$status' on EOF??";;
8089 if test "$status" = "$rd_nodata"; then
8090 echo "WARNING: you can't distinguish between EOF and no data!"
8094 echo "I can't compile the test program--assuming errno EAGAIN will do."
8101 echo "Using $hint value $eagain."
8102 echo "Your read() returns $rd_nodata when no data is present."
8103 case "$d_eofnblk" in
8104 "$define") echo "And you can see EOF because read() returns 0.";;
8105 "$undef") echo "But you can't see EOF status from read() returned value.";;
8107 echo "(Assuming you can't see EOF status from read anyway.)"
8113 $rm -f try try.* .out core head.c mtry
8115 : see if fchmod exists
8119 : see if fchown exists
8123 : see if this is an fcntl system
8127 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8128 while $test $# -ge 2; do
8130 $define) echo "#include <$2>";;
8134 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8136 if eval $compile; then
8147 : see whether socket exists
8149 $echo $n "Hmm... $c" >&4
8150 if set socket val -f d_socket; eval $csym; $val; then
8151 echo "Looks like you have Berkeley networking support." >&4
8153 if set setsockopt val -f; eval $csym; $val; then
8156 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8160 if $contains socklib libc.list >/dev/null 2>&1; then
8161 echo "Looks like you have Berkeley networking support." >&4
8163 : we will have to assume that it supports the 4.2 BSD interface
8166 echo "You don't have Berkeley networking in libc$_a..." >&4
8167 if test "X$d_socket" = "X$define"; then
8168 echo "...but you seem to believe that you have sockets." >&4
8170 for net in net socket
8172 if test -f /usr/lib/lib$net$_a; then
8173 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8174 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8175 if $contains socket libc.list >/dev/null 2>&1; then
8180 echo "...but the Wollongong group seems to have hacked it in." >&4
8181 sockethdr="-I/usr/netinclude"
8184 echo "Found Berkeley sockets interface in lib$net." >& 4
8185 if $contains setsockopt libc.list >/dev/null 2>&1; then
8188 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8195 if test "X$d_socket" != "X$define"; then
8196 echo "or anywhere else I see." >&4
8204 : see if socketpair exists
8205 set socketpair d_sockpair
8210 echo "Checking the availability of certain socket constants..." >& 4
8211 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8212 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8214 #include <sys/types.h>
8215 #include <sys/socket.h>
8221 set try; if eval $compile; then
8224 set d_${enum}; eval $setvar
8228 : see if sys/select.h has to be included
8229 set sys/select.h i_sysselct
8232 : see if we should include time.h, sys/time.h, or both
8234 if test "X$timeincl" = X; then
8235 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8236 $echo $n "I'm now running the test program...$c"
8237 $cat >try.c <<'EOCP'
8238 #include <sys/types.h>
8243 #ifdef SYSTIMEKERNEL
8246 #include <sys/time.h>
8249 #include <sys/select.h>
8258 struct timezone tzp;
8260 if (foo.tm_sec == foo.tm_sec)
8263 if (bar.tv_sec == bar.tv_sec)
8270 for s_timezone in '-DS_TIMEZONE' ''; do
8272 for s_timeval in '-DS_TIMEVAL' ''; do
8273 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8274 for i_time in '' '-DI_TIME'; do
8275 for i_systime in '-DI_SYSTIME' ''; do
8278 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8279 if eval $compile; then
8280 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8284 $echo $n "Succeeded with $flags$c"
8296 *SYSTIMEKERNEL*) i_systimek="$define"
8297 timeincl=`./findhdr sys/time.h`
8298 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8299 *) i_systimek="$undef";;
8302 *I_TIME*) i_time="$define"
8303 timeincl=`./findhdr time.h`" $timeincl"
8304 echo "We'll include <time.h>." >&4;;
8305 *) i_time="$undef";;
8308 *I_SYSTIME*) i_systime="$define"
8309 timeincl=`./findhdr sys/time.h`" $timeincl"
8310 echo "We'll include <sys/time.h>." >&4;;
8311 *) i_systime="$undef";;
8316 : check for fd_set items
8319 Checking to see how well your C compiler handles fd_set and friends ...
8321 $cat >fd_set.c <<EOCP
8322 #$i_systime I_SYS_TIME
8323 #$i_sysselct I_SYS_SELECT
8324 #$d_socket HAS_SOCKET
8325 #include <sys/types.h>
8327 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8330 #include <sys/time.h>
8333 #include <sys/select.h>
8342 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8349 set fd_set -DTRYBITS
8350 if eval $compile; then
8351 d_fds_bits="$define"
8353 echo "Well, your system knows about the normal fd_set typedef..." >&4
8355 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8356 d_fd_macros="$define"
8359 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8361 d_fd_macros="$undef"
8365 Hmm, your compiler has some difficulty with fd_set. Checking further...
8368 if eval $compile; then
8371 echo "Well, your system has some sort of fd_set available..." >&4
8373 echo "and you have the normal fd_set macros." >&4
8374 d_fd_macros="$define"
8377 but not the normal fd_set macros! Gross! More work for me...
8379 d_fd_macros="$undef"
8382 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8385 d_fd_macros="$undef"
8390 : see if fgetpos exists
8391 set fgetpos d_fgetpos
8394 : see if flock exists
8398 : see if fork exists
8402 : see if pathconf exists
8403 set pathconf d_pathconf
8406 : see if fpathconf exists
8407 set fpathconf d_fpathconf
8410 : define an is-a-typedef? function
8411 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8413 "") inclist="sys/types.h";;
8415 eval "varval=\$$var";
8419 for inc in $inclist; do
8420 echo "#include <$inc>" >>temp.c;
8422 echo "#ifdef $type" >> temp.c;
8423 echo "printf(\"We have $type\");" >> temp.c;
8424 echo "#endif" >> temp.c;
8425 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8426 if $contains $type temp.E >/dev/null 2>&1; then
8432 *) eval "$var=\$varval";;
8435 : define an is-a-typedef? function that prompts if the type is not available.
8436 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8438 "") inclist="sys/types.h";;
8440 eval "varval=\$$var";
8444 for inc in $inclist; do
8445 echo "#include <$inc>" >>temp.c;
8447 echo "#ifdef $type" >> temp.c;
8448 echo "printf(\"We have $type\");" >> temp.c;
8449 echo "#endif" >> temp.c;
8450 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8452 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8453 if $contains $type temp.E >/dev/null 2>&1; then
8454 echo "$type found." >&4;
8457 echo "$type NOT found." >&4;
8463 *) eval "$var=\$varval";;
8466 : see what type lseek is declared as in the kernel
8467 rp="What is the type used for lseek's offset on this system?"
8468 set off_t lseektype long stdio.h sys/types.h
8472 $echo $n "Checking to see how big your file offsets are...$c" >&4
8474 #include <sys/types.h>
8478 printf("%d\n", sizeof($lseektype));
8482 if eval $compile_ok; then
8484 $echo " $lseeksize bytes." >&4
8488 echo "(I can't seem to compile the test program. Guessing...)"
8489 rp="What is the size of your file offsets (in bytes)?"
8495 : see what type file positions are declared as in the library
8496 rp="What is the type for file position used by fsetpos()?"
8497 set fpos_t fpostype long stdio.h sys/types.h
8502 *_t) zzz="$fpostype" ;;
8505 echo "Checking the size of $zzz..." >&4
8507 #include <sys/types.h>
8510 printf("%d\n", sizeof($fpostype));
8514 if eval $compile_ok; then
8518 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8521 echo "Your $zzz size is $fpossize bytes."
8526 echo "(I can't compile the test program--guessing $fpossize.)" >&4
8533 echo "Checking to see if your system supports off64_t..." >&4
8535 #include <sys/types.h>
8537 int main() { off64_t x = 7; }'
8540 if eval $compile; then
8542 echo "Yes, it does."
8545 echo "No, it doesn't."
8546 case "$lseeksize" in
8547 8) echo "(This is okay because your off_t is 64 bits wide.)" ;;
8554 : check for fpos64_t
8556 echo "Checking to see if your system supports fpos64_t..." >&4
8558 #include <sys/stdio.h>
8559 int main() { fpos64_t x x = 7; }'
8562 if eval $compile; then
8564 echo "Yes, it does."
8567 echo "No, it doesn't."
8569 8) echo "(This is okay because your fpos_t is 64 bits wide.)" ;;
8576 hasstruct='varname=$1; struct=$2; shift; shift;
8577 while $test $# -ge 2; do
8579 $define) echo "#include <$2>";;
8583 echo "int main () { struct $struct foo; }" >> try.c;
8585 if eval $compile; then
8594 : see if this is a sys/param system
8595 set sys/param.h i_sysparam
8598 : see if this is a sys/mount.h system
8599 set sys/mount.h i_sysmount
8602 : see if sys/types.h has to be included
8603 set sys/types.h i_systypes
8608 echo "Checking to see if your system supports struct fs_data..." >&4
8609 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8611 case "$d_fs_data_s" in
8612 "$define") echo "Yes, it does." ;;
8613 *) echo "No, it doesn't." ;;
8616 : see if fseeko exists
8620 : see if fsetpos exists
8621 set fsetpos d_fsetpos
8625 : see if fstatfs exists
8626 set fstatfs d_fstatfs
8630 : see if statvfs exists
8631 set statvfs d_statvfs
8634 : see if fstatvfs exists
8635 set fstatvfs d_fstatvfs
8639 : see if ftello exists
8643 : see if getgrent exists
8644 set getgrent d_getgrent
8647 : see if gethostbyaddr exists
8648 set gethostbyaddr d_gethbyaddr
8651 : see if gethostbyname exists
8652 set gethostbyname d_gethbyname
8655 : see if gethostent exists
8656 set gethostent d_gethent
8659 : see how we will look up host name
8662 if set gethostname val -f d_gethname; eval $csym; $val; then
8663 echo 'gethostname() found.' >&4
8664 d_gethname="$define"
8667 if set uname val -f d_uname; eval $csym; $val; then
8670 uname() was found, but you're running xenix, and older versions of xenix
8671 have a broken uname(). If you don't really know whether your xenix is old
8672 enough to have a broken system call, use the default answer.
8679 rp='Is your uname() broken?'
8682 n*) d_uname="$define"; call=uname;;
8685 echo 'uname() found.' >&4
8692 case "$d_gethname" in
8693 '') d_gethname="$undef";;
8696 '') d_uname="$undef";;
8698 case "$d_uname$d_gethname" in
8703 Every now and then someone has a $call() that lies about the hostname
8704 but can't be fixed for political or economic reasons. If you wish, I can
8705 pretend $call() isn't there and maybe compute hostname at run-time
8706 thanks to the '$phostname' command.
8709 rp="Shall I ignore $call() from now on?"
8712 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8715 case "$phostname" in
8717 *) case "$aphostname" in
8723 file=`./loc $file $file $pth`
8724 aphostname=`echo $file $*`
8729 case "$d_uname$d_gethname" in
8732 case "$phostname" in
8734 echo "There will be no way for $package to get your hostname." >&4;;
8736 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8740 case "$d_phostname" in
8741 '') d_phostname="$undef";;
8744 : see if this is a netdb.h system
8748 : see if prototypes for various gethostxxx netdb.h functions are available
8750 set d_gethostprotos gethostent $i_netdb netdb.h
8753 : see if getlogin exists
8754 set getlogin d_getlogin
8757 : see if getmnt exists
8761 : see if getmntent exists
8762 set getmntent d_getmntent
8765 : see if getnetbyaddr exists
8766 set getnetbyaddr d_getnbyaddr
8769 : see if getnetbyname exists
8770 set getnetbyname d_getnbyname
8773 : see if getnetent exists
8774 set getnetent d_getnent
8777 : see if prototypes for various getnetxxx netdb.h functions are available
8779 set d_getnetprotos getnetent $i_netdb netdb.h
8783 : see if getprotobyname exists
8784 set getprotobyname d_getpbyname
8787 : see if getprotobynumber exists
8788 set getprotobynumber d_getpbynumber
8791 : see if getprotoent exists
8792 set getprotoent d_getpent
8795 : see if getpgid exists
8796 set getpgid d_getpgid
8799 : see if getpgrp2 exists
8800 set getpgrp2 d_getpgrp2
8803 : see if getppid exists
8804 set getppid d_getppid
8807 : see if getpriority exists
8808 set getpriority d_getprior
8811 : see if prototypes for various getprotoxxx netdb.h functions are available
8813 set d_getprotoprotos getprotoent $i_netdb netdb.h
8816 : see if getpwent exists
8817 set getpwent d_getpwent
8821 : see if getservbyname exists
8822 set getservbyname d_getsbyname
8825 : see if getservbyport exists
8826 set getservbyport d_getsbyport
8829 : see if getservent exists
8830 set getservent d_getsent
8833 : see if prototypes for various getservxxx netdb.h functions are available
8835 set d_getservprotos getservent $i_netdb netdb.h
8838 : see if getspent exists
8839 set getspent d_getspent
8842 : see if getspnam exists
8843 set getspnam d_getspnam
8846 : see if gettimeofday or ftime exists
8847 set gettimeofday d_gettimeod
8849 case "$d_gettimeod" in
8855 val="$undef"; set d_ftime; eval $setvar
8858 case "$d_gettimeod$d_ftime" in
8861 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8865 : see if this is an grp system
8871 xxx=`./findhdr grp.h`
8872 $cppstdin $cppflags $cppminus < $xxx >$$.h
8874 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8886 set d_grpasswd; eval $setvar
8890 : see if hasmntopt exists
8891 set hasmntopt d_hasmntopt
8894 : see if this is a netinet/in.h or sys/in.h system
8895 set netinet/in.h i_niin sys/in.h i_sysin
8898 : see if arpa/inet.h has to be included
8899 set arpa/inet.h i_arpainet
8902 : see if htonl --and friends-- exists
8907 : Maybe they are macros.
8912 #include <sys/types.h>
8913 #$i_niin I_NETINET_IN
8915 #$i_arpainet I_ARPA_INET
8917 #include <netinet/in.h>
8923 #include <arpa/inet.h>
8926 printf("Defined as a macro.");
8929 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8930 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8932 echo "But it seems to be defined as a macro." >&4
8940 : see which of string.h or strings.h is needed
8942 strings=`./findhdr string.h`
8943 if $test "$strings" && $test -r "$strings"; then
8944 echo "Using <string.h> instead of <strings.h>." >&4
8948 strings=`./findhdr strings.h`
8949 if $test "$strings" && $test -r "$strings"; then
8950 echo "Using <strings.h> instead of <string.h>." >&4
8952 echo "No string header found -- You'll surely have problems." >&4
8958 "$undef") strings=`./findhdr strings.h`;;
8959 *) strings=`./findhdr string.h`;;
8964 if set index val -f; eval $csym; $val; then
8965 if set strchr val -f d_strchr; eval $csym; $val; then
8966 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8969 echo "strchr() found." >&4
8973 echo "index() found." >&4
8978 echo "index() found." >&4
8981 if set strchr val -f d_strchr; eval $csym; $val; then
8984 echo "strchr() found." >&4
8986 echo "No index() or strchr() found!" >&4
8991 set d_strchr; eval $setvar
8993 set d_index; eval $setvar
8995 : check whether inet_aton exists
8996 set inet_aton d_inetaton
8999 : see if inttypes.h is available
9000 : we want a real compile instead of Inhdr because some systems
9001 : have an inttypes.h which includes non-existent headers
9004 #include <inttypes.h>
9006 static int32_t foo32 = 0x12345678;
9010 if eval $compile; then
9011 echo "<inttypes.h> found." >&4
9014 echo "<inttypes.h> NOT found." >&4
9022 case "$use64bits" in
9025 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9027 #include <sys/types.h>
9028 #$i_inttypes I_INTTYPES
9030 #include <inttypes.h>
9032 int main() { int64_t x = 7; }
9035 if eval $compile; then
9037 echo " Yes, it does." >&4
9040 echo " No, it doesn't." >&4
9053 $cat >isascii.c <<'EOCP'
9065 if eval $compile; then
9066 echo "isascii() found." >&4
9069 echo "isascii() NOT found." >&4
9076 : see if killpg exists
9080 : see if lchown exists
9082 $cat > try.c <<'EOCP'
9083 /* System header to define __stub macros and hopefully few prototypes,
9084 which can conflict with char lchown(); below. */
9086 /* Override any gcc2 internal prototype to avoid an error. */
9087 /* We use char because int might match the return type of a gcc2
9088 builtin and then its argument prototype would still apply. */
9091 /* The GNU C library defines this for functions which it implements
9092 to always fail with ENOSYS. Some functions are actually named
9093 something starting with __ and the normal name is an alias. */
9094 #if defined (__stub_lchown) || defined (__stub___lchown)
9102 if eval $compile; then
9103 $echo "lchown() found." >&4
9106 $echo "lchown() NOT found." >&4
9112 : See if number of significant digits in a double precision number is known
9114 $cat >ldbl_dig.c <<EOM
9124 printf("Contains LDBL_DIG");
9127 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9128 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9129 echo "LDBL_DIG found." >&4
9132 echo "LDBL_DIG NOT found." >&4
9139 : see if link exists
9143 : see if localeconv exists
9144 set localeconv d_locconv
9147 : see if lockf exists
9151 : check for long long
9153 $echo $n "Checking to see if your system supports long long..." $c >&4
9154 echo 'int main() { long long x = 7; }' > try.c
9156 if eval $compile; then
9158 echo " Yes, it does." >&4
9161 echo " No, it doesn't." >&4
9167 : check for length of long long
9168 case "${d_longlong}${longlongsize}" in
9171 $echo $n "Checking to see how big your long longs are..." $c >&4
9172 $cat >try.c <<'EOCP'
9176 printf("%d\n", sizeof(long long));
9180 if eval $compile_ok; then
9181 longlongsize=`./try$exe_ext`
9182 $echo " $longlongsize bytes." >&4
9186 echo "(I can't seem to compile the test program. Guessing...)"
9187 rp="What is the size of a long long (in bytes)?"
9191 if $test "X$longsize" = "X$longlongsize"; then
9192 echo "(That isn't any different from an ordinary long.)"
9198 : see if lstat exists
9202 : see if mblen exists
9206 : see if mbstowcs exists
9207 set mbstowcs d_mbstowcs
9210 : see if mbtowc exists
9214 : see if memchr exists
9218 : see if memcmp exists
9222 : see if memcpy exists
9226 : see if memmove exists
9227 set memmove d_memmove
9230 : see if memset exists
9234 : see if mkdir exists
9238 : see if mkfifo exists
9242 : see if mktime exists
9246 : see if msgctl exists
9250 : see if msgget exists
9254 : see if msgsnd exists
9258 : see if msgrcv exists
9262 : see how much of the 'msg*(2)' library is present.
9265 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9266 *"$undef"*) h_msg=false;;
9270 case "`ipcs 2>&1`" in
9271 "SVID messages"*"not configured"*)
9272 echo "Your $osname does not have the msg*(2) configured." >&4
9287 : we could also check for sys/ipc.h ...
9288 if $h_msg && $test `./findhdr sys/msg.h`; then
9289 echo "You have the full msg*(2) library." >&4
9292 echo "You don't have the full msg*(2) library." >&4
9298 : see if nice exists
9302 : see if POSIX threads are available
9303 set pthread.h i_pthread
9309 : how to create joinable pthreads
9310 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9312 echo "Checking what constant to use for creating joinable pthreads..." >&4
9313 $cat >try.c <<'EOCP'
9314 #include <pthread.h>
9316 int detachstate = JOINABLE;
9319 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9320 if eval $compile; then
9321 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9322 val="$undef" # Yes, undef.
9323 set d_old_pthread_create_joinable
9326 set old_pthread_create_joinable
9329 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9330 if eval $compile; then
9331 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9333 set d_old_pthread_create_joinable
9335 val=PTHREAD_CREATE_UNDETACHED
9336 set old_pthread_create_joinable
9339 set try -DJOINABLE=__UNDETACHED
9340 if eval $compile; then
9341 echo "You seem to use __UNDETACHED." >&4
9343 set d_old_pthread_create_joinable
9346 set old_pthread_create_joinable
9349 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9351 set d_old_pthread_create_joinable
9354 set old_pthread_create_joinable
9361 d_old_pthread_create_joinable="$undef"
9362 old_pthread_create_joinable=""
9365 : see if pause exists
9369 : see if pipe exists
9373 : see if poll exists
9378 : see whether the various POSIXish _yields exist
9380 #include <pthread.h>
9386 #ifdef PTHREAD_YIELD
9389 #ifdef PTHREAD_YIELD_NULL
9390 pthread_yield(NULL);
9396 : see if sched_yield exists
9397 set try -DSCHED_YIELD
9398 if eval $compile; then
9400 sched_yield='sched_yield()'
9404 case "$usethreads" in
9407 $define) echo 'sched_yield() found.' >&4 ;;
9408 *) echo 'sched_yield() NOT found.' >&4 ;;
9414 : see if pthread_yield exists
9415 set try -DPTHREAD_YIELD
9416 if eval $compile; then
9418 case "$sched_yield" in
9419 '') sched_yield='pthread_yield()' ;;
9422 set try -DPTHREAD_YIELD_NULL
9423 if eval $compile; then
9425 case "$sched_yield" in
9426 '') sched_yield='pthread_yield(NULL)' ;;
9432 case "$usethreads" in
9435 $define) echo 'pthread_yield() found.' >&4 ;;
9436 *) echo 'pthread_yield() NOT found.' >&4 ;;
9443 case "$sched_yield" in
9444 '') sched_yield=undef ;;
9449 : see if this is a pwd.h system
9455 xxx=`./findhdr pwd.h`
9456 $cppstdin $cppflags $cppminus < $xxx >$$.h
9458 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9466 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9474 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9482 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9490 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9498 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9506 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9514 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9526 set d_pwquota; eval $setvar
9527 set d_pwage; eval $setvar
9528 set d_pwchange; eval $setvar
9529 set d_pwclass; eval $setvar
9530 set d_pwexpire; eval $setvar
9531 set d_pwcomment; eval $setvar
9532 set d_pwgecos; eval $setvar
9533 set d_pwpasswd; eval $setvar
9537 : see if readdir and friends exist
9538 set readdir d_readdir
9540 set seekdir d_seekdir
9542 set telldir d_telldir
9544 set rewinddir d_rewinddir
9547 : see if readlink exists
9548 set readlink d_readlink
9551 : see if rename exists
9555 : see if rmdir exists
9559 : see if memory.h is available.
9564 : See if it conflicts with string.h
9570 $cppstdin $cppflags $cppminus < $strings > mem.h
9571 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9573 echo "We won't be including <memory.h>."
9583 : can bcopy handle overlapping blocks?
9588 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9595 $cat >>try.c <<'EOCP'
9598 # include <memory.h>
9601 # include <stdlib.h>
9604 # include <string.h>
9606 # include <strings.h>
9609 # include <unistd.h> /* Needed for NetBSD */
9613 char buf[128], abc[128];
9619 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9621 for (align = 7; align >= 0; align--) {
9622 for (len = 36; len; len--) {
9625 for (off = 1; off <= len; off++) {
9626 bcopy(b, b+off, len);
9627 bcopy(b+off, b, len);
9628 if (bcmp(b, abc, len))
9637 if eval $compile_ok; then
9638 if ./try 2>/dev/null; then
9642 echo "It can't, sorry."
9643 case "$d_memmove" in
9644 "$define") echo "But that's Ok since you have memmove()." ;;
9648 echo "(I can't compile the test program, so we'll assume not...)"
9649 case "$d_memmove" in
9650 "$define") echo "But that's Ok since you have memmove()." ;;
9655 $rm -f try.* try core
9659 : can memcpy handle overlapping blocks?
9664 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9671 $cat >>try.c <<'EOCP'
9674 # include <memory.h>
9677 # include <stdlib.h>
9680 # include <string.h>
9682 # include <strings.h>
9685 # include <unistd.h> /* Needed for NetBSD */
9689 char buf[128], abc[128];
9695 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9696 try to store the string in read-only memory. */
9697 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9699 for (align = 7; align >= 0; align--) {
9700 for (len = 36; len; len--) {
9702 memcpy(b, abc, len);
9703 for (off = 1; off <= len; off++) {
9704 memcpy(b+off, b, len);
9705 memcpy(b, b+off, len);
9706 if (memcmp(b, abc, len))
9715 if eval $compile_ok; then
9716 if ./try 2>/dev/null; then
9720 echo "It can't, sorry."
9721 case "$d_memmove" in
9722 "$define") echo "But that's Ok since you have memmove()." ;;
9726 echo "(I can't compile the test program, so we'll assume not...)"
9727 case "$d_memmove" in
9728 "$define") echo "But that's Ok since you have memmove()." ;;
9733 $rm -f try.* try core
9737 : can memcmp be trusted to compare relative magnitude?
9742 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9749 $cat >>try.c <<'EOCP'
9752 # include <memory.h>
9755 # include <stdlib.h>
9758 # include <string.h>
9760 # include <strings.h>
9763 # include <unistd.h> /* Needed for NetBSD */
9769 if ((a < b) && memcmp(&a, &b, 1) < 0)
9775 if eval $compile_ok; then
9776 if ./try 2>/dev/null; then
9780 echo "No, it can't (it uses signed chars)."
9783 echo "(I can't compile the test program, so we'll assume not...)"
9787 $rm -f try.* try core
9791 : see if select exists
9795 : see if semctl exists
9799 : see if semget exists
9803 : see if semop exists
9807 : see how much of the 'sem*(2)' library is present.
9810 case "$d_semctl$d_semget$d_semop" in
9811 *"$undef"*) h_sem=false;;
9815 case "`ipcs 2>&1`" in
9816 "SVID messages"*"not configured"*)
9817 echo "Your $osname does not have the sem*(2) configured." >&4
9830 : we could also check for sys/ipc.h ...
9831 if $h_sem && $test `./findhdr sys/sem.h`; then
9832 echo "You have the full sem*(2) library." >&4
9835 echo "You don't have the full sem*(2) library." >&4
9841 : see whether sys/sem.h defines union semun
9843 $cat > try.c <<'END'
9844 #include <sys/types.h>
9845 #include <sys/ipc.h>
9846 #include <sys/sem.h>
9847 int main () { union semun semun; semun.buf = 0; }
9850 if eval $compile; then
9851 echo "You have union semun in <sys/sem.h>." >&4
9854 echo "You do not have union semun in <sys/sem.h>." >&4
9857 $rm -f try try.c try.h
9861 : see how to do semctl IPC_STAT
9864 : see whether semctl IPC_STAT can use union semun
9869 # define S_IRUSR S_IREAD
9870 # define S_IWUSR S_IWRITE
9871 # define S_IXUSR S_IEXEC
9873 # define S_IRUSR 0400
9874 # define S_IWUSR 0200
9875 # define S_IXUSR 0100
9877 # define S_IRGRP (S_IRUSR>>3)
9878 # define S_IWGRP (S_IWUSR>>3)
9879 # define S_IXGRP (S_IXUSR>>3)
9880 # define S_IROTH (S_IRUSR>>6)
9881 # define S_IWOTH (S_IWUSR>>6)
9882 # define S_IXOTH (S_IXUSR>>6)
9885 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9886 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9887 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9892 #include <sys/types.h>
9893 #include <sys/ipc.h>
9894 #include <sys/sem.h>
9895 #include <sys/stat.h>
9902 #$d_union_semun HAS_UNION_SEMUN
9905 #ifndef HAS_UNION_SEMUN
9908 struct semid_ds *buf;
9909 unsigned short *array;
9915 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9916 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9918 struct semid_ds argbuf;
9921 st = semctl(sem, 0, IPC_STAT, arg);
9925 # endif /* IPC_STAT */
9926 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9928 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9929 # endif /* IPC_RMID */
9930 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9932 #endif /* IPC_PRIVATE && ... */
9933 printf("semget failed: errno = %d\n", errno);
9939 if eval $compile; then
9942 semun) val="$define" ;;
9948 case "$d_semctl_semun" in
9950 echo "You can use union semun for semctl IPC_STAT." >&4
9953 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9958 : see whether semctl IPC_STAT can use struct semid_ds pointer
9959 $cat > try.c <<'END'
9960 #include <sys/types.h>
9961 #include <sys/ipc.h>
9962 #include <sys/sem.h>
9963 #include <sys/stat.h>
9971 struct semid_ds arg;
9974 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9975 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9978 st = semctl(sem, 0, IPC_STAT, &arg);
9980 printf("semid_ds\n");
9982 # endif /* IPC_STAT */
9983 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9985 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9986 # endif /* IPC_RMID */
9987 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9989 #endif /* IPC_PRIVATE && ... */
9990 printf("semget failed: errno = %d\n", errno);
9997 if eval $compile; then
10000 semid_ds) val="$define" ;;
10004 set d_semctl_semid_ds
10006 case "$d_semctl_semid_ds" in
10008 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10010 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10017 # We do not have the full sem*(2) library, so assume we can not
10023 set d_semctl_semid_ds
10028 : see if setegid exists
10029 set setegid d_setegid
10032 : see if seteuid exists
10033 set seteuid d_seteuid
10036 : see if setgrent exists
10037 set setgrent d_setgrent
10040 : see if sethostent exists
10041 set sethostent d_sethent
10044 : see if setlinebuf exists
10045 set setlinebuf d_setlinebuf
10048 : see if setlocale exists
10049 set setlocale d_setlocale
10052 : see if setnetent exists
10053 set setnetent d_setnent
10056 : see if setprotoent exists
10057 set setprotoent d_setpent
10060 : see if setpgid exists
10061 set setpgid d_setpgid
10064 : see if setpgrp2 exists
10065 set setpgrp2 d_setpgrp2
10068 : see if setpriority exists
10069 set setpriority d_setprior
10072 : see if setpwent exists
10073 set setpwent d_setpwent
10076 : see if setregid exists
10077 set setregid d_setregid
10079 set setresgid d_setresgid
10082 : see if setreuid exists
10083 set setreuid d_setreuid
10085 set setresuid d_setresuid
10088 : see if setrgid exists
10089 set setrgid d_setrgid
10092 : see if setruid exists
10093 set setruid d_setruid
10096 : see if setservent exists
10097 set setservent d_setsent
10100 : see if setsid exists
10101 set setsid d_setsid
10104 : see if setspent exists
10105 set setspent d_setspent
10108 : see if setvbuf exists
10109 set setvbuf d_setvbuf
10112 : see if sfio.h is available
10117 : see if sfio library is available
10128 : Ok, but do we want to use it.
10132 true|$define|[yY]*) dflt='y';;
10135 echo "$package can use the sfio library, but it is experimental."
10136 rp="You seem to have sfio available, do you want to try using it?"
10140 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10142 : Remove sfio from list of libraries to use
10143 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10146 echo "libs = $libs" >&4
10150 *) case "$usesfio" in
10151 true|$define|[yY]*)
10152 echo "Sorry, cannot find sfio on this machine" >&4
10153 echo "Ignoring your setting of usesfio=$usesfio" >&4
10161 $define) usesfio='true';;
10162 *) usesfio='false';;
10165 : see if shmctl exists
10166 set shmctl d_shmctl
10169 : see if shmget exists
10170 set shmget d_shmget
10173 : see if shmat exists
10176 : see what shmat returns
10179 $cat >shmat.c <<'END'
10180 #include <sys/shm.h>
10183 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10188 echo "and it returns ($shmattype)." >&4
10189 : see if a prototype for shmat is available
10190 xxx=`./findhdr sys/shm.h`
10191 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10192 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10203 set d_shmatprototype
10206 : see if shmdt exists
10210 : see how much of the 'shm*(2)' library is present.
10213 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10214 *"$undef"*) h_shm=false;;
10218 case "`ipcs 2>&1`" in
10219 "SVID shared memory"*"not configured"*)
10220 echo "Your $osname does not have the shm*(2) configured." >&4
10223 set shmctl d_shmctl
10225 set shmget d_shmget
10235 : we could also check for sys/ipc.h ...
10236 if $h_shm && $test `./findhdr sys/shm.h`; then
10237 echo "You have the full shm*(2) library." >&4
10240 echo "You don't have the full shm*(2) library." >&4
10247 : see if we have sigaction
10248 if set sigaction val -f d_sigaction; eval $csym; $val; then
10249 echo 'sigaction() found.' >&4
10250 $cat > try.c <<'EOP'
10252 #include <sys/types.h>
10253 #include <signal.h>
10256 struct sigaction act, oact;
10258 oact.sa_handler = 0;
10262 if eval $compile_ok; then
10265 echo "But you don't seem to have a useable struct sigaction." >&4
10269 echo 'sigaction NOT found.' >&4
10272 set d_sigaction; eval $setvar
10273 $rm -f try try$_o try.c
10275 : see if sigsetjmp exists
10277 case "$d_sigsetjmp" in
10279 $cat >try.c <<'EOP'
10280 #include <setjmp.h>
10285 if (sigsetjmp(env,1))
10288 siglongjmp(env, 1);
10293 if eval $compile; then
10294 if ./try >/dev/null 2>&1; then
10295 echo "POSIX sigsetjmp found." >&4
10299 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10305 echo "sigsetjmp not found." >&4
10309 *) val="$d_sigsetjmp"
10310 case "$d_sigsetjmp" in
10311 $define) echo "POSIX sigsetjmp found." >&4;;
10312 $undef) echo "sigsetjmp not found." >&4;;
10320 : see if sqrtl exists
10324 : see if sys/stat.h is available
10325 set sys/stat.h i_sysstat
10329 : see if stat knows about block sizes
10331 echo "Checking to see if your struct stat has st_blocks field..." >&4
10332 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10336 : see if this is a sys/vfs.h system
10337 set sys/vfs.h i_sysvfs
10341 : see if this is a sys/statfs.h system
10342 set sys/statfs.h i_sysstatfs
10347 echo "Checking to see if your system supports struct statfs..." >&4
10348 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10350 case "$d_statfs_s" in
10351 "$define") echo "Yes, it does." ;;
10352 *) echo "No, it doesn't." ;;
10357 : see if struct statfs knows about f_flags
10358 case "$d_statfs_s" in
10361 echo "Checking to see if your struct statfs has f_flags field..." >&4
10362 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10366 set d_statfs_f_flags
10370 case "$d_statfs_f_flags" in
10371 "$define") echo "Yes, it does." ;;
10372 *) echo "No, it doesn't." ;;
10375 : see if _ptr and _cnt from stdio act std
10377 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10378 echo "(Looks like you have stdio.h from Linux.)"
10379 case "$stdio_ptr" in
10380 '') stdio_ptr='((fp)->_IO_read_ptr)'
10383 *) ptr_lval=$d_stdio_ptr_lval;;
10385 case "$stdio_cnt" in
10386 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10389 *) cnt_lval=$d_stdio_cnt_lval;;
10391 case "$stdio_base" in
10392 '') stdio_base='((fp)->_IO_read_base)';;
10394 case "$stdio_bufsiz" in
10395 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10398 case "$stdio_ptr" in
10399 '') stdio_ptr='((fp)->_ptr)'
10402 *) ptr_lval=$d_stdio_ptr_lval;;
10404 case "$stdio_cnt" in
10405 '') stdio_cnt='((fp)->_cnt)'
10408 *) cnt_lval=$d_stdio_cnt_lval;;
10410 case "$stdio_base" in
10411 '') stdio_base='((fp)->_base)';;
10413 case "$stdio_bufsiz" in
10414 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10417 : test whether _ptr and _cnt really work
10418 echo "Checking how std your stdio is..." >&4
10421 #define FILE_ptr(fp) $stdio_ptr
10422 #define FILE_cnt(fp) $stdio_cnt
10424 FILE *fp = fopen("try.c", "r");
10427 18 <= FILE_cnt(fp) &&
10428 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10436 if eval $compile; then
10438 echo "Your stdio acts pretty std."
10441 echo "Your stdio isn't very std."
10444 echo "Your stdio doesn't appear very std."
10450 : Can _ptr be used as an lvalue?
10451 case "$d_stdstdio$ptr_lval" in
10452 $define$define) val=$define ;;
10455 set d_stdio_ptr_lval
10458 : Can _cnt be used as an lvalue?
10459 case "$d_stdstdio$cnt_lval" in
10460 $define$define) val=$define ;;
10463 set d_stdio_cnt_lval
10466 : see if _base is also standard
10468 case "$d_stdstdio" in
10472 #define FILE_base(fp) $stdio_base
10473 #define FILE_bufsiz(fp) $stdio_bufsiz
10475 FILE *fp = fopen("try.c", "r");
10478 19 <= FILE_bufsiz(fp) &&
10479 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10486 if eval $compile; then
10488 echo "And its _base field acts std."
10491 echo "But its _base field isn't std."
10494 echo "However, it seems to be lacking the _base field."
10503 Checking how to access stdio streams by file descriptor number...
10505 case "$stdio_stream_array" in
10506 '') $cat >try.c <<EOCP
10509 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10513 for s in _iob __iob __sF
10515 set try -DSTDIO_STREAM_ARRAY=$s
10516 if eval $compile; then
10517 case "`./try$exe_ext`" in
10518 yes) stdio_stream_array=$s; break ;;
10522 $rm -f try.* try$exe_ext
10524 case "$stdio_stream_array" in
10526 I can't figure out how to access stdio streams by file descriptor number.
10528 d_stdio_stream_array="$undef"
10531 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10533 d_stdio_stream_array="$define"
10537 : see if strcoll exists
10538 set strcoll d_strcoll
10541 : check for structure copying
10543 echo "Checking to see if your C compiler can copy structs..." >&4
10544 $cat >try.c <<'EOCP'
10554 if $cc -c try.c >/dev/null 2>&1 ; then
10556 echo "Yup, it can."
10559 echo "Nope, it can't."
10565 : see if strerror and/or sys_errlist[] exist
10567 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10568 if set strerror val -f d_strerror; eval $csym; $val; then
10569 echo 'strerror() found.' >&4
10570 d_strerror="$define"
10571 d_strerrm='strerror(e)'
10572 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10573 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10574 d_syserrlst="$define"
10576 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10577 d_syserrlst="$undef"
10579 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10580 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10581 echo 'strerror() found in string header.' >&4
10582 d_strerror="$define"
10583 d_strerrm='strerror(e)'
10584 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10585 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10586 d_syserrlst="$define"
10588 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10589 d_syserrlst="$undef"
10591 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10592 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10593 d_strerror="$undef"
10594 d_syserrlst="$define"
10595 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10597 echo 'strerror() and sys_errlist[] NOT found.' >&4
10598 d_strerror="$undef"
10599 d_syserrlst="$undef"
10600 d_strerrm='"unknown"'
10604 : see if strtod exists
10605 set strtod d_strtod
10608 : see if strtol exists
10609 set strtol d_strtol
10612 : see if strtoul exists
10613 set strtoul d_strtoul
10616 : see if strtoull exists
10617 set strtoull d_strtoull
10620 : see if strxfrm exists
10621 set strxfrm d_strxfrm
10624 : see if symlink exists
10625 set symlink d_symlink
10628 : see if syscall exists
10629 set syscall d_syscall
10632 : see if sysconf exists
10633 set sysconf d_sysconf
10636 : see if system exists
10637 set system d_system
10640 : see if tcgetpgrp exists
10641 set tcgetpgrp d_tcgetpgrp
10644 : see if tcsetpgrp exists
10645 set tcsetpgrp d_tcsetpgrp
10648 : see if prototype for telldir is available
10650 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10653 : see if this is a sys/times.h system
10654 set sys/times.h i_systimes
10657 : see if times exists
10659 if set times val -f d_times; eval $csym; $val; then
10660 echo 'times() found.' >&4
10663 case "$i_systimes" in
10664 "$define") inc='sys/times.h';;
10666 rp="What is the type returned by times() on this system?"
10667 set clock_t clocktype long stdio.h sys/types.h $inc
10670 echo 'times() NOT found, hope that will do.' >&4
10675 : see if truncate exists
10676 set truncate d_truncate
10679 : see if tzname[] exists
10681 if set tzname val -a d_tzname; eval $csym; $val; then
10683 echo 'tzname[] found.' >&4
10686 echo 'tzname[] NOT found.' >&4
10691 : see if umask exists
10695 : see if ustat exists
10699 : backward compatibility for d_hvfork
10700 if test X$d_hvfork != X; then
10701 d_vfork="$d_hvfork"
10704 : see if there is a vfork
10709 : Ok, but do we want to use it. vfork is reportedly unreliable in
10710 : perl on Solaris 2.x, and probably elsewhere.
10714 case "$usevfork" in
10720 Perl can only use a vfork() that doesn't suffer from strict
10721 restrictions on calling functions or modifying global data in
10722 the child. For example, glibc-2.1 contains such a vfork()
10723 that is unsuitable. If your system provides a proper fork()
10724 call, chances are that you do NOT want perl to use vfork().
10727 rp="Do you still want to use vfork()?"
10732 echo "Ok, we won't use vfork()."
10741 $define) usevfork='true';;
10742 *) usevfork='false';;
10745 : see if this is an sysdir system
10746 set sys/dir.h i_sysdir
10749 : see if this is an sysndir system
10750 set sys/ndir.h i_sysndir
10753 : see if closedir exists
10754 set closedir d_closedir
10757 case "$d_closedir" in
10760 echo "Checking whether closedir() returns a status..." >&4
10761 cat > closedir.c <<EOM
10762 #$i_dirent I_DIRENT /**/
10763 #$i_sysdir I_SYS_DIR /**/
10764 #$i_sysndir I_SYS_NDIR /**/
10765 #$i_systypes I_SYS_TYPES /**/
10767 #if defined(I_SYS_TYPES)
10768 #include <sys/types.h>
10770 #if defined(I_DIRENT)
10771 #include <dirent.h>
10772 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10773 #include <sys/dir.h>
10777 #include <sys/ndir.h>
10781 #include <ndir.h> /* may be wrong in the future */
10783 #include <sys/dir.h>
10788 int main() { return closedir(opendir(".")); }
10791 if eval $compile_ok; then
10792 if ./closedir > /dev/null 2>&1 ; then
10793 echo "Yes, it does."
10796 echo "No, it doesn't."
10800 echo "(I can't seem to compile the test program--assuming it doesn't)"
10808 set d_void_closedir
10811 : check for volatile keyword
10813 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10814 $cat >try.c <<'EOCP'
10817 typedef struct _goo_struct goo_struct;
10818 goo_struct * volatile goo = ((goo_struct *)0);
10819 struct _goo_struct {
10824 typedef unsigned short foo_t;
10825 char *volatile foo;
10827 volatile foo_t blech;
10831 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10833 echo "Yup, it does."
10836 echo "Nope, it doesn't."
10842 : see if there is a wait4
10846 : see if waitpid exists
10847 set waitpid d_waitpid
10850 : see if wcstombs exists
10851 set wcstombs d_wcstombs
10854 : see if wctomb exists
10855 set wctomb d_wctomb
10858 : preserve RCS keywords in files with variable substitution, grrr
10863 Revision='$Revision'
10865 case "$crosscompile" in
10866 ''|[nN]*) crosscompile="$undef" ;;
10870 next|rhapsody) multiarch="$define" ;;
10872 case "$multiarch" in
10873 ''|[nN]*) multiarch="$undef" ;;
10876 : check for alignment requirements
10878 case "$crosscompile$multiarch" in
10881 You seem to be either cross-compiling or doing a multiarchitecture build,
10882 skipping the memory alignment check.
10885 case "$alignbytes" in
10886 '') alignbytes=8 ;;
10890 case "$alignbytes" in
10891 '') echo "Checking alignment constraints..." >&4
10892 $cat >try.c <<'EOCP'
10899 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10903 if eval $compile_ok; then
10907 echo "(I can't seem to compile the test program...)"
10910 *) dflt="$alignbytes"
10913 rp="Doubles must be aligned on a how-many-byte boundary?"
10921 : check for ordering of bytes in a long
10923 case "$crosscompile$multiarch" in
10926 You seem to be either cross-compiling or doing a multiarchitecture build,
10927 skipping the byteorder check.
10933 case "$byteorder" in
10936 In the following, larger digits indicate more significance. A big-endian
10937 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10938 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10939 machines may have weird orders like 3412. A Cray will report 87654321,
10940 an Alpha will report 12345678. If the test program works the default is
10942 I'm now running the test program...
10944 $cat >try.c <<'EOCP'
10951 char c[sizeof(long)];
10954 if (sizeof(long) > 4)
10955 u.l = (0x08070605L << 32) | 0x04030201L;
10958 for (i = 0; i < sizeof(long); i++)
10959 printf("%c", u.c[i]+'0');
10966 if eval $compile && ./try > /dev/null; then
10969 [1-4][1-4][1-4][1-4]|12345678|87654321)
10970 echo "(The test program ran ok.)"
10971 echo "byteorder=$dflt"
10974 ????|????????) echo "(The test program ran ok.)" ;;
10975 *) echo "(The test program didn't run right for some reason.)" ;;
10980 (I can't seem to compile the test program. Guessing big-endian...)
10983 case "$xxx_prompt" in
10985 rp="What is the order of bytes in a long?"
10999 : how do we catenate cpp tokens here?
11001 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11002 $cat >cpp_stuff.c <<'EOCP'
11003 #define RCAT(a,b)a/**/b
11004 #define ACAT(a,b)a ## b
11008 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11009 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11010 echo "Oh! Smells like ANSI's been here." >&4
11011 echo "We can catify or stringify, separately or together!"
11013 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11014 echo "Ah, yes! The good old days!" >&4
11015 echo "However, in the good old days we don't know how to stringify and"
11016 echo "catify at the same time."
11020 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11021 to have to edit the values of CAT[2-5] in config.h...
11023 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11027 : see if this is a db.h system
11033 : Check db version.
11035 echo "Checking Berkeley DB version ..." >&4
11041 #include <sys/types.h>
11046 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11047 int Major, Minor, Patch ;
11048 unsigned long Version ;
11049 (void)db_version(&Major, &Minor, &Patch) ;
11050 printf("You have Berkeley DB Version 2 or greater\n");
11052 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11053 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11054 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11055 Major, Minor, Patch) ;
11057 /* check that db.h & libdb are compatible */
11058 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11059 printf("db.h and libdb are incompatible\n") ;
11063 printf("db.h and libdb are compatible\n") ;
11065 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11066 + DB_VERSION_PATCH ;
11068 /* needs to be >= 2.3.4 */
11069 if (Version < 2003004) {
11070 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11071 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11077 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11078 printf("You have Berkeley DB Version 1\n");
11079 exit(0); /* DB version < 2: the coast is clear. */
11081 exit(1); /* <db.h> not Berkeley DB? */
11087 if eval $compile && ./try; then
11088 echo 'Looks OK.' >&4
11090 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11094 : Remove db from list of libraries to use
11095 echo "Removing unusable -ldb from library list" >&4
11096 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11099 echo "libs = $libs" >&4
11109 : Check the return type needed for hash
11111 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11117 #include <sys/types.h>
11120 #ifndef DB_VERSION_MAJOR
11121 u_int32_t hash_cb (ptr, size)
11129 info.hash = hash_cb;
11133 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11134 if $contains warning try.out >>/dev/null 2>&1 ; then
11137 db_hashtype='u_int32_t'
11140 : XXX Maybe we should just give up here.
11141 db_hashtype=u_int32_t
11143 echo "Help: I can't seem to compile the db test program." >&4
11144 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11147 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11149 *) db_hashtype=u_int32_t
11154 : Check the return type needed for prefix
11156 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11162 #include <sys/types.h>
11165 #ifndef DB_VERSION_MAJOR
11166 size_t prefix_cb (key1, key2)
11174 info.prefix = prefix_cb;
11178 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11179 if $contains warning try.out >>/dev/null 2>&1 ; then
11180 db_prefixtype='int'
11182 db_prefixtype='size_t'
11185 db_prefixtype='size_t'
11186 : XXX Maybe we should just give up here.
11188 echo "Help: I can't seem to compile the db test program." >&4
11189 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11192 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11194 *) db_prefixtype='size_t'
11198 : check for void type
11200 echo "Checking to see how well your C compiler groks the void type..." >&4
11201 case "$voidflags" in
11203 $cat >try.c <<'EOCP'
11209 extern void moo(); /* function returning void */
11210 void (*goo)(); /* ptr to func returning void */
11212 void *hue; /* generic ptr */
11225 int main() { sub(); }
11227 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11228 voidflags=$defvoidused
11229 echo "Good. It appears to support void to the level $package wants.">&4
11230 if $contains warning .out >/dev/null 2>&1; then
11231 echo "However, you might get some warnings that look like this:"
11235 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11236 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11237 echo "It supports 1..."
11238 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11239 echo "It also supports 2..."
11240 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11242 echo "And it supports 4 but not 8 definitely."
11244 echo "It doesn't support 4..."
11245 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11247 echo "But it supports 8."
11250 echo "Neither does it support 8."
11254 echo "It does not support 2..."
11255 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11257 echo "But it supports 4 and 8."
11259 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11261 echo "And it supports 4 but has not heard about 8."
11263 echo "However it supports 8 but not 4."
11268 echo "There is no support at all for void."
11273 case "$voidflags" in
11275 *) $cat >&4 <<'EOM'
11276 Support flag bits are:
11277 1: basic void declarations.
11278 2: arrays of pointers to functions returning void.
11279 4: operations between pointers to and addresses of void functions.
11280 8: generic void pointers.
11283 rp="Your void support flags add up to what?"
11291 : How can we generate normalized random numbers ?
11293 echo "Looking for a random number function..." >&4
11294 case "$randfunc" in
11296 if set drand48 val -f; eval $csym; $val; then
11298 echo "Good, found drand48()." >&4
11299 elif set random val -f; eval $csym; $val; then
11301 echo "OK, found random()." >&4
11304 echo "Yick, looks like I have to use rand()." >&4
11315 *-Dmy_rand=*|*-Dmy_srand=*)
11316 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11317 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11318 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11319 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11323 while $test "$cont"; do
11324 rp="Use which function to generate random numbers?"
11326 if $test "$ans" = "$dflt"; then
11332 if set $ans val -f; eval $csym; $val; then
11336 rp="I cannot find function $ans. Use that name anyway?"
11345 case "$randfunc" in
11347 drand01="drand48()"
11353 case "$randbits" in
11355 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11357 #$i_unistd I_UNISTD
11358 #$i_stdlib I_STDLIB
11361 # include <unistd.h>
11364 # include <stdlib.h>
11369 register unsigned long tmp;
11370 register unsigned long max = 0L;
11372 for (i = 1000; i; i--) {
11373 tmp = (unsigned long) $randfunc();
11374 if (tmp > max) max = tmp;
11376 for (i = 0; max; i++)
11382 if eval $compile_ok; then
11386 echo "(I can't seem to compile the test program...)"
11393 rp="How many bits does your $randfunc() function produce?"
11397 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11398 seedfunc="s$randfunc"
11399 randseedtype=unsigned
11403 rp="How many bits does your $randfunc() function produce?"
11406 seedfunc="s$randfunc"
11407 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11408 if set $seedfunc val -f; eval $csym; $val; then
11409 echo "(Using $seedfunc() to seed random generator)"
11411 echo "(Warning: no $seedfunc() to seed random generator)"
11414 randseedtype=unsigned
11422 echo "Determining whether or not we are on an EBCDIC system..." >&4
11423 $cat >tebcdic.c <<'EOM'
11426 if ('M'==0xd4) return 0;
11433 if eval $compile_ok; then
11435 echo "You have EBCDIC." >&4
11438 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11441 echo "I'm unable to compile the test program." >&4
11442 echo "I'll assume ASCII or some ISO Latin." >&4
11444 $rm -f tebcdic.c tebcdic
11450 Checking how to flush all pending stdio output...
11452 # I only know how to find the first 32 possibly open files on SunOS.
11453 # See also hints/sunos_4_1.sh and util.c --AD
11455 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11457 $cat >>try.c <<EOCP
11459 #$i_unistd I_UNISTD
11461 # include <unistd.h>
11463 #$d_sysconf HAS_SYSCONF
11464 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11465 #ifdef HAS_STDIO_STREAM_ARRAY
11466 # define STDIO_STREAM_ARRAY $stdio_stream_array
11469 FILE* p = fopen("try.out", "w");
11473 # ifdef TRY_FPRINTF
11477 #ifdef TRY_FFLUSH_NULL
11480 #ifdef TRY_FFLUSH_ALL
11482 long open_max = -1;
11483 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11484 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11486 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11487 open_max = sysconf(_SC_OPEN_MAX);
11490 open_max = FOPEN_MAX;
11493 open_max = OPEN_MAX;
11502 # ifdef HAS_STDIO_STREAM_ARRAY
11503 if (open_max > 0) {
11505 for (i = 0; i < open_max; i++)
11506 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11507 STDIO_STREAM_ARRAY[i]._file < open_max &&
11508 STDIO_STREAM_ARRAY[i]._flag)
11509 fflush(&STDIO_STREAM_ARRAY[i]);
11517 : first we have to find out how _not_ to flush
11518 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11520 set try -DTRY_FPUTC
11521 if eval $compile; then
11523 ./try$exe_ext 2>/dev/null
11524 if $test ! -s try.out -a "X$?" = X42; then
11530 set try -DTRY_FPRINTF
11532 if eval $compile; then
11534 ./try$exe_ext 2>/dev/null
11535 if $test ! -s try.out -a "X$?" = X42; then
11536 output=-DTRY_FPRINTF
11542 : check for fflush NULL behaviour
11543 case "$fflushNULL" in
11544 '') set try -DTRY_FFLUSH_NULL $output
11545 if eval $compile; then
11547 ./try$exe_ext 2>/dev/null
11549 if $test -s try.out -a "X$code" = X42; then
11550 fflushNULL="`$cat try.out`"
11552 if $test "X$code" != X42; then
11554 (If this test failed, don't worry, we'll try another method shortly.)
11559 $rm -f core try.core core.try.*
11560 case "$fflushNULL" in
11562 Your fflush(NULL) works okay.
11564 fflushNULL="$define"
11567 Your fflush(NULL) isn't working (contrary to ANSI C).
11569 fflushNULL="$undef"
11572 Cannot figure out whether your fflush(NULL) works or not.
11573 I'm assuming it doesn't (contrary to ANSI C).
11575 fflushNULL="$undef"
11579 $define|true|[yY]*)
11580 fflushNULL="$define"
11583 fflushNULL="$undef"
11586 : check explicit looping only if NULL did not work
11587 case "$fflushNULL" in
11589 : check for fflush all behaviour
11590 case "$fflushall" in
11591 '') set try -DTRY_FFLUSH_ALL $output
11592 if eval $compile; then
11594 (Now testing the other method--but note that also this may fail.)
11597 ./try$exe_ext 2>/dev/null
11598 if $test -s try.out -a "X$?" = X42; then
11599 fflushall="`$cat try.out`"
11602 $rm -f core try.core core.try.*
11603 case "$fflushall" in
11605 Whew. Flushing explicitly all the stdio streams works.
11607 fflushall="$define"
11610 Sigh. Flushing explicitly all the stdio streams doesn't work.
11615 Cannot figure out whether flushing stdio streams explicitly works or not.
11616 I'm assuming it doesn't.
11622 "$define"|true|[yY]*)
11623 fflushall="$define"
11630 *) fflushall="$undef"
11633 case "$fflushNULL$fflushall" in
11636 I cannot figure out how to flush pending stdio output.
11640 $rm -f try.* try$exe_ext
11642 : Store the full pathname to the ar program for use in the C program
11643 : Respect a hint or command line value for full_ar.
11648 : Store the full pathname to the sed program for use in the C program
11651 : see what type gids are declared as in the kernel
11653 echo "Looking for the type for group ids returned by getgid()."
11654 set gid_t gidtype xxx stdio.h sys/types.h
11658 xxx=`./findhdr sys/user.h`
11659 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11661 unsigned) dflt="$1 $2" ;;
11665 *) dflt="$gidtype";;
11668 gid_t) echo "gid_t found." ;;
11669 *) rp="What is the type for group ids returned by getgid()?"
11677 *_t) zzz="$gidtype" ;;
11680 echo "Checking the size of $zzz..." >&4
11682 #include <sys/types.h>
11685 printf("%d\n", sizeof($gidtype));
11689 if eval $compile_ok; then
11693 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11696 echo "Your $zzz size is $gidsize bytes."
11701 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11707 *_t) zzz="$gidtype" ;;
11710 echo "Checking the sign of $zzz..." >&4
11712 #include <sys/types.h>
11723 if eval $compile; then
11727 echo "(I can't execute the test program--guessing unsigned.)" >&4
11731 1) echo "Your $zzz is unsigned." ;;
11732 -1) echo "Your $zzz is signed." ;;
11738 echo "(I can't compile the test program--guessing unsigned.)" >&4
11744 echo "Checking which 64-bit integer type to use..." >&4
11750 val='"unsigned int"'
11755 *) case "$longsize" in
11759 val='"unsigned long"'
11764 *) case "$uselonglong:$d_longlong:$longlongsize" in
11769 val='"unsigned long long"'
11774 *) case "$d_int64t" in
11792 case "$quadtype" in
11793 '') echo "Alas, no 64-bit integer types in sight." >&4 ;;
11794 *) echo "Using '$quadtype' for 64-bit integers." >&4 ;;
11797 : check for length of character
11799 case "$charsize" in
11801 echo "Checking to see how big your characters are..." >&4
11802 $cat >try.c <<'EOCP'
11806 printf("%d\n", sizeof(char));
11810 if eval $compile_ok; then
11814 echo "(I can't seem to compile the test program. Guessing...)"
11821 rp="What is the size of a character (in bytes)?"
11828 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11830 case "$use64bits:$quadtype" in
11833 uvtype="$uquadtype"
11838 uvtype="unsigned long"
11844 case "$uselongdouble:$d_longdbl" in
11846 nvtype="long double"
11847 nvsize=$longdblsize
11854 echo "(IV will be "$ivtype", $ivsize bytes)"
11855 echo "(UV will be "$uvtype", $uvsize bytes)"
11856 echo "(NV will be "$nvtype", $nvsize bytes)"
11859 #$i_inttypes I_INTTYPES
11861 #include <inttypes.h>
11866 int8_t i = INT8_MAX;
11867 uint8_t u = UINT8_MAX;
11868 printf("int8_t\n");
11871 int16_t i = INT16_MAX;
11872 uint16_t i = UINT16_MAX;
11873 printf("int16_t\n");
11876 int32_t i = INT32_MAX;
11877 uint32_t u = UINT32_MAX;
11878 printf("int32_t\n");
11884 '') case "$charsize" in
11886 u8type="unsigned char"
11895 if eval $compile; then
11896 case "`./try$exe_ext`" in
11897 int8_t) i8type=int8_t
11907 '') if $test $charsize -ge 1; then
11909 u8type="unsigned char"
11917 '') case "$shortsize" in
11919 u16type="unsigned short"
11927 '') set try -DINT16
11928 if eval $compile; then
11929 case "`./try$exe_ext`" in
11941 '') if $test $shortsize -ge 2; then
11943 u16type="unsigned short"
11951 '') case "$longsize" in
11953 u32type="unsigned long"
11957 *) case "$intsize" in
11959 u32type="unsigned int"
11969 '') set try -DINT32
11970 if eval $compile; then
11971 case "`./try$exe_ext`" in
11983 '') if $test $intsize -ge 4; then
11985 u32type="unsigned int"
11993 '') case "$quadtype" in
11995 *) i64type="$quadtype"
11996 u64type="$uquadtype"
12008 if $test X"$quadtype" != X; then
12010 echo "Checking how to print 64-bit integers..." >&4
12012 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12013 $cat >try.c <<'EOCP'
12014 #include <sys/types.h>
12017 int q = 12345678901;
12018 printf("%ld\n", q);
12022 if eval $compile; then
12023 yyy=`./try$exe_ext`
12026 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12027 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12028 echo "We will use %d."
12034 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12035 $cat >try.c <<'EOCP'
12036 #include <sys/types.h>
12039 long q = 12345678901;
12040 printf("%ld\n", q);
12044 if eval $compile; then
12045 yyy=`./try$exe_ext`
12048 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12049 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12050 echo "We will use %ld."
12056 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12057 $cat >try.c <<'EOCP'
12058 #include <sys/types.h>
12059 #include <inttypes.h>
12062 int64_t q = 12345678901;
12063 printf("%" PRId64 "\n", q);
12067 if eval $compile; then
12068 yyy=`./try$exe_ext`
12071 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12072 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12073 echo "We will use the C9X style."
12079 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12080 $cat >try.c <<'EOCP'
12081 #include <sys/types.h>
12084 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12085 printf("%lld\n", q);
12089 if eval $compile; then
12090 yyy=`./try$exe_ext`
12093 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12094 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12095 echo "We will use the %lld style."
12101 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12103 #include <sys/types.h>
12106 $quadtype q = 12345678901;
12107 printf("%Ld\n", q);
12111 if eval $compile; then
12112 yyy=`./try$exe_ext`
12115 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12116 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12117 echo "We will use %Ld."
12123 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12125 #include <sys/types.h>
12128 $quadtype q = 12345678901;
12129 printf("%qd\n", q);
12133 if eval $compile; then
12134 yyy=`./try$exe_ext`
12137 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12138 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12139 echo "We will use %qd."
12145 if $test X"$sPRId64" = X; then
12146 echo "Cannot figure out how to print 64-bit integers." >&4
12154 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12155 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12157 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12158 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12164 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12166 if $test X"$ivsize" = X8; then
12167 ivdformat="$sPRId64"
12168 uvuformat="$sPRIu64"
12169 uvoformat="$sPRIo64"
12170 uvxformat="$sPRIx64"
12172 if $test X"$ivsize" = X"$longsize"; then
12178 if $test X"$ivsize" = X"$intsize"; then
12185 if $test X"$ivsize" = X"$shortsize"; then
12195 case "$ivdformat" in
12196 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12203 $echo "Checking the format string to be used for gids..." >&4
12206 -1) if $test X"$gidsize" = X"$ivsize"; then
12207 gidformat="$ivdformat"
12209 if $test X"$gidsize" = X"$longsize"; then
12212 if $test X"$gidsize" = X"$intsize"; then
12215 if $test X"$gidsize" = X"$shortsize"; then
12222 *) if $test X"$gidsize" = X"$uvsize"; then
12223 gidformat="$uvuformat"
12225 if $test X"$gidsize" = X"$longsize"; then
12228 if $test X"$gidsize" = X"$intsize"; then
12231 if $test X"$gidsize" = X"$shortsize"; then
12240 : see if getgroups exists
12241 set getgroups d_getgrps
12244 : see if setgroups exists
12245 set setgroups d_setgrps
12249 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12251 case "$d_getgrps$d_setgrps" in
12253 case "$groupstype" in
12254 '') dflt="$gidtype" ;;
12255 *) dflt="$groupstype" ;;
12258 What type of pointer is the second argument to getgroups() and setgroups()?
12259 Usually this is the same as group ids, $gidtype, but not always.
12262 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12266 *) groupstype="$gidtype";;
12270 echo "Checking if your $make program sets \$(MAKE)..." >&4
12271 case "$make_set_make" in
12273 $sed 's/^X //' > testmake.mak << 'EOF'
12275 X @echo 'maketemp="$(MAKE)"'
12277 case "`$make -f testmake.mak 2>/dev/null`" in
12278 *maketemp=*) make_set_make='#' ;;
12279 *) make_set_make="MAKE=$make" ;;
12281 $rm -f testmake.mak
12284 case "$make_set_make" in
12285 '#') echo "Yup, it does.";;
12286 *) echo "Nope, it doesn't.";;
12289 : see what type is used for mode_t
12290 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12291 set mode_t modetype int stdio.h sys/types.h
12294 : define a fucntion to check prototypes
12295 $cat > protochk <<EOSH
12298 optimize="$optimize"
12300 prototype="$prototype"
12305 $cat >> protochk <<'EOSH'
12310 while test $# -ge 2; do
12312 $define) echo "#include <$2>" >> try.c ;;
12313 literal) echo "$2" >> try.c ;;
12317 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12318 cat >> try.c <<'EOCP'
12319 #ifdef CAN_PROTOTYPE
12320 #define _(args) args
12325 echo "$foo" >> try.c
12326 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12327 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12333 $eunicefix protochk
12335 : see what type is used for size_t
12336 rp="What is the type used for the length parameter for string functions?"
12337 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12340 : check for type of arguments to gethostbyaddr.
12341 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12342 case "$d_gethbyaddr" in
12346 Checking to see what type of arguments are accepted by gethostbyaddr().
12348 hdrs="$define sys/types.h
12349 $d_socket sys/socket.h
12350 $i_niin netinet/in.h
12352 $i_unistd unistd.h"
12353 : The first arg can 'char *' or 'void *'
12354 : The second arg is some of integral type
12355 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12356 for yyy in size_t long int; do
12357 case "$netdb_host_type" in
12358 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12359 if ./protochk "$try" $hdrs; then
12360 echo "Your system accepts $xxx for the first arg."
12361 echo "...and $yyy for the second arg."
12362 netdb_host_type="$xxx"
12363 netdb_hlen_type="$yyy"
12369 : In case none of those worked, prompt the user.
12370 case "$netdb_host_type" in
12371 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12374 netdb_host_type=$ans
12375 rp='What is the type for the 2nd argument to gethostbyaddr?'
12378 netdb_hlen_type=$ans
12382 *) : no gethostbyaddr, so pick harmless defaults
12383 netdb_host_type='char *'
12384 netdb_hlen_type="$sizetype"
12387 # Remove the "const" if needed. -- but then we'll have a
12389 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12392 : check for type of argument to gethostbyname.
12393 if test "X$netdb_name_type" = X ; then
12394 case "$d_gethbyname" in
12398 Checking to see what type of argument is accepted by gethostbyname().
12400 hdrs="$define sys/types.h
12401 $d_socket sys/socket.h
12402 $i_niin netinet/in.h
12404 $i_unistd unistd.h"
12405 for xxx in "const char *" "char *"; do
12406 case "$netdb_name_type" in
12407 '') try="extern struct hostent *gethostbyname($xxx);"
12408 if ./protochk "$try" $hdrs; then
12409 echo "Your system accepts $xxx."
12410 netdb_name_type="$xxx"
12415 : In case none of those worked, prompt the user.
12416 case "$netdb_name_type" in
12417 '') rp='What is the type for the 1st argument to gethostbyname?'
12420 netdb_name_type=$ans
12424 *) : no gethostbyname, so pick harmless default
12425 netdb_name_type='char *'
12430 : check for type of 1st argument to getnetbyaddr.
12431 if test "X$netdb_net_type" = X ; then
12432 case "$d_getnbyaddr" in
12436 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12438 hdrs="$define sys/types.h
12439 $d_socket sys/socket.h
12440 $i_niin netinet/in.h
12442 $i_unistd unistd.h"
12443 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12444 case "$netdb_net_type" in
12445 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12446 if ./protochk "$try" $hdrs; then
12447 echo "Your system accepts $xxx."
12448 netdb_net_type="$xxx"
12453 : In case none of those worked, prompt the user.
12454 case "$netdb_net_type" in
12455 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12458 netdb_net_type=$ans
12462 *) : no getnetbyaddr, so pick harmless default
12463 netdb_net_type='long'
12467 : locate the preferred pager for this system
12481 '') dflt=/usr/ucb/more;;
12488 rp='What pager is used on your system?'
12492 : see what type pids are declared as in the kernel
12493 rp="What is the type of process ids on this system?"
12494 set pid_t pidtype int stdio.h sys/types.h
12497 : Find earliest binary compatible site_perl subdirectory perl can use.
12498 case "$bincompat5005" in
12499 "$define") xs_apiversion='5.005' ;;
12500 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12502 : Find earliest pure perl site_perl subdirectory perl can use.
12503 : The versioned directories started at 5.005.
12504 pm_apiversion='5.005'
12506 : check for length of pointer
12510 $echo $n "Checking to see how big your pointers are...$c" >&4
12511 if test "$voidflags" -gt 7; then
12512 echo '#define VOID_PTR char *' > try.c
12514 echo '#define VOID_PTR void *' > try.c
12516 $cat >>try.c <<'EOCP'
12520 printf("%d\n", sizeof(VOID_PTR));
12525 if eval $compile_ok; then
12527 $echo " $ptrsize bytes." >&4
12530 echo "(I can't seem to compile the test program. Guessing...)" >&4
12531 rp="What is the size of a pointer (in bytes)?"
12539 : see if ar generates random libraries by itself
12541 echo "Checking how to generate random libraries on your machine..." >&4
12542 echo 'int bar1() { return bar2(); }' > bar1.c
12543 echo 'int bar2() { return 2; }' > bar2.c
12544 $cat > foo.c <<'EOP'
12545 int main() { printf("%d\n", bar1()); exit(0); }
12547 $cc $ccflags -c bar1.c >/dev/null 2>&1
12548 $cc $ccflags -c bar2.c >/dev/null 2>&1
12549 $cc $ccflags -c foo.c >/dev/null 2>&1
12550 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12551 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12552 ./foobar >/dev/null 2>&1; then
12553 echo "$ar appears to generate random libraries itself."
12556 elif $ar ts bar$_a >/dev/null 2>&1 &&
12557 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12558 ./foobar >/dev/null 2>&1; then
12559 echo "a table of contents needs to be added with '$ar ts'."
12566 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12567 $test -f $ranlib || ranlib=''
12570 if $test -n "$ranlib"; then
12571 echo "your system has '$ranlib'; we'll use that."
12574 echo "your system doesn't seem to support random libraries"
12575 echo "so we'll use lorder and tsort to order the libraries."
12582 : check for type of arguments to select.
12583 case "$selecttype" in
12584 '') case "$d_select" in
12587 Checking to see what type of arguments are accepted by select().
12589 hdrs="$define sys/types.h
12590 $i_systime sys/time.h
12591 $i_sysselct sys/select.h
12592 $d_socket sys/socket.h"
12593 : The first arg can be int, unsigned, or size_t
12594 : The last arg may or may not be 'const'
12596 : void pointer has been seen but using that
12597 : breaks the selectminbits test
12598 for xxx in 'fd_set *' 'int *'; do
12599 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12600 for tmo in 'struct timeval *' 'const struct timeval *'; do
12602 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12603 if ./protochk "$try" $hdrs; then
12604 echo "Your system accepts $xxx."
12613 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12614 case "$d_fd_set" in
12615 $define) dflt="fd_set *" ;;
12624 *) : no select, so pick a harmless default
12631 : check for the select 'width'
12632 case "$selectminbits" in
12633 '') case "$d_select" in
12637 Checking to see on how many bits at a time your select() operates...
12640 #include <sys/types.h>
12642 #$i_systime I_SYS_TIME
12643 #$i_systimek I_SYS_TIME_KERNEL
12648 # ifdef I_SYS_TIME_KERNEL
12651 # include <sys/time.h>
12652 # ifdef I_SYS_TIME_KERNEL
12656 #$i_sysselct I_SYS_SELECT
12657 #ifdef I_SYS_SELECT
12658 #include <sys/select.h>
12660 #$d_socket HAS_SOCKET
12662 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12666 #define S sizeof(*(b))
12668 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12669 #define NBITS (NBYTES * 8)
12678 fp = fopen("try.c", "r");
12684 b = ($selecttype)s;
12685 for (i = 0; i < NBITS; i++)
12689 select(fd + 1, b, 0, 0, &t);
12690 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12691 printf("%d\n", i + 1);
12696 if eval $compile_ok; then
12697 selectminbits=`./try`
12698 case "$selectminbits" in
12700 Cannot figure out on how many bits at a time your select() operates.
12701 I'll play safe and guess it is 32 bits.
12707 *) bits="$selectminbits bits" ;;
12709 echo "Your select() operates on $bits at a time." >&4
12711 rp='What is the minimum number of bits your select() operates on?'
12712 case "$byteorder" in
12713 1234|12345678) dflt=32 ;;
12718 selectminbits="$val"
12722 *) : no select, so pick a harmless default
12729 : Trace out the files included by signal.h, then look for SIGxxx names.
12730 : Remove SIGARRAYSIZE used by HPUX.
12731 : Remove SIGSTKSIZE used by Linux.
12732 : Remove SIGSTKSZ used by Posix.
12733 : Remove SIGTYP void lines used by OS2.
12734 xxx=`echo '#include <signal.h>' |
12735 $cppstdin $cppminus $cppflags 2>/dev/null |
12736 $grep '^[ ]*#.*include' |
12737 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12738 : Check this list of files to be sure we have parsed the cpp output ok.
12739 : This will also avoid potentially non-existent files, such
12742 for xx in $xxx /dev/null ; do
12743 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12745 : If we have found no files, at least try signal.h
12746 case "$xxxfiles" in
12747 '') xxxfiles=`./findhdr signal.h` ;;
12750 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12751 print substr($2, 4, 20)
12753 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12754 print substr($3, 4, 20)
12756 : Append some common names just in case the awk scan failed.
12757 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12758 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12759 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12760 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12761 : generate a few handy files for later
12762 $cat > signal.c <<'EOCP'
12763 #include <sys/types.h>
12764 #include <signal.h>
12768 /* Strange style to avoid deeply-nested #if/#else/#endif */
12771 # define NSIG (_NSIG)
12777 # define NSIG (SIGMAX+1)
12783 # define NSIG (SIG_MAX+1)
12789 # define NSIG (MAXSIG+1)
12795 # define NSIG (MAX_SIG+1)
12800 # ifdef SIGARRAYSIZE
12801 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12807 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12811 /* Default to some arbitrary number that's big enough to get most
12812 of the common signals.
12818 printf("NSIG %d\n", NSIG);
12824 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12826 printf "#ifdef SIG"; printf $1; printf "\n"
12827 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12828 printf $1; printf ");\n"
12832 printf "#endif /* JUST_NSIG */\n";
12836 $cat >signal.awk <<'EOP'
12837 BEGIN { ndups = 0 }
12838 $1 ~ /^NSIG$/ { nsig = $2 }
12839 ($1 !~ /^NSIG$/) && (NF == 2) {
12840 if ($2 > maxsig) { maxsig = $2 }
12841 if (sig_name[$2]) {
12842 dup_name[ndups] = $1
12843 dup_num[ndups] = $2
12855 printf("NSIG %d\n", nsig);
12856 for (n = 1; n < nsig; n++) {
12858 printf("%s %d\n", sig_name[n], sig_num[n])
12861 printf("NUM%d %d\n", n, n)
12864 for (n = 0; n < ndups; n++) {
12865 printf("%s %d\n", dup_name[n], dup_num[n])
12869 $cat >signal_cmd <<EOS
12871 if $test -s signal.lst; then
12872 echo "Using your existing signal.lst file"
12877 $cat >>signal_cmd <<'EOS'
12880 if eval $compile_ok; then
12881 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12883 echo "(I can't seem be able to compile the whole test program)" >&4
12884 echo "(I'll try it in little pieces.)" >&4
12885 set signal -DJUST_NSIG
12886 if eval $compile_ok; then
12887 ./signal$_exe > signal.nsg
12890 echo "I can't seem to figure out how many signals you have." >&4
12891 echo "Guessing 50." >&4
12892 echo 'NSIG 50' > signal.nsg
12894 : Now look at all the signal names, one at a time.
12895 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12896 $cat > signal.c <<EOCP
12897 #include <sys/types.h>
12898 #include <signal.h>
12901 printf("$xx %d\n", SIG${xx});
12906 if eval $compile; then
12907 echo "SIG${xx} found."
12908 ./signal$_exe >> signal.ls1
12910 echo "SIG${xx} NOT found."
12913 if $test -s signal.ls1; then
12914 $cat signal.nsg signal.ls1 |
12915 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12919 if $test -s signal.lst; then
12922 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12923 echo 'kill -l' >signal
12924 set X `csh -f <signal`
12928 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12930 echo $@ | $tr ' ' $trnl | \
12931 $awk '{ printf "%s %d\n", $1, ++s; }
12932 END { printf "NSIG %d\n", ++s }' >signal.lst
12934 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12936 chmod a+x signal_cmd
12937 $eunicefix signal_cmd
12939 : generate list of signal names
12941 case "$sig_name_init" in
12943 *) case "$sig_num_init" in
12944 ''|*,*) doinit=yes ;;
12949 echo "Generating a list of signal names and numbers..." >&4
12951 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12952 sig_name=`$awk 'BEGIN { printf "ZERO " }
12953 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12954 sig_num=`$awk 'BEGIN { printf "0 " }
12955 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12956 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12957 !/^NSIG/ { printf "\"%s\", ", $1 }
12958 END { printf "0\n" }' signal.lst`
12959 sig_num_init=`$awk 'BEGIN { printf "0, " }
12960 !/^NSIG/ { printf "%d, ", $2}
12961 END { printf "0\n"}' signal.lst`
12964 echo "The following $sig_count signals are available:"
12966 echo $sig_name | $awk \
12967 'BEGIN { linelen = 0 }
12969 for (i = 1; i <= NF; i++) {
12970 name = "SIG" $i " "
12971 linelen = linelen + length(name)
12972 if (linelen > 70) {
12974 linelen = length(name)
12980 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12982 : see what type is used for signed size_t
12983 set ssize_t ssizetype int stdio.h sys/types.h
12986 $cat > ssize.c <<EOM
12988 #include <sys/types.h>
12989 #define Size_t $sizetype
12990 #define SSize_t $dflt
12993 if (sizeof(Size_t) == sizeof(SSize_t))
12995 else if (sizeof(Size_t) == sizeof(int))
13004 if eval $compile_ok && ./ssize > /dev/null; then
13005 ssizetype=`./ssize`
13006 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13009 Help! I can't compile and run the ssize_t test program: please enlighten me!
13010 (This is probably a misconfiguration in your system or libraries, and
13011 you really ought to fix it. Still, I'll try anyway.)
13013 I need a type that is the same size as $sizetype, but is guaranteed to
13014 be signed. Common values are ssize_t, int and long.
13017 rp="What signed type is the same size as $sizetype?"
13021 $rm -f ssize ssize.*
13023 : see what type of char stdio uses.
13025 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13026 echo "Your stdio uses unsigned chars." >&4
13027 stdchar="unsigned char"
13029 echo "Your stdio uses signed chars." >&4
13033 : see if time exists
13035 if test "X$d_time" = X -o X"$timetype" = X; then
13036 if set time val -f d_time; eval $csym; $val; then
13037 echo 'time() found.' >&4
13039 rp="What is the type returned by time() on this system?"
13040 set time_t timetype long stdio.h sys/types.h
13043 echo 'time() not found, hope that will do.' >&4
13051 : see what type uids are declared as in the kernel
13053 echo "Looking for the type for user ids returned by getuid()."
13054 set uid_t uidtype xxx stdio.h sys/types.h
13058 xxx=`./findhdr sys/user.h`
13059 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13061 unsigned) dflt="$1 $2" ;;
13065 *) dflt="$uidtype";;
13068 uid_t) echo "uid_t found." ;;
13069 *) rp="What is the type for user ids returned by getuid()?"
13077 *_t) zzz="$uidtype" ;;
13080 echo "Checking the size of $zzz..." >&4
13082 #include <sys/types.h>
13085 printf("%d\n", sizeof($uidtype));
13089 if eval $compile_ok; then
13093 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13096 echo "Your $zzz size is $uidsize bytes."
13101 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13106 *_t) zzz="$uidtype" ;;
13109 echo "Checking the sign of $zzz..." >&4
13111 #include <sys/types.h>
13122 if eval $compile; then
13126 echo "(I can't execute the test program--guessing unsigned.)" >&4
13130 1) echo "Your $zzz is unsigned." ;;
13131 -1) echo "Your $zzz is signed." ;;
13137 echo "(I can't compile the test program--guessing unsigned.)" >&4
13143 $echo "Checking the format string to be used for uids..." >&4
13146 -1) if $test X"$uidsize" = X"$ivsize"; then
13147 uidformat="$ivdformat"
13149 if $test X"$uidsize" = X"$longsize"; then
13152 if $test X"$uidsize" = X"$intsize"; then
13155 if $test X"$uidsize" = X"$shortsize"; then
13162 *) if $test X"$uidsize" = X"$uvsize"; then
13163 uidformat="$uvuformat"
13165 if $test X"$uidsize" = X"$longsize"; then
13168 if $test X"$uidsize" = X"$intsize"; then
13171 if $test X"$uidsize" = X"$shortsize"; then
13180 : see if dbm.h is available
13181 : see if dbmclose exists
13182 set dbmclose d_dbmclose
13185 case "$d_dbmclose" in
13195 *) set rpcsvc/dbm.h i_rpcsvcdbm
13200 *) echo "We won't be including <dbm.h>"
13210 : see if this is a sys/file.h system
13215 : do we need to include sys/file.h ?
13219 if $h_sysfile; then
13221 echo "We'll be including <sys/file.h>." >&4
13224 echo "We won't be including <sys/file.h>." >&4
13234 : see if fcntl.h is there
13239 : see if we can include fcntl.h
13245 echo "We'll be including <fcntl.h>." >&4
13248 if $h_sysfile; then
13249 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13251 echo "We won't be including <fcntl.h>." >&4
13263 : see if locale.h is available
13264 set locale.h i_locale
13267 : see if mach cthreads are available
13268 if test "X$usethreads" = "X$define"; then
13269 set mach/cthreads.h i_machcthr
13272 i_machcthr="$undef"
13277 : see if this is a math.h system
13281 : see if this is a mntent.h system
13282 set mntent.h i_mntent
13285 : see if ndbm.h is available
13290 : see if dbm_open exists
13291 set dbm_open d_dbm_open
13293 case "$d_dbm_open" in
13296 echo "We won't be including <ndbm.h>"
13305 : see if net/errno.h is available
13307 set net/errno.h val
13310 : Unfortunately, it causes problems on some systems. Arrgh.
13313 cat > try.c <<'EOM'
13316 #include <net/errno.h>
13322 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13323 echo "We'll be including <net/errno.h>." >&4
13325 echo "We won't be including <net/errno.h>." >&4
13334 : see if netinet/tcp.h is available
13335 set netinet/tcp.h i_netinettcp
13338 : see if this is a poll.h system
13342 : get C preprocessor symbols handy
13344 $echo $n "Hmm... $c"
13345 echo $al | $tr ' ' $trnl >Cppsym.know
13346 $cat <<EOSS >Cppsym
13354 case "\$list\$#" in
13357 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13359 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13362 unknown="\$unknown \$sym"
13372 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13374 exit 0; _ _ _ _\1\\ \1\\
13377 echo "exit 1; _ _ _" >>Cppsym\$\$
13378 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13380 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13386 $rm -f Cppsym\$\$ Cppsym2\$\$
13391 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13393 : now check the C compiler for additional symbols
13394 postprocess_cc_v=''
13396 aix) postprocess_cc_v="|$tr , ' '" ;;
13403 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13406 -D*) echo "\$i" | $sed 's/^-D//';;
13407 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13412 postprocess_cc_v=''
13415 ./ccsym > ccsym1.raw
13416 if $test -s ccsym1.raw; then
13417 $sort ccsym1.raw | $uniq >ccsym.raw
13419 mv ccsym1.raw ccsym.raw
13422 $awk '/\=/ { print $0; next }
13423 { print $0"=1" }' ccsym.raw >ccsym.list
13424 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13425 $comm -13 ccsym.true ccsym.list >ccsym.own
13426 $comm -12 ccsym.true ccsym.list >ccsym.com
13427 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13429 if $test -z ccsym.raw; then
13430 echo "Your C compiler doesn't seem to define any symbols!" >&4
13432 echo "However, your C preprocessor defines the following symbols:"
13435 cppsymbols=`$cat Cppsym.true`
13436 cppsymbols=`echo $cppsymbols`
13437 cppccsymbols="$cppsymbols"
13439 if $test -s ccsym.com; then
13440 echo "Your C compiler and pre-processor define these symbols:"
13441 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13444 cppccsymbols=`$cat ccsym.com`
13445 cppccsymbols=`echo $cppccsymbols`
13446 $test "$silent" || sleep 1
13448 if $test -s ccsym.cpp; then
13449 $test "$also" && echo " "
13450 echo "Your C pre-processor ${also}defines the following symbols:"
13451 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13453 cppsymbols=`$cat ccsym.cpp`
13454 cppsymbols=`echo $cppsymbols`
13455 $test "$silent" || sleep 1
13457 if $test -s ccsym.own; then
13458 $test "$also" && echo " "
13459 echo "Your C compiler ${also}defines the following cpp symbols:"
13460 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13461 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13462 ccsymbols=`$cat ccsym.own`
13463 ccsymbols=`echo $ccsymbols`
13464 $test "$silent" || sleep 1
13469 : see if this is a termio system
13473 if $test `./findhdr termios.h`; then
13474 set tcsetattr i_termios
13480 "$define") echo "You have POSIX termios.h... good!" >&4;;
13481 *) if ./Cppsym pyr; then
13482 case "`/bin/universe`" in
13483 ucb) if $test `./findhdr sgtty.h`; then
13485 echo "<sgtty.h> found." >&4
13487 echo "System is pyramid with BSD universe."
13488 echo "<sgtty.h> not found--you could have problems." >&4
13490 *) if $test `./findhdr termio.h`; then
13492 echo "<termio.h> found." >&4
13494 echo "System is pyramid with USG universe."
13495 echo "<termio.h> not found--you could have problems." >&4
13499 if $test `./findhdr termio.h`; then
13500 echo "<termio.h> found." >&4
13502 elif $test `./findhdr sgtty.h`; then
13503 echo "<sgtty.h> found." >&4
13506 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13509 if $test `./findhdr sgtty.h`; then
13510 echo "<sgtty.h> found." >&4
13512 elif $test `./findhdr termio.h`; then
13513 echo "<termio.h> found." >&4
13516 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13520 set i_termio; eval $setvar
13521 val=$val2; set i_sgtty; eval $setvar
13522 val=$val3; set i_termios; eval $setvar
13524 : see if this is a shadow.h system
13525 set shadow.h i_shadow
13528 : see if this is a socks.h system
13529 set socks.h i_socks
13532 : see if stdarg is available
13534 if $test `./findhdr stdarg.h`; then
13535 echo "<stdarg.h> found." >&4
13538 echo "<stdarg.h> NOT found." >&4
13542 : see if varags is available
13544 if $test `./findhdr varargs.h`; then
13545 echo "<varargs.h> found." >&4
13547 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13550 : set up the varargs testing programs
13551 $cat > varargs.c <<EOP
13553 #include <stdarg.h>
13556 #include <varargs.h>
13560 int f(char *p, ...)
13574 p = va_arg(ap, char *);
13579 $cat > varargs <<EOP
13581 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13590 : now check which varargs header should be included
13595 if `./varargs I_STDARG`; then
13597 elif `./varargs I_VARARGS`; then
13602 if `./varargs I_VARARGS`; then
13609 echo "I could not find the definition for va_dcl... You have problems..." >&4
13610 val="$undef"; set i_stdarg; eval $setvar
13611 val="$undef"; set i_varargs; eval $setvar
13616 case "$i_varhdr" in
13618 val="$define"; set i_stdarg; eval $setvar
13619 val="$undef"; set i_varargs; eval $setvar
13622 val="$undef"; set i_stdarg; eval $setvar
13623 val="$define"; set i_varargs; eval $setvar
13626 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13630 : see if stddef is available
13631 set stddef.h i_stddef
13634 : see if sys/access.h is available
13635 set sys/access.h i_sysaccess
13638 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13639 set sys/filio.h i_sysfilio
13642 if $test `./findhdr sys/ioctl.h`; then
13644 echo '<sys/ioctl.h> found.' >&4
13647 if $test $i_sysfilio = "$define"; then
13648 echo '<sys/ioctl.h> NOT found.' >&4
13650 $test $i_sgtty = "$define" && xxx="sgtty.h"
13651 $test $i_termio = "$define" && xxx="termio.h"
13652 $test $i_termios = "$define" && xxx="termios.h"
13653 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13659 : see if sys/resource.h has to be included
13660 set sys/resource.h i_sysresrc
13663 : see if sys/security.h is available
13664 set sys/security.h i_syssecrt
13667 : see if this is a sys/statvfs.h system
13668 set sys/statvfs.h i_sysstatvfs
13671 : see if this is a sys/uio.h system
13672 set sys/uio.h i_sysuio
13675 : see if this is a sys/un.h system
13676 set sys/un.h i_sysun
13679 : see if this is a syswait system
13680 set sys/wait.h i_syswait
13683 : see if this is a ustat.h system
13684 set ustat.h i_ustat
13687 : see if this is an utime system
13688 set utime.h i_utime
13691 : see if this is a values.h system
13692 set values.h i_values
13695 : see if this is a vfork system
13698 set vfork.h i_vfork
13706 : see if gdbm.h is available
13711 : see if gdbm_open exists
13712 set gdbm_open d_gdbm_open
13714 case "$d_gdbm_open" in
13717 echo "We won't be including <gdbm.h>"
13727 echo "Looking for extensions..." >&4
13728 : If we are using the old config.sh, known_extensions may contain
13729 : old or inaccurate or duplicate values.
13730 known_extensions=''
13731 nonxs_extensions=''
13732 : We do not use find because it might not be available.
13733 : We do not just use MANIFEST because the user may have dropped
13734 : some additional extensions into the source tree and expect them
13737 : Function to recursively find available extensions, ignoring DynaLoader
13738 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13742 DynaLoader|dynaload) ;;
13744 if $test -f $xxx/$xxx.xs; then
13745 known_extensions="$known_extensions $1$xxx";
13746 elif $test -f $xxx/Makefile.PL; then
13747 nonxs_extensions="$nonxs_extensions $1$xxx";
13749 if $test -d $xxx -a $# -lt 10; then
13752 eval $find_extensions;
13764 eval $find_extensions
13765 set X $nonxs_extensions
13767 nonxs_extensions="$*"
13768 set X $known_extensions
13770 known_extensions="$*"
13773 : Now see which are supported on this system.
13775 for xxx in $known_extensions ; do
13779 $define) avail_ext="$avail_ext $xxx" ;;
13782 GDBM_File|gdbm_fil)
13784 $define) avail_ext="$avail_ext $xxx" ;;
13787 NDBM_File|ndbm_fil)
13789 $define) avail_ext="$avail_ext $xxx" ;;
13792 ODBM_File|odbm_fil)
13793 case "${i_dbm}${i_rpcsvcdbm}" in
13794 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13798 case "$useposix" in
13799 true|define|y) avail_ext="$avail_ext $xxx" ;;
13803 case "$useopcode" in
13804 true|define|y) avail_ext="$avail_ext $xxx" ;;
13808 case "$d_socket" in
13809 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13813 case "$usethreads" in
13814 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13818 : XXX Do we need a useipcsysv variable here
13819 case "${d_msg}${d_sem}${d_shm}" in
13820 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13823 *) avail_ext="$avail_ext $xxx"
13832 : Now see which nonxs extensions are supported on this system.
13833 : For now assume all are.
13835 for xxx in $nonxs_extensions ; do
13837 *) nonxs_ext="$nonxs_ext $xxx"
13849 A number of extensions are supplied with $package. You may choose to
13850 compile these extensions for dynamic loading (the default), compile
13851 them into the $package executable (static loading), or not include
13852 them at all. Answer "none" to include no extensions.
13853 Note that DynaLoader is always built and need not be mentioned here.
13856 case "$dynamic_ext" in
13857 '') dflt="$avail_ext" ;;
13858 *) dflt="$dynamic_ext"
13859 # Perhaps we are reusing an old out-of-date config.sh.
13862 if test X"$dynamic_ext" != X"$avail_ext"; then
13864 NOTICE: Your previous config.sh list may be incorrect.
13865 The extensions now available to you are
13867 but the default list from your previous config.sh is
13879 rp="What extensions do you wish to load dynamically?"
13882 none) dynamic_ext=' ' ;;
13883 *) dynamic_ext="$ans" ;;
13886 case "$static_ext" in
13888 : Exclude those already listed in dynamic linking
13890 for xxx in $avail_ext; do
13891 case " $dynamic_ext " in
13893 *) dflt="$dflt $xxx" ;;
13900 *) dflt="$static_ext"
13907 rp="What extensions do you wish to load statically?"
13910 none) static_ext=' ' ;;
13911 *) static_ext="$ans" ;;
13916 A number of extensions are supplied with $package. Answer "none"
13917 to include no extensions.
13918 Note that DynaLoader is always built and need not be mentioned here.
13921 case "$static_ext" in
13922 '') dflt="$avail_ext" ;;
13923 *) dflt="$static_ext"
13924 # Perhaps we are reusing an old out-of-date config.sh.
13927 if test X"$static_ext" != X"$avail_ext"; then
13929 NOTICE: Your previous config.sh list may be incorrect.
13930 The extensions now available to you are
13932 but the default list from your previous config.sh is
13941 : Exclude those that are not xs extensions
13945 rp="What extensions do you wish to include?"
13948 none) static_ext=' ' ;;
13949 *) static_ext="$ans" ;;
13954 set X $dynamic_ext $static_ext $nonxs_ext
13958 : Remove build directory name from cppstdin so it can be used from
13959 : either the present location or the final installed location.
13961 : Get out of the UU directory to get correct path name.
13963 case "$cppstdin" in
13965 echo "Stripping down cppstdin path name"
13971 : end of configuration questions
13973 echo "End of configuration questions."
13976 : back to where it started
13977 if test -d ../UU; then
13981 : configuration may be patched via a 'config.over' file
13982 if $test -f config.over; then
13985 rp='I see a config.over file. Do you wish to load it?'
13988 n*) echo "OK, I'll ignore it.";;
13990 echo "Configuration override changes have been loaded."
13995 : in case they want portability, strip down executable paths
13996 case "$d_portable" in
13999 echo "Stripping down executable paths..." >&4
14000 for file in $loclist $trylist; do
14002 eval $file=`basename $temp`
14007 : create config.sh file
14009 echo "Creating config.sh..." >&4
14010 $spitshell <<EOT >config.sh
14013 # This file was produced by running the Configure script. It holds all the
14014 # definitions figured out by Configure. Should you modify one of these values,
14015 # do not forget to propagate your changes by running "Configure -der". You may
14016 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14019 # Package name : $package
14020 # Source directory : $src
14021 # Configuration time: $cf_time
14022 # Configured by : $cf_by
14023 # Target system : $myuname
14033 Revision='$Revision'
14040 alignbytes='$alignbytes'
14041 ansi2knr='$ansi2knr'
14042 aphostname='$aphostname'
14043 apiversion='$apiversion'
14046 archlibexp='$archlibexp'
14047 archname64='$archname64'
14048 archname='$archname'
14049 archobjs='$archobjs'
14054 bincompat5005='$bincompat5005'
14058 byteorder='$byteorder'
14060 castflags='$castflags'
14063 cccdlflags='$cccdlflags'
14064 ccdlflags='$ccdlflags'
14066 ccsymbols='$ccsymbols'
14068 cf_email='$cf_email'
14070 charsize='$charsize'
14074 clocktype='$clocktype'
14076 compress='$compress'
14077 contains='$contains'
14081 cpp_stuff='$cpp_stuff'
14082 cppccsymbols='$cppccsymbols'
14083 cppflags='$cppflags'
14085 cppminus='$cppminus'
14087 cppstdin='$cppstdin'
14088 cppsymbols='$cppsymbols'
14089 crosscompile='$crosscompile'
14090 cryptlib='$cryptlib'
14092 d_Gconvert='$d_Gconvert'
14093 d_PRIEldbl='$d_PRIEldbl'
14094 d_PRIFldbl='$d_PRIFldbl'
14095 d_PRIGldbl='$d_PRIGldbl'
14096 d_PRIX64='$d_PRIX64'
14097 d_PRId64='$d_PRId64'
14098 d_PRIeldbl='$d_PRIeldbl'
14099 d_PRIfldbl='$d_PRIfldbl'
14100 d_PRIgldbl='$d_PRIgldbl'
14101 d_PRIi64='$d_PRIi64'
14102 d_PRIo64='$d_PRIo64'
14103 d_PRIu64='$d_PRIu64'
14104 d_PRIx64='$d_PRIx64'
14105 d_access='$d_access'
14106 d_accessx='$d_accessx'
14108 d_archlib='$d_archlib'
14111 d_attribut='$d_attribut'
14114 d_bincompat5005='$d_bincompat5005'
14116 d_bsdgetpgrp='$d_bsdgetpgrp'
14117 d_bsdsetpgrp='$d_bsdsetpgrp'
14119 d_casti32='$d_casti32'
14120 d_castneg='$d_castneg'
14121 d_charvspr='$d_charvspr'
14123 d_chroot='$d_chroot'
14124 d_chsize='$d_chsize'
14125 d_closedir='$d_closedir'
14129 d_cuserid='$d_cuserid'
14130 d_dbl_dig='$d_dbl_dig'
14131 d_difftime='$d_difftime'
14132 d_dirnamlen='$d_dirnamlen'
14133 d_dlerror='$d_dlerror'
14134 d_dlopen='$d_dlopen'
14135 d_dlsymun='$d_dlsymun'
14136 d_dosuid='$d_dosuid'
14137 d_drand48proto='$d_drand48proto'
14139 d_eaccess='$d_eaccess'
14140 d_endgrent='$d_endgrent'
14141 d_endhent='$d_endhent'
14142 d_endnent='$d_endnent'
14143 d_endpent='$d_endpent'
14144 d_endpwent='$d_endpwent'
14145 d_endsent='$d_endsent'
14146 d_endspent='$d_endspent'
14147 d_eofnblk='$d_eofnblk'
14148 d_eunice='$d_eunice'
14149 d_fchmod='$d_fchmod'
14150 d_fchown='$d_fchown'
14152 d_fd_macros='$d_fd_macros'
14153 d_fd_set='$d_fd_set'
14154 d_fds_bits='$d_fds_bits'
14155 d_fgetpos='$d_fgetpos'
14156 d_flexfnam='$d_flexfnam'
14159 d_fpathconf='$d_fpathconf'
14160 d_fpos64_t='$d_fpos64_t'
14161 d_fs_data_s='$d_fs_data_s'
14162 d_fseeko='$d_fseeko'
14163 d_fsetpos='$d_fsetpos'
14164 d_fstatfs='$d_fstatfs'
14165 d_fstatvfs='$d_fstatvfs'
14166 d_ftello='$d_ftello'
14168 d_getgrent='$d_getgrent'
14169 d_getgrps='$d_getgrps'
14170 d_gethbyaddr='$d_gethbyaddr'
14171 d_gethbyname='$d_gethbyname'
14172 d_gethent='$d_gethent'
14173 d_gethname='$d_gethname'
14174 d_gethostprotos='$d_gethostprotos'
14175 d_getlogin='$d_getlogin'
14176 d_getmnt='$d_getmnt'
14177 d_getmntent='$d_getmntent'
14178 d_getnbyaddr='$d_getnbyaddr'
14179 d_getnbyname='$d_getnbyname'
14180 d_getnent='$d_getnent'
14181 d_getnetprotos='$d_getnetprotos'
14182 d_getpbyname='$d_getpbyname'
14183 d_getpbynumber='$d_getpbynumber'
14184 d_getpent='$d_getpent'
14185 d_getpgid='$d_getpgid'
14186 d_getpgrp2='$d_getpgrp2'
14187 d_getpgrp='$d_getpgrp'
14188 d_getppid='$d_getppid'
14189 d_getprior='$d_getprior'
14190 d_getprotoprotos='$d_getprotoprotos'
14191 d_getpwent='$d_getpwent'
14192 d_getsbyname='$d_getsbyname'
14193 d_getsbyport='$d_getsbyport'
14194 d_getsent='$d_getsent'
14195 d_getservprotos='$d_getservprotos'
14196 d_getspent='$d_getspent'
14197 d_getspnam='$d_getspnam'
14198 d_gettimeod='$d_gettimeod'
14199 d_gnulibc='$d_gnulibc'
14200 d_grpasswd='$d_grpasswd'
14201 d_hasmntopt='$d_hasmntopt'
14204 d_inetaton='$d_inetaton'
14205 d_int64t='$d_int64t'
14206 d_isascii='$d_isascii'
14207 d_killpg='$d_killpg'
14208 d_lchown='$d_lchown'
14209 d_ldbl_dig='$d_ldbl_dig'
14211 d_locconv='$d_locconv'
14213 d_longdbl='$d_longdbl'
14214 d_longlong='$d_longlong'
14217 d_mbstowcs='$d_mbstowcs'
14218 d_mbtowc='$d_mbtowc'
14219 d_memchr='$d_memchr'
14220 d_memcmp='$d_memcmp'
14221 d_memcpy='$d_memcpy'
14222 d_memmove='$d_memmove'
14223 d_memset='$d_memset'
14225 d_mkfifo='$d_mkfifo'
14226 d_mktime='$d_mktime'
14228 d_msg_ctrunc='$d_msg_ctrunc'
14229 d_msg_dontroute='$d_msg_dontroute'
14230 d_msg_oob='$d_msg_oob'
14231 d_msg_peek='$d_msg_peek'
14232 d_msg_proxy='$d_msg_proxy'
14233 d_msgctl='$d_msgctl'
14234 d_msgget='$d_msgget'
14235 d_msgrcv='$d_msgrcv'
14236 d_msgsnd='$d_msgsnd'
14237 d_mymalloc='$d_mymalloc'
14239 d_off64_t='$d_off64_t'
14240 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14241 d_oldpthreads='$d_oldpthreads'
14242 d_oldsock='$d_oldsock'
14244 d_pathconf='$d_pathconf'
14246 d_phostname='$d_phostname'
14249 d_portable='$d_portable'
14250 d_pthread_yield='$d_pthread_yield'
14252 d_pwchange='$d_pwchange'
14253 d_pwclass='$d_pwclass'
14254 d_pwcomment='$d_pwcomment'
14255 d_pwexpire='$d_pwexpire'
14256 d_pwgecos='$d_pwgecos'
14257 d_pwpasswd='$d_pwpasswd'
14258 d_pwquota='$d_pwquota'
14259 d_readdir='$d_readdir'
14260 d_readlink='$d_readlink'
14261 d_rename='$d_rename'
14262 d_rewinddir='$d_rewinddir'
14264 d_safebcpy='$d_safebcpy'
14265 d_safemcpy='$d_safemcpy'
14266 d_sanemcmp='$d_sanemcmp'
14267 d_sched_yield='$d_sched_yield'
14268 d_scm_rights='$d_scm_rights'
14269 d_seekdir='$d_seekdir'
14270 d_select='$d_select'
14272 d_semctl='$d_semctl'
14273 d_semctl_semid_ds='$d_semctl_semid_ds'
14274 d_semctl_semun='$d_semctl_semun'
14275 d_semget='$d_semget'
14277 d_setegid='$d_setegid'
14278 d_seteuid='$d_seteuid'
14279 d_setgrent='$d_setgrent'
14280 d_setgrps='$d_setgrps'
14281 d_sethent='$d_sethent'
14282 d_setlinebuf='$d_setlinebuf'
14283 d_setlocale='$d_setlocale'
14284 d_setnent='$d_setnent'
14285 d_setpent='$d_setpent'
14286 d_setpgid='$d_setpgid'
14287 d_setpgrp2='$d_setpgrp2'
14288 d_setpgrp='$d_setpgrp'
14289 d_setprior='$d_setprior'
14290 d_setpwent='$d_setpwent'
14291 d_setregid='$d_setregid'
14292 d_setresgid='$d_setresgid'
14293 d_setresuid='$d_setresuid'
14294 d_setreuid='$d_setreuid'
14295 d_setrgid='$d_setrgid'
14296 d_setruid='$d_setruid'
14297 d_setsent='$d_setsent'
14298 d_setsid='$d_setsid'
14299 d_setspent='$d_setspent'
14300 d_setvbuf='$d_setvbuf'
14304 d_shmatprototype='$d_shmatprototype'
14305 d_shmctl='$d_shmctl'
14307 d_shmget='$d_shmget'
14308 d_sigaction='$d_sigaction'
14309 d_sigsetjmp='$d_sigsetjmp'
14310 d_socket='$d_socket'
14311 d_sockpair='$d_sockpair'
14313 d_statblks='$d_statblks'
14314 d_statfs_f_flags='$d_statfs_f_flags'
14315 d_statfs_s='$d_statfs_s'
14316 d_statvfs='$d_statvfs'
14317 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14318 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14319 d_stdio_stream_array='$d_stdio_stream_array'
14320 d_stdiobase='$d_stdiobase'
14321 d_stdstdio='$d_stdstdio'
14322 d_strchr='$d_strchr'
14323 d_strcoll='$d_strcoll'
14324 d_strctcpy='$d_strctcpy'
14325 d_strerrm='$d_strerrm'
14326 d_strerror='$d_strerror'
14327 d_strtod='$d_strtod'
14328 d_strtol='$d_strtol'
14329 d_strtoul='$d_strtoul'
14330 d_strtoull='$d_strtoull'
14331 d_strxfrm='$d_strxfrm'
14332 d_suidsafe='$d_suidsafe'
14333 d_symlink='$d_symlink'
14334 d_syscall='$d_syscall'
14335 d_sysconf='$d_sysconf'
14336 d_sysernlst='$d_sysernlst'
14337 d_syserrlst='$d_syserrlst'
14338 d_system='$d_system'
14339 d_tcgetpgrp='$d_tcgetpgrp'
14340 d_tcsetpgrp='$d_tcsetpgrp'
14341 d_telldir='$d_telldir'
14342 d_telldirproto='$d_telldirproto'
14345 d_truncate='$d_truncate'
14346 d_tzname='$d_tzname'
14349 d_union_semun='$d_union_semun'
14351 d_vendorbin='$d_vendorbin'
14352 d_vendorlib='$d_vendorlib'
14354 d_void_closedir='$d_void_closedir'
14355 d_voidsig='$d_voidsig'
14356 d_voidtty='$d_voidtty'
14357 d_volatile='$d_volatile'
14358 d_vprintf='$d_vprintf'
14360 d_waitpid='$d_waitpid'
14361 d_wcstombs='$d_wcstombs'
14362 d_wctomb='$d_wctomb'
14365 db_hashtype='$db_hashtype'
14366 db_prefixtype='$db_prefixtype'
14367 defvoidused='$defvoidused'
14368 direntrytype='$direntrytype'
14371 doublesize='$doublesize'
14373 dynamic_ext='$dynamic_ext'
14379 eunicefix='$eunicefix'
14382 extensions='$extensions'
14383 fflushNULL='$fflushNULL'
14384 fflushall='$fflushall'
14386 firstmakefile='$firstmakefile'
14388 fpossize='$fpossize'
14389 fpostype='$fpostype'
14390 freetype='$freetype'
14392 full_csh='$full_csh'
14393 full_sed='$full_sed'
14394 gccversion='$gccversion'
14395 gidformat='$gidformat'
14401 groupcat='$groupcat'
14402 groupstype='$groupstype'
14405 h_sysfile='$h_sysfile'
14417 i_arpainet='$i_arpainet'
14418 i_bsdioctl='$i_bsdioctl'
14421 i_dirent='$i_dirent'
14428 i_inttypes='$i_inttypes'
14429 i_limits='$i_limits'
14430 i_locale='$i_locale'
14431 i_machcthr='$i_machcthr'
14432 i_malloc='$i_malloc'
14434 i_memory='$i_memory'
14435 i_mntent='$i_mntent'
14438 i_neterrno='$i_neterrno'
14439 i_netinettcp='$i_netinettcp'
14442 i_pthread='$i_pthread'
14444 i_rpcsvcdbm='$i_rpcsvcdbm'
14447 i_shadow='$i_shadow'
14449 i_stdarg='$i_stdarg'
14450 i_stddef='$i_stddef'
14451 i_stdlib='$i_stdlib'
14452 i_string='$i_string'
14453 i_sysaccess='$i_sysaccess'
14454 i_sysdir='$i_sysdir'
14455 i_sysfile='$i_sysfile'
14456 i_sysfilio='$i_sysfilio'
14458 i_sysioctl='$i_sysioctl'
14459 i_sysmount='$i_sysmount'
14460 i_sysndir='$i_sysndir'
14461 i_sysparam='$i_sysparam'
14462 i_sysresrc='$i_sysresrc'
14463 i_syssecrt='$i_syssecrt'
14464 i_sysselct='$i_sysselct'
14465 i_syssockio='$i_syssockio'
14466 i_sysstat='$i_sysstat'
14467 i_sysstatfs='$i_sysstatfs'
14468 i_sysstatvfs='$i_sysstatvfs'
14469 i_systime='$i_systime'
14470 i_systimek='$i_systimek'
14471 i_systimes='$i_systimes'
14472 i_systypes='$i_systypes'
14473 i_sysuio='$i_sysuio'
14475 i_sysvfs='$i_sysvfs'
14476 i_syswait='$i_syswait'
14477 i_termio='$i_termio'
14478 i_termios='$i_termios'
14480 i_unistd='$i_unistd'
14483 i_values='$i_values'
14484 i_varargs='$i_varargs'
14485 i_varhdr='$i_varhdr'
14487 ignore_versioned_solibs='$ignore_versioned_solibs'
14490 installarchlib='$installarchlib'
14491 installbin='$installbin'
14492 installman1dir='$installman1dir'
14493 installman3dir='$installman3dir'
14494 installprefix='$installprefix'
14495 installprefixexp='$installprefixexp'
14496 installprivlib='$installprivlib'
14497 installscript='$installscript'
14498 installsitearch='$installsitearch'
14499 installsitebin='$installsitebin'
14500 installsitelib='$installsitelib'
14501 installstyle='$installstyle'
14502 installusrbinperl='$installusrbinperl'
14503 installvendorbin='$installvendorbin'
14504 installvendorlib='$installvendorlib'
14506 ivdformat='$ivdformat'
14509 known_extensions='$known_extensions'
14513 lddlflags='$lddlflags'
14515 ldlibpthname='$ldlibpthname'
14522 libswanted='$libswanted'
14528 locincpth='$locincpth'
14529 loclibpth='$loclibpth'
14530 longdblsize='$longdblsize'
14531 longlongsize='$longlongsize'
14532 longsize='$longsize'
14536 lseeksize='$lseeksize'
14537 lseektype='$lseektype'
14541 make_set_make='$make_set_make'
14542 mallocobj='$mallocobj'
14543 mallocsrc='$mallocsrc'
14544 malloctype='$malloctype'
14546 man1direxp='$man1direxp'
14549 man3direxp='$man3direxp'
14552 mips_type='$mips_type'
14555 modetype='$modetype'
14557 multiarch='$multiarch'
14559 myarchname='$myarchname'
14560 mydomain='$mydomain'
14561 myhostname='$myhostname'
14564 netdb_hlen_type='$netdb_hlen_type'
14565 netdb_host_type='$netdb_host_type'
14566 netdb_name_type='$netdb_name_type'
14567 netdb_net_type='$netdb_net_type'
14570 nm_so_opt='$nm_so_opt'
14571 nonxs_ext='$nonxs_ext'
14575 o_nonblock='$o_nonblock'
14577 old_pthread_create_joinable='$old_pthread_create_joinable'
14578 optimize='$optimize'
14579 orderlib='$orderlib'
14585 patchlevel='$patchlevel'
14586 path_sep='$path_sep'
14588 perladmin='$perladmin'
14589 perlpath='$perlpath'
14591 phostname='$phostname'
14594 pm_apiversion='$pm_apiversion'
14598 prefixexp='$prefixexp'
14600 privlibexp='$privlibexp'
14601 prototype='$prototype'
14603 quadcase='$quadcase'
14604 quadtype='$quadtype'
14605 randbits='$randbits'
14606 randfunc='$randfunc'
14607 randseedtype='$randseedtype'
14609 rd_nodata='$rd_nodata'
14613 sPRIEldbl='$sPRIEldbl'
14614 sPRIFldbl='$sPRIFldbl'
14615 sPRIGldbl='$sPRIGldbl'
14618 sPRIeldbl='$sPRIeldbl'
14619 sPRIfldbl='$sPRIfldbl'
14620 sPRIgldbl='$sPRIgldbl'
14625 sched_yield='$sched_yield'
14626 scriptdir='$scriptdir'
14627 scriptdirexp='$scriptdirexp'
14629 seedfunc='$seedfunc'
14630 selectminbits='$selectminbits'
14631 selecttype='$selecttype'
14632 sendmail='$sendmail'
14635 sharpbang='$sharpbang'
14636 shmattype='$shmattype'
14637 shortsize='$shortsize'
14640 sig_count='$sig_count'
14641 sig_name='$sig_name'
14642 sig_name_init='$sig_name_init'
14644 sig_num_init='$sig_num_init'
14645 signal_t='$signal_t'
14646 sitearch='$sitearch'
14647 sitearchexp='$sitearchexp'
14649 sitebinexp='$sitebinexp'
14651 sitelibexp='$sitelibexp'
14652 siteprefix='$siteprefix'
14653 siteprefixexp='$siteprefixexp'
14654 sizetype='$sizetype'
14659 sockethdr='$sockethdr'
14660 socketlib='$socketlib'
14662 spackage='$spackage'
14663 spitshell='$spitshell'
14666 ssizetype='$ssizetype'
14667 startperl='$startperl'
14669 static_ext='$static_ext'
14671 stdio_base='$stdio_base'
14672 stdio_bufsiz='$stdio_bufsiz'
14673 stdio_cnt='$stdio_cnt'
14674 stdio_filbuf='$stdio_filbuf'
14675 stdio_ptr='$stdio_ptr'
14676 stdio_stream_array='$stdio_stream_array'
14679 subversion='$subversion'
14686 timeincl='$timeincl'
14687 timetype='$timetype'
14700 uidformat='$uidformat'
14706 uquadtype='$uquadtype'
14707 use64bits='$use64bits'
14709 uselargefiles='$uselargefiles'
14710 uselongdouble='$uselongdouble'
14711 uselonglong='$uselonglong'
14712 usemorebits='$usemorebits'
14713 usemultiplicity='$usemultiplicity'
14714 usemymalloc='$usemymalloc'
14716 useopcode='$useopcode'
14717 useperlio='$useperlio'
14718 useposix='$useposix'
14720 useshrplib='$useshrplib'
14721 usesocks='$usesocks'
14722 usethreads='$usethreads'
14723 usevendorprefix='$usevendorprefix'
14724 usevfork='$usevfork'
14727 uvoformat='$uvoformat'
14730 uvuformat='$uvuformat'
14731 uvxformat='$uvxformat'
14732 vendorbin='$vendorbin'
14733 vendorbinexp='$vendorbinexp'
14734 vendorlib='$vendorlib'
14735 vendorlibexp='$vendorlibexp'
14736 vendorprefix='$vendorprefix'
14737 vendorprefixexp='$vendorprefixexp'
14740 voidflags='$voidflags'
14742 xs_apiversion='$xs_apiversion'
14747 : Add in command line options if available
14748 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14750 : add special variables
14751 $test -f $src/patchlevel.h && \
14752 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14753 echo "CONFIGDOTSH=true" >>config.sh
14755 : propagate old symbols
14756 if $test -f UU/config.sh; then
14757 <UU/config.sh sort | uniq >UU/oldconfig.sh
14758 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14759 sort | uniq -u >UU/oldsyms
14760 set X `cat UU/oldsyms`
14766 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14768 echo "# Variables propagated from previous config.sh file." >>config.sh
14769 for sym in `cat UU/oldsyms`; do
14770 echo " Propagating $hint variable "'$'"$sym..."
14771 eval 'tmp="$'"${sym}"'"'
14773 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14779 : Finish up by extracting the .SH files
14793 If you'd like to make any changes to the config.sh file before I begin
14794 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14797 rp="Press return or use a shell escape to edit config.sh:"
14802 *) : in case they cannot read
14803 sh 1>&4 -c "$ans";;
14808 : if this fails, just run all the .SH files by hand
14815 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14822 Now you need to generate make dependencies by running "$make depend".
14823 You might prefer to run it in background: "$make depend > makedepend.out &"
14824 It can take a while, so you might not want to run it right now.
14829 rp="Run $make depend now?"
14833 $make depend && echo "Now you must run a $make."
14836 echo "You must run '$make depend' then '$make'."
14839 elif test -f [Mm]akefile; then
14841 echo "Now you must run a $make."
14846 if $test -f Policy.sh; then
14849 If you compile $package on a different machine or from a different object
14850 directory, copy the Policy.sh file from this object directory to the
14851 new one before you run Configure -- this will help you with most of
14852 the policy defaults.
14856 if $test -f config.msg; then
14857 echo "Hmm. I also noted the following information while running:"
14859 $cat config.msg >&4
14862 $rm -f kit*isdone ark*isdone