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 Tue Jan 25 16:35:03 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
674 inc_version_list_init=''
694 ignore_versioned_solibs=''
852 d_stdio_stream_array=''
853 stdio_stream_array=''
897 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
900 : We must find out about Eunice early
902 if test -f /etc/unixtovms; then
903 eunicefix=/etc/unixtovms
905 if test -f /etc/unixtovms.exe; then
906 eunicefix=/etc/unixtovms.exe
910 : list of known cpp symbols, sorted alphabetically
911 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
912 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
913 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
914 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
915 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
916 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
917 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
918 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
919 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
920 al="$al VMS Xenix286"
921 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
922 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
923 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
924 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
925 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
926 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
927 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
928 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
929 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
930 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
931 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
932 al="$al __SVR4_2__ __UMAXV__"
933 al="$al ____386BSD____ __alpha __alpha__ __amiga"
934 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
935 al="$al __host_mips__"
936 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
937 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
938 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
939 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
940 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
941 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
942 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
943 al="$al __mc88100 __mc88100__ __mips __mips__"
944 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
945 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
946 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
947 al="$al _host_mips _mips _unix"
948 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
949 al="$al apollo ardent att386 att3b"
950 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
951 al="$al cadmus clipper concurrent convex cray ctix"
952 al="$al dmert encore gcos gcx gimpel gould"
953 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
954 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
955 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
956 al="$al i186 i286 i386 i486 i8086"
957 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
958 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
959 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
960 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
961 al="$al mc88000 mc88100 merlin mert mips mvs n16"
962 al="$al ncl_el ncl_mr"
963 al="$al news1500 news1700 news1800 news1900 news3700"
964 al="$al news700 news800 news900 ns16000 ns32000"
965 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
966 al="$al parisc pc532 pdp11 plexus posix pyr"
967 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
968 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
969 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
970 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
971 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
972 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
975 : set useposix=false in your hint file to disable the POSIX extension.
977 : set useopcode=false in your hint file to disable the Opcode extension.
979 : Trailing extension. Override this in a hint file, if needed.
981 : Extra object files, if any, needed on this platform.
983 : Possible local include directories to search.
984 : Set locincpth to "" in a hint file to defeat local include searches.
985 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
986 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
988 : no include file wanted by default
992 : change the next line if compiling for Xenix/286 on Xenix/386
993 xlibpth='/usr/lib/386 /lib/386'
995 : Possible local library directories to search.
996 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
997 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
999 : general looking path for locating libraries
1000 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
1001 glibpth="$glibpth /lib /usr/lib $xlibpth"
1002 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
1003 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1005 : Private path used by Configure to find libraries. Its value
1006 : is prepended to libpth. This variable takes care of special
1007 : machines, like the mips. Usually, it should be empty.
1010 : default library list
1012 : some systems want to use only the non-versioned libso:s
1013 ignore_versioned_solibs=''
1014 : set usemultiplicity on the Configure command line to enable multiplicity.
1015 : set usesocks on the Configure command line to enable socks.
1016 : set usethreads on the Configure command line to enable threads.
1017 : full support for void wanted by default
1020 : List of libraries we want.
1021 : If anyone needs -lnet, put it in a hint file.
1022 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1023 libswanted="$libswanted dld ld sun m c cposix posix"
1024 libswanted="$libswanted ndir dir crypt sec"
1025 libswanted="$libswanted ucb bsd BSD PW x"
1026 : We probably want to search /usr/shlib before most other libraries.
1027 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1028 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1029 glibpth="/usr/shlib $glibpth"
1030 : Do not use vfork unless overridden by a hint file.
1033 : Find the basic shell for Bourne shell scripts
1037 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1040 if test -f "$xxx"; then
1043 : Build up a list and do a single loop so we can 'break' out.
1044 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1045 for xxx in sh bash ksh pdksh ash; do
1047 try="$try ${p}/${xxx}"
1051 if test -f "$xxx"; then
1054 elif test -f "$xxx.exe"; then
1065 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1067 Usually it's in /bin/sh. How did you even get this far?
1068 Please contact me (Perl Maintainers) at perlbug@perl.com and
1069 we'll try to straighten this all out.
1075 : see if sh knows # comments
1076 if `$sh -c '#' >/dev/null 2>&1`; then
1080 test -f $xcat || xcat=/usr/bin/cat
1085 if test -s today; then
1088 echo "#! $xcat" > try
1092 if test -s today; then
1100 echo "Your $sh doesn't grok # comments--I will strip them later on."
1103 echo "exec grep -v '^[ ]*#'" >spitshell
1105 $eunicefix spitshell
1106 spitshell=`pwd`/spitshell
1108 echo "I presume that if # doesn't work, #! won't work either!"
1113 : figure out how to guarantee sh startup
1115 '') startsh=${sharpbang}${sh} ;;
1127 : echo "Yup, it does."
1129 echo "Hmm... '$startsh' does not guarantee sh startup..."
1130 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1135 : Save command line options in file UU/cmdline.opt for later use in
1136 : generating config.sh.
1137 cat > cmdline.opt <<EOSH
1138 # Configure command line arguments.
1145 cat >>cmdline.opt <<EOSH
1146 config_arg$argn='$arg'
1148 argn=`expr $argn + 1`
1151 : produce awk script to parse command line options
1152 cat >options.awk <<'EOF'
1154 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1156 len = length(optstr);
1157 for (i = 1; i <= len; i++) {
1158 c = substr(optstr, i, 1);
1159 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1170 if (substr(str, 1, 1) != "-") {
1171 printf("'%s'\n", str);
1175 for (i = 2; i <= len; i++) {
1176 c = substr(str, i, 1);
1178 printf("-%s\n", substr(str, i));
1184 printf("'%s'\n", substr(str, i + 1));
1197 : process the command line options
1198 set X `for arg in "$@"; do echo "X$arg"; done |
1199 sed -e s/X// | awk -f options.awk`
1204 : set up default values
1214 rm -f optdef.sh posthint.sh
1215 cat >optdef.sh <<EOS
1221 while test $# -gt 0; do
1223 -d) shift; fastread=yes;;
1224 -e) shift; alldone=cont;;
1228 if test -r "$1"; then
1231 echo "$me: cannot read config file $1." >&2
1236 -h) shift; error=true;;
1237 -r) shift; reuseval=true;;
1238 -s) shift; silent=true; realsilent=true;;
1239 -E) shift; alldone=exit;;
1240 -K) shift; knowitall=true;;
1241 -O) shift; override=true;;
1242 -S) shift; silent=true; extractsh=true;;
1247 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1248 echo "$me: ignoring -D $1" >&2
1251 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1252 *) echo "$1='define'" >> optdef.sh;;
1259 *=) echo "$1" >> optdef.sh;;
1261 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1262 echo "$me: ignoring -U $1" >&2
1264 *) echo "$1='undef'" >> optdef.sh;;
1275 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1279 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1286 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1287 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1288 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1289 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1290 *) xxx=`echo $yyy|sed 's!:.*!!'`
1291 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1297 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=''" >> posthint.sh ;;
1304 echo "$yyy='$zzz'" >> posthint.sh ;;
1306 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1308 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1313 echo "$yyy=$zzz" >> posthint.sh ;;
1314 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1317 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1320 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1328 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1329 [-U symbol] [-U symbol=] [-A command:symbol...]
1330 -d : use defaults for all answers.
1331 -e : go on without questioning past the production of config.sh.
1332 -f : specify an alternate default configuration file.
1333 -h : print this help message and exit (with an error status).
1334 -r : reuse C symbols value if possible (skips costly nm extraction).
1335 -s : silent mode, only echoes questions and essential information.
1336 -D : define symbol to have some value:
1337 -D symbol symbol gets the value 'define'
1338 -D symbol=value symbol gets the value 'value'
1339 -E : stop at the end of questions, after having produced config.sh.
1340 -K : do not use unless you know what you are doing.
1341 -O : let -D and -U override definitions from loaded configuration file.
1342 -S : perform variable substitutions on all .SH files (can mix with -f)
1343 -U : undefine symbol:
1344 -U symbol symbol gets the value 'undef'
1345 -U symbol= symbol gets completely empty
1346 -A : manipulate symbol after the platform specific hints have been applied:
1347 -A symbol=value append " "value to symbol
1348 -A append:symbol=value append value to symbol
1349 -A define:symbol=value define symbol to have value
1350 -A clear:symbol define symbol to be ''
1351 -A define:symbol define symbol to be 'define'
1352 -A eval:symbol=value define symbol to be eval of value
1353 -A prepend:symbol=value prepend value to symbol
1354 -A undef:symbol define symbol to be 'undef'
1355 -A undef:symbol= define symbol to be ''
1356 -V : print version number and exit (with a zero status).
1363 case "$fastread$alldone" in
1366 if test ! -t 0; then
1367 echo "Say 'sh Configure', not 'sh <Configure'"
1375 true) exec 1>/dev/null;;
1378 : run the defines and the undefines, if any, but leave the file out there...
1381 : create the posthint manipulation script and leave the file out there...
1386 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1387 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1388 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1389 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1390 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1393 : Some greps do not return status, grrr.
1394 echo "grimblepritz" >grimble
1395 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1397 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1403 : the following should work in any shell
1407 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1408 cat >contains <<'EOSS'
1409 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1414 : Find the path to the source tree
1417 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1420 *) src=`cd ../$src && pwd` ;;
1433 if test -f $rsrc/Configure && \
1434 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1436 : found it, so we are ok.
1439 for src in . .. ../.. ../../.. ../../../..; do
1440 if test -f ../$src/Configure && \
1441 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1452 Sorry, I can't seem to locate the source dir for $package. Please start
1453 Configure with an explicit path -- i.e. /some/path/Configure.
1461 echo "Sources for $package found in \"$src\"." >&4
1465 : script used to extract .SH files with variable substitutions
1466 cat >extract <<'EOS'
1468 echo "Doing variable substitutions on .SH files..."
1469 if test -f $src/MANIFEST; then
1470 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1472 echo "(Looking for .SH files under the source directory.)"
1473 set x `(cd $src; find . -name "*.SH" -print)`
1477 0) set x `(cd $src; echo *.SH)`; shift;;
1479 if test ! -f $src/$1; then
1485 while test $name; do
1486 if test ! -d "$name"; then
1487 create="$name $create";
1488 name=`echo $name | sed -e "s|^[^/]*$||"`;
1489 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1494 for file in $create; do
1503 dir=`expr X$file : 'X\(.*\)/'`
1504 file=`expr X$file : 'X.*/\(.*\)'`
1505 (cd $dir && . ./$file)
1515 dir=`expr X$file : 'X\(.*\)/'`
1516 file=`expr X$file : 'X.*/\(.*\)'`
1517 (set x $dir; shift; eval $mkdir_p)
1527 if test -f $src/config_h.SH; then
1528 if test ! -f config.h; then
1529 : oops, they left it out of MANIFEST, probably, so do it anyway.
1535 : extract files and exit if asked to do so
1536 case "$extractsh" in
1538 case "$realsilent" in
1542 case "$config_sh" in
1543 '') config_sh='config.sh';;
1546 echo "Fetching answers from $config_sh..."
1549 test "$override" && . ./optdef.sh
1558 : Eunice requires " " instead of "", can you believe it
1561 echo "Beginning of configuration questions for $package."
1563 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1565 : first determine how to suppress newline on echo command
1567 echo "Checking echo to see how to suppress newlines..."
1568 (echo "hi there\c" ; echo " ") >.echotmp
1569 if $contains c .echotmp >/dev/null 2>&1 ; then
1580 echo $n "The star should be here-->$c"
1584 : Now test for existence of everything in MANIFEST
1586 if test -f $rsrc/MANIFEST; then
1587 echo "First let's make sure your kit is complete. Checking..." >&4
1588 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1591 for filelist in x??; do
1592 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1594 if test -s missing; then
1598 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1600 You have the option of continuing the configuration process, despite the
1601 distinct possibility that your kit is damaged, by typing 'y'es. If you
1602 do, don't blame me if something goes wrong. I advise you to type 'n'o
1603 and contact the author (perlbug@perl.com).
1606 echo $n "Continue? [n] $c" >&4
1610 echo "Continuing..." >&4
1614 echo "ABORTING..." >&4
1619 echo "Looks good..."
1622 echo "There is no MANIFEST file. I hope your kit is complete !"
1627 : Find the appropriate value for a newline for tr
1628 if test -n "$DJGPP"; then
1631 if test X"$trnl" = X; then
1632 case "`echo foo|tr '\n' x 2>/dev/null`" in
1636 if test X"$trnl" = X; then
1637 case "`echo foo|tr '\012' x 2>/dev/null`" in
1638 foox) trnl='\012' ;;
1641 if test X"$trnl" = X; then
1644 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1650 : compute the number of columns on the terminal for proper question formatting
1655 : set up the echo used in my read
1656 myecho="case \"\$xxxm\" in
1657 '') echo $n \"\$rp $c\" >&4;;
1659 '') echo $n \"[\$xxxm] $c\";;
1661 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1663 echo $n \"[\$xxxm] $c\" >&4
1665 echo $n \"\$rp [\$xxxm] $c\" >&4
1671 : now set up to do reads with possible shell escape and default assignment
1677 case "\$fastread" in
1678 yes) case "\$dflt" in
1681 case "\$silent-\$rp" in
1686 *) case "\$silent" in
1687 true) case "\$rp" in
1692 while expr "X\$ans" : "X!" >/dev/null; do
1696 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1704 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1713 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1718 echo "(OK, I'll run with -d after this question.)" >&4
1721 echo "*** Sorry, \$1 not supported yet." >&4
1731 echo "*** Substitution done -- please confirm."
1733 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1738 echo "*** Error -- try again."
1745 case "\$ans\$xxxm\$nostick" in
1757 : create .config dir to save info across Configure sessions
1758 test -d ../.config || mkdir ../.config
1759 cat >../.config/README <<EOF
1760 This directory created by Configure to save information that should
1761 persist across sessions for $package.
1763 You may safely delete it if you wish.
1766 : general instructions
1769 user=`(logname) 2>/dev/null`
1771 '') user=`whoami 2>&1`;;
1773 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1776 rp='Would you like to see the instructions?'
1787 This installation shell script will examine your system and ask you questions
1788 to determine how the perl5 package should be installed. If you get
1789 stuck on a question, you may use a ! shell escape to start a subshell or
1790 execute a command. Many of the questions will have default answers in square
1791 brackets; typing carriage return will give you the default.
1793 On some of the questions which ask for file or directory names you are allowed
1794 to use the ~name construct to specify the login directory belonging to "name",
1795 even if you don't have a shell which knows about that. Questions where this is
1796 allowed will be marked "(~name ok)".
1800 dflt='Type carriage return to continue'
1804 The prompter used in this script allows you to use shell variables and
1805 backticks in your answers. You may use $1, $2, etc... to refer to the words
1806 in the default answer, as if the default line was a set of arguments given to a
1807 script shell. This means you may also use $* to repeat the whole default line,
1808 so you do not have to re-type everything to add something to the default.
1810 Everytime there is a substitution, you will have to confirm. If there is an
1811 error (e.g. an unmatched backtick), the default answer will remain unchanged
1812 and you will be prompted again.
1814 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1815 the questions and use the computed defaults (or the previous answers if there
1816 was already a config.sh file). Type 'Configure -h' for a list of options.
1817 You may also start interactively and then answer '& -d' at any prompt to turn
1818 on the non-interactive behaviour for the remainder of the execution.
1824 Much effort has been expended to ensure that this shell script will run on any
1825 Unix system. If despite that it blows up on yours, your best bet is to edit
1826 Configure and run it again. If you can't run Configure for some reason,
1827 you'll have to generate a config.sh file by hand. Whatever problems you
1828 have, let me (perlbug@perl.com) know how I blew it.
1830 This installation script affects things in two ways:
1832 1) it may do direct variable substitutions on some of the files included
1834 2) it builds a config.h file for inclusion in C programs. You may edit
1835 any of these files as the need arises after running this script.
1837 If you make a mistake on a question, there is no easy way to back up to it
1838 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1839 files. Configure will offer to let you do this before it runs the SH files.
1842 dflt='Type carriage return to continue'
1844 case "$firsttime" in
1845 true) echo $user >>../.config/instruct;;
1849 : find out where common programs are
1851 echo "Locating common programs..." >&4
1864 if test -d \$dir/\$thing; then
1870 for thisthing in \$dir/\$thing; do
1871 : just loop through to pick last item
1873 if test -f \$thisthing; then
1876 elif test -f \$dir/\$thing.exe; then
1877 if test -n "$DJGPP"; then
1878 echo \$dir/\$thing.exe
1880 : on Eunice apparently
1931 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1932 pth="$pth /lib /usr/lib"
1933 for file in $loclist; do
1937 if test -f "$xxx"; then
1940 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1941 xxx=`./loc $file $file $pth`
1944 '') xxx=`./loc $file $file $pth`;;
1945 *) xxx=`./loc $xxx $xxx $pth`;;
1951 echo $file is in $xxx.
1954 echo $file is in $xxx.
1957 echo "I don't know where '$file' is, and my life depends on it." >&4
1958 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1964 echo "Don't worry if any of the following aren't found..."
1966 for file in $trylist; do
1970 if test -f "$xxx"; then
1973 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1974 xxx=`./loc $file $file $pth`
1977 '') xxx=`./loc $file $file $pth`;;
1978 *) xxx=`./loc $xxx $xxx $pth`;;
1984 echo $file is in $xxx.
1987 echo $file is in $xxx.
1990 echo "I don't see $file out there, $say."
1997 echo "Substituting grep for egrep."
2003 echo "Substituting cp for ln."
2009 echo "Hopefully test is built into your sh."
2012 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2013 echo "Using the test built into your sh."
2021 echo "Hopefully echo is built into your sh."
2026 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2027 $echo $n "hi there$c" >foo1
2028 echo $n "hi there$c" >foo2
2029 if cmp foo1 foo2 >/dev/null 2>&1; then
2030 echo "They are compatible. In fact, they may be identical."
2037 They are not compatible! You are probably running ksh on a non-USG system.
2038 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2039 have echo built in and we may have to run some Bourne shell scripts. That
2040 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2043 $echo $n "The star should be here-->$c"
2050 : determine whether symbolic links are supported
2053 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2054 echo "Symbolic links are supported." >&4
2057 echo "Symbolic links are NOT supported." >&4
2062 : see whether [:lower:] and [:upper:] are supported character classes
2064 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2066 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2070 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2071 # (0xc9 and 0xd1), therefore that is a nice testing point.
2072 if test "X$up" = X -o "X$low" = X; then
2073 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2079 if test "X$up" = X -o "X$low" = X; then
2080 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2086 if test "X$up" = X -o "X$low" = X; then
2087 case "`echo IJ | od -x 2>/dev/null`" in
2089 echo "Hey, this might be EBCDIC." >&4
2090 if test "X$up" = X -o "X$low" = X; then
2091 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2092 ij) up='[A-IJ-RS-Z]'
2097 if test "X$up" = X -o "X$low" = X; then
2098 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2108 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2110 echo "Using $up and $low to convert case." >&4
2113 echo "I don't know how to translate letters from upper to lower case." >&4
2114 echo "Your tr is not acting any way I know of." >&4
2118 : set up the translation script tr, must be called with ./tr of course
2122 '[A-Z][a-z]') exec $tr '$up' '$low';;
2123 '[a-z][A-Z]') exec $tr '$low' '$up';;
2130 : Try to determine whether config.sh was made on this system
2131 case "$config_sh" in
2133 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2134 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2135 # because the A-Z/a-z are not consecutive.
2136 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2137 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2138 newmyuname="$myuname"
2140 case "$knowitall" in
2142 if test -f ../config.sh; then
2143 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2144 eval "`grep myuname= ../config.sh`"
2146 if test "X$myuname" = "X$newmyuname"; then
2154 : Get old answers from old config file if Configure was run on the
2155 : same system, otherwise use the hints.
2158 if test -f config.sh; then
2160 rp="I see a config.sh file. Shall I use it to set the defaults?"
2163 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2164 *) echo "Fetching default answers from your old config.sh file..." >&4
2172 : Older versions did not always set $sh. Catch re-use of such
2181 if test ! -f config.sh; then
2184 First time through, eh? I have some defaults handy for some systems
2185 that need some extra help getting the Configure answers right:
2188 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2190 : Half the following guesses are probably wrong... If you have better
2191 : tests or hints, please send them to perlbug@perl.com
2192 : The metaconfig authors would also appreciate a copy...
2193 $test -f /irix && osname=irix
2194 $test -f /xenix && osname=sco_xenix
2195 $test -f /dynix && osname=dynix
2196 $test -f /dnix && osname=dnix
2197 $test -f /lynx.os && osname=lynxos
2198 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2199 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2200 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2201 $test -f /bin/mips && /bin/mips && osname=mips
2202 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2203 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2204 $test -d /usr/apollo/bin && osname=apollo
2205 $test -f /etc/saf/_sactab && osname=svr4
2206 $test -d /usr/include/minix && osname=minix
2207 if $test -d /MachTen -o -d /MachTen_Folder; then
2209 if $test -x /sbin/version; then
2210 osvers=`/sbin/version | $awk '{print $2}' |
2211 $sed -e 's/[A-Za-z]$//'`
2212 elif $test -x /usr/etc/version; then
2213 osvers=`/usr/etc/version | $awk '{print $2}' |
2214 $sed -e 's/[A-Za-z]$//'`
2220 $test -f /sys/posix.dll &&
2221 $test -f /usr/bin/what &&
2222 set X `/usr/bin/what /sys/posix.dll` &&
2223 $test "$3" = UWIN &&
2227 if $test -f $uname; then
2235 umips) osname=umips ;;
2238 [23]100) osname=mips ;;
2239 next*) osname=next ;;
2241 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2242 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2245 elif $test -f /etc/kconfig; then
2247 if test "$lns" = "$ln -s"; then
2249 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2251 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2258 if test -n "$DJGPP"; then
2267 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2269 'not found') osvers="$4"."$3" ;;
2270 '<3240'|'<>3240') osvers=3.2.0 ;;
2271 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2272 '=3250'|'>3250') osvers=3.2.5 ;;
2276 bsd386) osname=bsd386
2279 cygwin*) osname=cygwin
2282 *dc.osx) osname=dcosx
2288 domainos) osname=apollo
2294 dynixptx*) osname=dynixptx
2295 osvers=`echo "$4"|sed 's/^v//'`
2297 freebsd) osname=freebsd
2299 genix) osname=genix ;;
2301 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2317 netbsd*) osname=netbsd
2320 news-os) osvers="$3"
2322 4*) osname=newsos4 ;;
2326 next*) osname=next ;;
2327 POSIX-BC | posix-bc ) osname=posix-bc
2330 powerux | power_ux | powermax_os | powermaxos | \
2331 powerunix | power_unix) osname=powerux
2337 solaris) osname=solaris
2339 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2346 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2350 titanos) osname=titanos
2359 ultrix) osname=ultrix
2362 osf1|mls+) case "$5" in
2365 osvers=`echo "$3" | sed 's/^[xvt]//'`
2367 hp*) osname=hp_osf1 ;;
2368 mips) osname=mips_osf1 ;;
2371 unixware) osname=svr5
2377 $2) case "$osname" in
2381 : svr4.x or possibly later
2391 if test -f /stand/boot ; then
2392 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2393 if test -n "$INITPROG" -a -f "$INITPROG"; then
2394 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2395 if test -n "$isesix"; then
2403 *) if test -f /etc/systemid; then
2405 set `echo $3 | $sed 's/\./ /g'` $4
2406 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2408 elif $test -f $src/hints/sco_$1_$2.sh; then
2410 elif $test -f $src/hints/sco_$1.sh; then
2415 '') : Still unknown. Probably a generic Sys V.
2424 *) case "$osname" in
2425 '') : Still unknown. Probably a generic BSD.
2433 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2434 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2435 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2438 $rm -f UU/kernel.what
2439 elif test -d c:/.; then
2446 : Now look for a hint file osname_osvers, unless one has been
2447 : specified already.
2450 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2451 : Also try without trailing minor version numbers.
2452 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2453 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2454 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2455 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2458 *) case "$osvers" in
2461 *) if $test -f $src/hints/$file.sh ; then
2463 elif $test -f $src/hints/$xfile.sh ; then
2465 elif $test -f $src/hints/$xxfile.sh ; then
2467 elif $test -f $src/hints/$xxxfile.sh ; then
2469 elif $test -f $src/hints/$xxxxfile.sh ; then
2471 elif $test -f "$src/hints/${osname}.sh" ; then
2480 if $test -f Policy.sh ; then
2483 none) dflt="Policy" ;;
2484 *) dflt="Policy $dflt" ;;
2489 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2493 if $test -f Policy.sh ; then
2496 There's also a Policy hint file available, which should make the
2497 site-specific (policy) questions easier to answer.
2504 You may give one or more space-separated answers, or "none" if appropriate.
2505 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2506 is a good thing. DO NOT give a wrong version or a wrong OS.
2510 rp="Which of these apply, if any?"
2513 for file in $tans; do
2514 if $test X$file = XPolicy -a -f Policy.sh; then
2516 $cat Policy.sh >> UU/config.sh
2517 elif $test -f $src/hints/$file.sh; then
2518 . $src/hints/$file.sh
2519 $cat $src/hints/$file.sh >> UU/config.sh
2520 elif $test X$tans = X -o X$tans = Xnone ; then
2523 : Give one chance to correct a possible typo.
2524 echo "$file.sh does not exist"
2526 rp="hint to use instead?"
2528 for file in $ans; do
2529 if $test -f "$src/hints/$file.sh"; then
2530 . $src/hints/$file.sh
2531 $cat $src/hints/$file.sh >> UU/config.sh
2532 elif $test X$ans = X -o X$ans = Xnone ; then
2535 echo "$file.sh does not exist -- ignored."
2542 : Remember our hint file for later.
2543 if $test -f "$src/hints/$file.sh" ; then
2553 echo "Fetching default answers from $config_sh..." >&4
2557 cp $config_sh config.sh 2>/dev/null
2567 test "$override" && . ./optdef.sh
2568 myuname="$newmyuname"
2570 : Restore computed paths
2571 for file in $loclist $trylist; do
2572 eval $file="\$_$file"
2577 Configure uses the operating system name and version to set some defaults.
2578 The default value is probably right if the name rings a bell. Otherwise,
2579 since spelling matters for me, either accept the default or answer "none"
2586 ''|' '|none) dflt=none ;;
2587 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2590 *) dflt="$osname" ;;
2592 rp="Operating system name?"
2596 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2602 ''|' '|none) dflt=none ;;
2603 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2604 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2606 ''|' ') dflt=none ;;
2611 *) dflt="$osvers" ;;
2613 rp="Operating system version?"
2623 : who configured the system
2624 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2625 cf_by=`(logname) 2>/dev/null`
2628 cf_by=`(whoami) 2>/dev/null`
2630 "") cf_by=unknown ;;
2634 : set up the script used to warn in case of inconsistency
2641 echo "*** WHOA THERE!!! ***" >&4
2642 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2643 rp=" Keep the $hint value?"
2646 y) td=$was; tu=$was;;
2650 : function used to set $1 to $val
2651 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2653 $define$undef) . ./whoa; eval "$var=\$td";;
2654 $undef$define) . ./whoa; eval "$var=\$tu";;
2655 *) eval "$var=$val";;
2660 Perl can be built to take advantage of threads, on some systems.
2661 To do so, Configure must be run with -Dusethreads.
2663 Note that threading is a highly experimental feature, and
2664 some known race conditions still remain. If you choose to try
2665 it, be very sure to not actually deploy it for production
2666 purposes. README.threads has more details, and is required
2667 reading if you enable threads.
2669 case "$usethreads" in
2670 $define|true|[yY]*) dflt='y';;
2673 rp='Build a threading Perl?'
2676 y|Y) val="$define" ;;
2682 case "$usethreads" in
2686 As of 5.5.640, Perl has two different internal threading implementations,
2687 the 5.005 version (5005threads) and an interpreter-based version
2688 (ithreads) that has one interpreter per thread. Both are very
2689 experimental. This arrangement exists to help developers work out
2690 which one is better.
2692 : Default to ithreads unless overridden on command line or with
2695 case "$use5005threads" in
2696 $define|true|[yY]*) dflt='n';;
2698 case "$useithreads" in
2699 $undef|false|[nN]*) dflt='n';;
2701 rp='Use interpreter-based ithreads?'
2704 y|Y) val="$define" ;;
2709 : Now set use5005threads to the opposite value.
2710 case "$useithreads" in
2711 $define) val="$undef" ;;
2718 useithreads="$undef"
2719 use5005threads="$undef"
2723 case "$d_oldpthreads" in
2724 '') : Configure tests would be welcome here. For now, assume undef.
2726 *) val="$d_oldpthreads" ;;
2732 case "$usethreads" in
2733 "$define"|true|[yY]*)
2734 : Look for a hint-file generated 'call-back-unit'. If the
2735 : user has specified that a threading perl is to be built,
2736 : we may need to set or change some other defaults.
2737 if $test -f usethreads.cbu; then
2738 echo "Your platform has some specific hints for threaded builds, using them..."
2742 (Your platform doesn't have any specific hints for threaded builds.
2743 Assuming POSIX threads, then.)
2751 Perl can be built so that multiple Perl interpreters can coexist
2752 within the same Perl executable.
2755 case "$useithreads" in
2758 This multiple interpreter support is required for interpreter-based threads.
2763 echo 'Normally you do not need this and you should answer no.'
2764 case "$usemultiplicity" in
2765 $define|true|[yY]*) dflt='y';;
2768 rp='Build Perl for multiplicity?'
2771 y|Y) val="$define" ;;
2779 : determine where manual pages are on this system
2783 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2784 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2785 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2786 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2787 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2788 sysman=`./loc . /usr/man/man1 $syspath`
2791 if $test -d "$sysman"; then
2792 echo "System manual is in $sysman." >&4
2794 echo "Could not find manual pages in source form." >&4
2797 : see what memory models we can support
2800 $cat >pdp11.c <<'EOP'
2809 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2810 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2811 dflt='unsplit split'
2813 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2816 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2821 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2824 if $test -d /lib/large || $test -d /usr/lib/large; then
2827 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2836 Some systems have different model sizes. On most systems they are called
2837 small, medium, large, and huge. On the PDP11 they are called unsplit and
2838 split. If your system doesn't support different memory models, say "none".
2839 If you wish to force everything to one memory model, say "none" here and
2840 put the appropriate flags later when it asks you for other cc and ld flags.
2841 Venix systems may wish to put "none" and let the compiler figure things out.
2842 (In the following question multiple model names should be space separated.)
2844 The default for most systems is "none".
2847 rp="Which memory models are supported?"
2862 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2863 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2870 rp="What flag indicates separate I and D space?"
2878 *large*|*small*|*medium*|*huge*)
2885 rp="What flag indicates large model?"
2895 *huge*) case "$huge" in
2899 rp="What flag indicates huge model?"
2909 *medium*) case "$medium" in
2913 rp="What flag indicates medium model?"
2920 *) medium="$large";;
2923 *small*) case "$small" in
2927 rp="What flag indicates small model?"
2938 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2941 $rm -f pdp11.* pdp11
2943 : make some quick guesses about what we are up against
2945 $echo $n "Hmm... $c"
2955 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2956 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2958 echo "Looks kind of like an OSF/1 system, but we'll see..."
2960 elif test `echo abc | tr a-z A-Z` = Abc ; then
2961 xxx=`./loc addbib blurfl $pth`
2962 if $test -f $xxx; then
2963 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2967 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2968 echo "Looks kind of like an extended USG system, but we'll see..."
2970 echo "Looks kind of like a USG system, but we'll see..."
2974 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2975 echo "Looks kind of like a BSD system, but we'll see..."
2979 echo "Looks kind of like a Version 7 system, but we'll see..."
2982 case "$eunicefix" in
2985 There is, however, a strange, musty smell in the air that reminds me of
2986 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2990 : it so happens the Eunice I know will not run shell scripts in Unix format
2994 echo "Congratulations. You aren't running Eunice."
2998 : Detect OS2. The p_ variable is set above in the Head.U unit.
3003 I have the feeling something is not exactly right, however...don't tell me...
3004 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3009 if test -f /xenix; then
3010 echo "Actually, this looks more like a XENIX system..."
3015 echo "It's not Xenix..."
3020 if test -f /venix; then
3021 echo "Actually, this looks more like a VENIX system..."
3028 echo "Nor is it Venix..."
3031 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3032 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3035 : see if we need a special compiler
3043 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3044 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3058 On some older systems the default C compiler will not resolve multiple global
3059 references that happen to have the same name. On some such systems the "Mcc"
3060 command may be used to force these to be resolved. On other systems a "cc -M"
3061 command is required. (Note that the -M flag on other systems indicates a
3062 memory model to use!) If you have the Gnu C compiler, you might wish to use
3068 rp="Use which C compiler?"
3076 rp="Use which C compiler?"
3080 : Look for a hint-file generated 'call-back-unit'. Now that the
3081 : user has specified the compiler, we may need to set or change some
3083 if $test -f cc.cbu; then
3087 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3088 $cat >gccvers.c <<EOM
3093 printf("%s\n", __VERSION__);
3095 printf("%s\n", "1");
3101 if $cc -o gccvers gccvers.c; then
3102 gccversion=`./gccvers`
3103 case "$gccversion" in
3104 '') echo "You are not using GNU cc." ;;
3105 *) echo "You are using GNU cc $gccversion."
3110 echo "*** WHOA THERE!!! ***" >&4
3111 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3112 case "$knowitall" in
3114 echo " You'd better start hunting for one and let me know about it." >&4
3120 case "$gccversion" in
3121 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3124 : decide how portable to be. Allow command line overrides.
3125 case "$d_portable" in
3127 *) d_portable="$define" ;;
3130 : set up shell script to do ~ expansion
3136 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3139 if $test -f /bin/csh; then
3140 /bin/csh -f -c "glob \$1"
3145 name=\`$expr x\$1 : '..\([^/]*\)'\`
3146 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3147 if $test ! -d "\$dir"; then
3149 echo "\$me: can't locate home directory for: \$name" >&2
3154 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3170 : now set up to get a file name
3174 cat <<'EOSC' >>getfile
3190 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3191 fn=`echo $fn | sed 's/(.*)//'`
3197 loc_file=`expr $fn : '.*:\(.*\)'`
3198 fn=`expr $fn : '\(.*\):.*'`
3206 */*) fullpath=true;;
3215 *e*) exp_file=true;;
3218 *p*) nopath_ok=true;;
3223 *d*) type='Directory';;
3224 *l*) type='Locate';;
3229 Locate) what='File';;
3234 case "$d_portable" in
3242 while test "$type"; do
3247 true) rp="$rp (~name ok)";;
3250 if test -f UU/getfile.ok && \
3251 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3270 value=`UU/filexp $ans`
3273 if test "$ans" != "$value"; then
3274 echo "(That expands to $value on this system.)"
3288 /*) value="$ansexp" ;;
3293 echo "I shall only accept a full path name, as in /bin/ls." >&4
3294 echo "Use a ! shell escape if you wish to check pathnames." >&4
3297 echo "Please give a full path name, starting with slash." >&4
3300 echo "Note that using ~name is ok provided it expands well." >&4
3313 for fp in $gfpth; do
3314 if test "X$fp" = X.; then
3319 if test -f "$pf"; then
3321 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3323 echo "($value is not a plain file, but that's ok.)"
3326 if test X"$type" = X; then
3333 for fp in $gfpth; do
3334 if test "X$fp" = X.; then
3339 if test -d "$pf"; then
3347 if test -d "$ansexp"; then
3348 echo "(Looking for $loc_file in directory $value.)"
3349 value="$value/$loc_file"
3350 ansexp="$ansexp/$loc_file"
3352 if test -f "$ansexp"; then
3355 case "$nopath_ok" in
3356 true) case "$value" in
3358 *) echo "Assuming $value will be in people's path."
3374 if test "$fastread" = yes; then
3379 rp="$what $value doesn't exist. Use that name anyway?"
3398 test "X$gfpthkeep" != Xy && gfpth=""
3401 : What should the include directory be ?
3403 $echo $n "Hmm... $c"
3407 if $test -f /bin/mips && /bin/mips; then
3408 echo "Looks like a MIPS system..."
3409 $cat >usr.c <<'EOCP'
3410 #ifdef SYSTYPE_BSD43
3414 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3415 dflt='/bsd43/usr/include'
3419 mips_type='System V'
3421 $rm -f usr.c usr.out
3422 echo "and you're compiling with the $mips_type compiler and libraries."
3426 echo "Doesn't look like a MIPS system."
3436 case "$xxx_prompt" in
3439 rp='Where are the include files you want to use?'
3447 : see how we invoke the C preprocessor
3449 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3450 cat <<'EOT' >testcpp.c
3456 if test ! -f cppstdin; then
3457 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3458 # AIX cc -E doesn't show the absolute headerfile
3459 # locations but we'll cheat by using the -M flag.
3460 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
3462 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3465 echo "Keeping your $hint cppstdin wrapper."
3468 wrapper=`pwd`/cppstdin
3472 if $test "X$cppstdin" != "X" && \
3473 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3476 echo "You used to use $cppstdin $cppminus so we'll use that again."
3478 '') echo "But let's see if we can live without a wrapper..." ;;
3480 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3481 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3483 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3486 echo "(However, $cpprun $cpplast does not work, let's see...)"
3494 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3501 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3502 $cc -E <testcpp.c >testcpp.out 2>&1; \
3503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3504 echo "Yup, it does."
3507 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3508 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3510 echo "Yup, it does."
3513 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3514 $cc -P <testcpp.c >testcpp.out 2>&1; \
3515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3516 echo "Yipee, that works!"
3519 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3520 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3522 echo "At long last!"
3525 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3526 $cpp <testcpp.c >testcpp.out 2>&1; \
3527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3531 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3532 $cpp - <testcpp.c >testcpp.out 2>&1; \
3533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3534 echo "Hooray, it works! I was beginning to wonder."
3537 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3538 $wrapper <testcpp.c >testcpp.out 2>&1; \
3539 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3545 rp="No dice. I can't find a C preprocessor. Name one:"
3549 $x_cpp <testcpp.c >testcpp.out 2>&1
3550 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3551 echo "OK, that will do." >&4
3553 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3568 echo "Perhaps can we force $cc -E using a wrapper..."
3569 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3570 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3576 echo "Nope, we'll have to live without it..."
3590 "$wrapper"|'cppstdin') ;;
3591 *) $rm -f $wrapper;;
3593 $rm -f testcpp.c testcpp.out
3595 : Set private lib path
3598 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3603 '') dlist="$loclibpth $plibpth $glibpth";;
3604 *) dlist="$libpth";;
3607 : Now check and see which directories actually exist, avoiding duplicates
3611 if $test -d $xxx; then
3614 *) libpth="$libpth $xxx";;
3620 Some systems have incompatible or broken versions of libraries. Among
3621 the directories listed in the question below, please remove any you
3622 know not to be holding relevant libraries, and add any that are needed.
3623 Say "none" for none.
3634 rp="Directories to use for library searches?"
3641 : compute shared library extension
3644 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3654 On some systems, shared libraries may be available. Answer 'none' if
3655 you want to suppress searching of shared libraries for the remainder
3656 of this configuration.
3659 rp='What is the file extension used for shared libraries?'
3663 : Define several unixisms.
3664 : Hints files or command line option can be used to override them.
3665 : The convoluted testing is in case hints files set either the old
3668 '') case "$exe_ext" in
3670 *) _exe="$exe_ext" ;;
3675 '') case "$lib_ext" in
3682 '') case "$obj_ext" in
3689 '') case "$path_sep" in
3700 : Which makefile gets called first. This is used by make depend.
3701 case "$firstmakefile" in
3702 '') firstmakefile='makefile';;
3707 Perl can be built to use the SOCKS proxy protocol library. To do so,
3708 Configure must be run with -Dusesocks.
3710 Normally you do not need this and you should answer no.
3714 $define|true|[yY]*) dflt='y';;
3717 rp='Build Perl for SOCKS?'
3720 y|Y) val="$define" ;;
3726 : Looking for optional libraries
3728 echo "Checking for optional libraries..." >&4
3733 case "$libswanted" in
3734 '') libswanted='c_s';;
3738 libswanted="$libswanted socks5 socks5_sh"
3741 for thislib in $libswanted; do
3743 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3744 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3745 echo "Found -l$thislib (shared)."
3748 *) dflt="$dflt -l$thislib";;
3750 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3751 echo "Found -l$thislib (shared)."
3754 *) dflt="$dflt -l$thislib";;
3756 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3757 echo "Found -l$thislib."
3760 *) dflt="$dflt -l$thislib";;
3762 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3763 echo "Found -l$thislib."
3766 *) dflt="$dflt -l$thislib";;
3768 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3769 echo "Found -l${thislib}_s."
3772 *) dflt="$dflt -l${thislib}_s";;
3774 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3775 echo "Found -l$thislib."
3778 *) dflt="$dflt -l$thislib";;
3781 echo "No -l$thislib."
3792 ' '|'') dflt='none';;
3797 In order to compile $package on your machine, a number of libraries
3798 are usually needed. Include any other special libraries here as well.
3799 Say "none" for none. The default list is almost always right.
3803 rp="What libraries to use?"
3810 : determine optimization, if desired, or use for debug flag also
3812 ' '|$undef) dflt='none';;
3814 *) dflt="$optimize";;
3818 By default, $package compiles with the -O flag to use the optimizer.
3819 Alternately, you might want to use the symbolic debugger, which uses
3820 the -g flag (on traditional Unix systems). Either flag can be
3821 specified here. To use neither flag, specify the word "none".
3824 rp="What optimizer/debugger flag should be used?"
3828 'none') optimize=" ";;
3832 : We will not override a previous value, but we might want to
3833 : augment a hint file
3835 default|recommended)
3836 case "$gccversion" in
3837 1*) dflt='-fpcc-struct-return' ;;
3840 *-g*) dflt="$dflt -DDEBUGGING";;
3842 case "$gccversion" in
3843 2*) if test -d /etc/conf/kconfig.d &&
3844 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3850 case "$gccversion" in
3854 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3855 echo 'int main(void) { return 0; }' > gcctest.c
3856 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3857 echo "Yes, it does." 2>&1
3860 echo "Leaving current flags $ccflags alone." 2>&1
3862 *) dflt="$dflt -fno-strict-aliasing" ;;
3865 echo "Nope, it doesn't, but that's ok." 2>&1
3872 case "$mips_type" in
3873 *BSD*|'') inclwanted="$locincpth $usrinc";;
3874 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3876 for thisincl in $inclwanted; do
3877 if $test -d $thisincl; then
3878 if $test x$thisincl != x$usrinc; then
3881 *) dflt="$dflt -I$thisincl";;
3887 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3889 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3897 *) dflt="$dflt -D$2";;
3901 set signal.h LANGUAGE_C; eval $inctest
3905 ccflags="$ccflags -DSOCKS"
3910 default|recommended) dflt="$ccflags $dflt" ;;
3911 *) dflt="$ccflags";;
3919 Your C compiler may want other flags. For this question you should include
3920 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3921 but you should NOT include libraries or ld flags like -lwhatever. If you
3922 want $package to honor its debug switch, you should include -DDEBUGGING here.
3923 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3925 To use no flags, specify the word "none".
3931 rp="Any additional cc flags?"
3938 : the following weeds options from ccflags that are of no interest to cpp
3940 case "$gccversion" in
3941 1*) cppflags="$cppflags -D__GNUC__"
3943 case "$mips_type" in
3945 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3951 echo "Let me guess what the preprocessor flags are..." >&4
3965 *) ftry="$previous $flag";;
3967 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3968 >cpp1.out 2>/dev/null && \
3969 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3970 >cpp2.out 2>/dev/null && \
3971 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3972 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3974 cppflags="$cppflags $ftry"
3984 *-*) echo "They appear to be: $cppflags";;
3986 $rm -f cpp.c cpp?.out
3990 : flags used in final linking phase
3992 '') if ./venix; then
3998 *-posix*) dflt="$dflt -posix" ;;
4001 *) dflt="$ldflags";;
4004 : Try to guess additional flags to pick up local libraries.
4005 for thislibdir in $libpth; do
4006 case " $loclibpth " in
4009 *"-L$thislibdir "*) ;;
4010 *) dflt="$dflt -L$thislibdir" ;;
4022 Your C linker may need flags. For this question you should
4023 include -L/whatever and any other flags used by the C linker, but you
4024 should NOT include libraries like -lwhatever.
4026 Make sure you include the appropriate -L/path flags if your C linker
4027 does not normally search all of the directories you specified above,
4030 To use no flags, specify the word "none".
4034 rp="Any additional ld flags (NOT including libraries)?"
4040 rmlist="$rmlist pdp11"
4044 echo "Checking your choice of C compiler and flags for coherency..." >&4
4045 $cat > try.c <<'EOF'
4047 int main() { printf("Ok\n"); exit(0); }
4049 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4051 $cat >try.msg <<'EOM'
4052 I've tried to compile and run the following simple program:
4055 $cat try.c >> try.msg
4057 $cat >> try.msg <<EOM
4064 and I got the following output:
4068 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4069 if sh -c './try' >>try.msg 2>&1; then
4073 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4076 cat >> try.msg <<'EOQS'
4077 If $libs contains -lsfio, and sfio is mis-configured, then it
4078 sometimes (apparently) runs and exits with a 0 status, but with no
4079 output! It may have to do with sfio's use of _exit vs. exit.
4082 rp="You have a big problem. Shall I abort Configure"
4089 echo "The program compiled OK, but exited with status $?." >>try.msg
4090 rp="You have a problem. Shall I abort Configure"
4094 echo "I can't compile the test program." >>try.msg
4095 rp="You have a BIG problem. Shall I abort Configure"
4101 case "$knowitall" in
4103 echo "(The supplied flags or libraries might be incorrect.)"
4111 *) echo "Ok. Stopping Configure." >&4
4116 n) echo "OK, that should do.";;
4118 $rm -f try try.* core
4120 : define an is-a-typedef? function
4121 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4123 "") inclist="sys/types.h";;
4125 eval "varval=\$$var";
4129 for inc in $inclist; do
4130 echo "#include <$inc>" >>temp.c;
4132 echo "#ifdef $type" >> temp.c;
4133 echo "printf(\"We have $type\");" >> temp.c;
4134 echo "#endif" >> temp.c;
4135 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4136 if $contains $type temp.E >/dev/null 2>&1; then
4142 *) eval "$var=\$varval";;
4145 : define an is-a-typedef? function that prompts if the type is not available.
4146 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4148 "") inclist="sys/types.h";;
4150 eval "varval=\$$var";
4154 for inc in $inclist; do
4155 echo "#include <$inc>" >>temp.c;
4157 echo "#ifdef $type" >> temp.c;
4158 echo "printf(\"We have $type\");" >> temp.c;
4159 echo "#endif" >> temp.c;
4160 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4162 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4163 if $contains $type temp.E >/dev/null 2>&1; then
4164 echo "$type found." >&4;
4167 echo "$type NOT found." >&4;
4173 *) eval "$var=\$varval";;
4176 : define a shorthand compile call
4180 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4181 : define a shorthand compile call for compilations that should be ok.
4185 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4187 : check for lengths of integral types
4191 echo "Checking to see how big your integers are..." >&4
4192 $cat >intsize.c <<'EOCP'
4196 printf("intsize=%d;\n", (int)sizeof(int));
4197 printf("longsize=%d;\n", (int)sizeof(long));
4198 printf("shortsize=%d;\n", (int)sizeof(short));
4203 if eval $compile_ok && ./intsize > /dev/null; then
4205 echo "Your integers are $intsize bytes long."
4206 echo "Your long integers are $longsize bytes long."
4207 echo "Your short integers are $shortsize bytes long."
4211 Help! I can't compile and run the intsize test program: please enlighten me!
4212 (This is probably a misconfiguration in your system or libraries, and
4213 you really ought to fix it. Still, I'll try anyway.)
4217 rp="What is the size of an integer (in bytes)?"
4221 rp="What is the size of a long integer (in bytes)?"
4225 rp="What is the size of a short integer (in bytes)?"
4231 $rm -f intsize intsize.*
4233 : see what type lseek is declared as in the kernel
4234 rp="What is the type used for lseek's offset on this system?"
4235 set off_t lseektype long stdio.h sys/types.h
4239 $echo $n "Checking to see how big your file offsets are...$c" >&4
4241 #include <sys/types.h>
4245 printf("%d\n", (int)sizeof($lseektype));
4250 if eval $compile_ok; then
4252 $echo " $lseeksize bytes." >&4
4256 echo "(I can't seem to compile the test program. Guessing...)"
4257 rp="What is the size of your file offsets (in bytes)?"
4263 : see what type file positions are declared as in the library
4264 rp="What is the type for file position used by fsetpos()?"
4265 set fpos_t fpostype long stdio.h sys/types.h
4270 *_t) zzz="$fpostype" ;;
4273 $echo $n "Checking the size of $zzz...$c" >&4
4275 #include <sys/types.h>
4278 printf("%d\n", (int)sizeof($fpostype));
4283 if eval $compile_ok; then
4288 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4291 echo " $fpossize bytes."
4297 echo "(I can't compile the test program. Guessing...)" >&4
4298 rp="What is the size of your file positions (in bytes)?"
4305 case "$lseeksize:$fpossize" in
4308 You can have files larger than 2 gigabytes.
4313 Perl can be built to understand large files (files larger than 2 gigabytes)
4314 on some systems. To do so, Configure must be run with -Duselargefiles.
4316 If this doesn't make any sense to you, just accept the default 'y'.
4318 case "$uselargefiles" in
4319 "$undef"|false|[nN]*) dflt='n' ;;
4322 rp='Try to understand large files, if available?'
4325 y|Y) val="$define" ;;
4332 case "$uselargefiles" in
4334 : Look for a hint-file generated 'call-back-unit'. If the
4335 : user has specified that a large files perl is to be built,
4336 : we may need to set or change some other defaults.
4337 if $test -f uselfs.cbu; then
4338 echo "Your platform has some specific hints for large file builds, using them..."
4341 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4343 #include <sys/types.h>
4347 printf("%d\n", (int)sizeof($lseektype));
4352 if eval $compile_ok; then
4354 $echo " $lseeksize bytes." >&4
4358 echo "(I can't seem to compile the test program. Guessing...)"
4359 rp="What is the size of your file offsets (in bytes)?"
4364 *_t) zzz="$fpostype" ;;
4367 $echo $n "Rechecking the size of $zzz...$c" >&4
4369 #include <sys/types.h>
4372 printf("%d\n", (int)sizeof($fpostype));
4377 if eval $compile_ok; then
4382 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4385 echo " $fpossize bytes."
4391 echo "(I can't compile the test program. Guessing...)" >&4
4392 rp="What is the size of your file positions (in bytes)?"
4402 case "$usemorebits" in
4403 "$define"|true|[yY]*)
4405 uselongdouble="$define"
4406 usemorebits="$define"
4408 *) usemorebits="$undef"
4413 case "$intsize:$longsize" in
4416 You have natively 64-bit integers.
4421 Perl can be built to take advantage of 64-bit integer types
4422 on some systems. To do so, Configure must be run with -Duse64bits.
4424 If this doesn't make any sense to you, just accept the default.
4426 case "$use64bits" in
4427 $define|true|[yY]*) dflt='y';;
4430 rp='Try to use 64-bit integers, if available?'
4433 y|Y) val="$define" ;;
4441 case "$archname64" in
4442 '') archname64='' ;; # not a typo
4445 case "$use64bits" in
4446 "$define"|true|[yY]*)
4447 : Look for a hint-file generated 'call-back-unit'. If the
4448 : user has specified that a 64-bit perl is to be built,
4449 : we may need to set or change some other defaults.
4450 if $test -f use64bits.cbu; then
4451 echo "Your platform has some specific hints for 64-bit builds, using them..."
4455 (Your platform doesn't have any specific hints for 64-bit builds.)
4457 case "$intsize:$longsize" in
4459 (This is probably okay, as your system is a natively 64-bit system.)
4463 case "$gccversion" in
4465 *) case "$ccflags" in
4466 *-DUSE_LONG_LONG*) ;;
4468 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4469 to the compilation flags.
4471 ccflags="$ccflags -DUSE_LONG_LONG"
4480 : determine the architecture name
4482 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4483 tarch=`arch`"-$osname"
4484 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4485 if uname -m > tmparch 2>&1 ; then
4486 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4487 -e 's/$/'"-$osname/" tmparch`
4495 case "$myarchname" in
4498 echo "(Your architecture name used to be $myarchname.)"
4505 *) dflt="$archname";;
4507 rp='What is your architecture name'
4510 case "$usethreads" in
4512 echo "Threads selected." >&4
4514 *-thread*) echo "...and architecture name already has -thread." >&4
4516 *) archname="$archname-thread"
4517 echo "...setting architecture name to $archname." >&4
4522 case "$usemultiplicity" in
4524 echo "Multiplicity selected." >&4
4526 *-multi*) echo "...and architecture name already has -multi." >&4
4528 *) archname="$archname-multi"
4529 echo "...setting architecture name to $archname." >&4
4534 case "$use64bits" in
4536 case "$archname64" in
4541 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4543 *) archname="$archname-$archname64"
4544 echo "...setting architecture name to $archname." >&4
4551 : determine root of directory hierarchy where package will be installed.
4554 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4562 By default, $package will be installed in $dflt/bin, manual pages
4563 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4564 installation directories. Typically this is something like /usr/local.
4565 If you wish to have binaries under /usr/bin but other parts of the
4566 installation under /usr/local, that's ok: you will be prompted
4567 separately for each of the installation directories, the prefix being
4568 only used to set the defaults.
4572 rp='Installation prefix to use?'
4580 *) oldprefix="$prefix";;
4590 $define|true) afs=true ;;
4591 $undef|false) afs=false ;;
4592 *) if test -d /afs; then
4600 echo "AFS may be running... I'll be extra cautious then..." >&4
4602 echo "AFS does not seem to be running..." >&4
4605 : determine installation prefix for where package is to be installed.
4609 Since you are running AFS, I need to distinguish the directory in which
4610 files will reside from the directory in which they are installed (and from
4611 which they are presumably copied to the former directory by occult means).
4614 case "$installprefix" in
4615 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4616 *) dflt="$installprefix";;
4621 In some special cases, particularly when building $package for distribution,
4622 it is convenient to distinguish between the directory in which files should
4623 be installed from the directory ($prefix) in which they
4624 will eventually reside. For most users, these two directories are the same.
4627 case "$installprefix" in
4629 *) dflt=$installprefix;;
4633 rp='What installation prefix should I use for installing files?'
4635 installprefix="$ans"
4636 installprefixexp="$ansexp"
4638 : set the prefixit variable, to compute a suitable default value
4639 prefixit='case "$3" in
4641 case "$oldprefix" in
4642 "") eval "$1=\"\$$2\"";;
4649 ""|" ") eval "$1=\"\$$2\"";;
4655 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4657 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4658 /*-$oldprefix/*|\~*-$oldprefix/*)
4659 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4660 *) eval "$1=\"\$$2\"";;
4664 : set the base revision
4668 : get the patchlevel
4670 echo "Getting the current patchlevel..." >&4
4671 if $test -r $rsrc/patchlevel.h;then
4672 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4673 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4674 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4675 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4676 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4684 $echo $n "(You have $package" $c
4687 *) $echo $n " $baserev" $c ;;
4689 $echo $n " patchlevel $patchlevel" $c
4690 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4694 : XXX Should be a Configure test for double-dots in filenames.
4695 version=`echo $baserev $patchlevel $subversion | \
4696 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4697 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4698 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4701 version=`echo $baserev $patchlevel $subversion | \
4702 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4703 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4704 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4707 : Special case the 5.005_xx maintenance series, which used 5.005
4708 : without any subversion label as a subdirectory in $sitelib
4709 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4710 api_versionstring='5.005'
4713 : determine installation style
4714 : For now, try to deduce it from prefix unless it is already set.
4715 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4716 case "$installstyle" in
4717 '') case "$prefix" in
4718 *perl*) dflt='lib';;
4719 *) dflt='lib/perl5' ;;
4722 *) dflt='lib/perl5' ;;
4724 : Probably not worth prompting for this since we prompt for all
4725 : the directories individually, and the prompt would be too long and
4729 : determine where private library files go
4730 : Usual default is /usr/local/lib/perl5/$version.
4731 : Also allow things like /opt/perl/lib/$version, since
4732 : /opt/perl/lib/perl5... would be redundant.
4733 : The default "style" setting is made in installstyle.U
4734 case "$installstyle" in
4735 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4736 *) set dflt privlib lib/$version ;;
4741 There are some auxiliary files for $package that need to be put into a
4742 private library directory that is accessible by everyone.
4746 rp='Pathname where the private library files will reside?'
4749 privlibexp="$ansexp"
4750 : Change installation prefix, if necessary.
4751 if $test X"$prefix" != X"$installprefix"; then
4752 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4754 installprivlib="$privlibexp"
4757 : set the prefixup variable, to restore leading tilda escape
4758 prefixup='case "$prefixexp" in
4760 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4763 : determine where public architecture dependent libraries go
4766 : privlib default is /usr/local/lib/$package/$version
4767 : archlib default is /usr/local/lib/$package/$version/$archname
4768 : privlib may have an optional trailing /share.
4769 tdflt=`echo $privlib | $sed 's,/share$,,'`
4770 tdflt=$tdflt/$archname
4779 $spackage contains architecture-dependent library files. If you are
4780 sharing libraries in a heterogeneous environment, you might store
4781 these files in a separate location. Otherwise, you can just include
4782 them with the rest of the public library files.
4786 rp='Where do you want to put the public architecture-dependent libraries?'
4789 archlibexp="$ansexp"
4790 if $test X"$archlib" = X"$privlib"; then
4795 : Change installation prefix, if necessary.
4796 if $test X"$prefix" != X"$installprefix"; then
4797 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4799 installarchlib="$archlibexp"
4803 : Binary compatibility with 5.005 is not possible for builds
4804 : with advanced features
4805 case "$usethreads$usemultiplicity" in
4807 bincompat5005="$undef"
4808 d_bincompat5005="$undef"
4812 Perl 5.006 can be compiled for binary compatibility with 5.005.
4813 If you decide to do so, you will be able to continue using most
4814 of the extensions that were compiled for Perl 5.005.
4817 case "$bincompat5005$d_bincompat5005" in
4818 *"$undef"*) dflt=n ;;
4821 rp='Binary compatibility with Perl 5.005?'
4824 y*) val="$define" ;;
4829 case "$d_bincompat5005" in
4831 bincompat5005="$define"
4833 *) bincompat5005="$undef"
4834 d_bincompat5005="$undef"
4841 : see if setuid scripts can be secure
4844 Some kernels have a bug that prevents setuid #! scripts from being
4845 secure. Some sites have disabled setuid #! scripts because of this.
4847 First let's decide if your kernel supports secure setuid #! scripts.
4848 (If setuid #! scripts would be secure but have been disabled anyway,
4849 don't say that they are secure if asked.)
4854 if $test -d /dev/fd; then
4855 echo "#!$ls" >reflect
4856 chmod +x,u+s reflect
4857 ./reflect >flect 2>&1
4858 if $contains "/dev/fd" flect >/dev/null; then
4859 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4863 If you are not sure if they are secure, I can check but I'll need a
4864 username and password different from the one you are using right now.
4865 If you don't have such a username or don't want me to test, simply
4869 rp='Other username to test security of setuid scripts with?'
4874 case "$d_suidsafe" in
4875 '') echo "I'll assume setuid scripts are *not* secure." >&4
4878 echo "Well, the $hint value is *not* secure." >&4
4880 *) echo "Well, the $hint value *is* secure." >&4
4885 $rm -f reflect flect
4886 echo "#!$ls" >reflect
4887 chmod +x,u+s reflect
4890 echo '"su" will (probably) prompt you for '"$ans's password."
4891 su $ans -c './reflect >flect'
4892 if $contains "/dev/fd" flect >/dev/null; then
4893 echo "Okay, it looks like setuid scripts are secure." >&4
4896 echo "I don't think setuid scripts are secure." >&4
4901 rp='Does your kernel have *secure* setuid scripts?'
4904 [yY]*) val="$define";;
4909 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4910 echo "(That's for file descriptors, not floppy disks.)"
4916 $rm -f reflect flect
4918 : now see if they want to do setuid emulation
4921 case "$d_suidsafe" in
4924 echo "No need to emulate SUID scripts since they are secure here." >& 4
4928 Some systems have disabled setuid scripts, especially systems where
4929 setuid scripts cannot be secure. On systems where setuid scripts have
4930 been disabled, the setuid/setgid bits on scripts are currently
4931 useless. It is possible for $package to detect those bits and emulate
4932 setuid/setgid in a secure fashion. This emulation will only work if
4933 setuid scripts have been disabled in your kernel.
4937 "$define") dflt=y ;;
4940 rp="Do you want to do setuid/setgid emulation?"
4943 [yY]*) val="$define";;
4951 : determine filename position in cpp output
4953 echo "Computing filename position in cpp output for #include directives..." >&4
4954 echo '#include <stdio.h>' > foo.c
4957 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4958 $grep '^[ ]*#.*stdio\.h' | \
4959 while read cline; do
4962 while $test \$# -gt 0; do
4963 if $test -r \`echo \$1 | $tr -d '"'\`; then
4968 pos=\`expr \$pos + 1\`
4980 *) pos="${fieldn}th";;
4982 echo "Your cpp writes the filename in the $pos field of the line."
4984 : locate header file
4989 for usrincdir in $usrinc
4991 if test -f \$usrincdir/\$wanted; then
4992 echo "\$usrincdir/\$wanted"
4996 awkprg='{ print \$$fieldn }'
4997 echo "#include <\$wanted>" > foo\$\$.c
4998 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4999 $grep "^[ ]*#.*\$wanted" | \
5000 while read cline; do
5001 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5003 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5004 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5009 # status = 0: grep returned 0 lines, case statement not executed
5010 # status = 1: headerfile found
5011 # status = 2: while loop executed, no headerfile found
5015 if test \$status -eq 1; then
5022 : define an alternate in-header-list? function
5023 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5024 cont=true; xxf="echo \"<\$1> found.\" >&4";
5025 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5026 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5028 case $# in 4) instead=instead;; *) instead="at last";; esac;
5029 while $test "$cont"; do
5031 var=$2; eval "was=\$$2";
5032 if $test "$xxx" && $test -r "$xxx";
5034 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5037 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5038 set $yyy; shift; shift; yyy=$@;
5039 case $# in 0) cont="";;
5040 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5041 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5042 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5043 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5047 do set $yyy; var=$2; eval "was=\$$2";
5048 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5049 set $yyy; shift; shift; yyy=$@;
5052 : see if this is a malloc.h system
5053 set malloc.h i_malloc
5056 : see if stdlib is available
5057 set stdlib.h i_stdlib
5060 : determine which malloc to compile in
5062 case "$usemymalloc" in
5063 ''|[yY]*|true|$define) dflt='y' ;;
5066 rp="Do you wish to attempt to use the malloc that comes with $package?"
5072 mallocsrc='malloc.c'
5073 mallocobj="malloc$_o"
5074 d_mymalloc="$define"
5077 : Remove malloc from list of libraries to use
5078 echo "Removing unneeded -lmalloc from library list" >&4
5079 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5082 echo "libs = $libs" >&4
5094 : compute the return types of malloc and free
5096 $cat >malloc.c <<END
5100 #include <sys/types.h>
5114 case "$malloctype" in
5116 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5123 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5127 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5134 echo "Your system uses $freetype free(), it would seem." >&4
5138 The installation process will also create a directory for
5139 vendor-supplied add-ons. Vendors who supply perl with their system
5140 may find it convenient to place all vendor-supplied files in this
5141 directory rather than in the main distribution directory. This will
5142 ease upgrades between binary-compatible maintenance versions of perl.
5144 Of course you may also use these directories in whatever way you see
5145 fit. For example, you might use them to access modules shared over a
5146 company-wide network.
5148 The default answer should be fine for most people.
5149 This causes further questions about vendor add-ons to be skipped
5150 and no vendor-specific directories will be configured for perl.
5153 rp='Do you want to configure vendor-specific add-on directories?'
5154 case "$usevendorprefix" in
5155 define|true|[yY]*) dflt=y ;;
5161 rp='Installation prefix to use for vendor-supplied add-ons?'
5162 case "$vendorprefix" in
5164 *) dflt=$vendorprefix ;;
5168 case "$vendorprefix" in
5172 *) oldvendorprefix="$prefix";;
5176 usevendorprefix="$define"
5178 vendorprefixexp="$ansexp"
5180 *) usevendorprefix="$undef"
5186 case "$vendorprefix" in
5187 '') d_vendorlib="$undef"
5191 *) d_vendorlib="$define"
5192 : determine where vendor-supplied modules go.
5193 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5194 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5195 case "$installstyle" in
5196 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5197 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5200 rp='Pathname for the vendor-supplied library files?'
5203 vendorlibexp="$ansexp"
5204 : Change installation prefix, if necessary.
5205 if $test X"$prefix" != X"$installprefix"; then
5206 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5208 installvendorlib="$vendorlibexp"
5213 : Cruising for prototypes
5215 echo "Checking out function prototypes..." >&4
5216 $cat >prototype.c <<'EOCP'
5217 int main(int argc, char *argv[]) {
5220 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5221 echo "Your C compiler appears to support function prototypes."
5224 echo "Your C compiler doesn't seem to understand function prototypes."
5231 case "$prototype" in
5233 *) ansi2knr='ansi2knr'
5238 This version of $package can only be compiled by a compiler that
5239 understands function prototypes. Unfortunately, your C compiler
5241 doesn't seem to understand them. Sorry about that.
5243 If GNU cc is available for your system, perhaps you could try that instead.
5245 Eventually, we hope to support building Perl with pre-ANSI compilers.
5246 If you would like to help in that effort, please contact <perlbug@perl.org>.
5248 Aborting Configure now.
5254 : determine where public executables go
5259 rp='Pathname where the public executables will reside?'
5261 if $test "X$ansexp" != "X$binexp"; then
5266 : Change installation prefix, if necessary.
5267 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5268 if $test X"$prefix" != X"$installprefix"; then
5269 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5271 installbin="$binexp"
5276 After $package is installed, you may wish to install various
5277 add-on modules and utilities. Typically, these add-ons will
5278 be installed under $prefix with the rest
5279 of this package. However, you may wish to install such add-ons
5280 elsewhere under a different prefix.
5282 If you do not wish to put everything under a single prefix, that's
5283 ok. You will be prompted for the individual locations; this siteprefix
5284 is only used to suggest the defaults.
5286 The default should be fine for most people.
5290 rp='Installation prefix to use for add-on modules and utilities?'
5291 : XXX Here might be another good place for an installstyle setting.
5292 case "$siteprefix" in
5294 *) dflt=$siteprefix ;;
5298 case "$siteprefix" in
5303 *) oldsiteprefix="$prefix";;
5308 siteprefixexp="$ansexp"
5310 : determine where site specific libraries go.
5311 : Usual default is /usr/local/lib/perl5/site_perl/$version
5312 : The default "style" setting is made in installstyle.U
5313 : XXX No longer works with Prefixit stuff.
5314 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5315 case "$installstyle" in
5316 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5317 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5321 The installation process will create a directory for
5322 site-specific extensions and modules. Most users find it convenient
5323 to place all site-specific files in this directory rather than in the
5324 main distribution directory.
5328 rp='Pathname for the site-specific library files?'
5331 sitelibexp="$ansexp"
5332 : Change installation prefix, if necessary.
5333 if $test X"$prefix" != X"$installprefix"; then
5334 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5336 installsitelib="$sitelibexp"
5339 : Determine list of previous versions to include in @INC
5340 $cat > getverlist <<EOPL
5343 \$api_versionstring = "$api_versionstring";
5344 \$version = "$version";
5345 \$sitelib = "$sitelib";
5346 \$archname = "$archname";
5348 $cat >> getverlist <<'EOPL'
5349 # Can't have leading @ because metaconfig interprets it as a command!
5350 ;@inc_version_list=();
5351 $stem=dirname($sitelib);
5352 # Redo to do opendir/readdir?
5355 ;@candidates = glob("5.*");
5361 # XXX ToDo: These comparisons must be reworked when two-digit
5362 # subversions come along, so that 5.7.10 compares as greater than
5363 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5364 # widespread that we can use the built-in version vectors rather
5365 # than reinventing them here. For 5.6.0, however, we must
5366 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5367 foreach $d (@candidates) {
5368 if ($d lt $version) {
5369 if ($d ge $api_versionstring) {
5370 unshift(@inc_version_list, "$d/$archname", $d);
5372 elsif ($d ge "5.005") {
5373 unshift(@inc_version_list, $d);
5377 # Skip newer version. I.e. don't look in
5378 # 5.7.0 if we're installing 5.6.1.
5382 if (@inc_version_list) {
5383 print join(' ', @inc_version_list);
5386 # Blank space to preserve value for next Configure run.
5391 case "$inc_version_list" in
5392 '') if test -x $perl; then
5393 dflt=`$perl getverlist`
5398 $undef) dflt='none' ;;
5399 *) dflt="$inc_version_list" ;;
5403 In order to ease the process of upgrading, this version of perl
5404 can be configured to use modules built and installed with earlier
5405 versions of perl that were installed under $prefix. Specify here
5406 the list of earlier versions that this version of perl should check.
5407 If Configure detected no earlier versions of perl installed under
5408 $prefix, then the list will be empty. Answer 'none' to tell perl
5409 to not search earlier versions.
5411 The default should almost always be sensible, so if you're not sure,
5412 just accept the default.
5415 rp='List of earlier versions to include in @INC?'
5418 [Nn]one) inc_version_list=' ' ;;
5419 *) inc_version_list="$ans" ;;
5421 case "$inc_version_list" in
5423 inc_version_list_init='""';;
5424 *) inc_version_list_init=`echo $inc_version_list |
5425 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/"/'`
5430 : determine whether to install perl also as /usr/bin/perl
5433 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5435 Many scripts expect to perl to be installed as /usr/bin/perl.
5436 I can install the perl you are about to compile also as /usr/bin/perl
5437 (in addition to $installbin/perl).
5439 case "$installusrbinperl" in
5440 "$undef"|[nN]*) dflt='n';;
5443 rp="Do you want to install perl as /usr/bin/perl?"
5446 [yY]*) val="$define";;
5452 set installusrbinperl
5456 echo "Checking for GNU C Library..." >&4
5457 cat >gnulibc.c <<EOM
5469 if eval $compile_ok && ./gnulibc; then
5471 echo "You are using the GNU C Library"
5474 echo "You are not using the GNU C Library"
5480 : see if nm is to be used to determine whether a symbol is defined or not
5484 case "$d_gnulibc" in
5487 echo "nm probably won't work on the GNU C Library." >&4
5493 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5495 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5496 echo "'nm' won't be sufficient on this sytem." >&4
5502 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5503 if $test $dflt -gt 20; then
5513 true|$define) dflt=y;;
5520 I can use $nm to extract the symbols from your C libraries. This
5521 is a time consuming task which may generate huge output on the disk (up
5522 to 3 megabytes) but that should make the symbols extraction faster. The
5523 alternative is to skip the 'nm' extraction part and to compile a small
5524 test program instead to determine whether each symbol is present. If
5525 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5526 this may be the best solution.
5528 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5531 rp="Shall I use $nm to extract C symbols from the libraries?"
5534 [Nn]*) usenm=false;;
5543 : nm options which may be necessary
5545 '') if $test -f /mach_boot; then
5547 elif $test -d /usr/ccs/lib; then
5548 nm_opt='-p' # Solaris (and SunOS?)
5549 elif $test -f /dgux; then
5551 elif $test -f /lib64/rld; then
5552 nm_opt='-p' # 64-bit Irix
5558 : nm options which may be necessary for shared libraries but illegal
5559 : for archive libraries. Thank you, Linux.
5560 case "$nm_so_opt" in
5561 '') case "$myuname" in
5563 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5564 nm_so_opt='--dynamic'
5573 : get list of predefined functions in a handy place
5578 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5585 *) for thislib in $libs; do
5588 : Handle C library specially below.
5591 thislib=`echo $thislib | $sed -e 's/^-l//'`
5592 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5594 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5596 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5598 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5600 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5602 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5604 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5609 libnames="$libnames $try"
5611 *) libnames="$libnames $thislib" ;;
5620 for xxx in $libpth; do
5621 $test -r $1 || set $xxx/libc.$so
5622 : The messy sed command sorts on library version numbers.
5624 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5625 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5627 s/[0-9][0-9]*/0000&/g
5628 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5631 sort | $sed -e 's/^.* //'`
5634 $test -r $1 || set /usr/ccs/lib/libc.$so
5635 $test -r $1 || set /lib/libsys_s$_a
5641 if $test -r "$1"; then
5642 echo "Your (shared) C library seems to be in $1."
5644 elif $test -r /lib/libc && $test -r /lib/clib; then
5645 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5647 libc='/lib/clib /lib/libc'
5648 if $test -r /lib/syslib; then
5649 echo "(Your math library is in /lib/syslib.)"
5650 libc="$libc /lib/syslib"
5652 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5653 echo "Your C library seems to be in $libc, as you said before."
5654 elif $test -r $incpath/usr/lib/libc$_a; then
5655 libc=$incpath/usr/lib/libc$_a;
5656 echo "Your C library seems to be in $libc. That's fine."
5657 elif $test -r /lib/libc$_a; then
5659 echo "Your C library seems to be in $libc. You're normal."
5661 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5663 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5664 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5665 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5667 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5669 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5672 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5674 if $test -r "$tans"; then
5675 echo "Your C library seems to be in $tans, of all places."
5681 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5685 If the guess above is wrong (which it might be if you're using a strange
5686 compiler, or your machine supports multiple models), you can override it here.
5691 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5693 I can't seem to find your C library. I've looked in the following places:
5696 $sed 's/^/ /' libpath
5699 None of these seems to contain your C library. I need to get its name...
5704 rp='Where is your C library?'
5709 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5710 set X `cat libnames`
5713 case $# in 1) xxx=file; esac
5714 echo "Extracting names from the following $xxx for later perusal:" >&4
5716 $sed 's/^/ /' libnames >&4
5718 $echo $n "This may take a while...$c" >&4
5722 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5723 *) $nm $nm_opt $file 2>/dev/null;;
5728 $grep fprintf libc.tmp > libc.ptf
5729 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5730 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5732 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5738 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5740 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5742 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5744 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5746 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5748 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5750 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5752 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5754 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5756 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5757 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5759 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5761 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5763 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5765 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5767 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5769 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5771 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5773 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5775 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5777 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5779 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5781 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5783 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5785 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5787 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5790 $nm -p $* 2>/dev/null >libc.tmp
5791 $grep fprintf libc.tmp > libc.ptf
5792 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5793 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5799 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5801 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5802 for thisname in $libnames $libc; do
5803 $ar t $thisname >>libc.tmp
5805 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5807 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5808 # Repeat libc to extract forwarders to DLL entries too
5809 for thisname in $libnames $libc; do
5810 $ar tv $thisname >>libc.tmp
5811 # Revision 50 of EMX has bug in $ar.
5812 # it will not extract forwarders to DLL entries
5813 # Use emximp which will extract exactly them.
5814 emximp -o tmp.imp $thisname \
5816 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5817 < tmp.imp >>libc.tmp
5820 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5823 echo "$ar didn't seem to work right." >&4
5824 echo "Maybe this is a Cray...trying bld instead..." >&4
5825 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5827 for thisname in $libnames; do
5829 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5830 $ar t $thisname >>libc.tmp
5834 echo "That didn't work either. Giving up." >&4
5841 if $test -f /lib/syscalls.exp; then
5843 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5844 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5848 $rm -f libnames libpath
5850 : see if dld is available
5854 : is a C symbol defined?
5857 -v) tf=libc.tmp; tc=""; tdc="";;
5858 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5859 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5862 case "$reuseval-$4" in
5864 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5870 if $contains $tlook $tf >/dev/null 2>&1;
5875 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5876 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5884 $define) tval=true;;
5890 : define an is-in-libc? function
5891 inlibc='echo " "; td=$define; tu=$undef;
5892 sym=$1; var=$2; eval "was=\$$2";
5894 case "$reuseval$was" in
5904 echo "$sym() found." >&4;
5905 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5907 echo "$sym() NOT found." >&4;
5908 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5912 $define) echo "$sym() found." >&4;;
5913 *) echo "$sym() NOT found." >&4;;
5917 : see if dlopen exists
5924 : determine which dynamic loading, if any, to compile in
5926 dldir="ext/DynaLoader"
5939 $define) dflt='y' ;;
5942 $define) dflt='y' ;;
5944 : Does a dl_xxx.xs file exist for this operating system
5945 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5948 rp="Do you wish to use dynamic loading?"
5955 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5956 dflt="$dldir/dl_${osname}.xs"
5957 elif $test "$d_dlopen" = "$define" ; then
5958 dflt="$dldir/dl_dlopen.xs"
5959 elif $test "$i_dld" = "$define" ; then
5960 dflt="$dldir/dl_dld.xs"
5965 *) dflt="$dldir/$dlsrc"
5968 echo "The following dynamic loading files are available:"
5969 : Can not go over to $dldir because getfile has path hard-coded in.
5970 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5971 rp="Source file to use for dynamic loading"
5977 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5981 Some systems may require passing special flags to $cc -c to
5982 compile modules that will be used to create a shared library.
5983 To use no flags, say "none".
5986 case "$cccdlflags" in
5987 '') case "$gccversion" in
5988 '') case "$osname" in
5990 next) dflt='none' ;;
5991 irix*) dflt='-KPIC' ;;
5992 svr4*|esix*|solaris) dflt='-KPIC' ;;
5993 sunos) dflt='-pic' ;;
5997 *) case "$osname" in
5998 svr4*|esix*|solaris) dflt='-fPIC' ;;
6003 *) dflt="$cccdlflags" ;;
6005 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6008 none) cccdlflags=' ' ;;
6009 *) cccdlflags="$ans" ;;
6014 Some systems use ld to create libraries that can be dynamically loaded,
6015 while other systems (such as those using ELF) use $cc.
6019 '') $cat >try.c <<'EOM'
6020 /* Test for whether ELF binaries are produced */
6025 int i = open("a.out",O_RDONLY);
6028 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6029 exit(0); /* succeed (yes, it's ELF) */
6034 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6036 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6040 echo "I'll use ld to build dynamic libraries."
6049 rp="What command should be used to create dynamic libraries?"
6055 Some systems may require passing special flags to $ld to create a
6056 library that can be dynamically loaded. If your ld flags include
6057 -L/other/path options to locate libraries outside your loader's normal
6058 search path, you may need to specify those -L options here as well. To
6059 use no flags, say "none".
6062 case "$lddlflags" in
6063 '') case "$osname" in
6064 beos) dflt='-nostart' ;;
6066 linux|irix*) dflt='-shared' ;;
6067 next) dflt='none' ;;
6068 solaris) dflt='-G' ;;
6069 sunos) dflt='-assert nodefinitions' ;;
6070 svr4*|esix*) dflt="-G $ldflags" ;;
6074 *) dflt="$lddlflags" ;;
6077 : Try to guess additional flags to pick up local libraries.
6078 : Be careful not to append to a plain 'none'
6082 for thisflag in $ldflags; do
6087 *) dflt="$dflt $thisflag" ;;
6094 ''|' ') dflt='none' ;;
6097 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6100 none) lddlflags=' ' ;;
6101 *) lddlflags="$ans" ;;
6106 Some systems may require passing special flags to $cc to indicate that
6107 the resulting executable will use dynamic linking. To use no flags,
6111 case "$ccdlflags" in
6112 '') case "$osname" in
6113 hpux) dflt='-Wl,-E' ;;
6114 linux) dflt='-rdynamic' ;;
6115 next) dflt='none' ;;
6116 sunos) dflt='none' ;;
6120 *) dflt="$ccdlflags" ;;
6122 rp="Any special flags to pass to $cc to use dynamic linking?"
6125 none) ccdlflags=' ' ;;
6126 *) ccdlflags="$ans" ;;
6140 # No dynamic loading being used, so don't bother even to prompt.
6143 *) case "$useshrplib" in
6144 '') case "$osname" in
6145 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6147 also='Building a shared libperl is required for dynamic loading to work on your system.'
6152 also='Building a shared libperl is needed for MAB support.'
6170 The perl executable is normally obtained by linking perlmain.c with
6171 libperl${_a}, any static extensions (usually just DynaLoader), and
6172 any other libraries needed on this system (such as -lm, etc.). Since
6173 your system supports dynamic loading, it is probably possible to build
6174 a shared libperl.$so. If you will have more than one executable linked
6175 to libperl.$so, this will significantly reduce the size of each
6176 executable, but it may have a noticeable affect on performance. The
6177 default is probably sensible for your system.
6181 rp="Build a shared libperl.$so (y/n)"
6185 useshrplib='true' ;;
6186 *) useshrplib='false' ;;
6191 case "$useshrplib" in
6195 # Figure out a good name for libperl.so. Since it gets stored in
6196 # a version-specific architecture-dependent library, the version
6197 # number isn't really that important, except for making cc/ld happy.
6199 # A name such as libperl.so.3.1
6200 majmin="libperl.$so.$patchlevel.$subversion"
6201 # A name such as libperl.so.301
6202 majonly=`echo $patchlevel $subversion |
6203 $awk '{printf "%d%02d", $1, $2}'`
6204 majonly=libperl.$so.$majonly
6205 # I'd prefer to keep the os-specific stuff here to a minimum, and
6206 # rely on figuring it out from the naming of libc.
6207 case "${osname}${osvers}" in
6210 # XXX How handle the --version stuff for MAB?
6212 linux*) # ld won't link with a bare -lperl otherwise.
6215 cygwin*) # include version
6216 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6218 *) # Try to guess based on whether libc has major.minor.
6220 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6221 *libc.$so.[0-9]*) dflt=$majonly ;;
6222 *) dflt=libperl.$so ;;
6232 I need to select a good name for the shared libperl. If your system uses
6233 library names with major and minor numbers, then you might want something
6234 like $majmin. Alternatively, if your system uses a single version
6235 number for shared libraries, then you might want to use $majonly.
6236 Or, your system might be quite happy with a simple libperl.$so.
6238 Since the shared libperl will get installed into a version-specific
6239 architecture-dependent directory, the version number of the shared perl
6240 library probably isn't important, so the default should be o.k.
6243 rp='What name do you want to give to the shared libperl?'
6246 echo "Ok, I'll use $libperl"
6249 libperl="libperl${_a}"
6253 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6257 WARNING: Use of the shrpdir variable for the installation location of
6258 the shared $libperl is not supported. It was never documented and
6259 will not work in this version. Let me (perlbug@perl.com)
6260 know of any problems this may cause.
6266 But your current setting of $shrpdir is
6267 the default anyway, so it's harmless.
6272 Further, your current attempted setting of $shrpdir
6273 conflicts with the value of $archlibexp/CORE
6274 that installperl will use.
6281 # How will the perl executable find the installed shared $libperl?
6282 # Add $xxx to ccdlflags.
6283 # If we can't figure out a command-line option, use $shrpenv to
6284 # set env LD_RUN_PATH. The main perl makefile uses this.
6285 shrpdir=$archlibexp/CORE
6288 if "$useshrplib"; then
6291 # We'll set it in Makefile.SH...
6297 xxx="-Wl,-R$shrpdir"
6299 linux|irix*|dec_osf)
6300 xxx="-Wl,-rpath,$shrpdir"
6303 # next doesn't like the default...
6306 # beos doesn't like the default, either.
6309 # hpux doesn't like the default, either.
6310 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6313 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6319 # Only add $xxx if it isn't already in ccdlflags.
6320 case " $ccdlflags " in
6322 *) ccdlflags="$ccdlflags $xxx"
6325 Adding $xxx to the flags
6326 passed to $ld so that the perl executable will find the
6327 installed shared $libperl.
6335 # Fix ccdlflags in AIX for building external extensions.
6336 # (For building Perl itself bare -bE:perl.exp is needed,
6337 # Makefile.SH takes care of this.)
6339 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6341 # Respect a hint or command-line value.
6343 '') shrpenv="$tmp_shrpenv" ;;
6345 case "$ldlibpthname" in
6346 '') ldlibpthname=LD_LIBRARY_PATH ;;
6347 none) ldlibpthname='' ;;
6350 : determine where manual pages go
6351 set man1dir man1dir none
6355 $spackage has manual pages available in source form.
6359 echo "However, you don't have nroff, so they're probably useless to you."
6361 '') man1dir="none";;
6364 echo "If you don't want the manual sources installed, answer 'none'."
6369 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6370 lookpath="$lookpath $prefixexp/man/p_man/man1"
6371 lookpath="$lookpath $prefixexp/man/u_man/man1"
6372 lookpath="$lookpath $prefixexp/man/man.1"
6374 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6375 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6385 rp="Where do the main $spackage manual pages (source) go?"
6387 if $test "X$man1direxp" != "X$ansexp"; then
6391 man1direxp="$ansexp"
6397 : Change installation prefix, if necessary.
6398 if $test X"$prefix" != X"$installprefix"; then
6399 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6401 installman1dir="$man1direxp"
6404 : What suffix to use on installed man pages
6411 rp="What suffix should be used for the main $spackage man pages?"
6413 '') case "$man1dir" in
6427 *) dflt="$man1ext";;
6434 : see if we can have long filenames
6436 rmlist="$rmlist /tmp/cf$$"
6437 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6438 first=123456789abcdef
6439 second=/tmp/cf$$/$first
6440 $rm -f $first $second
6441 if (echo hi >$first) 2>/dev/null; then
6442 if $test -f 123456789abcde; then
6443 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6446 if (echo hi >$second) 2>/dev/null; then
6447 if $test -f /tmp/cf$$/123456789abcde; then
6449 That's peculiar... You can have filenames longer than 14 characters, but only
6450 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6451 I shall consider your system cannot support long filenames at all.
6455 echo 'You can have filenames longer than 14 characters.' >&4
6460 How confusing! Some of your filesystems are sane enough to allow filenames
6461 longer than 14 characters but some others like /tmp can't even think about them.
6462 So, for now on, I shall assume your kernel does not allow them at all.
6469 You can't have filenames longer than 14 chars. You can't even think about them!
6475 $rm -rf /tmp/cf$$ 123456789abcde*
6477 : determine where library module manual pages go
6478 set man3dir man3dir none
6482 $spackage has manual pages for many of the library modules.
6488 However, you don't have nroff, so they're probably useless to you.
6491 '') man3dir="none";;
6495 case "$d_flexfnam" in
6498 However, your system can't handle the long file names like File::Basename.3.
6501 '') man3dir="none";;
6505 echo "If you don't want the manual sources installed, answer 'none'."
6506 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6508 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6509 if $test -d "$privlib/man/man3"; then
6512 WARNING: Previous versions of perl installed man3 pages into
6513 $privlib/man/man3. This version will suggest a
6514 new default of $dflt.
6518 rp='Do you wish to preserve the old behavior?(y/n)'
6521 y*) dflt="$privlib/man/man3" ;;
6527 *) dflt="$man3dir" ;;
6531 rp="Where do the $package library man pages (source) go?"
6534 man3direxp="$ansexp"
6540 : Change installation prefix, if necessary.
6541 if $test X"$prefix" != X"$installprefix"; then
6542 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6544 installman3dir="$man3direxp"
6547 : What suffix to use on installed man pages
6553 rp="What suffix should be used for the $package library man pages?"
6555 '') case "$man3dir" in
6569 *) dflt="$man3ext";;
6576 : see if we have to deal with yellow pages, now NIS.
6577 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6578 if $test -f /usr/etc/nibindd; then
6580 echo "I'm fairly confident you're on a NeXT."
6582 rp='Do you get the hosts file via NetInfo?'
6591 y*) hostcat='nidump hosts .';;
6592 *) case "$hostcat" in
6593 nidump*) hostcat='';;
6603 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6611 rp='Are you getting the hosts file via yellow pages?'
6614 y*) hostcat='ypcat hosts';;
6615 *) hostcat='cat /etc/hosts';;
6621 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6624 '') test -f /etc/group && groupcat='cat /etc/group';;
6627 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6630 : now get the host name
6632 echo "Figuring out host name..." >&4
6633 case "$myhostname" in
6635 echo 'Maybe "hostname" will work...'
6636 if tans=`sh -c hostname 2>&1` ; then
6644 if $test "$cont"; then
6646 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6647 if tans=`cat /etc/systemid 2>&1` ; then
6649 phostname='cat /etc/systemid'
6650 echo "Whadyaknow. Xenix always was a bit strange..."
6653 elif $test -r /etc/systemid; then
6654 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6657 if $test "$cont"; then
6658 echo 'No, maybe "uuname -l" will work...'
6659 if tans=`sh -c 'uuname -l' 2>&1` ; then
6661 phostname='uuname -l'
6663 echo 'Strange. Maybe "uname -n" will work...'
6664 if tans=`sh -c 'uname -n' 2>&1` ; then
6666 phostname='uname -n'
6668 echo 'Oh well, maybe I can mine it out of whoami.h...'
6669 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6670 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6671 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6673 case "$myhostname" in
6674 '') echo "Does this machine have an identity crisis or something?"
6677 echo "Well, you said $myhostname before..."
6678 phostname='echo $myhostname';;
6684 : you do not want to know about this
6689 if $test "$myhostname" ; then
6691 rp='Your host name appears to be "'$myhostname'".'" Right?"
6699 : bad guess or no guess
6700 while $test "X$myhostname" = X ; do
6702 rp="Please type the (one word) name of your host:"
6707 : translate upper to lower if necessary
6708 case "$myhostname" in
6710 echo "(Normalizing case in your host name)"
6711 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6715 case "$myhostname" in
6717 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6718 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6719 echo "(Trimming domain name from host name--host name is now $myhostname)"
6721 *) case "$mydomain" in
6724 test "X$hostcat" = "Xypcat hosts" &&
6725 ypmatch "$myhostname" hosts 2>/dev/null |\
6726 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6729 test "X$hostcat" != "X" &&
6730 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6731 /[ ]$myhostname[ . ]/p" > hosts
6734 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6735 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6736 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6737 hosts | $sort | $uniq | \
6738 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6739 case `$echo X$dflt` in
6740 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6743 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6748 tans=`./loc resolv.conf X /etc /usr/etc`
6749 if $test -f "$tans"; then
6750 echo "(Attempting domain name extraction from $tans)"
6751 dflt=.`$sed -n -e 's/ / /g' \
6752 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6753 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6755 .) dflt=.`$sed -n -e 's/ / /g' \
6756 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6757 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6764 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6765 dflt=.`sh -c domainname 2>/dev/null`
6768 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6773 .) echo "(Lost all hope -- silly guess then)"
6779 *) dflt="$mydomain";;
6783 rp="What is your domain name?"
6793 : translate upper to lower if necessary
6796 echo "(Normalizing case in your domain name)"
6797 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6801 : a little sanity check here
6802 case "$phostname" in
6805 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6806 $myhostname$mydomain|$myhostname) ;;
6808 case "$phostname" in
6810 echo "(That doesn't agree with your whoami.h file, by the way.)"
6813 echo "(That doesn't agree with your $phostname command, by the way.)"
6823 I need to get your e-mail address in Internet format if possible, i.e.
6824 something like user@host.domain. Please answer accurately since I have
6825 no easy means to double check it. The default value provided below
6826 is most probably close to reality but may not be valid from outside
6827 your organization...
6831 while test "$cont"; do
6833 '') dflt="$cf_by@$myhostname$mydomain";;
6834 *) dflt="$cf_email";;
6836 rp='What is your e-mail address?'
6842 rp='Address does not look like an Internet one. Use it anyway?'
6858 If you or somebody else will be maintaining perl at your site, please
6859 fill in the correct e-mail address here so that they may be contacted
6860 if necessary. Currently, the "perlbug" program included with perl
6861 will send mail to this address in addition to perlbug@perl.com. You may
6862 enter "none" for no administrator.
6865 case "$perladmin" in
6866 '') dflt="$cf_email";;
6867 *) dflt="$perladmin";;
6869 rp='Perl administrator e-mail address'
6873 : figure out how to guarantee perl startup
6874 case "$startperl" in
6876 case "$sharpbang" in
6880 I can use the #! construct to start perl on your system. This will
6881 make startup of perl scripts faster, but may cause problems if you
6882 want to share those scripts and perl is not in a standard place
6883 ($binexp/perl) on all your platforms. The alternative is to force
6884 a shell by starting the script with a single ':' character.
6888 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6891 none) startperl=": # use perl";;
6892 *) startperl="#!$ans"
6893 if $test 30 -lt `echo "$ans" | wc -c`; then
6896 WARNING: Some systems limit the #! command to 32 characters.
6897 If you experience difficulty running Perl scripts with #!, try
6898 installing Perl in a directory with a shorter pathname.
6904 *) startperl=": # use perl"
6909 echo "I'll use $startperl to start perl scripts."
6911 : figure best path for perl in scripts
6914 perlpath="$binexp/perl"
6915 case "$startperl" in
6920 I will use the "eval 'exec'" idiom to start Perl on your system.
6921 I can use the full path of your Perl binary for this purpose, but
6922 doing so may cause problems if you want to share those scripts and
6923 Perl is not always in a standard place ($binexp/perl).
6927 rp="What path shall I use in \"eval 'exec'\"?"
6934 case "$startperl" in
6936 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6939 : determine where public executable scripts go
6940 set scriptdir scriptdir
6942 case "$scriptdir" in
6945 : guess some guesses
6946 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6947 $test -d /usr/share/bin && dflt=/usr/share/bin
6948 $test -d /usr/local/script && dflt=/usr/local/script
6949 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6950 $test -d $prefixexp/script && dflt=$prefixexp/script
6954 *) dflt="$scriptdir"
6959 Some installations have a separate directory just for executable scripts so
6960 that they can mount it across multiple architectures but keep the scripts in
6961 one spot. You might, for example, have a subdirectory of /usr/share for this.
6962 Or you might just lump your scripts in with all your other executables.
6966 rp='Where do you keep publicly executable scripts?'
6968 if $test "X$ansexp" != "X$scriptdirexp"; then
6972 scriptdirexp="$ansexp"
6973 : Change installation prefix, if necessary.
6974 if $test X"$prefix" != X"$installprefix"; then
6975 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6977 installscript="$scriptdirexp"
6980 : determine where site specific architecture-dependent libraries go.
6981 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6982 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6983 : sitelib may have an optional trailing /share.
6984 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6985 tdflt="$tdflt/$archname"
6986 set sitearch sitearch none
6989 '') dflt="$tdflt" ;;
6990 *) dflt="$sitearch" ;;
6994 The installation process will also create a directory for
6995 architecture-dependent site-specific extensions and modules.
6999 rp='Pathname for the site-specific architecture-dependent library files?'
7002 sitearchexp="$ansexp"
7003 : Change installation prefix, if necessary.
7004 if $test X"$prefix" != X"$installprefix"; then
7005 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7007 installsitearch="$sitearchexp"
7010 : determine where add-on public executables go
7012 '') dflt=$siteprefix/bin ;;
7016 rp='Pathname where the add-on public executables should be installed?'
7019 sitebinexp="$ansexp"
7020 : Change installation prefix, if necessary.
7021 if $test X"$prefix" != X"$installprefix"; then
7022 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7024 installsitebin="$sitebinexp"
7029 Perl can be built to take advantage of long doubles which
7030 (if available) may give more accuracy and range for floating point numbers.
7032 If this doesn't make any sense to you, just accept the default 'n'.
7036 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7039 case "$uselongdouble" in
7040 $define|true|[yY]*) dflt='y';;
7043 rp='Try to use long doubles if available?'
7046 y|Y) val="$define" ;;
7052 case "$uselongdouble" in
7053 true|[yY]*) uselongdouble="$define" ;;
7056 case "$uselongdouble" in
7058 : Look for a hint-file generated 'call-back-unit'. If the
7059 : user has specified that long doubles should be used,
7060 : we may need to set or change some other defaults.
7061 if $test -f uselongdouble.cbu; then
7062 echo "Your platform has some specific hints for long doubles, using them..."
7063 . ./uselongdouble.cbu
7066 (Your platform doesn't have any specific hints for long doubles.)
7074 Perl can be built to take advantage of long longs which
7075 (if available) may give more range for integer numbers.
7077 If this doesn't make any sense to you, just accept the default 'n'.
7081 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7084 case "$uselonglong" in
7085 $define|true|[yY]*) dflt='y';;
7088 rp='Try to use long longs if available?'
7091 y|Y) val="$define" ;;
7097 case "$uselonglong" in
7098 true|[yY]*) uselonglong="$define" ;;
7101 case "$uselonglong" in
7103 : Look for a hint-file generated 'call-back-unit'. If the
7104 : user has specified that long longs should be used,
7105 : we may need to set or change some other defaults.
7106 if $test -f uselonglong.cbu; then
7107 echo "Your platform has some specific hints for long longs, using them..."
7111 (Your platform doesn't have any specific hints for long longs.)
7119 Previous version of $package used the standard IO mechanisms as defined
7120 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7121 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7122 the default. This abstraction layer can use AT&T's sfio (if you already
7123 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7124 problems with some extension modules. Using PerlIO with stdio is safe,
7125 but it is slower than plain stdio and therefore is not the default.
7127 If this doesn't make any sense to you, just accept the default 'n'.
7129 case "$useperlio" in
7130 $define|true|[yY]*) dflt='y';;
7133 rp='Use the experimental PerlIO abstraction layer?'
7140 echo "Ok, doing things the stdio way"
7147 case "$vendorprefix" in
7148 '') d_vendorbin="$undef"
7152 *) d_vendorbin="$define"
7153 : determine where vendor-supplied executables go.
7154 dflt=$vendorprefix/bin
7156 rp='Pathname for the vendor-supplied executables directory?'
7159 vendorbinexp="$ansexp"
7160 : Change installation prefix, if necessary.
7161 if $test X"$prefix" != X"$installprefix"; then
7162 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7164 installvendorbin="$vendorbinexp"
7169 : check for length of double
7171 case "$doublesize" in
7173 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7174 $cat >try.c <<'EOCP'
7178 printf("%d\n", (int)sizeof(double));
7183 if eval $compile_ok; then
7185 $echo " $doublesize bytes." >&4
7188 echo "(I can't seem to compile the test program. Guessing...)"
7189 rp="What is the size of a double precision number (in bytes)?"
7197 : check for long doubles
7199 $echo $n "Checking to see if your system supports long double..." $c >&4
7200 echo 'int main() { long double x = 7.0; }' > try.c
7202 if eval $compile; then
7204 echo " Yes, it does." >&4
7207 echo " No, it doesn't." >&4
7213 : check for length of long double
7214 case "${d_longdbl}${longdblsize}" in
7217 $echo $n "Checking to see how big your long doubles are..." $c >&4
7218 $cat >try.c <<'EOCP'
7222 printf("%d\n", sizeof(long double));
7227 if eval $compile; then
7228 longdblsize=`./try$exe_ext`
7229 $echo " $longdblsize bytes." >&4
7233 echo "(I can't seem to compile the test program. Guessing...)" >&4
7234 rp="What is the size of a long double (in bytes)?"
7238 if $test "X$doublesize" = "X$longdblsize"; then
7239 echo "(That isn't any different from an ordinary double.)"
7245 : Check how to convert floats to strings.
7246 if test "X$d_Gconvert" = X; then
7248 echo "Checking for an efficient way to convert floats to strings."
7251 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7252 char *myname = "gconvert";
7255 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7256 char *myname = "gcvt";
7259 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7260 char *myname = "qgcvt";
7261 #define DOUBLETYPE long double
7264 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7265 char *myname = "sprintf";
7269 #define DOUBLETYPE double
7279 checkit(expect, got)
7283 if (strcmp(expect, got)) {
7284 printf("%s oddity: Expected %s, got %s\n",
7285 myname, expect, got);
7295 /* This must be 1st test on (which?) platform */
7296 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7297 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7298 checkit("0.1", buf);
7300 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7303 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7306 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7309 /* Some Linux gcvt's give 1.e+5 here. */
7310 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7311 checkit("100000", buf);
7313 /* Some Linux gcvt's give -1.e+5 here. */
7314 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7315 checkit("-100000", buf);
7320 case "$d_Gconvert" in
7321 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7322 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7323 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7324 *) xxx_list='gconvert gcvt sprintf' ;;
7327 case "$d_longdbl$uselongdouble" in
7328 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7331 for xxx_convert in $xxx_list; do
7332 echo "Trying $xxx_convert..."
7334 set try -DTRY_$xxx_convert
7335 if eval $compile; then
7336 echo "$xxx_convert() found." >&4
7338 echo "I'll use $xxx_convert to convert floats into a string." >&4
7341 echo "...But $xxx_convert didn't work as I expected."
7344 echo "$xxx_convert NOT found." >&4
7348 case "$xxx_convert" in
7349 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7350 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7351 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7352 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7358 if $test X"$d_longdbl" = X"$define"; then
7360 echo "Checking how to print long doubles..." >&4
7362 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7363 $cat >try.c <<'EOCP'
7364 #include <sys/types.h>
7368 printf("%.3f\n", d);
7372 if eval $compile; then
7376 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7377 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7378 echo "We will use %f."
7384 if $test X"$sPRIfldbl" = X; then
7385 $cat >try.c <<'EOCP'
7386 #include <sys/types.h>
7389 long double d = 123.456;
7390 printf("%.3llf\n", d);
7394 if eval $compile; then
7398 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7399 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7400 echo "We will use %llf."
7406 if $test X"$sPRIfldbl" = X; then
7407 $cat >try.c <<'EOCP'
7408 #include <sys/types.h>
7411 long double d = 123.456;
7412 printf("%.3Lf\n", d);
7416 if eval $compile; then
7420 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7421 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7422 echo "We will use %Lf."
7428 if $test X"$sPRIfldbl" = X; then
7429 $cat >try.c <<'EOCP'
7430 #include <sys/types.h>
7433 long double d = 123.456;
7434 printf("%.3lf\n", d);
7438 if eval $compile; then
7442 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7443 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7444 echo "We will use %lf."
7450 if $test X"$sPRIfldbl" = X; then
7451 echo "Cannot figure out how to print long doubles." >&4
7458 case "$sPRIfldbl" in
7459 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7460 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7462 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7463 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7467 : Initialize h_fcntl
7470 : Initialize h_sysfile
7473 : access call always available on UNIX
7477 : locate the flags for 'access()'
7481 $cat >access.c <<'EOCP'
7482 #include <sys/types.h>
7487 #include <sys/file.h>
7496 : check sys/file.h first, no particular reason here
7497 if $test `./findhdr sys/file.h` && \
7498 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7500 echo "<sys/file.h> defines the *_OK access constants." >&4
7501 elif $test `./findhdr fcntl.h` && \
7502 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7504 echo "<fcntl.h> defines the *_OK access constants." >&4
7505 elif $test `./findhdr unistd.h` && \
7506 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7507 echo "<unistd.h> defines the *_OK access constants." >&4
7509 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7515 : see if accessx exists
7516 set accessx d_accessx
7519 : see if alarm exists
7523 : see if atolf exists
7527 : see if atoll exists
7531 : Look for GNU-cc style attribute checking
7533 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7534 $cat >attrib.c <<'EOCP'
7536 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7538 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7539 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7540 echo "Your C compiler doesn't fully support __attribute__."
7543 echo "Your C compiler supports __attribute__."
7547 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7554 : see if bcmp exists
7558 : see if bcopy exists
7562 : see if this is a unistd.h system
7563 set unistd.h i_unistd
7566 : see if getpgrp exists
7567 set getpgrp d_getpgrp
7570 case "$d_getpgrp" in
7573 echo "Checking to see which flavor of getpgrp is in use..."
7576 #include <sys/types.h>
7578 # include <unistd.h>
7582 if (getuid() == 0) {
7583 printf("(I see you are running Configure as super-user...)\n");
7587 if (getpgrp(1) == 0)
7596 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7597 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7599 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7600 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7603 echo "I can't seem to compile and run the test program."
7605 xxx="a USG one, i.e. you use getpgrp()."
7607 # SVR4 systems can appear rather BSD-ish.
7610 xxx="a BSD one, i.e. you use getpgrp(pid)."
7614 xxx="probably a USG one, i.e. you use getpgrp()."
7619 echo "Assuming your getpgrp is $xxx" >&4
7628 : see if setpgrp exists
7629 set setpgrp d_setpgrp
7632 case "$d_setpgrp" in
7635 echo "Checking to see which flavor of setpgrp is in use..."
7638 #include <sys/types.h>
7640 # include <unistd.h>
7644 if (getuid() == 0) {
7645 printf("(I see you are running Configure as super-user...)\n");
7649 if (-1 == setpgrp(1, 1))
7652 if (setpgrp() != -1)
7658 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7659 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7661 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7662 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7665 echo "(I can't seem to compile and run the test program.)"
7667 xxx="a USG one, i.e. you use setpgrp()."
7669 # SVR4 systems can appear rather BSD-ish.
7672 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7676 xxx="probably a USG one, i.e. you use setpgrp()."
7681 echo "Assuming your setpgrp is $xxx" >&4
7689 : see if bzero exists
7693 : see if signal is declared as pointer to function returning int or void
7695 xxx=`./findhdr signal.h`
7696 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7697 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7698 echo "You have int (*signal())() instead of void." >&4
7700 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7701 echo "You have void (*signal())()." >&4
7703 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7704 echo "You have int (*signal())() instead of void." >&4
7706 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7707 echo "You have void (*signal())()." >&4
7710 case "$d_voidsig" in
7712 echo "I can't determine whether signal handler returns void or int..." >&4
7714 rp="What type does your signal handler return?"
7721 echo "As you already told me, signal handler returns void." >&4
7724 *) echo "As you already told me, signal handler returns int." >&4
7731 case "$d_voidsig" in
7732 "$define") signal_t="void";;
7737 : check for ability to cast large floats to 32-bit ints.
7739 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7740 if $test "$intsize" -ge 4; then
7747 #include <sys/types.h>
7749 $signal_t blech(s) int s; { exit(3); }
7756 signal(SIGFPE, blech);
7758 /* Don't let compiler optimize the test away. Store the number
7759 in a writable string for gcc to pass to sscanf under HP/UX.
7761 sprintf(str, "2147483647");
7762 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7766 /* x86 processors will probably give 0x8000 0000, which is a
7767 sign change. We don't want that. We want to mimic SPARC
7768 behavior here, which is to preserve the sign and give
7771 if (i32 != ($xxx) f)
7777 if eval $compile_ok; then
7781 echo "(I can't seem to compile the test program--assuming it can't)"
7789 echo "Nope, it can't."
7796 : check for ability to cast negative floats to unsigned
7798 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7801 #include <sys/types.h>
7803 $signal_t blech(s) int s; { exit(7); }
7804 $signal_t blech_in_list(s) int s; { exit(4); }
7805 unsigned long dummy_long(p) unsigned long p; { return p; }
7806 unsigned int dummy_int(p) unsigned int p; { return p; }
7807 unsigned short dummy_short(p) unsigned short p; { return p; }
7811 unsigned long along;
7813 unsigned short ashort;
7817 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7818 a direct f = -123. assignment. gcc-2.8.0 reportedly
7819 optimized the whole file away
7821 /* Store the number in a writable string for gcc to pass to
7824 sprintf(str, "-123");
7825 sscanf(str, "%lf", &f); /* f = -123.; */
7827 signal(SIGFPE, blech);
7828 along = (unsigned long)f;
7829 aint = (unsigned int)f;
7830 ashort = (unsigned short)f;
7831 if (along != (unsigned long)-123)
7833 if (aint != (unsigned int)-123)
7835 if (ashort != (unsigned short)-123)
7837 sprintf(str, "1073741824.");
7838 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7841 along = (unsigned long)f;
7842 if (along != 0x80000000)
7846 along = (unsigned long)f;
7847 if (along != 0x7fffffff)
7851 along = (unsigned long)f;
7852 if (along != 0x80000001)
7856 signal(SIGFPE, blech_in_list);
7857 sprintf(str, "123.");
7858 sscanf(str, "%lf", &f); /* f = 123.; */
7859 along = dummy_long((unsigned long)f);
7860 aint = dummy_int((unsigned int)f);
7861 ashort = dummy_short((unsigned short)f);
7862 if (along != (unsigned long)123)
7864 if (aint != (unsigned int)123)
7866 if (ashort != (unsigned short)123)
7873 if eval $compile_ok; then
7877 echo "(I can't seem to compile the test program--assuming it can't)"
7880 case "$castflags" in
7885 echo "Nope, it can't."
7892 : see if vprintf exists
7894 if set vprintf val -f d_vprintf; eval $csym; $val; then
7895 echo 'vprintf() found.' >&4
7897 $cat >vprintf.c <<'EOF'
7898 #include <varargs.h>
7900 int main() { xxx("foo"); }
7909 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7913 if eval $compile && ./vprintf; then
7914 echo "Your vsprintf() returns (int)." >&4
7917 echo "Your vsprintf() returns (char*)." >&4
7921 echo 'vprintf() NOT found.' >&4
7931 : see if chown exists
7935 : see if chroot exists
7939 : see if chsize exists
7943 : check for const keyword
7945 echo 'Checking to see if your C compiler knows about "const"...' >&4
7946 $cat >const.c <<'EOCP'
7947 typedef struct spug { int drokk; } spug;
7954 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7956 echo "Yup, it does."
7959 echo "Nope, it doesn't."
7964 : see if crypt exists
7966 if set crypt val -f d_crypt; eval $csym; $val; then
7967 echo 'crypt() found.' >&4
7971 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7972 if $test -z "$cryptlib"; then
7973 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7977 if $test -z "$cryptlib"; then
7978 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7982 if $test -z "$cryptlib"; then
7983 cryptlib=`./loc libcrypt$_a "" $libpth`
7987 if $test -z "$cryptlib"; then
7988 echo 'crypt() NOT found.' >&4
7997 : get csh whereabouts
7999 'csh') val="$undef" ;;
8004 : Respect a hint or command line value for full_csh.
8006 '') full_csh=$csh ;;
8009 : see if cuserid exists
8010 set cuserid d_cuserid
8013 : see if this is a limits.h system
8014 set limits.h i_limits
8017 : see if this is a float.h system
8021 : See if number of significant digits in a double precision number is known
8023 $cat >dbl_dig.c <<EOM
8033 printf("Contains DBL_DIG");
8036 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8037 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8038 echo "DBL_DIG found." >&4
8041 echo "DBL_DIG NOT found." >&4
8048 : see if difftime exists
8049 set difftime d_difftime
8052 : see if this is a dirent system
8054 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8056 echo "<dirent.h> found." >&4
8059 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8060 echo "<sys/dir.h> found." >&4
8063 xinc=`./findhdr sys/ndir.h`
8065 echo "<dirent.h> NOT found." >&4
8070 : Look for type of directory structure.
8072 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8074 case "$direntrytype" in
8077 $define) guess1='struct dirent' ;;
8078 *) guess1='struct direct' ;;
8081 *) guess1="$direntrytype"
8086 'struct dirent') guess2='struct direct' ;;
8087 *) guess2='struct dirent' ;;
8090 if $contains "$guess1" try.c >/dev/null 2>&1; then
8091 direntrytype="$guess1"
8092 echo "Your directory entries are $direntrytype." >&4
8093 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8094 direntrytype="$guess2"
8095 echo "Your directory entries seem to be $direntrytype." >&4
8097 echo "I don't recognize your system's directory entries." >&4
8098 rp="What type is used for directory entries on this system?"
8106 : see if the directory entry stores field length
8108 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8109 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8110 echo "Good, your directory entry keeps length information in d_namlen." >&4
8113 echo "Your directory entry does not know about the d_namlen field." >&4
8120 : see if dlerror exists
8123 set dlerror d_dlerror
8127 : see if dlfcn is available
8135 On a few systems, the dynamically loaded modules that perl generates and uses
8136 will need a different extension than shared libs. The default will probably
8144 rp='What is the extension of dynamically loaded modules'
8153 : Check if dlsym need a leading underscore
8159 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8160 $cat >dyna.c <<'EOM'
8169 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8171 #include <sys/types.h>
8185 int mode = RTLD_LAZY ;
8187 handle = dlopen("./dyna.$dlext", mode) ;
8188 if (handle == NULL) {
8193 symbol = dlsym(handle, "fred") ;
8194 if (symbol == NULL) {
8195 /* try putting a leading underscore */
8196 symbol = dlsym(handle, "_fred") ;
8197 if (symbol == NULL) {
8210 : Call the object file tmp-dyna.o in case dlext=o.
8211 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8212 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8213 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8214 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8217 1) echo "Test program failed using dlopen." >&4
8218 echo "Perhaps you should not use dynamic loading." >&4;;
8219 2) echo "Test program failed using dlsym." >&4
8220 echo "Perhaps you should not use dynamic loading." >&4;;
8221 3) echo "dlsym needs a leading underscore" >&4
8223 4) echo "dlsym doesn't need a leading underscore." >&4;;
8226 echo "I can't compile and run the test program." >&4
8227 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8232 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8237 hasproto='varname=$1; func=$2; shift; shift;
8238 while $test $# -ge 2; do
8240 $define) echo "#include <$2>";;
8244 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8245 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8246 echo "$func() prototype found.";
8249 echo "$func() prototype NOT found.";
8254 $rm -f try.c tryout.c'
8256 : see if prototype for drand48 is available
8258 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8261 : see if dup2 exists
8265 : see if eaccess exists
8266 set eaccess d_eaccess
8269 : see if endgrent exists
8270 set endgrent d_endgrent
8273 : see if endhostent exists
8274 set endhostent d_endhent
8277 : see if endnetent exists
8278 set endnetent d_endnent
8281 : see if endprotoent exists
8282 set endprotoent d_endpent
8285 : see if endpwent exists
8286 set endpwent d_endpwent
8289 : see if endservent exists
8290 set endservent d_endsent
8293 : see if endspent exists
8294 set endspent d_endspent
8297 : Locate the flags for 'open()'
8299 $cat >open3.c <<'EOCP'
8300 #include <sys/types.h>
8305 #include <sys/file.h>
8316 : check sys/file.h first to get FREAD on Sun
8317 if $test `./findhdr sys/file.h` && \
8318 set open3 -DI_SYS_FILE && eval $compile; then
8320 echo "<sys/file.h> defines the O_* constants..." >&4
8322 echo "and you have the 3 argument form of open()." >&4
8325 echo "but not the 3 argument form of open(). Oh, well." >&4
8328 elif $test `./findhdr fcntl.h` && \
8329 set open3 -DI_FCNTL && eval $compile; then
8331 echo "<fcntl.h> defines the O_* constants..." >&4
8333 echo "and you have the 3 argument form of open()." >&4
8336 echo "but not the 3 argument form of open(). Oh, well." >&4
8341 echo "I can't find the O_* constant definitions! You got problems." >&4
8347 : see which of string.h or strings.h is needed
8349 strings=`./findhdr string.h`
8350 if $test "$strings" && $test -r "$strings"; then
8351 echo "Using <string.h> instead of <strings.h>." >&4
8355 strings=`./findhdr strings.h`
8356 if $test "$strings" && $test -r "$strings"; then
8357 echo "Using <strings.h> instead of <string.h>." >&4
8359 echo "No string header found -- You'll surely have problems." >&4
8365 "$undef") strings=`./findhdr strings.h`;;
8366 *) strings=`./findhdr string.h`;;
8369 : check for non-blocking I/O stuff
8370 case "$h_sysfile" in
8371 true) echo "#include <sys/file.h>" > head.c;;
8374 true) echo "#include <fcntl.h>" > head.c;;
8375 *) echo "#include <sys/fcntl.h>" > head.c;;
8380 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8381 case "$o_nonblock" in
8384 $cat >>try.c <<'EOCP'
8388 printf("O_NONBLOCK\n");
8392 printf("O_NDELAY\n");
8396 printf("FNDELAY\n");
8403 if eval $compile_ok; then
8405 case "$o_nonblock" in
8406 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8407 *) echo "Seems like we can use $o_nonblock.";;
8410 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8413 *) echo "Using $hint value $o_nonblock.";;
8415 $rm -f try try.* .out core
8418 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8424 #include <sys/types.h>
8427 #define MY_O_NONBLOCK $o_nonblock
8428 #ifndef errno /* XXX need better Configure test */
8438 #include <strings.h>
8440 $signal_t blech(x) int x; { exit(3); }
8442 $cat >> try.c <<'EOCP'
8450 pipe(pd); /* Down: child -> parent */
8451 pipe(pu); /* Up: parent -> child */
8454 close(pd[1]); /* Parent reads from pd[0] */
8455 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8456 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8458 signal(SIGALRM, blech);
8460 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8462 sprintf(string, "%d\n", ret);
8463 write(2, string, strlen(string));
8466 if (errno == EAGAIN) {
8472 if (errno == EWOULDBLOCK)
8473 printf("EWOULDBLOCK\n");
8476 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8477 sleep(2); /* Give it time to close our pipe */
8479 ret = read(pd[0], buf, 1); /* Should read EOF */
8481 sprintf(string, "%d\n", ret);
8482 write(3, string, strlen(string));
8486 close(pd[0]); /* We write to pd[1] */
8487 close(pu[1]); /* We read from pu[0] */
8488 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8489 close(pd[1]); /* Pipe pd is now fully closed! */
8490 exit(0); /* Bye bye, thank you for playing! */
8494 if eval $compile_ok; then
8495 echo "$startsh" >mtry
8496 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8498 ./mtry >/dev/null 2>&1
8500 0) eagain=`$cat try.out`;;
8501 1) echo "Could not perform non-blocking setting!";;
8502 2) echo "I did a successful read() for something that was not there!";;
8503 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8504 *) echo "Something terribly wrong happened during testing.";;
8506 rd_nodata=`$cat try.ret`
8507 echo "A read() system call with no data present returns $rd_nodata."
8508 case "$rd_nodata" in
8511 echo "(That's peculiar, fixing that to be -1.)"
8517 echo "Forcing errno EAGAIN on read() with no data available."
8521 echo "Your read() sets errno to $eagain when no data is available."
8524 status=`$cat try.err`
8526 0) echo "And it correctly returns 0 to signal EOF.";;
8527 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8528 *) echo "However, your read() returns '$status' on EOF??";;
8531 if test "$status" = "$rd_nodata"; then
8532 echo "WARNING: you can't distinguish between EOF and no data!"
8536 echo "I can't compile the test program--assuming errno EAGAIN will do."
8543 echo "Using $hint value $eagain."
8544 echo "Your read() returns $rd_nodata when no data is present."
8545 case "$d_eofnblk" in
8546 "$define") echo "And you can see EOF because read() returns 0.";;
8547 "$undef") echo "But you can't see EOF status from read() returned value.";;
8549 echo "(Assuming you can't see EOF status from read anyway.)"
8555 $rm -f try try.* .out core head.c mtry
8557 : see if fchmod exists
8561 : see if fchown exists
8565 : see if this is an fcntl system
8569 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8570 while $test $# -ge 2; do
8572 $define) echo "#include <$2>";;
8576 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8578 if eval $compile; then
8589 : see whether socket exists
8591 $echo $n "Hmm... $c" >&4
8592 if set socket val -f d_socket; eval $csym; $val; then
8593 echo "Looks like you have Berkeley networking support." >&4
8595 if set setsockopt val -f; eval $csym; $val; then
8598 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8602 if $contains socklib libc.list >/dev/null 2>&1; then
8603 echo "Looks like you have Berkeley networking support." >&4
8605 : we will have to assume that it supports the 4.2 BSD interface
8608 echo "You don't have Berkeley networking in libc$_a..." >&4
8609 if test "X$d_socket" = "X$define"; then
8610 echo "...but you seem to believe that you have sockets." >&4
8612 for net in net socket
8614 if test -f /usr/lib/lib$net$_a; then
8615 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8616 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8617 if $contains socket libc.list >/dev/null 2>&1; then
8622 echo "...but the Wollongong group seems to have hacked it in." >&4
8623 sockethdr="-I/usr/netinclude"
8626 echo "Found Berkeley sockets interface in lib$net." >& 4
8627 if $contains setsockopt libc.list >/dev/null 2>&1; then
8630 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8637 if test "X$d_socket" != "X$define"; then
8638 echo "or anywhere else I see." >&4
8646 : see if socketpair exists
8647 set socketpair d_sockpair
8652 echo "Checking the availability of certain socket constants..." >& 4
8653 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8654 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8656 #include <sys/types.h>
8657 #include <sys/socket.h>
8663 set try; if eval $compile; then
8666 set d_${enum}; eval $setvar
8670 : see if sys/select.h has to be included
8671 set sys/select.h i_sysselct
8674 : see if we should include time.h, sys/time.h, or both
8676 if test "X$timeincl" = X; then
8677 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8678 $echo $n "I'm now running the test program...$c"
8679 $cat >try.c <<'EOCP'
8680 #include <sys/types.h>
8685 #ifdef SYSTIMEKERNEL
8688 #include <sys/time.h>
8691 #include <sys/select.h>
8700 struct timezone tzp;
8702 if (foo.tm_sec == foo.tm_sec)
8705 if (bar.tv_sec == bar.tv_sec)
8712 for s_timezone in '-DS_TIMEZONE' ''; do
8714 for s_timeval in '-DS_TIMEVAL' ''; do
8715 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8716 for i_time in '' '-DI_TIME'; do
8717 for i_systime in '-DI_SYSTIME' ''; do
8720 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8721 if eval $compile; then
8722 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8726 $echo $n "Succeeded with $flags$c"
8738 *SYSTIMEKERNEL*) i_systimek="$define"
8739 timeincl=`./findhdr sys/time.h`
8740 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8741 *) i_systimek="$undef";;
8744 *I_TIME*) i_time="$define"
8745 timeincl=`./findhdr time.h`" $timeincl"
8746 echo "We'll include <time.h>." >&4;;
8747 *) i_time="$undef";;
8750 *I_SYSTIME*) i_systime="$define"
8751 timeincl=`./findhdr sys/time.h`" $timeincl"
8752 echo "We'll include <sys/time.h>." >&4;;
8753 *) i_systime="$undef";;
8758 : check for fd_set items
8761 Checking to see how well your C compiler handles fd_set and friends ...
8763 $cat >fd_set.c <<EOCP
8764 #$i_systime I_SYS_TIME
8765 #$i_sysselct I_SYS_SELECT
8766 #$d_socket HAS_SOCKET
8767 #include <sys/types.h>
8769 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8772 #include <sys/time.h>
8775 #include <sys/select.h>
8784 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8791 set fd_set -DTRYBITS
8792 if eval $compile; then
8793 d_fds_bits="$define"
8795 echo "Well, your system knows about the normal fd_set typedef..." >&4
8797 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8798 d_fd_macros="$define"
8801 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8803 d_fd_macros="$undef"
8807 Hmm, your compiler has some difficulty with fd_set. Checking further...
8810 if eval $compile; then
8813 echo "Well, your system has some sort of fd_set available..." >&4
8815 echo "and you have the normal fd_set macros." >&4
8816 d_fd_macros="$define"
8819 but not the normal fd_set macros! Gross! More work for me...
8821 d_fd_macros="$undef"
8824 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8827 d_fd_macros="$undef"
8832 : see if fgetpos exists
8833 set fgetpos d_fgetpos
8836 : see if flock exists
8840 : see if fork exists
8844 : see if pathconf exists
8845 set pathconf d_pathconf
8848 : see if fpathconf exists
8849 set fpathconf d_fpathconf
8855 echo "Checking to see if your system supports off64_t..." >&4
8857 #include <sys/types.h>
8859 int main() { off64_t x = 7; }'
8862 if eval $compile; then
8864 echo "Yes, it does."
8867 echo "No, it doesn't."
8868 case "$lseeksize" in
8869 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8876 : check for fpos64_t
8878 echo "Checking to see if your system supports fpos64_t..." >&4
8880 #include <sys/stdio.h>
8881 int main() { fpos64_t x x = 7; }'
8884 if eval $compile; then
8886 echo "Yes, it does."
8889 echo "No, it doesn't."
8891 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8898 hasstruct='varname=$1; struct=$2; shift; shift;
8899 while $test $# -ge 2; do
8901 $define) echo "#include <$2>";;
8905 echo "int main () { struct $struct foo; }" >> try.c;
8907 if eval $compile; then
8916 : see if this is a sys/param system
8917 set sys/param.h i_sysparam
8920 : see if this is a sys/mount.h system
8921 set sys/mount.h i_sysmount
8924 : see if sys/types.h has to be included
8925 set sys/types.h i_systypes
8930 echo "Checking to see if your system supports struct fs_data..." >&4
8931 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8933 case "$d_fs_data_s" in
8934 "$define") echo "Yes, it does." ;;
8935 *) echo "No, it doesn't." ;;
8938 : see if fseeko exists
8942 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8945 : see if fsetpos exists
8946 set fsetpos d_fsetpos
8950 : see if fstatfs exists
8951 set fstatfs d_fstatfs
8955 : see if statvfs exists
8956 set statvfs d_statvfs
8959 : see if fstatvfs exists
8960 set fstatvfs d_fstatvfs
8964 : see if ftello exists
8968 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8971 : see if getgrent exists
8972 set getgrent d_getgrent
8975 : see if gethostbyaddr exists
8976 set gethostbyaddr d_gethbyaddr
8979 : see if gethostbyname exists
8980 set gethostbyname d_gethbyname
8983 : see if gethostent exists
8984 set gethostent d_gethent
8987 : see how we will look up host name
8990 if set gethostname val -f d_gethname; eval $csym; $val; then
8991 echo 'gethostname() found.' >&4
8992 d_gethname="$define"
8995 if set uname val -f d_uname; eval $csym; $val; then
8998 uname() was found, but you're running xenix, and older versions of xenix
8999 have a broken uname(). If you don't really know whether your xenix is old
9000 enough to have a broken system call, use the default answer.
9007 rp='Is your uname() broken?'
9010 n*) d_uname="$define"; call=uname;;
9013 echo 'uname() found.' >&4
9020 case "$d_gethname" in
9021 '') d_gethname="$undef";;
9024 '') d_uname="$undef";;
9026 case "$d_uname$d_gethname" in
9031 Every now and then someone has a $call() that lies about the hostname
9032 but can't be fixed for political or economic reasons. If you wish, I can
9033 pretend $call() isn't there and maybe compute hostname at run-time
9034 thanks to the '$phostname' command.
9037 rp="Shall I ignore $call() from now on?"
9040 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9043 case "$phostname" in
9045 *) case "$aphostname" in
9051 file=`./loc $file $file $pth`
9052 aphostname=`echo $file $*`
9057 case "$d_uname$d_gethname" in
9060 case "$phostname" in
9062 echo "There will be no way for $package to get your hostname." >&4;;
9064 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9068 case "$d_phostname" in
9069 '') d_phostname="$undef";;
9072 : see if this is a netdb.h system
9076 : see if prototypes for various gethostxxx netdb.h functions are available
9078 set d_gethostprotos gethostent $i_netdb netdb.h
9081 : see if getlogin exists
9082 set getlogin d_getlogin
9085 : see if getmnt exists
9089 : see if getmntent exists
9090 set getmntent d_getmntent
9093 : see if getnetbyaddr exists
9094 set getnetbyaddr d_getnbyaddr
9097 : see if getnetbyname exists
9098 set getnetbyname d_getnbyname
9101 : see if getnetent exists
9102 set getnetent d_getnent
9105 : see if prototypes for various getnetxxx netdb.h functions are available
9107 set d_getnetprotos getnetent $i_netdb netdb.h
9111 : see if getprotobyname exists
9112 set getprotobyname d_getpbyname
9115 : see if getprotobynumber exists
9116 set getprotobynumber d_getpbynumber
9119 : see if getprotoent exists
9120 set getprotoent d_getpent
9123 : see if getpgid exists
9124 set getpgid d_getpgid
9127 : see if getpgrp2 exists
9128 set getpgrp2 d_getpgrp2
9131 : see if getppid exists
9132 set getppid d_getppid
9135 : see if getpriority exists
9136 set getpriority d_getprior
9139 : see if prototypes for various getprotoxxx netdb.h functions are available
9141 set d_getprotoprotos getprotoent $i_netdb netdb.h
9144 : see if getpwent exists
9145 set getpwent d_getpwent
9149 : see if getservbyname exists
9150 set getservbyname d_getsbyname
9153 : see if getservbyport exists
9154 set getservbyport d_getsbyport
9157 : see if getservent exists
9158 set getservent d_getsent
9161 : see if prototypes for various getservxxx netdb.h functions are available
9163 set d_getservprotos getservent $i_netdb netdb.h
9166 : see if getspent exists
9167 set getspent d_getspent
9170 : see if getspnam exists
9171 set getspnam d_getspnam
9174 : see if gettimeofday or ftime exists
9175 set gettimeofday d_gettimeod
9177 case "$d_gettimeod" in
9183 val="$undef"; set d_ftime; eval $setvar
9186 case "$d_gettimeod$d_ftime" in
9189 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9193 : see if this is an grp system
9199 xxx=`./findhdr grp.h`
9200 $cppstdin $cppflags $cppminus < $xxx >$$.h
9202 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9214 set d_grpasswd; eval $setvar
9218 : see if hasmntopt exists
9219 set hasmntopt d_hasmntopt
9222 : see if this is a netinet/in.h or sys/in.h system
9223 set netinet/in.h i_niin sys/in.h i_sysin
9226 : see if arpa/inet.h has to be included
9227 set arpa/inet.h i_arpainet
9230 : see if htonl --and friends-- exists
9235 : Maybe they are macros.
9240 #include <sys/types.h>
9241 #$i_niin I_NETINET_IN
9243 #$i_arpainet I_ARPA_INET
9245 #include <netinet/in.h>
9251 #include <arpa/inet.h>
9254 printf("Defined as a macro.");
9257 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9258 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9260 echo "But it seems to be defined as a macro." >&4
9270 if set index val -f; eval $csym; $val; then
9271 if set strchr val -f d_strchr; eval $csym; $val; then
9272 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9275 echo "strchr() found." >&4
9279 echo "index() found." >&4
9284 echo "index() found." >&4
9287 if set strchr val -f d_strchr; eval $csym; $val; then
9290 echo "strchr() found." >&4
9292 echo "No index() or strchr() found!" >&4
9297 set d_strchr; eval $setvar
9299 set d_index; eval $setvar
9301 : check whether inet_aton exists
9302 set inet_aton d_inetaton
9307 $cat >isascii.c <<'EOCP'
9319 if eval $compile; then
9320 echo "isascii() found." >&4
9323 echo "isascii() NOT found." >&4
9330 : see if killpg exists
9334 : see if lchown exists
9336 $cat > try.c <<'EOCP'
9337 /* System header to define __stub macros and hopefully few prototypes,
9338 which can conflict with char lchown(); below. */
9340 /* Override any gcc2 internal prototype to avoid an error. */
9341 /* We use char because int might match the return type of a gcc2
9342 builtin and then its argument prototype would still apply. */
9345 /* The GNU C library defines this for functions which it implements
9346 to always fail with ENOSYS. Some functions are actually named
9347 something starting with __ and the normal name is an alias. */
9348 #if defined (__stub_lchown) || defined (__stub___lchown)
9356 if eval $compile; then
9357 $echo "lchown() found." >&4
9360 $echo "lchown() NOT found." >&4
9366 : See if number of significant digits in a double precision number is known
9368 $cat >ldbl_dig.c <<EOM
9378 printf("Contains LDBL_DIG");
9381 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9382 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9383 echo "LDBL_DIG found." >&4
9386 echo "LDBL_DIG NOT found." >&4
9393 : see if link exists
9397 : see if localeconv exists
9398 set localeconv d_locconv
9401 : see if lockf exists
9405 : check for long long
9407 $echo $n "Checking to see if your system supports long long..." $c >&4
9408 echo 'int main() { long long x = 7; return 0; }' > try.c
9410 if eval $compile; then
9412 echo " Yes, it does." >&4
9415 echo " No, it doesn't." >&4
9421 : check for length of long long
9422 case "${d_longlong}${longlongsize}" in
9425 $echo $n "Checking to see how big your long longs are..." $c >&4
9426 $cat >try.c <<'EOCP'
9430 printf("%d\n", (int)sizeof(long long));
9435 if eval $compile_ok; then
9436 longlongsize=`./try$exe_ext`
9437 $echo " $longlongsize bytes." >&4
9441 echo "(I can't seem to compile the test program. Guessing...)"
9442 rp="What is the size of a long long (in bytes)?"
9446 if $test "X$longsize" = "X$longlongsize"; then
9447 echo "(That isn't any different from an ordinary long.)"
9453 : see if lstat exists
9457 : see if mblen exists
9461 : see if mbstowcs exists
9462 set mbstowcs d_mbstowcs
9465 : see if mbtowc exists
9469 : see if memchr exists
9473 : see if memcmp exists
9477 : see if memcpy exists
9481 : see if memmove exists
9482 set memmove d_memmove
9485 : see if memset exists
9489 : see if mkdir exists
9493 : see if mkfifo exists
9497 : see if mktime exists
9501 : see if msgctl exists
9505 : see if msgget exists
9509 : see if msgsnd exists
9513 : see if msgrcv exists
9517 : see how much of the 'msg*(2)' library is present.
9520 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9521 *"$undef"*) h_msg=false;;
9525 case "`ipcs 2>&1`" in
9526 "SVID messages"*"not configured"*)
9527 echo "Your $osname does not have the msg*(2) configured." >&4
9542 : we could also check for sys/ipc.h ...
9543 if $h_msg && $test `./findhdr sys/msg.h`; then
9544 echo "You have the full msg*(2) library." >&4
9547 echo "You don't have the full msg*(2) library." >&4
9553 : see if nice exists
9557 : see if inttypes.h is available
9558 : we want a real compile instead of Inhdr because some systems
9559 : have an inttypes.h which includes non-existent headers
9562 #include <inttypes.h>
9564 static int32_t foo32 = 0x12345678;
9568 if eval $compile; then
9569 echo "<inttypes.h> found." >&4
9572 echo "<inttypes.h> NOT found." >&4
9581 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9583 #include <sys/types.h>
9584 #$i_inttypes I_INTTYPES
9586 #include <inttypes.h>
9588 int main() { int64_t x = 7; }
9591 if eval $compile; then
9593 echo " Yes, it does." >&4
9596 echo " No, it doesn't." >&4
9604 echo "Checking which 64-bit integer type we could use..." >&4
9610 val='"unsigned int"'
9615 *) case "$longsize" in
9619 val='"unsigned long"'
9624 *) case "$uselonglong:$d_longlong:$longlongsize" in
9629 val='"unsigned long long"'
9634 *) case "$d_int64t" in
9653 '') case "$uselonglong:$d_longlong:$longlongsize" in
9655 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9656 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9660 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9665 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9670 : check for length of character
9674 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9675 $cat >try.c <<'EOCP'
9679 printf("%d\n", (int)sizeof(char));
9684 if eval $compile_ok; then
9688 echo "(I can't seem to compile the test program. Guessing...)"
9695 rp="What is the size of a character (in bytes)?"
9702 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9704 case "$use64bits:$d_quad:$quadtype" in
9712 uvtype="unsigned long"
9718 case "$uselongdouble:$d_longdbl" in
9720 nvtype="long double"
9728 $echo "(IV will be "$ivtype", $ivsize bytes)"
9729 $echo "(UV will be "$uvtype", $uvsize bytes)"
9730 $echo "(NV will be "$nvtype", $nvsize bytes)"
9733 #$i_inttypes I_INTTYPES
9735 #include <inttypes.h>
9740 int8_t i = INT8_MAX;
9741 uint8_t u = UINT8_MAX;
9745 int16_t i = INT16_MAX;
9746 uint16_t i = UINT16_MAX;
9747 printf("int16_t\n");
9750 int32_t i = INT32_MAX;
9751 uint32_t u = UINT32_MAX;
9752 printf("int32_t\n");
9758 '') case "$charsize" in
9760 u8type="unsigned char"
9769 if eval $compile; then
9770 case "`./try$exe_ext`" in
9771 int8_t) i8type=int8_t
9781 '') if $test $charsize -ge 1; then
9783 u8type="unsigned char"
9791 '') case "$shortsize" in
9793 u16type="unsigned short"
9802 if eval $compile; then
9803 case "`./try$exe_ext`" in
9815 '') if $test $shortsize -ge 2; then
9817 u16type="unsigned short"
9825 '') case "$longsize" in
9827 u32type="unsigned long"
9831 *) case "$intsize" in
9833 u32type="unsigned int"
9844 if eval $compile; then
9845 case "`./try$exe_ext`" in
9857 '') if $test $intsize -ge 4; then
9859 u32type="unsigned int"
9867 '') case "$d_quad:$quadtype" in
9870 u64type="$uquadtype"
9878 $echo "Checking whether your NVs can preserve your UVs..." >&4
9882 $uvtype k = ($uvtype)~0, l;
9888 printf("preserve\n");
9893 if eval $compile; then
9894 case "`./try$exe_ext`" in
9895 preserve) d_nvpresuv="$define" ;;
9898 case "$d_nvpresuv" in
9899 $define) $echo "Yes, they can." 2>&1 ;;
9900 *) $echo "No, they can't." 2>&1
9907 : see if POSIX threads are available
9908 set pthread.h i_pthread
9914 : how to create joinable pthreads
9915 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9917 echo "Checking what constant to use for creating joinable pthreads..." >&4
9918 $cat >try.c <<'EOCP'
9919 #include <pthread.h>
9921 int detachstate = JOINABLE;
9924 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9925 if eval $compile; then
9926 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9927 val="$undef" # Yes, undef.
9928 set d_old_pthread_create_joinable
9931 set old_pthread_create_joinable
9934 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9935 if eval $compile; then
9936 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9938 set d_old_pthread_create_joinable
9940 val=PTHREAD_CREATE_UNDETACHED
9941 set old_pthread_create_joinable
9944 set try -DJOINABLE=__UNDETACHED
9945 if eval $compile; then
9946 echo "You seem to use __UNDETACHED." >&4
9948 set d_old_pthread_create_joinable
9951 set old_pthread_create_joinable
9954 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9956 set d_old_pthread_create_joinable
9959 set old_pthread_create_joinable
9966 d_old_pthread_create_joinable="$undef"
9967 old_pthread_create_joinable=""
9970 : see if pause exists
9974 : see if pipe exists
9978 : see if poll exists
9983 : see whether the various POSIXish _yields exist
9985 #include <pthread.h>
9991 #ifdef PTHREAD_YIELD
9994 #ifdef PTHREAD_YIELD_NULL
9995 pthread_yield(NULL);
10001 : see if sched_yield exists
10002 set try -DSCHED_YIELD
10003 if eval $compile; then
10005 sched_yield='sched_yield()'
10009 case "$usethreads" in
10012 $define) echo 'sched_yield() found.' >&4 ;;
10013 *) echo 'sched_yield() NOT found.' >&4 ;;
10019 : see if pthread_yield exists
10020 set try -DPTHREAD_YIELD
10021 if eval $compile; then
10023 case "$sched_yield" in
10024 '') sched_yield='pthread_yield()' ;;
10027 set try -DPTHREAD_YIELD_NULL
10028 if eval $compile; then
10030 case "$sched_yield" in
10031 '') sched_yield='pthread_yield(NULL)' ;;
10037 case "$usethreads" in
10040 $define) echo 'pthread_yield() found.' >&4 ;;
10041 *) echo 'pthread_yield() NOT found.' >&4 ;;
10045 set d_pthread_yield
10048 case "$sched_yield" in
10049 '') sched_yield=undef ;;
10054 : see if this is a pwd.h system
10060 xxx=`./findhdr pwd.h`
10061 $cppstdin $cppflags $cppminus < $xxx >$$.h
10063 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10071 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10079 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10087 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10095 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10103 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10111 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10119 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10131 set d_pwquota; eval $setvar
10132 set d_pwage; eval $setvar
10133 set d_pwchange; eval $setvar
10134 set d_pwclass; eval $setvar
10135 set d_pwexpire; eval $setvar
10136 set d_pwcomment; eval $setvar
10137 set d_pwgecos; eval $setvar
10138 set d_pwpasswd; eval $setvar
10142 : see if readdir and friends exist
10143 set readdir d_readdir
10145 set seekdir d_seekdir
10147 set telldir d_telldir
10149 set rewinddir d_rewinddir
10152 : see if readlink exists
10153 set readlink d_readlink
10156 : see if rename exists
10157 set rename d_rename
10160 : see if rmdir exists
10164 : see if memory.h is available.
10169 : See if it conflicts with string.h
10175 $cppstdin $cppflags $cppminus < $strings > mem.h
10176 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10178 echo "We won't be including <memory.h>."
10188 : can bcopy handle overlapping blocks?
10193 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10195 #$i_memory I_MEMORY
10196 #$i_stdlib I_STDLIB
10197 #$i_string I_STRING
10198 #$i_unistd I_UNISTD
10200 $cat >>try.c <<'EOCP'
10203 # include <memory.h>
10206 # include <stdlib.h>
10209 # include <string.h>
10211 # include <strings.h>
10214 # include <unistd.h> /* Needed for NetBSD */
10218 char buf[128], abc[128];
10224 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10226 for (align = 7; align >= 0; align--) {
10227 for (len = 36; len; len--) {
10229 bcopy(abc, b, len);
10230 for (off = 1; off <= len; off++) {
10231 bcopy(b, b+off, len);
10232 bcopy(b+off, b, len);
10233 if (bcmp(b, abc, len))
10242 if eval $compile_ok; then
10243 if ./try 2>/dev/null; then
10244 echo "Yes, it can."
10247 echo "It can't, sorry."
10248 case "$d_memmove" in
10249 "$define") echo "But that's Ok since you have memmove()." ;;
10253 echo "(I can't compile the test program, so we'll assume not...)"
10254 case "$d_memmove" in
10255 "$define") echo "But that's Ok since you have memmove()." ;;
10260 $rm -f try.* try core
10264 : can memcpy handle overlapping blocks?
10266 case "$d_memcpy" in
10269 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10271 #$i_memory I_MEMORY
10272 #$i_stdlib I_STDLIB
10273 #$i_string I_STRING
10274 #$i_unistd I_UNISTD
10276 $cat >>try.c <<'EOCP'
10279 # include <memory.h>
10282 # include <stdlib.h>
10285 # include <string.h>
10287 # include <strings.h>
10290 # include <unistd.h> /* Needed for NetBSD */
10294 char buf[128], abc[128];
10300 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10301 try to store the string in read-only memory. */
10302 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10304 for (align = 7; align >= 0; align--) {
10305 for (len = 36; len; len--) {
10307 memcpy(b, abc, len);
10308 for (off = 1; off <= len; off++) {
10309 memcpy(b+off, b, len);
10310 memcpy(b, b+off, len);
10311 if (memcmp(b, abc, len))
10320 if eval $compile_ok; then
10321 if ./try 2>/dev/null; then
10322 echo "Yes, it can."
10325 echo "It can't, sorry."
10326 case "$d_memmove" in
10327 "$define") echo "But that's Ok since you have memmove()." ;;
10331 echo "(I can't compile the test program, so we'll assume not...)"
10332 case "$d_memmove" in
10333 "$define") echo "But that's Ok since you have memmove()." ;;
10338 $rm -f try.* try core
10342 : can memcmp be trusted to compare relative magnitude?
10344 case "$d_memcmp" in
10347 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10349 #$i_memory I_MEMORY
10350 #$i_stdlib I_STDLIB
10351 #$i_string I_STRING
10352 #$i_unistd I_UNISTD
10354 $cat >>try.c <<'EOCP'
10357 # include <memory.h>
10360 # include <stdlib.h>
10363 # include <string.h>
10365 # include <strings.h>
10368 # include <unistd.h> /* Needed for NetBSD */
10374 if ((a < b) && memcmp(&a, &b, 1) < 0)
10380 if eval $compile_ok; then
10381 if ./try 2>/dev/null; then
10382 echo "Yes, it can."
10385 echo "No, it can't (it uses signed chars)."
10388 echo "(I can't compile the test program, so we'll assume not...)"
10392 $rm -f try.* try core
10396 : see if select exists
10397 set select d_select
10400 : see if semctl exists
10401 set semctl d_semctl
10404 : see if semget exists
10405 set semget d_semget
10408 : see if semop exists
10412 : see how much of the 'sem*(2)' library is present.
10415 case "$d_semctl$d_semget$d_semop" in
10416 *"$undef"*) h_sem=false;;
10420 case "`ipcs 2>&1`" in
10421 "SVID messages"*"not configured"*)
10422 echo "Your $osname does not have the sem*(2) configured." >&4
10425 set semctl d_semctl
10427 set semget d_semget
10435 : we could also check for sys/ipc.h ...
10436 if $h_sem && $test `./findhdr sys/sem.h`; then
10437 echo "You have the full sem*(2) library." >&4
10440 echo "You don't have the full sem*(2) library." >&4
10446 : see whether sys/sem.h defines union semun
10448 $cat > try.c <<'END'
10449 #include <sys/types.h>
10450 #include <sys/ipc.h>
10451 #include <sys/sem.h>
10452 int main () { union semun semun; semun.buf = 0; }
10455 if eval $compile; then
10456 echo "You have union semun in <sys/sem.h>." >&4
10459 echo "You do not have union semun in <sys/sem.h>." >&4
10462 $rm -f try try.c try.h
10466 : see how to do semctl IPC_STAT
10469 : see whether semctl IPC_STAT can use union semun
10474 # define S_IRUSR S_IREAD
10475 # define S_IWUSR S_IWRITE
10476 # define S_IXUSR S_IEXEC
10478 # define S_IRUSR 0400
10479 # define S_IWUSR 0200
10480 # define S_IXUSR 0100
10482 # define S_IRGRP (S_IRUSR>>3)
10483 # define S_IWGRP (S_IWUSR>>3)
10484 # define S_IXGRP (S_IXUSR>>3)
10485 # define S_IROTH (S_IRUSR>>6)
10486 # define S_IWOTH (S_IWUSR>>6)
10487 # define S_IXOTH (S_IXUSR>>6)
10490 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10491 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10492 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10497 #include <sys/types.h>
10498 #include <sys/ipc.h>
10499 #include <sys/sem.h>
10500 #include <sys/stat.h>
10507 #$d_union_semun HAS_UNION_SEMUN
10510 #ifndef HAS_UNION_SEMUN
10513 struct semid_ds *buf;
10514 unsigned short *array;
10520 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10521 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10523 struct semid_ds argbuf;
10526 st = semctl(sem, 0, IPC_STAT, arg);
10530 # endif /* IPC_STAT */
10531 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10533 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10534 # endif /* IPC_RMID */
10535 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10537 #endif /* IPC_PRIVATE && ... */
10538 printf("semget failed: errno = %d\n", errno);
10544 if eval $compile; then
10547 semun) val="$define" ;;
10553 case "$d_semctl_semun" in
10555 echo "You can use union semun for semctl IPC_STAT." >&4
10558 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10563 : see whether semctl IPC_STAT can use struct semid_ds pointer
10564 $cat > try.c <<'END'
10565 #include <sys/types.h>
10566 #include <sys/ipc.h>
10567 #include <sys/sem.h>
10568 #include <sys/stat.h>
10576 struct semid_ds arg;
10579 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10580 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10583 st = semctl(sem, 0, IPC_STAT, &arg);
10585 printf("semid_ds\n");
10587 # endif /* IPC_STAT */
10588 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10590 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10591 # endif /* IPC_RMID */
10592 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10594 #endif /* IPC_PRIVATE && ... */
10595 printf("semget failed: errno = %d\n", errno);
10602 if eval $compile; then
10605 semid_ds) val="$define" ;;
10609 set d_semctl_semid_ds
10611 case "$d_semctl_semid_ds" in
10613 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10615 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10622 # We do not have the full sem*(2) library, so assume we can not
10628 set d_semctl_semid_ds
10633 : see if setegid exists
10634 set setegid d_setegid
10637 : see if seteuid exists
10638 set seteuid d_seteuid
10641 : see if setgrent exists
10642 set setgrent d_setgrent
10645 : see if sethostent exists
10646 set sethostent d_sethent
10649 : see if setlinebuf exists
10650 set setlinebuf d_setlinebuf
10653 : see if setlocale exists
10654 set setlocale d_setlocale
10657 : see if setnetent exists
10658 set setnetent d_setnent
10661 : see if setprotoent exists
10662 set setprotoent d_setpent
10665 : see if setpgid exists
10666 set setpgid d_setpgid
10669 : see if setpgrp2 exists
10670 set setpgrp2 d_setpgrp2
10673 : see if setpriority exists
10674 set setpriority d_setprior
10677 : see if setpwent exists
10678 set setpwent d_setpwent
10681 : see if setregid exists
10682 set setregid d_setregid
10684 set setresgid d_setresgid
10687 : see if setreuid exists
10688 set setreuid d_setreuid
10690 set setresuid d_setresuid
10693 : see if setrgid exists
10694 set setrgid d_setrgid
10697 : see if setruid exists
10698 set setruid d_setruid
10701 : see if setservent exists
10702 set setservent d_setsent
10705 : see if setsid exists
10706 set setsid d_setsid
10709 : see if setspent exists
10710 set setspent d_setspent
10713 : see if setvbuf exists
10714 set setvbuf d_setvbuf
10717 : see if sfio.h is available
10722 : see if sfio library is available
10733 : Ok, but do we want to use it.
10737 true|$define|[yY]*) dflt='y';;
10740 echo "$package can use the sfio library, but it is experimental."
10741 rp="You seem to have sfio available, do you want to try using it?"
10745 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10747 : Remove sfio from list of libraries to use
10748 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10751 echo "libs = $libs" >&4
10755 *) case "$usesfio" in
10756 true|$define|[yY]*)
10757 echo "Sorry, cannot find sfio on this machine" >&4
10758 echo "Ignoring your setting of usesfio=$usesfio" >&4
10766 $define) usesfio='true';;
10767 *) usesfio='false';;
10770 : see if shmctl exists
10771 set shmctl d_shmctl
10774 : see if shmget exists
10775 set shmget d_shmget
10778 : see if shmat exists
10781 : see what shmat returns
10784 $cat >shmat.c <<'END'
10785 #include <sys/shm.h>
10788 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10793 echo "and it returns ($shmattype)." >&4
10794 : see if a prototype for shmat is available
10795 xxx=`./findhdr sys/shm.h`
10796 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10797 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10808 set d_shmatprototype
10811 : see if shmdt exists
10815 : see how much of the 'shm*(2)' library is present.
10818 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10819 *"$undef"*) h_shm=false;;
10823 case "`ipcs 2>&1`" in
10824 "SVID shared memory"*"not configured"*)
10825 echo "Your $osname does not have the shm*(2) configured." >&4
10828 set shmctl d_shmctl
10830 set shmget d_shmget
10840 : we could also check for sys/ipc.h ...
10841 if $h_shm && $test `./findhdr sys/shm.h`; then
10842 echo "You have the full shm*(2) library." >&4
10845 echo "You don't have the full shm*(2) library." >&4
10852 : see if we have sigaction
10853 if set sigaction val -f d_sigaction; eval $csym; $val; then
10854 echo 'sigaction() found.' >&4
10855 $cat > try.c <<'EOP'
10857 #include <sys/types.h>
10858 #include <signal.h>
10861 struct sigaction act, oact;
10863 oact.sa_handler = 0;
10864 /* so that act and oact are used */
10865 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10869 if eval $compile_ok; then
10872 echo "But you don't seem to have a useable struct sigaction." >&4
10876 echo 'sigaction NOT found.' >&4
10879 set d_sigaction; eval $setvar
10880 $rm -f try try$_o try.c
10882 : see if sigsetjmp exists
10884 case "$d_sigsetjmp" in
10886 $cat >try.c <<'EOP'
10887 #include <setjmp.h>
10892 if (sigsetjmp(env,1))
10895 siglongjmp(env, 1);
10900 if eval $compile; then
10901 if ./try >/dev/null 2>&1; then
10902 echo "POSIX sigsetjmp found." >&4
10906 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10912 echo "sigsetjmp not found." >&4
10916 *) val="$d_sigsetjmp"
10917 case "$d_sigsetjmp" in
10918 $define) echo "POSIX sigsetjmp found." >&4;;
10919 $undef) echo "sigsetjmp not found." >&4;;
10927 : see if sqrtl exists
10931 : see if sys/stat.h is available
10932 set sys/stat.h i_sysstat
10936 : see if stat knows about block sizes
10938 echo "Checking to see if your struct stat has st_blocks field..." >&4
10939 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10943 : see if this is a sys/vfs.h system
10944 set sys/vfs.h i_sysvfs
10948 : see if this is a sys/statfs.h system
10949 set sys/statfs.h i_sysstatfs
10954 echo "Checking to see if your system supports struct statfs..." >&4
10955 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
10957 case "$d_statfs_s" in
10958 "$define") echo "Yes, it does." ;;
10959 *) echo "No, it doesn't." ;;
10964 : see if struct statfs knows about f_flags
10965 case "$d_statfs_s" in
10968 echo "Checking to see if your struct statfs has f_flags field..." >&4
10969 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
10973 set d_statfs_f_flags
10977 case "$d_statfs_f_flags" in
10978 "$define") echo "Yes, it does." ;;
10979 *) echo "No, it doesn't." ;;
10982 : see if _ptr and _cnt from stdio act std
10984 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10985 echo "(Looks like you have stdio.h from Linux.)"
10986 case "$stdio_ptr" in
10987 '') stdio_ptr='((fp)->_IO_read_ptr)'
10990 *) ptr_lval=$d_stdio_ptr_lval;;
10992 case "$stdio_cnt" in
10993 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10996 *) cnt_lval=$d_stdio_cnt_lval;;
10998 case "$stdio_base" in
10999 '') stdio_base='((fp)->_IO_read_base)';;
11001 case "$stdio_bufsiz" in
11002 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11005 case "$stdio_ptr" in
11006 '') stdio_ptr='((fp)->_ptr)'
11009 *) ptr_lval=$d_stdio_ptr_lval;;
11011 case "$stdio_cnt" in
11012 '') stdio_cnt='((fp)->_cnt)'
11015 *) cnt_lval=$d_stdio_cnt_lval;;
11017 case "$stdio_base" in
11018 '') stdio_base='((fp)->_base)';;
11020 case "$stdio_bufsiz" in
11021 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11024 : test whether _ptr and _cnt really work
11025 echo "Checking how std your stdio is..." >&4
11028 #define FILE_ptr(fp) $stdio_ptr
11029 #define FILE_cnt(fp) $stdio_cnt
11031 FILE *fp = fopen("try.c", "r");
11034 18 <= FILE_cnt(fp) &&
11035 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11043 if eval $compile; then
11045 echo "Your stdio acts pretty std."
11048 echo "Your stdio isn't very std."
11051 echo "Your stdio doesn't appear very std."
11057 : Can _ptr be used as an lvalue?
11058 case "$d_stdstdio$ptr_lval" in
11059 $define$define) val=$define ;;
11062 set d_stdio_ptr_lval
11065 : Can _cnt be used as an lvalue?
11066 case "$d_stdstdio$cnt_lval" in
11067 $define$define) val=$define ;;
11070 set d_stdio_cnt_lval
11073 : see if _base is also standard
11075 case "$d_stdstdio" in
11079 #define FILE_base(fp) $stdio_base
11080 #define FILE_bufsiz(fp) $stdio_bufsiz
11082 FILE *fp = fopen("try.c", "r");
11085 19 <= FILE_bufsiz(fp) &&
11086 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11093 if eval $compile; then
11095 echo "And its _base field acts std."
11098 echo "But its _base field isn't std."
11101 echo "However, it seems to be lacking the _base field."
11110 Checking how to access stdio streams by file descriptor number...
11112 case "$stdio_stream_array" in
11113 '') $cat >try.c <<EOCP
11116 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11120 for s in _iob __iob __sF
11122 set try -DSTDIO_STREAM_ARRAY=$s
11123 if eval $compile; then
11124 case "`./try$exe_ext`" in
11125 yes) stdio_stream_array=$s; break ;;
11129 $rm -f try.* try$exe_ext
11131 case "$stdio_stream_array" in
11133 I can't figure out how to access stdio streams by file descriptor number.
11135 d_stdio_stream_array="$undef"
11138 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11140 d_stdio_stream_array="$define"
11144 : see if strcoll exists
11145 set strcoll d_strcoll
11148 : check for structure copying
11150 echo "Checking to see if your C compiler can copy structs..." >&4
11151 $cat >try.c <<'EOCP'
11161 if $cc -c try.c >/dev/null 2>&1 ; then
11163 echo "Yup, it can."
11166 echo "Nope, it can't."
11172 : see if strerror and/or sys_errlist[] exist
11174 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11175 if set strerror val -f d_strerror; eval $csym; $val; then
11176 echo 'strerror() found.' >&4
11177 d_strerror="$define"
11178 d_strerrm='strerror(e)'
11179 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11180 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11181 d_syserrlst="$define"
11183 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11184 d_syserrlst="$undef"
11186 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11187 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11188 echo 'strerror() found in string header.' >&4
11189 d_strerror="$define"
11190 d_strerrm='strerror(e)'
11191 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11192 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11193 d_syserrlst="$define"
11195 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11196 d_syserrlst="$undef"
11198 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11199 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11200 d_strerror="$undef"
11201 d_syserrlst="$define"
11202 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11204 echo 'strerror() and sys_errlist[] NOT found.' >&4
11205 d_strerror="$undef"
11206 d_syserrlst="$undef"
11207 d_strerrm='"unknown"'
11211 : see if strtod exists
11212 set strtod d_strtod
11215 : see if strtol exists
11216 set strtol d_strtol
11219 : see if strtold exists
11220 set strtold d_strtold
11223 : see if strtoll exists
11224 set strtoll d_strtoll
11227 : see if strtoul exists
11228 set strtoul d_strtoul
11231 : see if strtoull exists
11232 set strtoull d_strtoull
11235 : see if strtouq exists
11236 set strtouq d_strtouq
11239 : see if strxfrm exists
11240 set strxfrm d_strxfrm
11243 : see if symlink exists
11244 set symlink d_symlink
11247 : see if syscall exists
11248 set syscall d_syscall
11251 : see if sysconf exists
11252 set sysconf d_sysconf
11255 : see if system exists
11256 set system d_system
11259 : see if tcgetpgrp exists
11260 set tcgetpgrp d_tcgetpgrp
11263 : see if tcsetpgrp exists
11264 set tcsetpgrp d_tcsetpgrp
11267 : see if prototype for telldir is available
11269 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11272 : see if this is a sys/times.h system
11273 set sys/times.h i_systimes
11276 : see if times exists
11278 if set times val -f d_times; eval $csym; $val; then
11279 echo 'times() found.' >&4
11282 case "$i_systimes" in
11283 "$define") inc='sys/times.h';;
11285 rp="What is the type returned by times() on this system?"
11286 set clock_t clocktype long stdio.h sys/types.h $inc
11289 echo 'times() NOT found, hope that will do.' >&4
11294 : see if truncate exists
11295 set truncate d_truncate
11298 : see if tzname[] exists
11300 if set tzname val -a d_tzname; eval $csym; $val; then
11302 echo 'tzname[] found.' >&4
11305 echo 'tzname[] NOT found.' >&4
11310 : see if umask exists
11314 : see if ustat exists
11318 : backward compatibility for d_hvfork
11319 if test X$d_hvfork != X; then
11320 d_vfork="$d_hvfork"
11323 : see if there is a vfork
11328 : Ok, but do we want to use it. vfork is reportedly unreliable in
11329 : perl on Solaris 2.x, and probably elsewhere.
11333 case "$usevfork" in
11339 Perl can only use a vfork() that doesn't suffer from strict
11340 restrictions on calling functions or modifying global data in
11341 the child. For example, glibc-2.1 contains such a vfork()
11342 that is unsuitable. If your system provides a proper fork()
11343 call, chances are that you do NOT want perl to use vfork().
11346 rp="Do you still want to use vfork()?"
11351 echo "Ok, we won't use vfork()."
11360 $define) usevfork='true';;
11361 *) usevfork='false';;
11364 : see if this is an sysdir system
11365 set sys/dir.h i_sysdir
11368 : see if this is an sysndir system
11369 set sys/ndir.h i_sysndir
11372 : see if closedir exists
11373 set closedir d_closedir
11376 case "$d_closedir" in
11379 echo "Checking whether closedir() returns a status..." >&4
11380 cat > closedir.c <<EOM
11381 #$i_dirent I_DIRENT /**/
11382 #$i_sysdir I_SYS_DIR /**/
11383 #$i_sysndir I_SYS_NDIR /**/
11384 #$i_systypes I_SYS_TYPES /**/
11386 #if defined(I_SYS_TYPES)
11387 #include <sys/types.h>
11389 #if defined(I_DIRENT)
11390 #include <dirent.h>
11391 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11392 #include <sys/dir.h>
11396 #include <sys/ndir.h>
11400 #include <ndir.h> /* may be wrong in the future */
11402 #include <sys/dir.h>
11407 int main() { return closedir(opendir(".")); }
11410 if eval $compile_ok; then
11411 if ./closedir > /dev/null 2>&1 ; then
11412 echo "Yes, it does."
11415 echo "No, it doesn't."
11419 echo "(I can't seem to compile the test program--assuming it doesn't)"
11427 set d_void_closedir
11430 : check for volatile keyword
11432 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11433 $cat >try.c <<'EOCP'
11436 typedef struct _goo_struct goo_struct;
11437 goo_struct * volatile goo = ((goo_struct *)0);
11438 struct _goo_struct {
11443 typedef unsigned short foo_t;
11444 char *volatile foo;
11446 volatile foo_t blech;
11450 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11452 echo "Yup, it does."
11455 echo "Nope, it doesn't."
11461 : see if there is a wait4
11465 : see if waitpid exists
11466 set waitpid d_waitpid
11469 : see if wcstombs exists
11470 set wcstombs d_wcstombs
11473 : see if wctomb exists
11474 set wctomb d_wctomb
11477 : preserve RCS keywords in files with variable substitution, grrr
11482 Revision='$Revision'
11484 case "$crosscompile" in
11485 ''|[nN]*) crosscompile="$undef" ;;
11489 next|rhapsody) multiarch="$define" ;;
11491 case "$multiarch" in
11492 ''|[nN]*) multiarch="$undef" ;;
11495 : check for alignment requirements
11497 case "$crosscompile$multiarch" in
11500 You seem to be either cross-compiling or doing a multiarchitecture build,
11501 skipping the memory alignment check.
11504 case "$alignbytes" in
11505 '') alignbytes=8 ;;
11509 case "$alignbytes" in
11510 '') echo "Checking alignment constraints..." >&4
11511 $cat >try.c <<'EOCP'
11519 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11524 if eval $compile_ok; then
11528 echo "(I can't seem to compile the test program...)"
11531 *) dflt="$alignbytes"
11534 rp="Doubles must be aligned on a how-many-byte boundary?"
11542 : check for ordering of bytes in a long
11544 case "$crosscompile$multiarch" in
11547 You seem to be either cross-compiling or doing a multiarchitecture build,
11548 skipping the byteorder check.
11554 case "$byteorder" in
11557 In the following, larger digits indicate more significance. A big-endian
11558 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11559 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11560 machines may have weird orders like 3412. A Cray will report 87654321,
11561 an Alpha will report 12345678. If the test program works the default is
11563 I'm now running the test program...
11565 $cat >try.c <<'EOCP'
11572 char c[sizeof(long)];
11575 if (sizeof(long) > 4)
11576 u.l = (0x08070605L << 32) | 0x04030201L;
11579 for (i = 0; i < sizeof(long); i++)
11580 printf("%c", u.c[i]+'0');
11587 if eval $compile && ./try > /dev/null; then
11590 [1-4][1-4][1-4][1-4]|12345678|87654321)
11591 echo "(The test program ran ok.)"
11592 echo "byteorder=$dflt"
11595 ????|????????) echo "(The test program ran ok.)" ;;
11596 *) echo "(The test program didn't run right for some reason.)" ;;
11601 (I can't seem to compile the test program. Guessing big-endian...)
11604 case "$xxx_prompt" in
11606 rp="What is the order of bytes in a long?"
11620 : how do we catenate cpp tokens here?
11622 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11623 $cat >cpp_stuff.c <<'EOCP'
11624 #define RCAT(a,b)a/**/b
11625 #define ACAT(a,b)a ## b
11629 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11630 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11631 echo "Oh! Smells like ANSI's been here." >&4
11632 echo "We can catify or stringify, separately or together!"
11634 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11635 echo "Ah, yes! The good old days!" >&4
11636 echo "However, in the good old days we don't know how to stringify and"
11637 echo "catify at the same time."
11641 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11642 to have to edit the values of CAT[2-5] in config.h...
11644 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11648 : see if this is a db.h system
11654 : Check db version.
11656 echo "Checking Berkeley DB version ..." >&4
11662 #include <sys/types.h>
11667 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11668 int Major, Minor, Patch ;
11669 unsigned long Version ;
11670 (void)db_version(&Major, &Minor, &Patch) ;
11671 printf("You have Berkeley DB Version 2 or greater\n");
11673 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11674 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11675 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11676 Major, Minor, Patch) ;
11678 /* check that db.h & libdb are compatible */
11679 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11680 printf("db.h and libdb are incompatible\n") ;
11684 printf("db.h and libdb are compatible\n") ;
11686 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11687 + DB_VERSION_PATCH ;
11689 /* needs to be >= 2.3.4 */
11690 if (Version < 2003004) {
11691 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11692 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11698 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11699 printf("You have Berkeley DB Version 1\n");
11700 exit(0); /* DB version < 2: the coast is clear. */
11702 exit(1); /* <db.h> not Berkeley DB? */
11708 if eval $compile_ok && ./try; then
11709 echo 'Looks OK.' >&4
11711 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11715 : Remove db from list of libraries to use
11716 echo "Removing unusable -ldb from library list" >&4
11717 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11720 echo "libs = $libs" >&4
11730 : Check the return type needed for hash
11732 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11738 #include <sys/types.h>
11741 #ifndef DB_VERSION_MAJOR
11742 u_int32_t hash_cb (ptr, size)
11750 info.hash = hash_cb;
11754 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11755 if $contains warning try.out >>/dev/null 2>&1 ; then
11758 db_hashtype='u_int32_t'
11761 : XXX Maybe we should just give up here.
11762 db_hashtype=u_int32_t
11764 echo "Help: I can't seem to compile the db test program." >&4
11765 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11768 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11770 *) db_hashtype=u_int32_t
11775 : Check the return type needed for prefix
11777 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11783 #include <sys/types.h>
11786 #ifndef DB_VERSION_MAJOR
11787 size_t prefix_cb (key1, key2)
11795 info.prefix = prefix_cb;
11799 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11800 if $contains warning try.out >>/dev/null 2>&1 ; then
11801 db_prefixtype='int'
11803 db_prefixtype='size_t'
11806 db_prefixtype='size_t'
11807 : XXX Maybe we should just give up here.
11809 echo "Help: I can't seem to compile the db test program." >&4
11810 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11813 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11815 *) db_prefixtype='size_t'
11819 : check for void type
11821 echo "Checking to see how well your C compiler groks the void type..." >&4
11822 case "$voidflags" in
11824 $cat >try.c <<'EOCP'
11830 extern void moo(); /* function returning void */
11831 void (*goo)(); /* ptr to func returning void */
11833 void *hue; /* generic ptr */
11846 int main() { sub(); }
11848 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11849 voidflags=$defvoidused
11850 echo "Good. It appears to support void to the level $package wants.">&4
11851 if $contains warning .out >/dev/null 2>&1; then
11852 echo "However, you might get some warnings that look like this:"
11856 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11857 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11858 echo "It supports 1..."
11859 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11860 echo "It also supports 2..."
11861 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11863 echo "And it supports 4 but not 8 definitely."
11865 echo "It doesn't support 4..."
11866 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11868 echo "But it supports 8."
11871 echo "Neither does it support 8."
11875 echo "It does not support 2..."
11876 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11878 echo "But it supports 4 and 8."
11880 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11882 echo "And it supports 4 but has not heard about 8."
11884 echo "However it supports 8 but not 4."
11889 echo "There is no support at all for void."
11894 case "$voidflags" in
11896 *) $cat >&4 <<'EOM'
11897 Support flag bits are:
11898 1: basic void declarations.
11899 2: arrays of pointers to functions returning void.
11900 4: operations between pointers to and addresses of void functions.
11901 8: generic void pointers.
11904 rp="Your void support flags add up to what?"
11912 : How can we generate normalized random numbers ?
11914 echo "Looking for a random number function..." >&4
11915 case "$randfunc" in
11917 if set drand48 val -f; eval $csym; $val; then
11919 echo "Good, found drand48()." >&4
11920 elif set random val -f; eval $csym; $val; then
11922 echo "OK, found random()." >&4
11925 echo "Yick, looks like I have to use rand()." >&4
11936 *-Dmy_rand=*|*-Dmy_srand=*)
11937 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11938 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11939 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11940 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11944 while $test "$cont"; do
11945 rp="Use which function to generate random numbers?"
11947 if $test "$ans" = "$dflt"; then
11953 if set $ans val -f; eval $csym; $val; then
11957 rp="I cannot find function $ans. Use that name anyway?"
11966 case "$randfunc" in
11968 drand01="drand48()"
11974 case "$randbits" in
11976 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11978 #$i_unistd I_UNISTD
11979 #$i_stdlib I_STDLIB
11982 # include <unistd.h>
11985 # include <stdlib.h>
11990 register unsigned long tmp;
11991 register unsigned long max = 0L;
11993 for (i = 1000; i; i--) {
11994 tmp = (unsigned long) $randfunc();
11995 if (tmp > max) max = tmp;
11997 for (i = 0; max; i++)
12003 if eval $compile_ok; then
12007 echo "(I can't seem to compile the test program...)"
12014 rp="How many bits does your $randfunc() function produce?"
12018 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12019 seedfunc="s$randfunc"
12020 randseedtype=unsigned
12024 rp="How many bits does your $randfunc() function produce?"
12027 seedfunc="s$randfunc"
12028 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12029 if set $seedfunc val -f; eval $csym; $val; then
12030 echo "(Using $seedfunc() to seed random generator)"
12032 echo "(Warning: no $seedfunc() to seed random generator)"
12035 randseedtype=unsigned
12043 echo "Determining whether or not we are on an EBCDIC system..." >&4
12044 $cat >tebcdic.c <<'EOM'
12047 if ('M'==0xd4) return 0;
12054 if eval $compile_ok; then
12056 echo "You have EBCDIC." >&4
12059 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12062 echo "I'm unable to compile the test program." >&4
12063 echo "I'll assume ASCII or some ISO Latin." >&4
12065 $rm -f tebcdic.c tebcdic
12071 Checking how to flush all pending stdio output...
12073 # I only know how to find the first 32 possibly open files on SunOS.
12074 # See also hints/sunos_4_1.sh and util.c --AD
12076 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12078 $cat >>try.c <<EOCP
12080 #$i_unistd I_UNISTD
12082 # include <unistd.h>
12084 #$d_sysconf HAS_SYSCONF
12085 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12086 #ifdef HAS_STDIO_STREAM_ARRAY
12087 # define STDIO_STREAM_ARRAY $stdio_stream_array
12090 FILE* p = fopen("try.out", "w");
12094 # ifdef TRY_FPRINTF
12098 #ifdef TRY_FFLUSH_NULL
12101 #ifdef TRY_FFLUSH_ALL
12103 long open_max = -1;
12104 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12105 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12107 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12108 open_max = sysconf(_SC_OPEN_MAX);
12111 open_max = FOPEN_MAX;
12114 open_max = OPEN_MAX;
12123 # ifdef HAS_STDIO_STREAM_ARRAY
12124 if (open_max > 0) {
12126 for (i = 0; i < open_max; i++)
12127 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12128 STDIO_STREAM_ARRAY[i]._file < open_max &&
12129 STDIO_STREAM_ARRAY[i]._flag)
12130 fflush(&STDIO_STREAM_ARRAY[i]);
12138 : first we have to find out how _not_ to flush
12139 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12141 set try -DTRY_FPUTC
12142 if eval $compile; then
12144 ./try$exe_ext 2>/dev/null
12145 if $test ! -s try.out -a "X$?" = X42; then
12151 set try -DTRY_FPRINTF
12153 if eval $compile; then
12155 ./try$exe_ext 2>/dev/null
12156 if $test ! -s try.out -a "X$?" = X42; then
12157 output=-DTRY_FPRINTF
12163 : check for fflush NULL behaviour
12164 case "$fflushNULL" in
12165 '') set try -DTRY_FFLUSH_NULL $output
12166 if eval $compile; then
12168 ./try$exe_ext 2>/dev/null
12170 if $test -s try.out -a "X$code" = X42; then
12171 fflushNULL="`$cat try.out`"
12173 if $test "X$code" != X42; then
12175 (If this test failed, don't worry, we'll try another method shortly.)
12180 $rm -f core try.core core.try.*
12181 case "$fflushNULL" in
12183 Your fflush(NULL) works okay.
12185 fflushNULL="$define"
12188 Your fflush(NULL) isn't working (contrary to ANSI C).
12190 fflushNULL="$undef"
12193 Cannot figure out whether your fflush(NULL) works or not.
12194 I'm assuming it doesn't (contrary to ANSI C).
12196 fflushNULL="$undef"
12200 $define|true|[yY]*)
12201 fflushNULL="$define"
12204 fflushNULL="$undef"
12207 : check explicit looping only if NULL did not work
12208 case "$fflushNULL" in
12210 : check for fflush all behaviour
12211 case "$fflushall" in
12212 '') set try -DTRY_FFLUSH_ALL $output
12213 if eval $compile; then
12215 (Now testing the other method--but note that also this may fail.)
12218 ./try$exe_ext 2>/dev/null
12219 if $test -s try.out -a "X$?" = X42; then
12220 fflushall="`$cat try.out`"
12223 $rm -f core try.core core.try.*
12224 case "$fflushall" in
12226 Whew. Flushing explicitly all the stdio streams works.
12228 fflushall="$define"
12231 Sigh. Flushing explicitly all the stdio streams doesn't work.
12236 Cannot figure out whether flushing stdio streams explicitly works or not.
12237 I'm assuming it doesn't.
12243 "$define"|true|[yY]*)
12244 fflushall="$define"
12251 *) fflushall="$undef"
12254 case "$fflushNULL$fflushall" in
12257 I cannot figure out how to flush pending stdio output.
12261 $rm -f try.* try$exe_ext
12263 : Store the full pathname to the ar program for use in the C program
12264 : Respect a hint or command line value for full_ar.
12269 : Store the full pathname to the sed program for use in the C program
12272 : see what type gids are declared as in the kernel
12274 echo "Looking for the type for group ids returned by getgid()."
12275 set gid_t gidtype xxx stdio.h sys/types.h
12279 xxx=`./findhdr sys/user.h`
12280 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12282 unsigned) dflt="$1 $2" ;;
12286 *) dflt="$gidtype";;
12289 gid_t) echo "gid_t found." ;;
12290 *) rp="What is the type for group ids returned by getgid()?"
12298 *_t) zzz="$gidtype" ;;
12301 echo "Checking the size of $zzz..." >&4
12303 #include <sys/types.h>
12306 printf("%d\n", (int)sizeof($gidtype));
12311 if eval $compile_ok; then
12315 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12318 echo "Your $zzz size is $gidsize bytes."
12323 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12329 *_t) zzz="$gidtype" ;;
12332 echo "Checking the sign of $zzz..." >&4
12334 #include <sys/types.h>
12345 if eval $compile; then
12349 echo "(I can't execute the test program--guessing unsigned.)" >&4
12353 1) echo "Your $zzz is unsigned." ;;
12354 -1) echo "Your $zzz is signed." ;;
12360 echo "(I can't compile the test program--guessing unsigned.)" >&4
12366 if $test X"$quadtype" != X; then
12368 echo "Checking how to print 64-bit integers..." >&4
12370 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12371 $cat >try.c <<'EOCP'
12372 #include <sys/types.h>
12375 int q = 12345678901;
12376 printf("%ld\n", q);
12380 if eval $compile; then
12381 yyy=`./try$exe_ext`
12384 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12385 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12386 echo "We will use %d."
12392 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12393 $cat >try.c <<'EOCP'
12394 #include <sys/types.h>
12397 long q = 12345678901;
12398 printf("%ld\n", q);
12402 if eval $compile; then
12403 yyy=`./try$exe_ext`
12406 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12407 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12408 echo "We will use %ld."
12414 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12415 $cat >try.c <<'EOCP'
12416 #include <sys/types.h>
12417 #include <inttypes.h>
12420 int64_t q = 12345678901;
12421 printf("%" PRId64 "\n", q);
12425 if eval $compile; then
12426 yyy=`./try$exe_ext`
12429 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12430 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12431 echo "We will use the C9X style."
12437 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12438 $cat >try.c <<'EOCP'
12439 #include <sys/types.h>
12442 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12443 printf("%lld\n", q);
12447 if eval $compile; then
12448 yyy=`./try$exe_ext`
12451 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12452 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12453 echo "We will use the %lld style."
12459 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12461 #include <sys/types.h>
12464 $quadtype q = 12345678901;
12465 printf("%Ld\n", q);
12469 if eval $compile; then
12470 yyy=`./try$exe_ext`
12473 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12474 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12475 echo "We will use %Ld."
12481 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12483 #include <sys/types.h>
12486 $quadtype q = 12345678901;
12487 printf("%qd\n", q);
12491 if eval $compile; then
12492 yyy=`./try$exe_ext`
12495 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12496 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12497 echo "We will use %qd."
12503 if $test X"$sPRId64" = X; then
12504 echo "Cannot figure out how to print 64-bit integers." >&4
12512 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12513 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12515 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12516 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12522 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12524 if $test X"$ivsize" = X8; then
12525 ivdformat="$sPRId64"
12526 uvuformat="$sPRIu64"
12527 uvoformat="$sPRIo64"
12528 uvxformat="$sPRIx64"
12530 if $test X"$ivsize" = X"$longsize"; then
12536 if $test X"$ivsize" = X"$intsize"; then
12543 if $test X"$ivsize" = X"$shortsize"; then
12553 case "$ivdformat" in
12554 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12561 $echo "Checking the format string to be used for gids..." >&4
12564 -1) if $test X"$gidsize" = X"$ivsize"; then
12565 gidformat="$ivdformat"
12567 if $test X"$gidsize" = X"$longsize"; then
12570 if $test X"$gidsize" = X"$intsize"; then
12573 if $test X"$gidsize" = X"$shortsize"; then
12580 *) if $test X"$gidsize" = X"$uvsize"; then
12581 gidformat="$uvuformat"
12583 if $test X"$gidsize" = X"$longsize"; then
12586 if $test X"$gidsize" = X"$intsize"; then
12589 if $test X"$gidsize" = X"$shortsize"; then
12598 : see if getgroups exists
12599 set getgroups d_getgrps
12602 : see if setgroups exists
12603 set setgroups d_setgrps
12607 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12609 case "$d_getgrps$d_setgrps" in
12611 case "$groupstype" in
12612 '') dflt="$gidtype" ;;
12613 *) dflt="$groupstype" ;;
12616 What type of pointer is the second argument to getgroups() and setgroups()?
12617 Usually this is the same as group ids, $gidtype, but not always.
12620 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12624 *) groupstype="$gidtype";;
12628 echo "Checking if your $make program sets \$(MAKE)..." >&4
12629 case "$make_set_make" in
12631 $sed 's/^X //' > testmake.mak << 'EOF'
12633 X @echo 'maketemp="$(MAKE)"'
12635 case "`$make -f testmake.mak 2>/dev/null`" in
12636 *maketemp=*) make_set_make='#' ;;
12637 *) make_set_make="MAKE=$make" ;;
12639 $rm -f testmake.mak
12642 case "$make_set_make" in
12643 '#') echo "Yup, it does.";;
12644 *) echo "Nope, it doesn't.";;
12647 : see what type is used for mode_t
12648 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12649 set mode_t modetype int stdio.h sys/types.h
12652 : define a fucntion to check prototypes
12653 $cat > protochk <<EOSH
12656 optimize="$optimize"
12658 prototype="$prototype"
12663 $cat >> protochk <<'EOSH'
12668 while test $# -ge 2; do
12670 $define) echo "#include <$2>" >> try.c ;;
12671 literal) echo "$2" >> try.c ;;
12675 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12676 cat >> try.c <<'EOCP'
12677 #ifdef CAN_PROTOTYPE
12678 #define _(args) args
12683 echo "$foo" >> try.c
12684 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12685 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12691 $eunicefix protochk
12693 : see what type is used for size_t
12694 rp="What is the type used for the length parameter for string functions?"
12695 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12698 : check for type of arguments to gethostbyaddr.
12699 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12700 case "$d_gethbyaddr" in
12704 Checking to see what type of arguments are accepted by gethostbyaddr().
12706 hdrs="$define sys/types.h
12707 $d_socket sys/socket.h
12708 $i_niin netinet/in.h
12710 $i_unistd unistd.h"
12711 : The first arg can 'char *' or 'void *'
12712 : The second arg is some of integral type
12713 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12714 for yyy in size_t long int; do
12715 case "$netdb_host_type" in
12716 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12717 if ./protochk "$try" $hdrs; then
12718 echo "Your system accepts $xxx for the first arg."
12719 echo "...and $yyy for the second arg."
12720 netdb_host_type="$xxx"
12721 netdb_hlen_type="$yyy"
12727 : In case none of those worked, prompt the user.
12728 case "$netdb_host_type" in
12729 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12732 netdb_host_type=$ans
12733 rp='What is the type for the 2nd argument to gethostbyaddr?'
12736 netdb_hlen_type=$ans
12740 *) : no gethostbyaddr, so pick harmless defaults
12741 netdb_host_type='char *'
12742 netdb_hlen_type="$sizetype"
12745 # Remove the "const" if needed. -- but then we'll have a
12747 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12750 : check for type of argument to gethostbyname.
12751 if test "X$netdb_name_type" = X ; then
12752 case "$d_gethbyname" in
12756 Checking to see what type of argument is accepted by gethostbyname().
12758 hdrs="$define sys/types.h
12759 $d_socket sys/socket.h
12760 $i_niin netinet/in.h
12762 $i_unistd unistd.h"
12763 for xxx in "const char *" "char *"; do
12764 case "$netdb_name_type" in
12765 '') try="extern struct hostent *gethostbyname($xxx);"
12766 if ./protochk "$try" $hdrs; then
12767 echo "Your system accepts $xxx."
12768 netdb_name_type="$xxx"
12773 : In case none of those worked, prompt the user.
12774 case "$netdb_name_type" in
12775 '') rp='What is the type for the 1st argument to gethostbyname?'
12778 netdb_name_type=$ans
12782 *) : no gethostbyname, so pick harmless default
12783 netdb_name_type='char *'
12788 : check for type of 1st argument to getnetbyaddr.
12789 if test "X$netdb_net_type" = X ; then
12790 case "$d_getnbyaddr" in
12794 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12796 hdrs="$define sys/types.h
12797 $d_socket sys/socket.h
12798 $i_niin netinet/in.h
12800 $i_unistd unistd.h"
12801 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12802 case "$netdb_net_type" in
12803 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12804 if ./protochk "$try" $hdrs; then
12805 echo "Your system accepts $xxx."
12806 netdb_net_type="$xxx"
12811 : In case none of those worked, prompt the user.
12812 case "$netdb_net_type" in
12813 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12816 netdb_net_type=$ans
12820 *) : no getnetbyaddr, so pick harmless default
12821 netdb_net_type='long'
12825 : locate the preferred pager for this system
12839 '') dflt=/usr/ucb/more;;
12846 rp='What pager is used on your system?'
12850 : see what type pids are declared as in the kernel
12851 rp="What is the type of process ids on this system?"
12852 set pid_t pidtype int stdio.h sys/types.h
12855 : check for length of pointer
12859 $echo $n "Checking to see how big your pointers are...$c" >&4
12860 if test "$voidflags" -gt 7; then
12861 echo '#define VOID_PTR char *' > try.c
12863 echo '#define VOID_PTR void *' > try.c
12865 $cat >>try.c <<'EOCP'
12869 printf("%d\n", (int)sizeof(VOID_PTR));
12874 if eval $compile_ok; then
12876 $echo " $ptrsize bytes." >&4
12879 echo "(I can't seem to compile the test program. Guessing...)" >&4
12880 rp="What is the size of a pointer (in bytes)?"
12888 : see if ar generates random libraries by itself
12890 echo "Checking how to generate random libraries on your machine..." >&4
12891 echo 'int bar1() { return bar2(); }' > bar1.c
12892 echo 'int bar2() { return 2; }' > bar2.c
12893 $cat > foo.c <<'EOP'
12894 int main() { printf("%d\n", bar1()); exit(0); }
12896 $cc $ccflags -c bar1.c >/dev/null 2>&1
12897 $cc $ccflags -c bar2.c >/dev/null 2>&1
12898 $cc $ccflags -c foo.c >/dev/null 2>&1
12899 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12900 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12901 ./foobar >/dev/null 2>&1; then
12902 echo "$ar appears to generate random libraries itself."
12905 elif $ar ts bar$_a >/dev/null 2>&1 &&
12906 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12907 ./foobar >/dev/null 2>&1; then
12908 echo "a table of contents needs to be added with '$ar ts'."
12915 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12916 $test -f $ranlib || ranlib=''
12919 if $test -n "$ranlib"; then
12920 echo "your system has '$ranlib'; we'll use that."
12923 echo "your system doesn't seem to support random libraries"
12924 echo "so we'll use lorder and tsort to order the libraries."
12931 : check for type of arguments to select.
12932 case "$selecttype" in
12933 '') case "$d_select" in
12937 Checking to see what type of arguments are accepted by select().
12939 hdrs="$define sys/types.h
12940 $i_systime sys/time.h
12941 $i_sysselct sys/select.h
12942 $d_socket sys/socket.h"
12943 : The first arg can be int, unsigned, or size_t
12944 : The last arg may or may not be 'const'
12946 : void pointer has been seen but using that
12947 : breaks the selectminbits test
12948 for xxx in 'fd_set *' 'int *'; do
12949 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12950 for tmo in 'struct timeval *' 'const struct timeval *'; do
12952 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12953 if ./protochk "$try" $hdrs; then
12954 echo "Your system accepts $xxx."
12963 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12964 case "$d_fd_set" in
12965 $define) dflt="fd_set *" ;;
12974 *) : no select, so pick a harmless default
12981 : check for the select 'width'
12982 case "$selectminbits" in
12983 '') case "$d_select" in
12987 Checking to see on how many bits at a time your select() operates...
12990 #include <sys/types.h>
12992 #$i_systime I_SYS_TIME
12993 #$i_systimek I_SYS_TIME_KERNEL
12998 # ifdef I_SYS_TIME_KERNEL
13001 # include <sys/time.h>
13002 # ifdef I_SYS_TIME_KERNEL
13006 #$i_sysselct I_SYS_SELECT
13007 #ifdef I_SYS_SELECT
13008 #include <sys/select.h>
13010 #$d_socket HAS_SOCKET
13012 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13016 #define S sizeof(*(b))
13018 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13019 #define NBITS (NBYTES * 8)
13028 fp = fopen("try.c", "r");
13034 b = ($selecttype)s;
13035 for (i = 0; i < NBITS; i++)
13039 select(fd + 1, b, 0, 0, &t);
13040 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13041 printf("%d\n", i + 1);
13046 if eval $compile_ok; then
13047 selectminbits=`./try`
13048 case "$selectminbits" in
13050 Cannot figure out on how many bits at a time your select() operates.
13051 I'll play safe and guess it is 32 bits.
13057 *) bits="$selectminbits bits" ;;
13059 echo "Your select() operates on $bits at a time." >&4
13061 rp='What is the minimum number of bits your select() operates on?'
13062 case "$byteorder" in
13063 1234|12345678) dflt=32 ;;
13068 selectminbits="$val"
13072 *) : no select, so pick a harmless default
13079 : Trace out the files included by signal.h, then look for SIGxxx names.
13080 : Remove SIGARRAYSIZE used by HPUX.
13081 : Remove SIGSTKSIZE used by Linux.
13082 : Remove SIGSTKSZ used by Posix.
13083 : Remove SIGTYP void lines used by OS2.
13084 : Some cpps, like os390, dont give the file name anywhere
13085 if [ "X$fieldn" = X ]; then
13086 : Just make some guesses. We check them later.
13087 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13089 xxx=`echo '#include <signal.h>' |
13090 $cppstdin $cppminus $cppflags 2>/dev/null |
13091 $grep '^[ ]*#.*include' |
13092 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13094 : Check this list of files to be sure we have parsed the cpp output ok.
13095 : This will also avoid potentially non-existent files, such
13098 for xx in $xxx /dev/null ; do
13099 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13101 : If we have found no files, at least try signal.h
13102 case "$xxxfiles" in
13103 '') xxxfiles=`./findhdr signal.h` ;;
13106 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13107 print substr($2, 4, 20)
13109 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13110 print substr($3, 4, 20)
13112 : Append some common names just in case the awk scan failed.
13113 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13114 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13115 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13116 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13117 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13119 : generate a few handy files for later
13120 $cat > signal.c <<'EOCP'
13121 #include <sys/types.h>
13122 #include <signal.h>
13126 /* Strange style to avoid deeply-nested #if/#else/#endif */
13129 # define NSIG (_NSIG)
13135 # define NSIG (SIGMAX+1)
13141 # define NSIG (SIG_MAX+1)
13147 # define NSIG (MAXSIG+1)
13153 # define NSIG (MAX_SIG+1)
13158 # ifdef SIGARRAYSIZE
13159 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13165 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13169 /* Default to some arbitrary number that's big enough to get most
13170 of the common signals.
13176 printf("NSIG %d\n", NSIG);
13182 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13184 printf "#ifdef SIG"; printf $1; printf "\n"
13185 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13186 printf $1; printf ");\n"
13190 printf "#endif /* JUST_NSIG */\n";
13191 printf "exit(0);\n}\n";
13194 $cat >signal.awk <<'EOP'
13195 BEGIN { ndups = 0 }
13196 $1 ~ /^NSIG$/ { nsig = $2 }
13197 ($1 !~ /^NSIG$/) && (NF == 2) {
13198 if ($2 > maxsig) { maxsig = $2 }
13199 if (sig_name[$2]) {
13200 dup_name[ndups] = $1
13201 dup_num[ndups] = $2
13213 printf("NSIG %d\n", nsig);
13214 for (n = 1; n < nsig; n++) {
13216 printf("%s %d\n", sig_name[n], sig_num[n])
13219 printf("NUM%d %d\n", n, n)
13222 for (n = 0; n < ndups; n++) {
13223 printf("%s %d\n", dup_name[n], dup_num[n])
13227 $cat >signal_cmd <<EOS
13229 if $test -s signal.lst; then
13230 echo "Using your existing signal.lst file"
13235 $cat >>signal_cmd <<'EOS'
13238 if eval $compile_ok; then
13239 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13241 echo "(I can't seem be able to compile the whole test program)" >&4
13242 echo "(I'll try it in little pieces.)" >&4
13243 set signal -DJUST_NSIG
13244 if eval $compile_ok; then
13245 ./signal$_exe > signal.nsg
13248 echo "I can't seem to figure out how many signals you have." >&4
13249 echo "Guessing 50." >&4
13250 echo 'NSIG 50' > signal.nsg
13252 : Now look at all the signal names, one at a time.
13253 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13254 $cat > signal.c <<EOCP
13255 #include <sys/types.h>
13256 #include <signal.h>
13259 printf("$xx %d\n", SIG${xx});
13264 if eval $compile; then
13265 echo "SIG${xx} found."
13266 ./signal$_exe >> signal.ls1
13268 echo "SIG${xx} NOT found."
13271 if $test -s signal.ls1; then
13272 $cat signal.nsg signal.ls1 |
13273 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13277 if $test -s signal.lst; then
13280 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13281 echo 'kill -l' >signal
13282 set X `csh -f <signal`
13286 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13288 echo $@ | $tr ' ' $trnl | \
13289 $awk '{ printf "%s %d\n", $1, ++s; }
13290 END { printf "NSIG %d\n", ++s }' >signal.lst
13292 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13294 chmod a+x signal_cmd
13295 $eunicefix signal_cmd
13297 : generate list of signal names
13299 case "$sig_name_init" in
13301 *) case "$sig_num_init" in
13302 ''|*,*) doinit=yes ;;
13307 echo "Generating a list of signal names and numbers..." >&4
13309 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13310 sig_name=`$awk 'BEGIN { printf "ZERO " }
13311 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13312 sig_num=`$awk 'BEGIN { printf "0 " }
13313 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13314 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13315 !/^NSIG/ { printf "\"%s\", ", $1 }
13316 END { printf "0\n" }' signal.lst`
13317 sig_num_init=`$awk 'BEGIN { printf "0, " }
13318 !/^NSIG/ { printf "%d, ", $2}
13319 END { printf "0\n"}' signal.lst`
13322 echo "The following $sig_count signals are available:"
13324 echo $sig_name | $awk \
13325 'BEGIN { linelen = 0 }
13327 for (i = 1; i <= NF; i++) {
13328 name = "SIG" $i " "
13329 linelen = linelen + length(name)
13330 if (linelen > 70) {
13332 linelen = length(name)
13338 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13340 : see what type is used for signed size_t
13341 set ssize_t ssizetype int stdio.h sys/types.h
13344 $cat > ssize.c <<EOM
13346 #include <sys/types.h>
13347 #define Size_t $sizetype
13348 #define SSize_t $dflt
13351 if (sizeof(Size_t) == sizeof(SSize_t))
13353 else if (sizeof(Size_t) == sizeof(int))
13362 if eval $compile_ok && ./ssize > /dev/null; then
13363 ssizetype=`./ssize`
13364 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13367 Help! I can't compile and run the ssize_t test program: please enlighten me!
13368 (This is probably a misconfiguration in your system or libraries, and
13369 you really ought to fix it. Still, I'll try anyway.)
13371 I need a type that is the same size as $sizetype, but is guaranteed to
13372 be signed. Common values are ssize_t, int and long.
13375 rp="What signed type is the same size as $sizetype?"
13379 $rm -f ssize ssize.*
13381 : see what type of char stdio uses.
13383 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13384 echo "Your stdio uses unsigned chars." >&4
13385 stdchar="unsigned char"
13387 echo "Your stdio uses signed chars." >&4
13391 : see if time exists
13393 if test "X$d_time" = X -o X"$timetype" = X; then
13394 if set time val -f d_time; eval $csym; $val; then
13395 echo 'time() found.' >&4
13397 rp="What is the type returned by time() on this system?"
13398 set time_t timetype long stdio.h sys/types.h
13401 echo 'time() not found, hope that will do.' >&4
13409 : see what type uids are declared as in the kernel
13411 echo "Looking for the type for user ids returned by getuid()."
13412 set uid_t uidtype xxx stdio.h sys/types.h
13416 xxx=`./findhdr sys/user.h`
13417 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13419 unsigned) dflt="$1 $2" ;;
13423 *) dflt="$uidtype";;
13426 uid_t) echo "uid_t found." ;;
13427 *) rp="What is the type for user ids returned by getuid()?"
13435 *_t) zzz="$uidtype" ;;
13438 echo "Checking the size of $zzz..." >&4
13440 #include <sys/types.h>
13443 printf("%d\n", (int)sizeof($uidtype));
13448 if eval $compile_ok; then
13452 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13455 echo "Your $zzz size is $uidsize bytes."
13460 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13465 *_t) zzz="$uidtype" ;;
13468 echo "Checking the sign of $zzz..." >&4
13470 #include <sys/types.h>
13481 if eval $compile; then
13485 echo "(I can't execute the test program--guessing unsigned.)" >&4
13489 1) echo "Your $zzz is unsigned." ;;
13490 -1) echo "Your $zzz is signed." ;;
13496 echo "(I can't compile the test program--guessing unsigned.)" >&4
13502 $echo "Checking the format string to be used for uids..." >&4
13505 -1) if $test X"$uidsize" = X"$ivsize"; then
13506 uidformat="$ivdformat"
13508 if $test X"$uidsize" = X"$longsize"; then
13511 if $test X"$uidsize" = X"$intsize"; then
13514 if $test X"$uidsize" = X"$shortsize"; then
13521 *) if $test X"$uidsize" = X"$uvsize"; then
13522 uidformat="$uvuformat"
13524 if $test X"$uidsize" = X"$longsize"; then
13527 if $test X"$uidsize" = X"$intsize"; then
13530 if $test X"$uidsize" = X"$shortsize"; then
13539 : see if dbm.h is available
13540 : see if dbmclose exists
13541 set dbmclose d_dbmclose
13544 case "$d_dbmclose" in
13554 *) set rpcsvc/dbm.h i_rpcsvcdbm
13559 *) echo "We won't be including <dbm.h>"
13569 : see if this is a sys/file.h system
13574 : do we need to include sys/file.h ?
13578 if $h_sysfile; then
13580 echo "We'll be including <sys/file.h>." >&4
13583 echo "We won't be including <sys/file.h>." >&4
13593 : see if fcntl.h is there
13598 : see if we can include fcntl.h
13604 echo "We'll be including <fcntl.h>." >&4
13607 if $h_sysfile; then
13608 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13610 echo "We won't be including <fcntl.h>." >&4
13622 : see if locale.h is available
13623 set locale.h i_locale
13626 : see if mach cthreads are available
13627 if test "X$usethreads" = "X$define"; then
13628 set mach/cthreads.h i_machcthr
13631 i_machcthr="$undef"
13636 : see if this is a math.h system
13640 : see if this is a mntent.h system
13641 set mntent.h i_mntent
13644 : see if ndbm.h is available
13649 : see if dbm_open exists
13650 set dbm_open d_dbm_open
13652 case "$d_dbm_open" in
13655 echo "We won't be including <ndbm.h>"
13664 : see if net/errno.h is available
13666 set net/errno.h val
13669 : Unfortunately, it causes problems on some systems. Arrgh.
13672 cat > try.c <<'EOM'
13675 #include <net/errno.h>
13681 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13682 echo "We'll be including <net/errno.h>." >&4
13684 echo "We won't be including <net/errno.h>." >&4
13693 : see if netinet/tcp.h is available
13694 set netinet/tcp.h i_netinettcp
13697 : see if this is a poll.h system
13701 : get C preprocessor symbols handy
13703 $echo $n "Hmm... $c"
13704 echo $al | $tr ' ' $trnl >Cppsym.know
13705 $cat <<EOSS >Cppsym
13713 case "\$list\$#" in
13716 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13718 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13721 unknown="\$unknown \$sym"
13731 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13733 exit 0; _ _ _ _\1\\ \1\\
13736 echo "exit 1; _ _ _" >>Cppsym\$\$
13737 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13739 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13745 $rm -f Cppsym\$\$ Cppsym2\$\$
13750 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13752 : now check the C compiler for additional symbols
13753 postprocess_cc_v=''
13755 aix) postprocess_cc_v="|$tr , ' '" ;;
13762 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13765 -D*) echo "\$i" | $sed 's/^-D//';;
13766 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13771 postprocess_cc_v=''
13774 ./ccsym > ccsym1.raw
13775 if $test -s ccsym1.raw; then
13776 $sort ccsym1.raw | $uniq >ccsym.raw
13778 mv ccsym1.raw ccsym.raw
13781 $awk '/\=/ { print $0; next }
13782 { print $0"=1" }' ccsym.raw >ccsym.list
13783 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13784 $comm -13 ccsym.true ccsym.list >ccsym.own
13785 $comm -12 ccsym.true ccsym.list >ccsym.com
13786 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13788 if $test -z ccsym.raw; then
13789 echo "Your C compiler doesn't seem to define any symbols!" >&4
13791 echo "However, your C preprocessor defines the following symbols:"
13794 cppsymbols=`$cat Cppsym.true`
13795 cppsymbols=`echo $cppsymbols`
13796 cppccsymbols="$cppsymbols"
13798 if $test -s ccsym.com; then
13799 echo "Your C compiler and pre-processor define these symbols:"
13800 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13803 cppccsymbols=`$cat ccsym.com`
13804 cppccsymbols=`echo $cppccsymbols`
13805 $test "$silent" || sleep 1
13807 if $test -s ccsym.cpp; then
13808 $test "$also" && echo " "
13809 echo "Your C pre-processor ${also}defines the following symbols:"
13810 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13812 cppsymbols=`$cat ccsym.cpp`
13813 cppsymbols=`echo $cppsymbols`
13814 $test "$silent" || sleep 1
13816 if $test -s ccsym.own; then
13817 $test "$also" && echo " "
13818 echo "Your C compiler ${also}defines the following cpp symbols:"
13819 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13820 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13821 ccsymbols=`$cat ccsym.own`
13822 ccsymbols=`echo $ccsymbols`
13823 $test "$silent" || sleep 1
13828 : see if this is a termio system
13832 if $test `./findhdr termios.h`; then
13833 set tcsetattr i_termios
13839 "$define") echo "You have POSIX termios.h... good!" >&4;;
13840 *) if ./Cppsym pyr; then
13841 case "`/bin/universe`" in
13842 ucb) if $test `./findhdr sgtty.h`; then
13844 echo "<sgtty.h> found." >&4
13846 echo "System is pyramid with BSD universe."
13847 echo "<sgtty.h> not found--you could have problems." >&4
13849 *) if $test `./findhdr termio.h`; then
13851 echo "<termio.h> found." >&4
13853 echo "System is pyramid with USG universe."
13854 echo "<termio.h> not found--you could have problems." >&4
13858 if $test `./findhdr termio.h`; then
13859 echo "<termio.h> found." >&4
13861 elif $test `./findhdr sgtty.h`; then
13862 echo "<sgtty.h> found." >&4
13865 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13868 if $test `./findhdr sgtty.h`; then
13869 echo "<sgtty.h> found." >&4
13871 elif $test `./findhdr termio.h`; then
13872 echo "<termio.h> found." >&4
13875 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13879 set i_termio; eval $setvar
13880 val=$val2; set i_sgtty; eval $setvar
13881 val=$val3; set i_termios; eval $setvar
13883 : see if this is a shadow.h system
13884 set shadow.h i_shadow
13887 : see if this is a socks.h system
13888 set socks.h i_socks
13891 : see if stdarg is available
13893 if $test `./findhdr stdarg.h`; then
13894 echo "<stdarg.h> found." >&4
13897 echo "<stdarg.h> NOT found." >&4
13901 : see if varags is available
13903 if $test `./findhdr varargs.h`; then
13904 echo "<varargs.h> found." >&4
13906 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13909 : set up the varargs testing programs
13910 $cat > varargs.c <<EOP
13912 #include <stdarg.h>
13915 #include <varargs.h>
13919 int f(char *p, ...)
13933 p = va_arg(ap, char *);
13938 $cat > varargs <<EOP
13940 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13949 : now check which varargs header should be included
13954 if `./varargs I_STDARG`; then
13956 elif `./varargs I_VARARGS`; then
13961 if `./varargs I_VARARGS`; then
13968 echo "I could not find the definition for va_dcl... You have problems..." >&4
13969 val="$undef"; set i_stdarg; eval $setvar
13970 val="$undef"; set i_varargs; eval $setvar
13975 case "$i_varhdr" in
13977 val="$define"; set i_stdarg; eval $setvar
13978 val="$undef"; set i_varargs; eval $setvar
13981 val="$undef"; set i_stdarg; eval $setvar
13982 val="$define"; set i_varargs; eval $setvar
13985 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13989 : see if stddef is available
13990 set stddef.h i_stddef
13993 : see if sys/access.h is available
13994 set sys/access.h i_sysaccess
13997 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13998 set sys/filio.h i_sysfilio
14001 if $test `./findhdr sys/ioctl.h`; then
14003 echo '<sys/ioctl.h> found.' >&4
14006 if $test $i_sysfilio = "$define"; then
14007 echo '<sys/ioctl.h> NOT found.' >&4
14009 $test $i_sgtty = "$define" && xxx="sgtty.h"
14010 $test $i_termio = "$define" && xxx="termio.h"
14011 $test $i_termios = "$define" && xxx="termios.h"
14012 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14018 : see if sys/resource.h has to be included
14019 set sys/resource.h i_sysresrc
14022 : see if sys/security.h is available
14023 set sys/security.h i_syssecrt
14026 : see if this is a sys/statvfs.h system
14027 set sys/statvfs.h i_sysstatvfs
14030 : see if this is a sys/uio.h system
14031 set sys/uio.h i_sysuio
14034 : see if this is a sys/un.h system
14035 set sys/un.h i_sysun
14038 : see if this is a syswait system
14039 set sys/wait.h i_syswait
14042 : see if this is a ustat.h system
14043 set ustat.h i_ustat
14046 : see if this is an utime system
14047 set utime.h i_utime
14050 : see if this is a values.h system
14051 set values.h i_values
14054 : see if this is a vfork system
14057 set vfork.h i_vfork
14065 : see if gdbm.h is available
14070 : see if gdbm_open exists
14071 set gdbm_open d_gdbm_open
14073 case "$d_gdbm_open" in
14076 echo "We won't be including <gdbm.h>"
14086 echo "Looking for extensions..." >&4
14087 : If we are using the old config.sh, known_extensions may contain
14088 : old or inaccurate or duplicate values.
14089 known_extensions=''
14090 nonxs_extensions=''
14091 : We do not use find because it might not be available.
14092 : We do not just use MANIFEST because the user may have dropped
14093 : some additional extensions into the source tree and expect them
14096 : Function to recursively find available extensions, ignoring DynaLoader
14097 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14101 DynaLoader|dynaload) ;;
14103 if $test -f $xxx/$xxx.xs; then
14104 known_extensions="$known_extensions $1$xxx";
14105 elif $test -f $xxx/Makefile.PL; then
14106 nonxs_extensions="$nonxs_extensions $1$xxx";
14108 if $test -d $xxx -a $# -lt 10; then
14111 eval $find_extensions;
14123 eval $find_extensions
14124 set X $nonxs_extensions
14126 nonxs_extensions="$*"
14127 set X $known_extensions
14129 known_extensions="$*"
14132 : Now see which are supported on this system.
14134 for xxx in $known_extensions ; do
14138 $define) avail_ext="$avail_ext $xxx" ;;
14141 GDBM_File|gdbm_fil)
14143 $define) avail_ext="$avail_ext $xxx" ;;
14146 NDBM_File|ndbm_fil)
14148 $define) avail_ext="$avail_ext $xxx" ;;
14151 ODBM_File|odbm_fil)
14152 case "${i_dbm}${i_rpcsvcdbm}" in
14153 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14157 case "$useposix" in
14158 true|define|y) avail_ext="$avail_ext $xxx" ;;
14162 case "$useopcode" in
14163 true|define|y) avail_ext="$avail_ext $xxx" ;;
14167 case "$d_socket" in
14168 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14172 case "$usethreads" in
14173 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14177 : XXX Do we need a useipcsysv variable here
14178 case "${d_msg}${d_sem}${d_shm}" in
14179 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14182 *) avail_ext="$avail_ext $xxx"
14191 : Now see which nonxs extensions are supported on this system.
14192 : For now assume all are.
14194 for xxx in $nonxs_extensions ; do
14196 *) nonxs_ext="$nonxs_ext $xxx"
14208 A number of extensions are supplied with $package. You may choose to
14209 compile these extensions for dynamic loading (the default), compile
14210 them into the $package executable (static loading), or not include
14211 them at all. Answer "none" to include no extensions.
14212 Note that DynaLoader is always built and need not be mentioned here.
14215 case "$dynamic_ext" in
14216 '') dflt="$avail_ext" ;;
14217 *) dflt="$dynamic_ext"
14218 # Perhaps we are reusing an old out-of-date config.sh.
14221 if test X"$dynamic_ext" != X"$avail_ext"; then
14223 NOTICE: Your previous config.sh list may be incorrect.
14224 The extensions now available to you are
14226 but the default list from your previous config.sh is
14238 rp="What extensions do you wish to load dynamically?"
14241 none) dynamic_ext=' ' ;;
14242 *) dynamic_ext="$ans" ;;
14245 case "$static_ext" in
14247 : Exclude those already listed in dynamic linking
14249 for xxx in $avail_ext; do
14250 case " $dynamic_ext " in
14252 *) dflt="$dflt $xxx" ;;
14259 *) dflt="$static_ext"
14266 rp="What extensions do you wish to load statically?"
14269 none) static_ext=' ' ;;
14270 *) static_ext="$ans" ;;
14275 A number of extensions are supplied with $package. Answer "none"
14276 to include no extensions.
14277 Note that DynaLoader is always built and need not be mentioned here.
14280 case "$static_ext" in
14281 '') dflt="$avail_ext" ;;
14282 *) dflt="$static_ext"
14283 # Perhaps we are reusing an old out-of-date config.sh.
14286 if test X"$static_ext" != X"$avail_ext"; then
14288 NOTICE: Your previous config.sh list may be incorrect.
14289 The extensions now available to you are
14291 but the default list from your previous config.sh is
14300 : Exclude those that are not xs extensions
14304 rp="What extensions do you wish to include?"
14307 none) static_ext=' ' ;;
14308 *) static_ext="$ans" ;;
14313 set X $dynamic_ext $static_ext $nonxs_ext
14317 : Remove build directory name from cppstdin so it can be used from
14318 : either the present location or the final installed location.
14320 : Get out of the UU directory to get correct path name.
14322 case "$cppstdin" in
14324 echo "Stripping down cppstdin path name"
14330 : end of configuration questions
14332 echo "End of configuration questions."
14335 : back to where it started
14336 if test -d ../UU; then
14340 : configuration may be patched via a 'config.over' file
14341 if $test -f config.over; then
14344 rp='I see a config.over file. Do you wish to load it?'
14347 n*) echo "OK, I'll ignore it.";;
14349 echo "Configuration override changes have been loaded."
14354 : in case they want portability, strip down executable paths
14355 case "$d_portable" in
14358 echo "Stripping down executable paths..." >&4
14359 for file in $loclist $trylist; do
14361 eval $file=`basename $temp`
14366 : create config.sh file
14368 echo "Creating config.sh..." >&4
14369 $spitshell <<EOT >config.sh
14372 # This file was produced by running the Configure script. It holds all the
14373 # definitions figured out by Configure. Should you modify one of these values,
14374 # do not forget to propagate your changes by running "Configure -der". You may
14375 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14378 # Package name : $package
14379 # Source directory : $src
14380 # Configuration time: $cf_time
14381 # Configured by : $cf_by
14382 # Target system : $myuname
14392 Revision='$Revision'
14399 alignbytes='$alignbytes'
14400 ansi2knr='$ansi2knr'
14401 aphostname='$aphostname'
14402 api_revision='$api_revision'
14403 api_subversion='$api_subversion'
14404 api_version='$api_version'
14405 api_versionstring='$api_versionstring'
14408 archlibexp='$archlibexp'
14409 archname64='$archname64'
14410 archname='$archname'
14411 archobjs='$archobjs'
14416 bincompat5005='$bincompat5005'
14420 byteorder='$byteorder'
14422 castflags='$castflags'
14425 cccdlflags='$cccdlflags'
14426 ccdlflags='$ccdlflags'
14428 ccsymbols='$ccsymbols'
14430 cf_email='$cf_email'
14432 charsize='$charsize'
14436 clocktype='$clocktype'
14438 compress='$compress'
14439 contains='$contains'
14443 cpp_stuff='$cpp_stuff'
14444 cppccsymbols='$cppccsymbols'
14445 cppflags='$cppflags'
14447 cppminus='$cppminus'
14449 cppstdin='$cppstdin'
14450 cppsymbols='$cppsymbols'
14451 crosscompile='$crosscompile'
14452 cryptlib='$cryptlib'
14454 d_Gconvert='$d_Gconvert'
14455 d_PRIEldbl='$d_PRIEldbl'
14456 d_PRIFldbl='$d_PRIFldbl'
14457 d_PRIGldbl='$d_PRIGldbl'
14458 d_PRIX64='$d_PRIX64'
14459 d_PRId64='$d_PRId64'
14460 d_PRIeldbl='$d_PRIeldbl'
14461 d_PRIfldbl='$d_PRIfldbl'
14462 d_PRIgldbl='$d_PRIgldbl'
14463 d_PRIi64='$d_PRIi64'
14464 d_PRIo64='$d_PRIo64'
14465 d_PRIu64='$d_PRIu64'
14466 d_PRIx64='$d_PRIx64'
14467 d_access='$d_access'
14468 d_accessx='$d_accessx'
14470 d_archlib='$d_archlib'
14473 d_attribut='$d_attribut'
14476 d_bincompat5005='$d_bincompat5005'
14478 d_bsdgetpgrp='$d_bsdgetpgrp'
14479 d_bsdsetpgrp='$d_bsdsetpgrp'
14481 d_casti32='$d_casti32'
14482 d_castneg='$d_castneg'
14483 d_charvspr='$d_charvspr'
14485 d_chroot='$d_chroot'
14486 d_chsize='$d_chsize'
14487 d_closedir='$d_closedir'
14491 d_cuserid='$d_cuserid'
14492 d_dbl_dig='$d_dbl_dig'
14493 d_difftime='$d_difftime'
14494 d_dirnamlen='$d_dirnamlen'
14495 d_dlerror='$d_dlerror'
14496 d_dlopen='$d_dlopen'
14497 d_dlsymun='$d_dlsymun'
14498 d_dosuid='$d_dosuid'
14499 d_drand48proto='$d_drand48proto'
14501 d_eaccess='$d_eaccess'
14502 d_endgrent='$d_endgrent'
14503 d_endhent='$d_endhent'
14504 d_endnent='$d_endnent'
14505 d_endpent='$d_endpent'
14506 d_endpwent='$d_endpwent'
14507 d_endsent='$d_endsent'
14508 d_endspent='$d_endspent'
14509 d_eofnblk='$d_eofnblk'
14510 d_eunice='$d_eunice'
14511 d_fchmod='$d_fchmod'
14512 d_fchown='$d_fchown'
14514 d_fd_macros='$d_fd_macros'
14515 d_fd_set='$d_fd_set'
14516 d_fds_bits='$d_fds_bits'
14517 d_fgetpos='$d_fgetpos'
14518 d_flexfnam='$d_flexfnam'
14521 d_fpathconf='$d_fpathconf'
14522 d_fpos64_t='$d_fpos64_t'
14523 d_fs_data_s='$d_fs_data_s'
14524 d_fseeko='$d_fseeko'
14525 d_fsetpos='$d_fsetpos'
14526 d_fstatfs='$d_fstatfs'
14527 d_fstatvfs='$d_fstatvfs'
14528 d_ftello='$d_ftello'
14530 d_getgrent='$d_getgrent'
14531 d_getgrps='$d_getgrps'
14532 d_gethbyaddr='$d_gethbyaddr'
14533 d_gethbyname='$d_gethbyname'
14534 d_gethent='$d_gethent'
14535 d_gethname='$d_gethname'
14536 d_gethostprotos='$d_gethostprotos'
14537 d_getlogin='$d_getlogin'
14538 d_getmnt='$d_getmnt'
14539 d_getmntent='$d_getmntent'
14540 d_getnbyaddr='$d_getnbyaddr'
14541 d_getnbyname='$d_getnbyname'
14542 d_getnent='$d_getnent'
14543 d_getnetprotos='$d_getnetprotos'
14544 d_getpbyname='$d_getpbyname'
14545 d_getpbynumber='$d_getpbynumber'
14546 d_getpent='$d_getpent'
14547 d_getpgid='$d_getpgid'
14548 d_getpgrp2='$d_getpgrp2'
14549 d_getpgrp='$d_getpgrp'
14550 d_getppid='$d_getppid'
14551 d_getprior='$d_getprior'
14552 d_getprotoprotos='$d_getprotoprotos'
14553 d_getpwent='$d_getpwent'
14554 d_getsbyname='$d_getsbyname'
14555 d_getsbyport='$d_getsbyport'
14556 d_getsent='$d_getsent'
14557 d_getservprotos='$d_getservprotos'
14558 d_getspent='$d_getspent'
14559 d_getspnam='$d_getspnam'
14560 d_gettimeod='$d_gettimeod'
14561 d_gnulibc='$d_gnulibc'
14562 d_grpasswd='$d_grpasswd'
14563 d_hasmntopt='$d_hasmntopt'
14566 d_inetaton='$d_inetaton'
14567 d_int64t='$d_int64t'
14568 d_isascii='$d_isascii'
14569 d_killpg='$d_killpg'
14570 d_lchown='$d_lchown'
14571 d_ldbl_dig='$d_ldbl_dig'
14573 d_locconv='$d_locconv'
14575 d_longdbl='$d_longdbl'
14576 d_longlong='$d_longlong'
14579 d_mbstowcs='$d_mbstowcs'
14580 d_mbtowc='$d_mbtowc'
14581 d_memchr='$d_memchr'
14582 d_memcmp='$d_memcmp'
14583 d_memcpy='$d_memcpy'
14584 d_memmove='$d_memmove'
14585 d_memset='$d_memset'
14587 d_mkfifo='$d_mkfifo'
14588 d_mktime='$d_mktime'
14590 d_msg_ctrunc='$d_msg_ctrunc'
14591 d_msg_dontroute='$d_msg_dontroute'
14592 d_msg_oob='$d_msg_oob'
14593 d_msg_peek='$d_msg_peek'
14594 d_msg_proxy='$d_msg_proxy'
14595 d_msgctl='$d_msgctl'
14596 d_msgget='$d_msgget'
14597 d_msgrcv='$d_msgrcv'
14598 d_msgsnd='$d_msgsnd'
14599 d_mymalloc='$d_mymalloc'
14601 d_nvpresuv='$d_nvpresuv'
14602 d_off64_t='$d_off64_t'
14603 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14604 d_oldpthreads='$d_oldpthreads'
14605 d_oldsock='$d_oldsock'
14607 d_pathconf='$d_pathconf'
14609 d_phostname='$d_phostname'
14612 d_portable='$d_portable'
14613 d_pthread_yield='$d_pthread_yield'
14615 d_pwchange='$d_pwchange'
14616 d_pwclass='$d_pwclass'
14617 d_pwcomment='$d_pwcomment'
14618 d_pwexpire='$d_pwexpire'
14619 d_pwgecos='$d_pwgecos'
14620 d_pwpasswd='$d_pwpasswd'
14621 d_pwquota='$d_pwquota'
14623 d_readdir='$d_readdir'
14624 d_readlink='$d_readlink'
14625 d_rename='$d_rename'
14626 d_rewinddir='$d_rewinddir'
14628 d_safebcpy='$d_safebcpy'
14629 d_safemcpy='$d_safemcpy'
14630 d_sanemcmp='$d_sanemcmp'
14631 d_sched_yield='$d_sched_yield'
14632 d_scm_rights='$d_scm_rights'
14633 d_seekdir='$d_seekdir'
14634 d_select='$d_select'
14636 d_semctl='$d_semctl'
14637 d_semctl_semid_ds='$d_semctl_semid_ds'
14638 d_semctl_semun='$d_semctl_semun'
14639 d_semget='$d_semget'
14641 d_setegid='$d_setegid'
14642 d_seteuid='$d_seteuid'
14643 d_setgrent='$d_setgrent'
14644 d_setgrps='$d_setgrps'
14645 d_sethent='$d_sethent'
14646 d_setlinebuf='$d_setlinebuf'
14647 d_setlocale='$d_setlocale'
14648 d_setnent='$d_setnent'
14649 d_setpent='$d_setpent'
14650 d_setpgid='$d_setpgid'
14651 d_setpgrp2='$d_setpgrp2'
14652 d_setpgrp='$d_setpgrp'
14653 d_setprior='$d_setprior'
14654 d_setpwent='$d_setpwent'
14655 d_setregid='$d_setregid'
14656 d_setresgid='$d_setresgid'
14657 d_setresuid='$d_setresuid'
14658 d_setreuid='$d_setreuid'
14659 d_setrgid='$d_setrgid'
14660 d_setruid='$d_setruid'
14661 d_setsent='$d_setsent'
14662 d_setsid='$d_setsid'
14663 d_setspent='$d_setspent'
14664 d_setvbuf='$d_setvbuf'
14668 d_shmatprototype='$d_shmatprototype'
14669 d_shmctl='$d_shmctl'
14671 d_shmget='$d_shmget'
14672 d_sigaction='$d_sigaction'
14673 d_sigsetjmp='$d_sigsetjmp'
14674 d_socket='$d_socket'
14675 d_sockpair='$d_sockpair'
14677 d_statblks='$d_statblks'
14678 d_statfs_f_flags='$d_statfs_f_flags'
14679 d_statfs_s='$d_statfs_s'
14680 d_statvfs='$d_statvfs'
14681 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14682 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14683 d_stdio_stream_array='$d_stdio_stream_array'
14684 d_stdiobase='$d_stdiobase'
14685 d_stdstdio='$d_stdstdio'
14686 d_strchr='$d_strchr'
14687 d_strcoll='$d_strcoll'
14688 d_strctcpy='$d_strctcpy'
14689 d_strerrm='$d_strerrm'
14690 d_strerror='$d_strerror'
14691 d_strtod='$d_strtod'
14692 d_strtol='$d_strtol'
14693 d_strtold='$d_strtold'
14694 d_strtoll='$d_strtoll'
14695 d_strtoul='$d_strtoul'
14696 d_strtoull='$d_strtoull'
14697 d_strtouq='$d_strtouq'
14698 d_strxfrm='$d_strxfrm'
14699 d_suidsafe='$d_suidsafe'
14700 d_symlink='$d_symlink'
14701 d_syscall='$d_syscall'
14702 d_sysconf='$d_sysconf'
14703 d_sysernlst='$d_sysernlst'
14704 d_syserrlst='$d_syserrlst'
14705 d_system='$d_system'
14706 d_tcgetpgrp='$d_tcgetpgrp'
14707 d_tcsetpgrp='$d_tcsetpgrp'
14708 d_telldir='$d_telldir'
14709 d_telldirproto='$d_telldirproto'
14712 d_truncate='$d_truncate'
14713 d_tzname='$d_tzname'
14716 d_union_semun='$d_union_semun'
14718 d_vendorbin='$d_vendorbin'
14719 d_vendorlib='$d_vendorlib'
14721 d_void_closedir='$d_void_closedir'
14722 d_voidsig='$d_voidsig'
14723 d_voidtty='$d_voidtty'
14724 d_volatile='$d_volatile'
14725 d_vprintf='$d_vprintf'
14727 d_waitpid='$d_waitpid'
14728 d_wcstombs='$d_wcstombs'
14729 d_wctomb='$d_wctomb'
14732 db_hashtype='$db_hashtype'
14733 db_prefixtype='$db_prefixtype'
14734 defvoidused='$defvoidused'
14735 direntrytype='$direntrytype'
14738 doublesize='$doublesize'
14740 dynamic_ext='$dynamic_ext'
14746 eunicefix='$eunicefix'
14749 extensions='$extensions'
14750 fflushNULL='$fflushNULL'
14751 fflushall='$fflushall'
14753 firstmakefile='$firstmakefile'
14755 fpossize='$fpossize'
14756 fpostype='$fpostype'
14757 freetype='$freetype'
14759 full_csh='$full_csh'
14760 full_sed='$full_sed'
14761 gccversion='$gccversion'
14762 gidformat='$gidformat'
14768 groupcat='$groupcat'
14769 groupstype='$groupstype'
14772 h_sysfile='$h_sysfile'
14784 i_arpainet='$i_arpainet'
14785 i_bsdioctl='$i_bsdioctl'
14788 i_dirent='$i_dirent'
14795 i_inttypes='$i_inttypes'
14796 i_limits='$i_limits'
14797 i_locale='$i_locale'
14798 i_machcthr='$i_machcthr'
14799 i_malloc='$i_malloc'
14801 i_memory='$i_memory'
14802 i_mntent='$i_mntent'
14805 i_neterrno='$i_neterrno'
14806 i_netinettcp='$i_netinettcp'
14809 i_pthread='$i_pthread'
14811 i_rpcsvcdbm='$i_rpcsvcdbm'
14814 i_shadow='$i_shadow'
14816 i_stdarg='$i_stdarg'
14817 i_stddef='$i_stddef'
14818 i_stdlib='$i_stdlib'
14819 i_string='$i_string'
14820 i_sysaccess='$i_sysaccess'
14821 i_sysdir='$i_sysdir'
14822 i_sysfile='$i_sysfile'
14823 i_sysfilio='$i_sysfilio'
14825 i_sysioctl='$i_sysioctl'
14826 i_sysmount='$i_sysmount'
14827 i_sysndir='$i_sysndir'
14828 i_sysparam='$i_sysparam'
14829 i_sysresrc='$i_sysresrc'
14830 i_syssecrt='$i_syssecrt'
14831 i_sysselct='$i_sysselct'
14832 i_syssockio='$i_syssockio'
14833 i_sysstat='$i_sysstat'
14834 i_sysstatfs='$i_sysstatfs'
14835 i_sysstatvfs='$i_sysstatvfs'
14836 i_systime='$i_systime'
14837 i_systimek='$i_systimek'
14838 i_systimes='$i_systimes'
14839 i_systypes='$i_systypes'
14840 i_sysuio='$i_sysuio'
14842 i_sysvfs='$i_sysvfs'
14843 i_syswait='$i_syswait'
14844 i_termio='$i_termio'
14845 i_termios='$i_termios'
14847 i_unistd='$i_unistd'
14850 i_values='$i_values'
14851 i_varargs='$i_varargs'
14852 i_varhdr='$i_varhdr'
14854 ignore_versioned_solibs='$ignore_versioned_solibs'
14855 inc_version_list='$inc_version_list'
14856 inc_version_list_init='$inc_version_list_init'
14859 installarchlib='$installarchlib'
14860 installbin='$installbin'
14861 installman1dir='$installman1dir'
14862 installman3dir='$installman3dir'
14863 installprefix='$installprefix'
14864 installprefixexp='$installprefixexp'
14865 installprivlib='$installprivlib'
14866 installscript='$installscript'
14867 installsitearch='$installsitearch'
14868 installsitebin='$installsitebin'
14869 installsitelib='$installsitelib'
14870 installstyle='$installstyle'
14871 installusrbinperl='$installusrbinperl'
14872 installvendorbin='$installvendorbin'
14873 installvendorlib='$installvendorlib'
14875 ivdformat='$ivdformat'
14878 known_extensions='$known_extensions'
14882 lddlflags='$lddlflags'
14884 ldlibpthname='$ldlibpthname'
14891 libswanted='$libswanted'
14897 locincpth='$locincpth'
14898 loclibpth='$loclibpth'
14899 longdblsize='$longdblsize'
14900 longlongsize='$longlongsize'
14901 longsize='$longsize'
14905 lseeksize='$lseeksize'
14906 lseektype='$lseektype'
14910 make_set_make='$make_set_make'
14911 mallocobj='$mallocobj'
14912 mallocsrc='$mallocsrc'
14913 malloctype='$malloctype'
14915 man1direxp='$man1direxp'
14918 man3direxp='$man3direxp'
14921 mips_type='$mips_type'
14924 modetype='$modetype'
14926 multiarch='$multiarch'
14928 myarchname='$myarchname'
14929 mydomain='$mydomain'
14930 myhostname='$myhostname'
14933 netdb_hlen_type='$netdb_hlen_type'
14934 netdb_host_type='$netdb_host_type'
14935 netdb_name_type='$netdb_name_type'
14936 netdb_net_type='$netdb_net_type'
14939 nm_so_opt='$nm_so_opt'
14940 nonxs_ext='$nonxs_ext'
14944 o_nonblock='$o_nonblock'
14946 old_pthread_create_joinable='$old_pthread_create_joinable'
14947 optimize='$optimize'
14948 orderlib='$orderlib'
14954 patchlevel='$patchlevel'
14955 path_sep='$path_sep'
14957 perladmin='$perladmin'
14958 perlpath='$perlpath'
14960 phostname='$phostname'
14966 prefixexp='$prefixexp'
14968 privlibexp='$privlibexp'
14969 prototype='$prototype'
14971 quadkind='$quadkind'
14972 quadtype='$quadtype'
14973 randbits='$randbits'
14974 randfunc='$randfunc'
14975 randseedtype='$randseedtype'
14977 rd_nodata='$rd_nodata'
14981 sPRIEldbl='$sPRIEldbl'
14982 sPRIFldbl='$sPRIFldbl'
14983 sPRIGldbl='$sPRIGldbl'
14986 sPRIeldbl='$sPRIeldbl'
14987 sPRIfldbl='$sPRIfldbl'
14988 sPRIgldbl='$sPRIgldbl'
14993 sched_yield='$sched_yield'
14994 scriptdir='$scriptdir'
14995 scriptdirexp='$scriptdirexp'
14997 seedfunc='$seedfunc'
14998 selectminbits='$selectminbits'
14999 selecttype='$selecttype'
15000 sendmail='$sendmail'
15003 sharpbang='$sharpbang'
15004 shmattype='$shmattype'
15005 shortsize='$shortsize'
15008 sig_count='$sig_count'
15009 sig_name='$sig_name'
15010 sig_name_init='$sig_name_init'
15012 sig_num_init='$sig_num_init'
15013 signal_t='$signal_t'
15014 sitearch='$sitearch'
15015 sitearchexp='$sitearchexp'
15017 sitebinexp='$sitebinexp'
15019 sitelibexp='$sitelibexp'
15020 siteprefix='$siteprefix'
15021 siteprefixexp='$siteprefixexp'
15022 sizetype='$sizetype'
15027 sockethdr='$sockethdr'
15028 socketlib='$socketlib'
15030 spackage='$spackage'
15031 spitshell='$spitshell'
15034 ssizetype='$ssizetype'
15035 startperl='$startperl'
15037 static_ext='$static_ext'
15039 stdio_base='$stdio_base'
15040 stdio_bufsiz='$stdio_bufsiz'
15041 stdio_cnt='$stdio_cnt'
15042 stdio_filbuf='$stdio_filbuf'
15043 stdio_ptr='$stdio_ptr'
15044 stdio_stream_array='$stdio_stream_array'
15047 subversion='$subversion'
15054 timeincl='$timeincl'
15055 timetype='$timetype'
15068 uidformat='$uidformat'
15074 uquadtype='$uquadtype'
15075 use5005threads='$use5005threads'
15076 use64bits='$use64bits'
15078 useithreads='$useithreads'
15079 uselargefiles='$uselargefiles'
15080 uselongdouble='$uselongdouble'
15081 uselonglong='$uselonglong'
15082 usemorebits='$usemorebits'
15083 usemultiplicity='$usemultiplicity'
15084 usemymalloc='$usemymalloc'
15086 useopcode='$useopcode'
15087 useperlio='$useperlio'
15088 useposix='$useposix'
15090 useshrplib='$useshrplib'
15091 usesocks='$usesocks'
15092 usethreads='$usethreads'
15093 usevendorprefix='$usevendorprefix'
15094 usevfork='$usevfork'
15097 uvoformat='$uvoformat'
15100 uvuformat='$uvuformat'
15101 uvxformat='$uvxformat'
15102 vendorbin='$vendorbin'
15103 vendorbinexp='$vendorbinexp'
15104 vendorlib='$vendorlib'
15105 vendorlibexp='$vendorlibexp'
15106 vendorprefix='$vendorprefix'
15107 vendorprefixexp='$vendorprefixexp'
15110 voidflags='$voidflags'
15116 : Add in command line options if available
15117 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15119 : add special variables
15120 $test -f $src/patchlevel.h && \
15121 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15122 echo "CONFIGDOTSH=true" >>config.sh
15124 : propagate old symbols
15125 if $test -f UU/config.sh; then
15126 <UU/config.sh sort | uniq >UU/oldconfig.sh
15127 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15128 sort | uniq -u >UU/oldsyms
15129 set X `cat UU/oldsyms`
15135 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15137 echo "# Variables propagated from previous config.sh file." >>config.sh
15138 for sym in `cat UU/oldsyms`; do
15139 echo " Propagating $hint variable "'$'"$sym..."
15140 eval 'tmp="$'"${sym}"'"'
15142 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15148 : Finish up by extracting the .SH files
15162 If you'd like to make any changes to the config.sh file before I begin
15163 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15166 rp="Press return or use a shell escape to edit config.sh:"
15171 *) : in case they cannot read
15172 sh 1>&4 -c "$ans";;
15177 : if this fails, just run all the .SH files by hand
15184 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15191 Now you need to generate make dependencies by running "$make depend".
15192 You might prefer to run it in background: "$make depend > makedepend.out &"
15193 It can take a while, so you might not want to run it right now.
15198 rp="Run $make depend now?"
15202 $make depend && echo "Now you must run a $make."
15205 echo "You must run '$make depend' then '$make'."
15208 elif test -f [Mm]akefile; then
15210 echo "Now you must run a $make."
15215 if $test -f Policy.sh; then
15218 If you compile $package on a different machine or from a different object
15219 directory, copy the Policy.sh file from this object directory to the
15220 new one before you run Configure -- this will help you with most of
15221 the policy defaults.
15225 if $test -f config.msg; then
15226 echo "Hmm. I also noted the following information while running:"
15228 $cat config.msg >&4
15231 $rm -f kit*isdone ark*isdone