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 Fri Nov 12 01:02:11 EET 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 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=''
688 ignore_versioned_solibs=''
843 d_stdio_stream_array=''
844 stdio_stream_array=''
889 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
892 : We must find out about Eunice early
894 if test -f /etc/unixtovms; then
895 eunicefix=/etc/unixtovms
897 if test -f /etc/unixtovms.exe; then
898 eunicefix=/etc/unixtovms.exe
902 : Possible local include directories to search.
903 : Set locincpth to "" in a hint file to defeat local include searches.
904 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
905 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
907 : no include file wanted by default
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 : Trailing extension. Override this in a hint file, if needed.
977 : Extra object files, if any, needed on this platform.
980 : change the next line if compiling for Xenix/286 on Xenix/386
981 xlibpth='/usr/lib/386 /lib/386'
983 : Possible local library directories to search.
984 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
985 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
987 : general looking path for locating libraries
988 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
989 glibpth="$glibpth /lib /usr/lib $xlibpth"
990 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
991 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
993 : Private path used by Configure to find libraries. Its value
994 : is prepended to libpth. This variable takes care of special
995 : machines, like the mips. Usually, it should be empty.
998 : default library list
1000 : some systems want to use only the non-versioned libso:s
1001 ignore_versioned_solibs=''
1002 : full support for void wanted by default
1005 : set useposix=false in your hint file to disable the POSIX extension.
1007 : set useopcode=false in your hint file to disable the Opcode extension.
1009 : set usemultiplicity on the Configure command line to enable multiplicity.
1010 : set usesocks on the Configure command line to enable socks.
1011 : set usethreads on the Configure command line to enable threads.
1012 : List of libraries we want.
1013 : If anyone needs -lnet, put it in a hint file.
1014 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1015 libswanted="$libswanted dld ld sun m c cposix posix"
1016 libswanted="$libswanted ndir dir crypt sec"
1017 libswanted="$libswanted ucb bsd BSD PW x"
1018 : We probably want to search /usr/shlib before most other libraries.
1019 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1020 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1021 glibpth="/usr/shlib $glibpth"
1022 : Do not use vfork unless overridden by a hint file.
1025 : Find the basic shell for Bourne shell scripts
1029 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1032 if test -f "$xxx"; then
1035 : Build up a list and do a single loop so we can 'break' out.
1036 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1037 for xxx in sh bash ksh pdksh ash; do
1039 try="$try ${p}/${xxx}"
1043 if test -f "$xxx"; then
1046 elif test -f "$xxx.exe"; then
1057 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1059 Usually it's in /bin/sh. How did you even get this far?
1060 Please contact me (Perl Maintainers) at perlbug@perl.com and
1061 we'll try to straighten this all out.
1067 : see if sh knows # comments
1068 if `$sh -c '#' >/dev/null 2>&1`; then
1072 test -f $xcat || xcat=/usr/bin/cat
1077 if test -s today; then
1080 echo "#! $xcat" > try
1084 if test -s today; then
1092 echo "Your $sh doesn't grok # comments--I will strip them later on."
1095 echo "exec grep -v '^[ ]*#'" >spitshell
1097 $eunicefix spitshell
1098 spitshell=`pwd`/spitshell
1100 echo "I presume that if # doesn't work, #! won't work either!"
1105 : figure out how to guarantee sh startup
1107 '') startsh=${sharpbang}${sh} ;;
1119 : echo "Yup, it does."
1121 echo "Hmm... '$startsh' does not guarantee sh startup..."
1122 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1127 : Save command line options in file UU/cmdline.opt for later use in
1128 : generating config.sh.
1129 cat > cmdline.opt <<EOSH
1130 # Configure command line arguments.
1137 cat >>cmdline.opt <<EOSH
1138 config_arg$argn='$arg'
1140 argn=`expr $argn + 1`
1143 : produce awk script to parse command line options
1144 cat >options.awk <<'EOF'
1146 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1148 len = length(optstr);
1149 for (i = 1; i <= len; i++) {
1150 c = substr(optstr, i, 1);
1151 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1162 if (substr(str, 1, 1) != "-") {
1163 printf("'%s'\n", str);
1167 for (i = 2; i <= len; i++) {
1168 c = substr(str, i, 1);
1170 printf("-%s\n", substr(str, i));
1176 printf("'%s'\n", substr(str, i + 1));
1189 : process the command line options
1190 set X `for arg in "$@"; do echo "X$arg"; done |
1191 sed -e s/X// | awk -f options.awk`
1196 : set up default values
1206 rm -f optdef.sh posthint.sh
1207 cat >optdef.sh <<EOS
1213 while test $# -gt 0; do
1215 -d) shift; fastread=yes;;
1216 -e) shift; alldone=cont;;
1220 if test -r "$1"; then
1223 echo "$me: cannot read config file $1." >&2
1228 -h) shift; error=true;;
1229 -r) shift; reuseval=true;;
1230 -s) shift; silent=true; realsilent=true;;
1231 -E) shift; alldone=exit;;
1232 -K) shift; knowitall=true;;
1233 -O) shift; override=true;;
1234 -S) shift; silent=true; extractsh=true;;
1239 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1240 echo "$me: ignoring -D $1" >&2
1243 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1244 *) echo "$1='define'" >> optdef.sh;;
1251 *=) echo "$1" >> optdef.sh;;
1253 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1254 echo "$me: ignoring -U $1" >&2
1256 *) echo "$1='undef'" >> optdef.sh;;
1267 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1271 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1272 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1278 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1279 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1280 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1281 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1282 *) xxx=`echo $yyy|sed 's!:.*!!'`
1283 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1289 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1291 echo "$yyy=''" >> posthint.sh ;;
1296 echo "$yyy='$zzz'" >> posthint.sh ;;
1298 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1300 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1305 echo "$yyy=$zzz" >> posthint.sh ;;
1306 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1309 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1312 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1320 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1321 [-U symbol] [-U symbol=] [-A command:symbol...]
1322 -d : use defaults for all answers.
1323 -e : go on without questioning past the production of config.sh.
1324 -f : specify an alternate default configuration file.
1325 -h : print this help message and exit (with an error status).
1326 -r : reuse C symbols value if possible (skips costly nm extraction).
1327 -s : silent mode, only echoes questions and essential information.
1328 -D : define symbol to have some value:
1329 -D symbol symbol gets the value 'define'
1330 -D symbol=value symbol gets the value 'value'
1331 -E : stop at the end of questions, after having produced config.sh.
1332 -K : do not use unless you know what you are doing.
1333 -O : let -D and -U override definitions from loaded configuration file.
1334 -S : perform variable substitutions on all .SH files (can mix with -f)
1335 -U : undefine symbol:
1336 -U symbol symbol gets the value 'undef'
1337 -U symbol= symbol gets completely empty
1338 -A : manipulate symbol after the platform specific hints have been applied:
1339 -A symbol=value append " "value to symbol
1340 -A append:symbol=value append value to symbol
1341 -A define:symbol=value define symbol to have value
1342 -A clear:symbol define symbol to be ''
1343 -A define:symbol define symbol to be 'define'
1344 -A eval:symbol=value define symbol to be eval of value
1345 -A prepend:symbol=value prepend value to symbol
1346 -A undef:symbol define symbol to be 'undef'
1347 -A undef:symbol= define symbol to be ''
1348 -V : print version number and exit (with a zero status).
1355 case "$fastread$alldone" in
1358 if test ! -t 0; then
1359 echo "Say 'sh Configure', not 'sh <Configure'"
1367 true) exec 1>/dev/null;;
1370 : run the defines and the undefines, if any, but leave the file out there...
1373 : create the posthint manipulation script and leave the file out there...
1378 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1379 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1380 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1381 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1382 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1385 : Some greps do not return status, grrr.
1386 echo "grimblepritz" >grimble
1387 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1389 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1395 : the following should work in any shell
1399 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1400 cat >contains <<'EOSS'
1401 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1406 : Find the path to the source tree
1409 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1412 *) src=`cd ../$src && pwd` ;;
1425 if test -f $rsrc/Configure && \
1426 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1428 : found it, so we are ok.
1431 for src in . .. ../.. ../../.. ../../../..; do
1432 if test -f ../$src/Configure && \
1433 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1444 Sorry, I can't seem to locate the source dir for $package. Please start
1445 Configure with an explicit path -- i.e. /some/path/Configure.
1453 echo "Sources for $package found in \"$src\"." >&4
1457 : script used to extract .SH files with variable substitutions
1458 cat >extract <<'EOS'
1460 echo "Doing variable substitutions on .SH files..."
1461 if test -f $src/MANIFEST; then
1462 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1464 echo "(Looking for .SH files under the source directory.)"
1465 set x `(cd $src; find . -name "*.SH" -print)`
1469 0) set x `(cd $src; echo *.SH)`; shift;;
1471 if test ! -f $src/$1; then
1477 while test $name; do
1478 if test ! -d "$name"; then
1479 create="$name $create";
1480 name=`echo $name | sed -e "s|^[^/]*$||"`;
1481 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1486 for file in $create; do
1495 dir=`expr X$file : 'X\(.*\)/'`
1496 file=`expr X$file : 'X.*/\(.*\)'`
1497 (cd $dir && . ./$file)
1507 dir=`expr X$file : 'X\(.*\)/'`
1508 file=`expr X$file : 'X.*/\(.*\)'`
1509 (set x $dir; shift; eval $mkdir_p)
1519 if test -f $src/config_h.SH; then
1520 if test ! -f config.h; then
1521 : oops, they left it out of MANIFEST, probably, so do it anyway.
1527 : extract files and exit if asked to do so
1528 case "$extractsh" in
1530 case "$realsilent" in
1534 case "$config_sh" in
1535 '') config_sh='config.sh';;
1538 echo "Fetching answers from $config_sh..."
1541 test "$override" && . ./optdef.sh
1550 : Eunice requires " " instead of "", can you believe it
1553 echo "Beginning of configuration questions for $package."
1555 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1557 : first determine how to suppress newline on echo command
1559 echo "Checking echo to see how to suppress newlines..."
1560 (echo "hi there\c" ; echo " ") >.echotmp
1561 if $contains c .echotmp >/dev/null 2>&1 ; then
1572 echo $n "The star should be here-->$c"
1576 : Now test for existence of everything in MANIFEST
1578 if test -f $rsrc/MANIFEST; then
1579 echo "First let's make sure your kit is complete. Checking..." >&4
1580 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1583 for filelist in x??; do
1584 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1586 if test -s missing; then
1590 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1592 You have the option of continuing the configuration process, despite the
1593 distinct possibility that your kit is damaged, by typing 'y'es. If you
1594 do, don't blame me if something goes wrong. I advise you to type 'n'o
1595 and contact the author (perlbug@perl.com).
1598 echo $n "Continue? [n] $c" >&4
1602 echo "Continuing..." >&4
1606 echo "ABORTING..." >&4
1611 echo "Looks good..."
1614 echo "There is no MANIFEST file. I hope your kit is complete !"
1619 : Find the appropriate value for a newline for tr
1620 if test -n "$DJGPP"; then
1623 if test X"$trnl" = X; then
1624 case "`echo foo|tr '\n' x 2>/dev/null`" in
1628 if test X"$trnl" = X; then
1629 case "`echo foo|tr '\012' x 2>/dev/null`" in
1630 foox) trnl='\012' ;;
1633 if test X"$trnl" = X; then
1636 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1642 : compute the number of columns on the terminal for proper question formatting
1647 : set up the echo used in my read
1648 myecho="case \"\$xxxm\" in
1649 '') echo $n \"\$rp $c\" >&4;;
1651 '') echo $n \"[\$xxxm] $c\";;
1653 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1655 echo $n \"[\$xxxm] $c\" >&4
1657 echo $n \"\$rp [\$xxxm] $c\" >&4
1663 : now set up to do reads with possible shell escape and default assignment
1669 case "\$fastread" in
1670 yes) case "\$dflt" in
1673 case "\$silent-\$rp" in
1678 *) case "\$silent" in
1679 true) case "\$rp" in
1684 while expr "X\$ans" : "X!" >/dev/null; do
1688 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1696 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1705 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1710 echo "(OK, I'll run with -d after this question.)" >&4
1713 echo "*** Sorry, \$1 not supported yet." >&4
1723 echo "*** Substitution done -- please confirm."
1725 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1730 echo "*** Error -- try again."
1737 case "\$ans\$xxxm\$nostick" in
1749 : create .config dir to save info across Configure sessions
1750 test -d ../.config || mkdir ../.config
1751 cat >../.config/README <<EOF
1752 This directory created by Configure to save information that should
1753 persist across sessions for $package.
1755 You may safely delete it if you wish.
1758 : general instructions
1761 user=`(logname) 2>/dev/null`
1763 '') user=`whoami 2>&1`;;
1765 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1768 rp='Would you like to see the instructions?'
1779 This installation shell script will examine your system and ask you questions
1780 to determine how the perl5 package should be installed. If you get
1781 stuck on a question, you may use a ! shell escape to start a subshell or
1782 execute a command. Many of the questions will have default answers in square
1783 brackets; typing carriage return will give you the default.
1785 On some of the questions which ask for file or directory names you are allowed
1786 to use the ~name construct to specify the login directory belonging to "name",
1787 even if you don't have a shell which knows about that. Questions where this is
1788 allowed will be marked "(~name ok)".
1792 dflt='Type carriage return to continue'
1796 The prompter used in this script allows you to use shell variables and
1797 backticks in your answers. You may use $1, $2, etc... to refer to the words
1798 in the default answer, as if the default line was a set of arguments given to a
1799 script shell. This means you may also use $* to repeat the whole default line,
1800 so you do not have to re-type everything to add something to the default.
1802 Everytime there is a substitution, you will have to confirm. If there is an
1803 error (e.g. an unmatched backtick), the default answer will remain unchanged
1804 and you will be prompted again.
1806 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1807 the questions and use the computed defaults (or the previous answers if there
1808 was already a config.sh file). Type 'Configure -h' for a list of options.
1809 You may also start interactively and then answer '& -d' at any prompt to turn
1810 on the non-interactive behaviour for the remainder of the execution.
1816 Much effort has been expended to ensure that this shell script will run on any
1817 Unix system. If despite that it blows up on yours, your best bet is to edit
1818 Configure and run it again. If you can't run Configure for some reason,
1819 you'll have to generate a config.sh file by hand. Whatever problems you
1820 have, let me (perlbug@perl.com) know how I blew it.
1822 This installation script affects things in two ways:
1824 1) it may do direct variable substitutions on some of the files included
1826 2) it builds a config.h file for inclusion in C programs. You may edit
1827 any of these files as the need arises after running this script.
1829 If you make a mistake on a question, there is no easy way to back up to it
1830 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1831 files. Configure will offer to let you do this before it runs the SH files.
1834 dflt='Type carriage return to continue'
1836 case "$firsttime" in
1837 true) echo $user >>../.config/instruct;;
1841 : find out where common programs are
1843 echo "Locating common programs..." >&4
1856 if test -d \$dir/\$thing; then
1862 for thisthing in \$dir/\$thing; do
1863 : just loop through to pick last item
1865 if test -f \$thisthing; then
1868 elif test -f \$dir/\$thing.exe; then
1869 if test -n "$DJGPP"; then
1870 echo \$dir/\$thing.exe
1872 : on Eunice apparently
1922 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1923 pth="$pth /lib /usr/lib"
1924 for file in $loclist; do
1928 if test -f "$xxx"; then
1931 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1932 xxx=`./loc $file $file $pth`
1935 '') xxx=`./loc $file $file $pth`;;
1936 *) xxx=`./loc $xxx $xxx $pth`;;
1942 echo $file is in $xxx.
1945 echo $file is in $xxx.
1948 echo "I don't know where '$file' is, and my life depends on it." >&4
1949 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1955 echo "Don't worry if any of the following aren't found..."
1957 for file in $trylist; do
1961 if test -f "$xxx"; then
1964 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1965 xxx=`./loc $file $file $pth`
1968 '') xxx=`./loc $file $file $pth`;;
1969 *) xxx=`./loc $xxx $xxx $pth`;;
1975 echo $file is in $xxx.
1978 echo $file is in $xxx.
1981 echo "I don't see $file out there, $say."
1988 echo "Substituting grep for egrep."
1994 echo "Substituting cp for ln."
2000 echo "Hopefully test is built into your sh."
2003 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2004 echo "Using the test built into your sh."
2012 echo "Hopefully echo is built into your sh."
2017 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2018 $echo $n "hi there$c" >foo1
2019 echo $n "hi there$c" >foo2
2020 if cmp foo1 foo2 >/dev/null 2>&1; then
2021 echo "They are compatible. In fact, they may be identical."
2028 They are not compatible! You are probably running ksh on a non-USG system.
2029 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2030 have echo built in and we may have to run some Bourne shell scripts. That
2031 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2034 $echo $n "The star should be here-->$c"
2041 : determine whether symbolic links are supported
2044 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2045 echo "Symbolic links are supported." >&4
2048 echo "Symbolic links are NOT supported." >&4
2053 : see whether [:lower:] and [:upper:] are supported character classes
2055 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2057 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2061 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2062 # (0xc9 and 0xd1), therefore that is a nice testing point.
2063 if test "X$up" = X -o "X$low" = X; then
2064 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2070 if test "X$up" = X -o "X$low" = X; then
2071 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2077 if test "X$up" = X -o "X$low" = X; then
2078 case "`echo IJ | od -x 2>/dev/null`" in
2080 echo "Hey, this might be EBCDIC." >&4
2081 if test "X$up" = X -o "X$low" = X; then
2082 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2083 ij) up='[A-IJ-RS-Z]'
2088 if test "X$up" = X -o "X$low" = X; then
2089 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2099 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2101 echo "Using $up and $low to convert case." >&4
2104 echo "I don't know how to translate letters from upper to lower case." >&4
2105 echo "Your tr is not acting any way I know of." >&4
2109 : set up the translation script tr, must be called with ./tr of course
2113 '[A-Z][a-z]') exec $tr '$up' '$low';;
2114 '[a-z][A-Z]') exec $tr '$low' '$up';;
2121 : Try to determine whether config.sh was made on this system
2122 case "$config_sh" in
2124 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2125 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2126 # because the A-Z/a-z are not consecutive.
2127 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2128 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2129 newmyuname="$myuname"
2131 case "$knowitall" in
2133 if test -f ../config.sh; then
2134 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2135 eval "`grep myuname= ../config.sh`"
2137 if test "X$myuname" = "X$newmyuname"; then
2145 : Get old answers from old config file if Configure was run on the
2146 : same system, otherwise use the hints.
2149 if test -f config.sh; then
2151 rp="I see a config.sh file. Shall I use it to set the defaults?"
2154 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2155 *) echo "Fetching default answers from your old config.sh file..." >&4
2163 : Older versions did not always set $sh. Catch re-use of such
2172 if test ! -f config.sh; then
2175 First time through, eh? I have some defaults handy for some systems
2176 that need some extra help getting the Configure answers right:
2179 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2181 : Half the following guesses are probably wrong... If you have better
2182 : tests or hints, please send them to perlbug@perl.com
2183 : The metaconfig authors would also appreciate a copy...
2184 $test -f /irix && osname=irix
2185 $test -f /xenix && osname=sco_xenix
2186 $test -f /dynix && osname=dynix
2187 $test -f /dnix && osname=dnix
2188 $test -f /lynx.os && osname=lynxos
2189 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2190 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2191 $test -f /bin/mips && /bin/mips && osname=mips
2192 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2193 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2194 $test -d /usr/apollo/bin && osname=apollo
2195 $test -f /etc/saf/_sactab && osname=svr4
2196 $test -d /usr/include/minix && osname=minix
2197 if $test -d /MachTen -o -d /MachTen_Folder; then
2199 if $test -x /sbin/version; then
2200 osvers=`/sbin/version | $awk '{print $2}' |
2201 $sed -e 's/[A-Za-z]$//'`
2202 elif $test -x /usr/etc/version; then
2203 osvers=`/usr/etc/version | $awk '{print $2}' |
2204 $sed -e 's/[A-Za-z]$//'`
2209 $test -f /sys/posix.dll &&
2210 $test -f /usr/bin/what &&
2211 set X `/usr/bin/what /sys/posix.dll` &&
2212 $test "$3" = UWIN &&
2215 if $test -f $uname; then
2223 umips) osname=umips ;;
2226 [23]100) osname=mips ;;
2227 next*) osname=next ;;
2229 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2230 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2233 elif $test -f /etc/kconfig; then
2235 if test "$lns" = "$ln -s"; then
2237 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2239 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2246 if test -n "$DJGPP"; then
2255 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2257 'not found') osvers="$4"."$3" ;;
2258 '<3240'|'<>3240') osvers=3.2.0 ;;
2259 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2260 '=3250'|'>3250') osvers=3.2.5 ;;
2264 *dc.osx) osname=dcosx
2270 domainos) osname=apollo
2276 dynixptx*) osname=dynixptx
2277 osvers=`echo "$4"|sed 's/^v//'`
2279 freebsd) osname=freebsd
2281 genix) osname=genix ;;
2283 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2299 netbsd*) osname=netbsd
2302 news-os) osvers="$3"
2304 4*) osname=newsos4 ;;
2308 bsd386) osname=bsd386
2311 POSIX-BC | posix-bc ) osname=posix-bc
2314 powerux | power_ux | powermax_os | powermaxos | \
2315 powerunix | power_unix) osname=powerux
2318 next*) osname=next ;;
2319 solaris) osname=solaris
2321 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2328 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2332 titanos) osname=titanos
2341 ultrix) osname=ultrix
2344 osf1|mls+) case "$5" in
2347 osvers=`echo "$3" | sed 's/^[xvt]//'`
2349 hp*) osname=hp_osf1 ;;
2350 mips) osname=mips_osf1 ;;
2353 unixware) osname=svr5
2362 $2) case "$osname" in
2366 : svr4.x or possibly later
2376 if test -f /stand/boot ; then
2377 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2378 if test -n "$INITPROG" -a -f "$INITPROG"; then
2379 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2380 if test -n "$isesix"; then
2388 *) if test -f /etc/systemid; then
2390 set `echo $3 | $sed 's/\./ /g'` $4
2391 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2393 elif $test -f $src/hints/sco_$1_$2.sh; then
2395 elif $test -f $src/hints/sco_$1.sh; then
2400 '') : Still unknown. Probably a generic Sys V.
2409 *) case "$osname" in
2410 '') : Still unknown. Probably a generic BSD.
2418 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2419 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2420 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2423 $rm -f UU/kernel.what
2424 elif test -d c:/.; then
2431 : Now look for a hint file osname_osvers, unless one has been
2432 : specified already.
2435 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2436 : Also try without trailing minor version numbers.
2437 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2438 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2439 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2440 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2443 *) case "$osvers" in
2446 *) if $test -f $src/hints/$file.sh ; then
2448 elif $test -f $src/hints/$xfile.sh ; then
2450 elif $test -f $src/hints/$xxfile.sh ; then
2452 elif $test -f $src/hints/$xxxfile.sh ; then
2454 elif $test -f $src/hints/$xxxxfile.sh ; then
2456 elif $test -f "$src/hints/${osname}.sh" ; then
2465 if $test -f Policy.sh ; then
2468 none) dflt="Policy" ;;
2469 *) dflt="Policy $dflt" ;;
2474 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2478 if $test -f Policy.sh ; then
2481 There's also a Policy hint file available, which should make the
2482 site-specific (policy) questions easier to answer.
2489 You may give one or more space-separated answers, or "none" if appropriate.
2490 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2491 is a good thing. DO NOT give a wrong version or a wrong OS.
2495 rp="Which of these apply, if any?"
2498 for file in $tans; do
2499 if $test X$file = XPolicy -a -f Policy.sh; then
2501 $cat Policy.sh >> UU/config.sh
2502 elif $test -f $src/hints/$file.sh; then
2503 . $src/hints/$file.sh
2504 $cat $src/hints/$file.sh >> UU/config.sh
2505 elif $test X$tans = X -o X$tans = Xnone ; then
2508 : Give one chance to correct a possible typo.
2509 echo "$file.sh does not exist"
2511 rp="hint to use instead?"
2513 for file in $ans; do
2514 if $test -f "$src/hints/$file.sh"; then
2515 . $src/hints/$file.sh
2516 $cat $src/hints/$file.sh >> UU/config.sh
2517 elif $test X$ans = X -o X$ans = Xnone ; then
2520 echo "$file.sh does not exist -- ignored."
2527 : Remember our hint file for later.
2528 if $test -f "$src/hints/$file.sh" ; then
2538 echo "Fetching default answers from $config_sh..." >&4
2542 cp $config_sh config.sh 2>/dev/null
2552 test "$override" && . ./optdef.sh
2553 myuname="$newmyuname"
2555 : Restore computed paths
2556 for file in $loclist $trylist; do
2557 eval $file="\$_$file"
2562 Configure uses the operating system name and version to set some defaults.
2563 The default value is probably right if the name rings a bell. Otherwise,
2564 since spelling matters for me, either accept the default or answer "none"
2571 ''|' '|none) dflt=none ;;
2572 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2575 *) dflt="$osname" ;;
2577 rp="Operating system name?"
2581 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2587 ''|' '|none) dflt=none ;;
2588 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2589 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2591 ''|' ') dflt=none ;;
2596 *) dflt="$osvers" ;;
2598 rp="Operating system version?"
2608 : who configured the system
2609 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2610 cf_by=`(logname) 2>/dev/null`
2613 cf_by=`(whoami) 2>/dev/null`
2615 "") cf_by=unknown ;;
2619 : set up the script used to warn in case of inconsistency
2626 echo "*** WHOA THERE!!! ***" >&4
2627 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2628 rp=" Keep the $hint value?"
2631 y) td=$was; tu=$was;;
2635 : function used to set $1 to $val
2636 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2638 $define$undef) . ./whoa; eval "$var=\$td";;
2639 $undef$define) . ./whoa; eval "$var=\$tu";;
2640 *) eval "$var=$val";;
2645 Perl can be built to take advantage of threads, on some systems.
2646 To do so, Configure must be run with -Dusethreads.
2648 Note that threading is a highly experimental feature, and
2649 some known race conditions still remain. If you choose to try
2650 it, be very sure to not actually deploy it for production
2651 purposes. README.threads has more details, and is required
2652 reading if you enable threads.
2654 case "$usethreads" in
2655 $define|true|[yY]*) dflt='y';;
2658 rp='Build a threading Perl?'
2661 y|Y) val="$define" ;;
2667 case "$d_oldpthreads" in
2668 '') : Configure tests would be welcome here. For now, assume undef.
2670 *) val="$d_oldpthreads" ;;
2676 case "$usethreads" in
2677 "$define"|true|[yY]*)
2678 : Look for a hint-file generated 'call-back-unit'. If the
2679 : user has specified that a threading perl is to be built,
2680 : we may need to set or change some other defaults.
2681 if $test -f usethreads.cbu; then
2682 echo "Your platform has some specific hints for threaded builds, using them..."
2686 (Your platform doesn't have any specific hints for threaded builds.
2687 Assuming POSIX threads, then.)
2695 Perl can be built so that multiple Perl interpreters can coexist
2696 within the same Perl executable. To do so, Configure must be run with
2699 Normally you do not need this and you should answer no.
2702 case "$usemultiplicity" in
2703 $define|true|[yY]*) dflt='y';;
2706 rp='Build Perl for multiplicity?'
2709 y|Y) val="$define" ;;
2715 : determine where manual pages are on this system
2719 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2720 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2721 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2722 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2723 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2724 sysman=`./loc . /usr/man/man1 $syspath`
2727 if $test -d "$sysman"; then
2728 echo "System manual is in $sysman." >&4
2730 echo "Could not find manual pages in source form." >&4
2733 : see what memory models we can support
2736 $cat >pdp11.c <<'EOP'
2745 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2746 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2747 dflt='unsplit split'
2749 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2752 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2757 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2760 if $test -d /lib/large || $test -d /usr/lib/large; then
2763 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2772 Some systems have different model sizes. On most systems they are called
2773 small, medium, large, and huge. On the PDP11 they are called unsplit and
2774 split. If your system doesn't support different memory models, say "none".
2775 If you wish to force everything to one memory model, say "none" here and
2776 put the appropriate flags later when it asks you for other cc and ld flags.
2777 Venix systems may wish to put "none" and let the compiler figure things out.
2778 (In the following question multiple model names should be space separated.)
2780 The default for most systems is "none".
2783 rp="Which memory models are supported?"
2798 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2799 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2806 rp="What flag indicates separate I and D space?"
2814 *large*|*small*|*medium*|*huge*)
2821 rp="What flag indicates large model?"
2831 *huge*) case "$huge" in
2835 rp="What flag indicates huge model?"
2845 *medium*) case "$medium" in
2849 rp="What flag indicates medium model?"
2856 *) medium="$large";;
2859 *small*) case "$small" in
2863 rp="What flag indicates small model?"
2874 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2877 $rm -f pdp11.* pdp11
2879 : make some quick guesses about what we are up against
2881 $echo $n "Hmm... $c"
2891 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2892 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2894 echo "Looks kind of like an OSF/1 system, but we'll see..."
2896 elif test `echo abc | tr a-z A-Z` = Abc ; then
2897 xxx=`./loc addbib blurfl $pth`
2898 if $test -f $xxx; then
2899 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2903 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2904 echo "Looks kind of like an extended USG system, but we'll see..."
2906 echo "Looks kind of like a USG system, but we'll see..."
2910 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2911 echo "Looks kind of like a BSD system, but we'll see..."
2915 echo "Looks kind of like a Version 7 system, but we'll see..."
2918 case "$eunicefix" in
2921 There is, however, a strange, musty smell in the air that reminds me of
2922 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2926 : it so happens the Eunice I know will not run shell scripts in Unix format
2930 echo "Congratulations. You aren't running Eunice."
2934 : Detect OS2. The p_ variable is set above in the Head.U unit.
2939 I have the feeling something is not exactly right, however...don't tell me...
2940 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2945 if test -f /xenix; then
2946 echo "Actually, this looks more like a XENIX system..."
2951 echo "It's not Xenix..."
2956 if test -f /venix; then
2957 echo "Actually, this looks more like a VENIX system..."
2964 echo "Nor is it Venix..."
2967 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2968 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2971 : see if we need a special compiler
2979 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2980 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2994 On some older systems the default C compiler will not resolve multiple global
2995 references that happen to have the same name. On some such systems the "Mcc"
2996 command may be used to force these to be resolved. On other systems a "cc -M"
2997 command is required. (Note that the -M flag on other systems indicates a
2998 memory model to use!) If you have the Gnu C compiler, you might wish to use
3004 rp="Use which C compiler?"
3012 rp="Use which C compiler?"
3016 : Look for a hint-file generated 'call-back-unit'. Now that the
3017 : user has specified the compiler, we may need to set or change some
3019 if $test -f cc.cbu; then
3023 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3024 $cat >gccvers.c <<EOM
3029 printf("%s\n", __VERSION__);
3031 printf("%s\n", "1");
3037 if $cc -o gccvers gccvers.c; then
3038 gccversion=`./gccvers`
3039 case "$gccversion" in
3040 '') echo "You are not using GNU cc." ;;
3041 *) echo "You are using GNU cc $gccversion." ;;
3045 echo "*** WHOA THERE!!! ***" >&4
3046 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3047 case "$knowitall" in
3049 echo " You'd better start hunting for one and let me know about it." >&4
3055 case "$gccversion" in
3056 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3060 case "$usemorebits" in
3061 "$define"|true|[yY]*)
3063 uselongdouble="$define"
3064 usemorebits="$define"
3066 *) usemorebits="$undef"
3073 Perl can be built to understand large files (files larger than 2 gigabytes)
3074 on some systems. To do so, Configure must be run with -Duselargefiles.
3076 If this doesn't make any sense to you, just accept the default.
3078 case "$uselargefiles" in
3079 "$define"|true|[yY]*) dflt='y' ;;
3082 rp='Try to understand large files?'
3085 y|Y) val="$define" ;;
3090 case "$uselargefiles" in
3091 "$define") use64bits="$define" ;;
3096 Perl can be built to take advantage of explicit 64-bit interfaces,
3097 on some systems. To do so, Configure must be run with -Duse64bits.
3099 If this doesn't make any sense to you, just accept the default.
3101 case "$use64bits" in
3102 $define|true|[yY]*) dflt='y';;
3105 rp='Try to use explicit 64-bit interfaces, if available?'
3118 case "$archname64" in
3119 '') archname64='' ;; # not a typo
3122 case "$use64bits" in
3123 "$define"|true|[yY]*)
3124 : Look for a hint-file generated 'call-back-unit'. If the
3125 : user has specified that a 64 bit perl is to be built,
3126 : we may need to set or change some other defaults.
3127 if $test -f use64bits.cbu; then
3128 echo "Your platform has some specific hints for 64-bit builds, using them..."
3132 (Your platform doesn't have any specific hints for 64-bit builds.
3133 This is probably okay, especially if your system is a true 64-bit system.)
3135 case "$gccversion" in
3138 But since you seem to be using gcc,
3139 I will now add -DUSE_LONG_LONG to the compilation flags.
3141 ccflags="$ccflags -DUSE_LONG_LONG"
3148 : determine the architecture name
3150 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3151 tarch=`arch`"-$osname"
3152 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3153 if uname -m > tmparch 2>&1 ; then
3154 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3155 -e 's/$/'"-$osname/" tmparch`
3163 case "$myarchname" in
3166 echo "(Your architecture name used to be $myarchname.)"
3173 *) dflt="$archname";;
3175 rp='What is your architecture name'
3178 case "$usethreads" in
3180 echo "Threads selected." >&4
3182 *-thread*) echo "...and architecture name already has -thread." >&4
3184 *) archname="$archname-thread"
3185 echo "...setting architecture name to $archname." >&4
3190 case "$usemultiplicity" in
3192 echo "Multiplicity selected." >&4
3194 *-multi*) echo "...and architecture name already has -multi." >&4
3196 *) archname="$archname-multi"
3197 echo "...setting architecture name to $archname." >&4
3202 case "$use64bits" in
3204 echo "Explicit 64-bitness selected." >&4
3205 case "$archname64" in
3210 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3212 *) archname="$archname-$archname64"
3213 echo "...setting architecture name to $archname." >&4
3220 : decide how portable to be. Allow command line overrides.
3221 case "$d_portable" in
3223 *) d_portable="$define" ;;
3226 : set up shell script to do ~ expansion
3232 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3235 if $test -f /bin/csh; then
3236 /bin/csh -f -c "glob \$1"
3241 name=\`$expr x\$1 : '..\([^/]*\)'\`
3242 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3243 if $test ! -d "\$dir"; then
3245 echo "\$me: can't locate home directory for: \$name" >&2
3250 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3266 : now set up to get a file name
3270 cat <<'EOSC' >>getfile
3286 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3287 fn=`echo $fn | sed 's/(.*)//'`
3293 loc_file=`expr $fn : '.*:\(.*\)'`
3294 fn=`expr $fn : '\(.*\):.*'`
3302 */*) fullpath=true;;
3311 *e*) exp_file=true;;
3314 *p*) nopath_ok=true;;
3319 *d*) type='Directory';;
3320 *l*) type='Locate';;
3325 Locate) what='File';;
3330 case "$d_portable" in
3338 while test "$type"; do
3343 true) rp="$rp (~name ok)";;
3346 if test -f UU/getfile.ok && \
3347 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3366 value=`UU/filexp $ans`
3369 if test "$ans" != "$value"; then
3370 echo "(That expands to $value on this system.)"
3384 /*) value="$ansexp" ;;
3389 echo "I shall only accept a full path name, as in /bin/ls." >&4
3390 echo "Use a ! shell escape if you wish to check pathnames." >&4
3393 echo "Please give a full path name, starting with slash." >&4
3396 echo "Note that using ~name is ok provided it expands well." >&4
3409 for fp in $gfpth; do
3410 if test "X$fp" = X.; then
3415 if test -f "$pf"; then
3417 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3419 echo "($value is not a plain file, but that's ok.)"
3422 if test X"$type" = X; then
3429 for fp in $gfpth; do
3430 if test "X$fp" = X.; then
3435 if test -d "$pf"; then
3443 if test -d "$ansexp"; then
3444 echo "(Looking for $loc_file in directory $value.)"
3445 value="$value/$loc_file"
3446 ansexp="$ansexp/$loc_file"
3448 if test -f "$ansexp"; then
3451 case "$nopath_ok" in
3452 true) case "$value" in
3454 *) echo "Assuming $value will be in people's path."
3470 if test "$fastread" = yes; then
3475 rp="$what $value doesn't exist. Use that name anyway?"
3494 test "X$gfpthkeep" != Xy && gfpth=""
3497 : determine root of directory hierarchy where package will be installed.
3500 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3508 By default, $package will be installed in $dflt/bin, manual pages
3509 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3510 installation directories. Typically this is something like /usr/local.
3511 If you wish to have binaries under /usr/bin but other parts of the
3512 installation under /usr/local, that's ok: you will be prompted
3513 separately for each of the installation directories, the prefix being
3514 only used to set the defaults.
3518 rp='Installation prefix to use?'
3526 *) oldprefix="$prefix";;
3536 $define|true) afs=true ;;
3537 $undef|false) afs=false ;;
3538 *) if test -d /afs; then
3546 echo "AFS may be running... I'll be extra cautious then..." >&4
3548 echo "AFS does not seem to be running..." >&4
3551 : determine installation prefix for where package is to be installed.
3555 Since you are running AFS, I need to distinguish the directory in which
3556 files will reside from the directory in which they are installed (and from
3557 which they are presumably copied to the former directory by occult means).
3560 case "$installprefix" in
3561 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3562 *) dflt="$installprefix";;
3567 In some special cases, particularly when building $package for distribution,
3568 it is convenient to distinguish between the directory in which files should
3569 be installed from the directory ($prefix) in which they
3570 will eventually reside. For most users, these two directories are the same.
3573 case "$installprefix" in
3575 *) dflt=$installprefix;;
3579 rp='What installation prefix should I use for installing files?'
3581 installprefix="$ans"
3582 installprefixexp="$ansexp"
3584 : set the prefixit variable, to compute a suitable default value
3585 prefixit='case "$3" in
3587 case "$oldprefix" in
3588 "") eval "$1=\"\$$2\"";;
3595 ""|" ") eval "$1=\"\$$2\"";;
3601 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3603 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3604 /*-$oldprefix/*|\~*-$oldprefix/*)
3605 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3606 *) eval "$1=\"\$$2\"";;
3610 : set the base revision
3613 : get the patchlevel
3615 echo "Getting the current patchlevel..." >&4
3616 if $test -r $rsrc/patchlevel.h;then
3617 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3618 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3619 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3625 $echo $n "(You have $package" $c
3628 *) $echo $n " $baserev" $c ;;
3630 $echo $n " patchlevel $patchlevel" $c
3631 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3634 if test 0 -eq "$subversion"; then
3635 version=`LC_ALL=C; export LC_ALL; \
3636 echo $baserev $patchlevel | \
3637 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3639 version=`LC_ALL=C; export LC_ALL; \
3640 echo $baserev $patchlevel $subversion | \
3641 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3644 : determine installation style
3645 : For now, try to deduce it from prefix unless it is already set.
3646 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3647 case "$installstyle" in
3648 '') case "$prefix" in
3649 *perl*) dflt='lib';;
3650 *) dflt='lib/perl5' ;;
3653 *) dflt='lib/perl5' ;;
3655 : Probably not worth prompting for this since we prompt for all
3656 : the directories individually, and the prompt would be too long and
3660 : determine where private library files go
3661 : Usual default is /usr/local/lib/perl5/$version.
3662 : Also allow things like /opt/perl/lib/$version, since
3663 : /opt/perl/lib/perl5... would be redundant.
3664 : The default "style" setting is made in installstyle.U
3665 case "$installstyle" in
3666 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3667 *) set dflt privlib lib/$version ;;
3672 There are some auxiliary files for $package that need to be put into a
3673 private library directory that is accessible by everyone.
3677 rp='Pathname where the private library files will reside?'
3680 privlibexp="$ansexp"
3681 : Change installation prefix, if necessary.
3682 if $test X"$prefix" != X"$installprefix"; then
3683 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3685 installprivlib="$privlibexp"
3688 : set the prefixup variable, to restore leading tilda escape
3689 prefixup='case "$prefixexp" in
3691 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3694 : determine where public architecture dependent libraries go
3697 : privlib default is /usr/local/lib/$package/$version
3698 : archlib default is /usr/local/lib/$package/$version/$archname
3699 : privlib may have an optional trailing /share.
3700 tdflt=`echo $privlib | $sed 's,/share$,,'`
3701 tdflt=$tdflt/$archname
3710 $spackage contains architecture-dependent library files. If you are
3711 sharing libraries in a heterogeneous environment, you might store
3712 these files in a separate location. Otherwise, you can just include
3713 them with the rest of the public library files.
3717 rp='Where do you want to put the public architecture-dependent libraries?'
3720 archlibexp="$ansexp"
3721 if $test X"$archlib" = X"$privlib"; then
3726 : Change installation prefix, if necessary.
3727 if $test X"$prefix" != X"$installprefix"; then
3728 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3730 installarchlib="$archlibexp"
3734 : Binary compatibility with 5.005 is not possible for builds
3735 : with advanced features
3736 case "$usethreads$usemultiplicity" in
3738 bincompat5005="$undef"
3739 d_bincompat5005="$undef"
3743 Perl 5.006 can be compiled for binary compatibility with 5.005.
3744 If you decide to do so, you will be able to continue using most
3745 of the extensions that were compiled for Perl 5.005.
3748 case "$bincompat5005$d_bincompat5005" in
3749 *"$undef"*) dflt=n ;;
3752 rp='Binary compatibility with Perl 5.005?'
3755 y*) val="$define" ;;
3760 case "$d_bincompat5005" in
3762 bincompat5005="$define"
3764 *) bincompat5005="$undef"
3765 d_bincompat5005="$undef"
3772 : see if setuid scripts can be secure
3775 Some kernels have a bug that prevents setuid #! scripts from being
3776 secure. Some sites have disabled setuid #! scripts because of this.
3778 First let's decide if your kernel supports secure setuid #! scripts.
3779 (If setuid #! scripts would be secure but have been disabled anyway,
3780 don't say that they are secure if asked.)
3785 if $test -d /dev/fd; then
3786 echo "#!$ls" >reflect
3787 chmod +x,u+s reflect
3788 ./reflect >flect 2>&1
3789 if $contains "/dev/fd" flect >/dev/null; then
3790 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3794 If you are not sure if they are secure, I can check but I'll need a
3795 username and password different from the one you are using right now.
3796 If you don't have such a username or don't want me to test, simply
3800 rp='Other username to test security of setuid scripts with?'
3805 case "$d_suidsafe" in
3806 '') echo "I'll assume setuid scripts are *not* secure." >&4
3809 echo "Well, the $hint value is *not* secure." >&4
3811 *) echo "Well, the $hint value *is* secure." >&4
3816 $rm -f reflect flect
3817 echo "#!$ls" >reflect
3818 chmod +x,u+s reflect
3821 echo '"su" will (probably) prompt you for '"$ans's password."
3822 su $ans -c './reflect >flect'
3823 if $contains "/dev/fd" flect >/dev/null; then
3824 echo "Okay, it looks like setuid scripts are secure." >&4
3827 echo "I don't think setuid scripts are secure." >&4
3832 rp='Does your kernel have *secure* setuid scripts?'
3835 [yY]*) val="$define";;
3840 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3841 echo "(That's for file descriptors, not floppy disks.)"
3847 $rm -f reflect flect
3849 : now see if they want to do setuid emulation
3852 case "$d_suidsafe" in
3855 echo "No need to emulate SUID scripts since they are secure here." >& 4
3859 Some systems have disabled setuid scripts, especially systems where
3860 setuid scripts cannot be secure. On systems where setuid scripts have
3861 been disabled, the setuid/setgid bits on scripts are currently
3862 useless. It is possible for $package to detect those bits and emulate
3863 setuid/setgid in a secure fashion. This emulation will only work if
3864 setuid scripts have been disabled in your kernel.
3868 "$define") dflt=y ;;
3871 rp="Do you want to do setuid/setgid emulation?"
3874 [yY]*) val="$define";;
3882 : What should the include directory be ?
3884 $echo $n "Hmm... $c"
3888 if $test -f /bin/mips && /bin/mips; then
3889 echo "Looks like a MIPS system..."
3890 $cat >usr.c <<'EOCP'
3891 #ifdef SYSTYPE_BSD43
3895 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3896 dflt='/bsd43/usr/include'
3900 mips_type='System V'
3902 $rm -f usr.c usr.out
3903 echo "and you're compiling with the $mips_type compiler and libraries."
3907 echo "Doesn't look like a MIPS system."
3917 case "$xxx_prompt" in
3920 rp='Where are the include files you want to use?'
3928 : see how we invoke the C preprocessor
3930 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3931 cat <<'EOT' >testcpp.c
3937 if test ! -f cppstdin; then
3938 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3939 # AIX cc -E doesn't show the absolute headerfile
3940 # locations but we'll cheat by using the -M flag.
3941 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
3943 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3946 echo "Keeping your $hint cppstdin wrapper."
3949 wrapper=`pwd`/cppstdin
3953 if $test "X$cppstdin" != "X" && \
3954 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3955 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3957 echo "You used to use $cppstdin $cppminus so we'll use that again."
3959 '') echo "But let's see if we can live without a wrapper..." ;;
3961 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3962 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3964 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3967 echo "(However, $cpprun $cpplast does not work, let's see...)"
3975 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3982 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3983 $cc -E <testcpp.c >testcpp.out 2>&1; \
3984 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3985 echo "Yup, it does."
3988 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3989 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3990 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3991 echo "Yup, it does."
3994 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3995 $cc -P <testcpp.c >testcpp.out 2>&1; \
3996 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3997 echo "Yipee, that works!"
4000 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4001 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4002 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4003 echo "At long last!"
4006 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4007 $cpp <testcpp.c >testcpp.out 2>&1; \
4008 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4012 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4013 $cpp - <testcpp.c >testcpp.out 2>&1; \
4014 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4015 echo "Hooray, it works! I was beginning to wonder."
4018 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4019 $wrapper <testcpp.c >testcpp.out 2>&1; \
4020 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4026 rp="No dice. I can't find a C preprocessor. Name one:"
4030 $x_cpp <testcpp.c >testcpp.out 2>&1
4031 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4032 echo "OK, that will do." >&4
4034 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4049 echo "Perhaps can we force $cc -E using a wrapper..."
4050 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4051 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4057 echo "Nope, we'll have to live without it..."
4071 "$wrapper"|'cppstdin') ;;
4072 *) $rm -f $wrapper;;
4074 $rm -f testcpp.c testcpp.out
4076 : Set private lib path
4079 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4084 '') dlist="$loclibpth $plibpth $glibpth";;
4085 *) dlist="$libpth";;
4088 : Now check and see which directories actually exist, avoiding duplicates
4092 if $test -d $xxx; then
4095 *) libpth="$libpth $xxx";;
4101 Some systems have incompatible or broken versions of libraries. Among
4102 the directories listed in the question below, please remove any you
4103 know not to be holding relevant libraries, and add any that are needed.
4104 Say "none" for none.
4115 rp="Directories to use for library searches?"
4122 : compute shared library extension
4125 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4135 On some systems, shared libraries may be available. Answer 'none' if
4136 you want to suppress searching of shared libraries for the remaining
4137 of this configuration.
4140 rp='What is the file extension used for shared libraries?'
4144 : Define several unixisms.
4145 : Hints files or command line option can be used to override them.
4146 : The convoluted testing is in case hints files set either the old
4149 '') case "$exe_ext" in
4151 *) _exe="$exe_ext" ;;
4156 '') case "$lib_ext" in
4163 '') case "$obj_ext" in
4170 '') case "$path_sep" in
4181 : Which makefile gets called first. This is used by make depend.
4182 case "$firstmakefile" in
4183 '') firstmakefile='makefile';;
4188 Perl can be built to use the SOCKS proxy protocol library. To do so,
4189 Configure must be run with -Dusesocks.
4191 Normally you do not need this and you should answer no.
4195 $define|true|[yY]*) dflt='y';;
4198 rp='Build Perl for SOCKS?'
4201 y|Y) val="$define" ;;
4207 : Looking for optional libraries
4209 echo "Checking for optional libraries..." >&4
4214 case "$libswanted" in
4215 '') libswanted='c_s';;
4219 libswanted="$libswanted socks5 socks5_sh"
4222 for thislib in $libswanted; do
4224 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4225 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4226 echo "Found -l$thislib (shared)."
4229 *) dflt="$dflt -l$thislib";;
4231 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4232 echo "Found -l$thislib (shared)."
4235 *) dflt="$dflt -l$thislib";;
4237 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4238 echo "Found -l$thislib."
4241 *) dflt="$dflt -l$thislib";;
4243 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4244 echo "Found -l$thislib."
4247 *) dflt="$dflt -l$thislib";;
4249 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4250 echo "Found -l${thislib}_s."
4253 *) dflt="$dflt -l${thislib}_s";;
4255 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4256 echo "Found -l$thislib."
4259 *) dflt="$dflt -l$thislib";;
4262 echo "No -l$thislib."
4273 ' '|'') dflt='none';;
4278 In order to compile $package on your machine, a number of libraries
4279 are usually needed. Include any other special libraries here as well.
4280 Say "none" for none. The default list is almost always right.
4284 rp="What libraries to use?"
4291 : determine optimization, if desired, or use for debug flag also
4293 ' '|$undef) dflt='none';;
4295 *) dflt="$optimize";;
4299 By default, $package compiles with the -O flag to use the optimizer.
4300 Alternately, you might want to use the symbolic debugger, which uses
4301 the -g flag (on traditional Unix systems). Either flag can be
4302 specified here. To use neither flag, specify the word "none".
4305 rp="What optimizer/debugger flag should be used?"
4309 'none') optimize=" ";;
4313 : We will not override a previous value, but we might want to
4314 : augment a hint file
4316 default|recommended)
4317 case "$gccversion" in
4318 1*) dflt='-fpcc-struct-return' ;;
4321 *-g*) dflt="$dflt -DDEBUGGING";;
4323 case "$gccversion" in
4324 2*) if test -d /etc/conf/kconfig.d &&
4325 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4331 case "$gccversion" in
4335 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4336 echo 'int main(void) { return 0; }' > gcctest.c
4337 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4338 echo "Yes, it does." 2>&1
4341 echo "Leaving current flags $ccflags alone." 2>&1
4343 *) dflt="$dflt -fno-strict-aliasing" ;;
4346 echo "Nope, it doesn't, but that's ok." 2>&1
4353 case "$mips_type" in
4354 *BSD*|'') inclwanted="$locincpth $usrinc";;
4355 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4357 for thisincl in $inclwanted; do
4358 if $test -d $thisincl; then
4359 if $test x$thisincl != x$usrinc; then
4362 *) dflt="$dflt -I$thisincl";;
4368 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4370 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4378 *) dflt="$dflt -D$2";;
4382 set signal.h LANGUAGE_C; eval $inctest
4386 ccflags="$ccflags -DSOCKS"
4391 default|recommended) dflt="$ccflags $dflt" ;;
4392 *) dflt="$ccflags";;
4400 Your C compiler may want other flags. For this question you should include
4401 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4402 but you should NOT include libraries or ld flags like -lwhatever. If you
4403 want $package to honor its debug switch, you should include -DDEBUGGING here.
4404 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4406 To use no flags, specify the word "none".
4412 rp="Any additional cc flags?"
4419 : the following weeds options from ccflags that are of no interest to cpp
4421 case "$gccversion" in
4422 1*) cppflags="$cppflags -D__GNUC__"
4424 case "$mips_type" in
4426 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4432 echo "Let me guess what the preprocessor flags are..." >&4
4446 *) ftry="$previous $flag";;
4448 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4449 >cpp1.out 2>/dev/null && \
4450 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4451 >cpp2.out 2>/dev/null && \
4452 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4453 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4455 cppflags="$cppflags $ftry"
4465 *-*) echo "They appear to be: $cppflags";;
4467 $rm -f cpp.c cpp?.out
4471 : flags used in final linking phase
4473 '') if ./venix; then
4479 *-posix*) dflt="$dflt -posix" ;;
4482 *) dflt="$ldflags";;
4485 : Try to guess additional flags to pick up local libraries.
4486 for thislibdir in $libpth; do
4487 case " $loclibpth " in
4490 *"-L$thislibdir "*) ;;
4491 *) dflt="$dflt -L$thislibdir" ;;
4503 Your C linker may need flags. For this question you should
4504 include -L/whatever and any other flags used by the C linker, but you
4505 should NOT include libraries like -lwhatever.
4507 Make sure you include the appropriate -L/path flags if your C linker
4508 does not normally search all of the directories you specified above,
4511 To use no flags, specify the word "none".
4515 rp="Any additional ld flags (NOT including libraries)?"
4521 rmlist="$rmlist pdp11"
4525 echo "Checking your choice of C compiler and flags for coherency..." >&4
4526 $cat > try.c <<'EOF'
4528 int main() { printf("Ok\n"); exit(0); }
4530 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4532 $cat >try.msg <<'EOM'
4533 I've tried to compile and run the following simple program:
4536 $cat try.c >> try.msg
4538 $cat >> try.msg <<EOM
4545 and I got the following output:
4549 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4550 if sh -c './try' >>try.msg 2>&1; then
4554 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4557 cat >> try.msg <<'EOQS'
4558 If $libs contains -lsfio, and sfio is mis-configured, then it
4559 sometimes (apparently) runs and exits with a 0 status, but with no
4560 output! It may have to do with sfio's use of _exit vs. exit.
4563 rp="You have a big problem. Shall I abort Configure"
4570 echo "The program compiled OK, but exited with status $?." >>try.msg
4571 rp="You have a problem. Shall I abort Configure"
4575 echo "I can't compile the test program." >>try.msg
4576 rp="You have a BIG problem. Shall I abort Configure"
4582 case "$knowitall" in
4584 echo "(The supplied flags or libraries might be incorrect.)"
4592 *) echo "Ok. Stopping Configure." >&4
4597 n) echo "OK, that should do.";;
4599 $rm -f try try.* core
4601 : determine filename position in cpp output
4603 echo "Computing filename position in cpp output for #include directives..." >&4
4604 echo '#include <stdio.h>' > foo.c
4607 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4608 $grep '^[ ]*#.*stdio\.h' | \
4609 while read cline; do
4612 while $test \$# -gt 0; do
4613 if $test -r \`echo \$1 | $tr -d '"'\`; then
4618 pos=\`expr \$pos + 1\`
4630 *) pos="${fieldn}th";;
4632 echo "Your cpp writes the filename in the $pos field of the line."
4634 : locate header file
4639 for usrincdir in $usrinc
4641 if test -f \$usrincdir/\$wanted; then
4642 echo "\$usrincdir/\$wanted"
4646 awkprg='{ print \$$fieldn }'
4647 echo "#include <\$wanted>" > foo\$\$.c
4648 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4649 $grep "^[ ]*#.*\$wanted" | \
4650 while read cline; do
4651 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4653 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4654 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4659 # status = 0: grep returned 0 lines, case statement not executed
4660 # status = 1: headerfile found
4661 # status = 2: while loop executed, no headerfile found
4665 if test \$status -eq 1; then
4672 : define an alternate in-header-list? function
4673 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4674 cont=true; xxf="echo \"<\$1> found.\" >&4";
4675 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4676 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4678 case $# in 4) instead=instead;; *) instead="at last";; esac;
4679 while $test "$cont"; do
4681 var=$2; eval "was=\$$2";
4682 if $test "$xxx" && $test -r "$xxx";
4684 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4687 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4688 set $yyy; shift; shift; yyy=$@;
4689 case $# in 0) cont="";;
4690 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4691 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4692 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4693 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4697 do set $yyy; var=$2; eval "was=\$$2";
4698 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4699 set $yyy; shift; shift; yyy=$@;
4702 : see if this is a malloc.h system
4703 set malloc.h i_malloc
4706 : see if stdlib is available
4707 set stdlib.h i_stdlib
4710 : determine which malloc to compile in
4712 case "$usemymalloc" in
4713 ''|[yY]*|true|$define) dflt='y' ;;
4716 rp="Do you wish to attempt to use the malloc that comes with $package?"
4722 mallocsrc='malloc.c'
4723 mallocobj="malloc$_o"
4724 d_mymalloc="$define"
4727 : Remove malloc from list of libraries to use
4728 echo "Removing unneeded -lmalloc from library list" >&4
4729 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4732 echo "libs = $libs" >&4
4744 : compute the return types of malloc and free
4746 $cat >malloc.c <<END
4750 #include <sys/types.h>
4764 case "$malloctype" in
4766 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4773 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4777 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4784 echo "Your system uses $freetype free(), it would seem." >&4
4788 The installation process will also create a directory for
4789 vendor-supplied add-ons. Vendors who supply perl with their system
4790 may find it convenient to place all vendor-supplied files in this
4791 directory rather than in the main distribution directory. This will
4792 ease upgrades between binary-compatible maintenance versions of perl.
4794 Of course you may also use these directories in whatever way you see
4795 fit. For example, you might use them to access modules shared over a
4796 company-wide network.
4798 The default answer should be fine for most people.
4799 This causes further questions about vendor add-ons to be skipped
4800 and no vendor-specific directories will be configured for perl.
4803 rp='Do you want to configure vendor-specific add-on directories?'
4804 case "$usevendorprefix" in
4805 define|true|[yY]*) dflt=y ;;
4811 rp='Installation prefix to use for vendor-supplied add-ons?'
4812 case "$vendorprefix" in
4814 *) dflt=$vendorprefix ;;
4818 case "$vendorprefix" in
4822 *) oldvendorprefix="$prefix";;
4826 usevendorprefix="$define"
4828 vendorprefixexp="$ansexp"
4830 *) usevendorprefix="$undef"
4836 case "$vendorprefix" in
4837 '') d_vendorlib="$undef"
4841 *) d_vendorlib="$define"
4842 : determine where vendor-supplied modules go.
4843 : Usual default is /usr/local/lib/perl5/vendor_perl
4844 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4845 case "$installstyle" in
4846 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4847 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4850 rp='Pathname for the vendor-supplied library files?'
4853 vendorlibexp="$ansexp"
4854 : Change installation prefix, if necessary.
4855 if $test X"$prefix" != X"$installprefix"; then
4856 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4858 installvendorlib="$vendorlibexp"
4863 : Cruising for prototypes
4865 echo "Checking out function prototypes..." >&4
4866 $cat >prototype.c <<'EOCP'
4867 int main(int argc, char *argv[]) {
4870 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4871 echo "Your C compiler appears to support function prototypes."
4874 echo "Your C compiler doesn't seem to understand function prototypes."
4881 case "$prototype" in
4883 *) ansi2knr='ansi2knr'
4888 This version of $package can only be compiled by a compiler that
4889 understands function prototypes. Unfortunately, your C compiler
4891 doesn't seem to understand them. Sorry about that.
4893 If GNU cc is available for your system, perhaps you could try that instead.
4895 Eventually, we hope to support building Perl with pre-ANSI compilers.
4896 If you would like to help in that effort, please contact <perlbug@perl.org>.
4898 Aborting Configure now.
4904 : determine where public executables go
4909 rp='Pathname where the public executables will reside?'
4911 if $test "X$ansexp" != "X$binexp"; then
4916 : Change installation prefix, if necessary.
4917 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4918 if $test X"$prefix" != X"$installprefix"; then
4919 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4921 installbin="$binexp"
4924 : determine whether to install perl also as /usr/bin/perl
4927 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4929 Many scripts expect to perl to be installed as /usr/bin/perl.
4930 I can install the perl you are about to compile also as /usr/bin/perl
4931 (in addition to $installbin/perl).
4933 case "$installusrbinperl" in
4934 "$undef"|[nN]*) dflt='n';;
4937 rp="Do you want to install perl as /usr/bin/perl?"
4940 [yY]*) val="$define";;
4946 set installusrbinperl
4949 : define a shorthand compile call
4953 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4954 : define a shorthand compile call for compilations that should be ok.
4958 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4961 echo "Checking for GNU C Library..." >&4
4962 cat >gnulibc.c <<EOM
4974 if eval $compile_ok && ./gnulibc; then
4976 echo "You are using the GNU C Library"
4979 echo "You are not using the GNU C Library"
4985 : see if nm is to be used to determine whether a symbol is defined or not
4989 case "$d_gnulibc" in
4992 echo "nm probably won't work on the GNU C Library." >&4
4998 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5000 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5001 echo "'nm' won't be sufficient on this sytem." >&4
5007 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5008 if $test $dflt -gt 20; then
5018 true|$define) dflt=y;;
5025 I can use $nm to extract the symbols from your C libraries. This
5026 is a time consuming task which may generate huge output on the disk (up
5027 to 3 megabytes) but that should make the symbols extraction faster. The
5028 alternative is to skip the 'nm' extraction part and to compile a small
5029 test program instead to determine whether each symbol is present. If
5030 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5031 this may be the best solution.
5033 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5036 rp="Shall I use $nm to extract C symbols from the libraries?"
5039 [Nn]*) usenm=false;;
5048 : nm options which may be necessary
5050 '') if $test -f /mach_boot; then
5052 elif $test -d /usr/ccs/lib; then
5053 nm_opt='-p' # Solaris (and SunOS?)
5054 elif $test -f /dgux; then
5056 elif $test -f /lib64/rld; then
5057 nm_opt='-p' # 64-bit Irix
5063 : nm options which may be necessary for shared libraries but illegal
5064 : for archive libraries. Thank you, Linux.
5065 case "$nm_so_opt" in
5066 '') case "$myuname" in
5068 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5069 nm_so_opt='--dynamic'
5078 : get list of predefined functions in a handy place
5083 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5090 *) for thislib in $libs; do
5093 : Handle C library specially below.
5096 thislib=`echo $thislib | $sed -e 's/^-l//'`
5097 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5099 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5101 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5103 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5105 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5107 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5109 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5114 libnames="$libnames $try"
5116 *) libnames="$libnames $thislib" ;;
5125 for xxx in $libpth; do
5126 $test -r $1 || set $xxx/libc.$so
5127 : The messy sed command sorts on library version numbers.
5129 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5130 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5132 s/[0-9][0-9]*/0000&/g
5133 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5136 sort | $sed -e 's/^.* //'`
5139 $test -r $1 || set /usr/ccs/lib/libc.$so
5140 $test -r $1 || set /lib/libsys_s$_a
5146 if $test -r "$1"; then
5147 echo "Your (shared) C library seems to be in $1."
5149 elif $test -r /lib/libc && $test -r /lib/clib; then
5150 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5152 libc='/lib/clib /lib/libc'
5153 if $test -r /lib/syslib; then
5154 echo "(Your math library is in /lib/syslib.)"
5155 libc="$libc /lib/syslib"
5157 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5158 echo "Your C library seems to be in $libc, as you said before."
5159 elif $test -r $incpath/usr/lib/libc$_a; then
5160 libc=$incpath/usr/lib/libc$_a;
5161 echo "Your C library seems to be in $libc. That's fine."
5162 elif $test -r /lib/libc$_a; then
5164 echo "Your C library seems to be in $libc. You're normal."
5166 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5168 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5169 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5170 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5172 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5174 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5177 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5179 if $test -r "$tans"; then
5180 echo "Your C library seems to be in $tans, of all places."
5186 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5190 If the guess above is wrong (which it might be if you're using a strange
5191 compiler, or your machine supports multiple models), you can override it here.
5196 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5198 I can't seem to find your C library. I've looked in the following places:
5201 $sed 's/^/ /' libpath
5204 None of these seems to contain your C library. I need to get its name...
5209 rp='Where is your C library?'
5214 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5215 set X `cat libnames`
5218 case $# in 1) xxx=file; esac
5219 echo "Extracting names from the following $xxx for later perusal:" >&4
5221 $sed 's/^/ /' libnames >&4
5223 $echo $n "This may take a while...$c" >&4
5227 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5228 *) $nm $nm_opt $file 2>/dev/null;;
5233 $grep fprintf libc.tmp > libc.ptf
5234 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5235 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5237 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5239 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5241 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5243 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5245 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5247 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5249 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5251 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5253 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5255 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5257 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5259 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5261 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5262 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5264 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5266 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5268 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5270 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5272 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5274 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5276 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5278 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5280 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5282 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5284 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5286 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5288 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5290 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5292 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5295 $nm -p $* 2>/dev/null >libc.tmp
5296 $grep fprintf libc.tmp > libc.ptf
5297 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5298 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5304 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5306 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5307 for thisname in $libnames $libc; do
5308 $ar t $thisname >>libc.tmp
5310 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5312 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5313 # Repeat libc to extract forwarders to DLL entries too
5314 for thisname in $libnames $libc; do
5315 $ar tv $thisname >>libc.tmp
5316 # Revision 50 of EMX has bug in $ar.
5317 # it will not extract forwarders to DLL entries
5318 # Use emximp which will extract exactly them.
5319 emximp -o tmp.imp $thisname \
5321 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5322 < tmp.imp >>libc.tmp
5325 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5328 echo "$ar didn't seem to work right." >&4
5329 echo "Maybe this is a Cray...trying bld instead..." >&4
5330 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5332 for thisname in $libnames; do
5334 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5335 $ar t $thisname >>libc.tmp
5339 echo "That didn't work either. Giving up." >&4
5346 if $test -f /lib/syscalls.exp; then
5348 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5349 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5353 $rm -f libnames libpath
5355 : see if dld is available
5359 : is a C symbol defined?
5362 -v) tf=libc.tmp; tc=""; tdc="";;
5363 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5364 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5367 case "$reuseval-$4" in
5369 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5375 if $contains $tlook $tf >/dev/null 2>&1;
5380 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5381 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5389 $define) tval=true;;
5395 : define an is-in-libc? function
5396 inlibc='echo " "; td=$define; tu=$undef;
5397 sym=$1; var=$2; eval "was=\$$2";
5399 case "$reuseval$was" in
5409 echo "$sym() found." >&4;
5410 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5412 echo "$sym() NOT found." >&4;
5413 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5417 $define) echo "$sym() found." >&4;;
5418 *) echo "$sym() NOT found." >&4;;
5422 : see if dlopen exists
5429 : determine which dynamic loading, if any, to compile in
5431 dldir="ext/DynaLoader"
5444 $define) dflt='y' ;;
5447 $define) dflt='y' ;;
5449 : Does a dl_xxx.xs file exist for this operating system
5450 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5453 rp="Do you wish to use dynamic loading?"
5460 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5461 dflt="$dldir/dl_${osname}.xs"
5462 elif $test "$d_dlopen" = "$define" ; then
5463 dflt="$dldir/dl_dlopen.xs"
5464 elif $test "$i_dld" = "$define" ; then
5465 dflt="$dldir/dl_dld.xs"
5470 *) dflt="$dldir/$dlsrc"
5473 echo "The following dynamic loading files are available:"
5474 : Can not go over to $dldir because getfile has path hard-coded in.
5475 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5476 rp="Source file to use for dynamic loading"
5482 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5486 Some systems may require passing special flags to $cc -c to
5487 compile modules that will be used to create a shared library.
5488 To use no flags, say "none".
5491 case "$cccdlflags" in
5492 '') case "$gccversion" in
5493 '') case "$osname" in
5495 next) dflt='none' ;;
5496 irix*) dflt='-KPIC' ;;
5497 svr4*|esix*|solaris) dflt='-KPIC' ;;
5498 sunos) dflt='-pic' ;;
5502 *) case "$osname" in
5503 svr4*|esix*|solaris) dflt='-fPIC' ;;
5508 *) dflt="$cccdlflags" ;;
5510 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5513 none) cccdlflags=' ' ;;
5514 *) cccdlflags="$ans" ;;
5519 Some systems use ld to create libraries that can be dynamically loaded,
5520 while other systems (such as those using ELF) use $cc.
5524 '') $cat >try.c <<'EOM'
5525 /* Test for whether ELF binaries are produced */
5530 int i = open("a.out",O_RDONLY);
5533 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5534 exit(0); /* succeed (yes, it's ELF) */
5539 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5541 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5545 echo "I'll use ld to build dynamic libraries."
5554 rp="What command should be used to create dynamic libraries?"
5560 Some systems may require passing special flags to $ld to create a
5561 library that can be dynamically loaded. If your ld flags include
5562 -L/other/path options to locate libraries outside your loader's normal
5563 search path, you may need to specify those -L options here as well. To
5564 use no flags, say "none".
5567 case "$lddlflags" in
5568 '') case "$osname" in
5569 beos) dflt='-nostart' ;;
5571 linux|irix*) dflt='-shared' ;;
5572 next) dflt='none' ;;
5573 solaris) dflt='-G' ;;
5574 sunos) dflt='-assert nodefinitions' ;;
5575 svr4*|esix*) dflt="-G $ldflags" ;;
5579 *) dflt="$lddlflags" ;;
5582 : Try to guess additional flags to pick up local libraries.
5583 : Be careful not to append to a plain 'none'
5587 for thisflag in $ldflags; do
5592 *) dflt="$dflt $thisflag" ;;
5599 ''|' ') dflt='none' ;;
5602 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5605 none) lddlflags=' ' ;;
5606 *) lddlflags="$ans" ;;
5611 Some systems may require passing special flags to $cc to indicate that
5612 the resulting executable will use dynamic linking. To use no flags,
5616 case "$ccdlflags" in
5617 '') case "$osname" in
5618 hpux) dflt='-Wl,-E' ;;
5619 linux) dflt='-rdynamic' ;;
5620 next) dflt='none' ;;
5621 sunos) dflt='none' ;;
5625 *) dflt="$ccdlflags" ;;
5627 rp="Any special flags to pass to $cc to use dynamic loading?"
5630 none) ccdlflags=' ' ;;
5631 *) ccdlflags="$ans" ;;
5645 # No dynamic loading being used, so don't bother even to prompt.
5648 *) case "$useshrplib" in
5649 '') case "$osname" in
5650 svr4*|dgux|dynixptx|esix|powerux|beos)
5652 also='Building a shared libperl is required for dynamic loading to work on your system.'
5657 also='Building a shared libperl is needed for MAB support.'
5675 The perl executable is normally obtained by linking perlmain.c with
5676 libperl${_a}, any static extensions (usually just DynaLoader), and
5677 any other libraries needed on this system (such as -lm, etc.). Since
5678 your system supports dynamic loading, it is probably possible to build
5679 a shared libperl.$so. If you will have more than one executable linked
5680 to libperl.$so, this will significantly reduce the size of each
5681 executable, but it may have a noticeable affect on performance. The
5682 default is probably sensible for your system.
5686 rp="Build a shared libperl.$so (y/n)"
5690 useshrplib='true' ;;
5691 *) useshrplib='false' ;;
5696 case "$useshrplib" in
5700 # Figure out a good name for libperl.so. Since it gets stored in
5701 # a version-specific architecture-dependent library, the version
5702 # number isn't really that important, except for making cc/ld happy.
5704 # A name such as libperl.so.3.1
5705 majmin="libperl.$so.$patchlevel.$subversion"
5706 # A name such as libperl.so.301
5707 majonly=`echo $patchlevel $subversion |
5708 $awk '{printf "%d%02d", $1, $2}'`
5709 majonly=libperl.$so.$majonly
5710 # I'd prefer to keep the os-specific stuff here to a minimum, and
5711 # rely on figuring it out from the naming of libc.
5712 case "${osname}${osvers}" in
5715 # XXX How handle the --version stuff for MAB?
5717 linux*) # ld won't link with a bare -lperl otherwise.
5720 *) # Try to guess based on whether libc has major.minor.
5722 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5723 *libc.$so.[0-9]*) dflt=$majonly ;;
5724 *) dflt=libperl.$so ;;
5734 I need to select a good name for the shared libperl. If your system uses
5735 library names with major and minor numbers, then you might want something
5736 like $majmin. Alternatively, if your system uses a single version
5737 number for shared libraries, then you might want to use $majonly.
5738 Or, your system might be quite happy with a simple libperl.$so.
5740 Since the shared libperl will get installed into a version-specific
5741 architecture-dependent directory, the version number of the shared perl
5742 library probably isn't important, so the default should be o.k.
5745 rp='What name do you want to give to the shared libperl?'
5748 echo "Ok, I'll use $libperl"
5751 libperl="libperl${_a}"
5755 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5759 WARNING: Use of the shrpdir variable for the installation location of
5760 the shared $libperl is not supported. It was never documented and
5761 will not work in this version. Let me (perlbug@perl.com)
5762 know of any problems this may cause.
5768 But your current setting of $shrpdir is
5769 the default anyway, so it's harmless.
5774 Further, your current attempted setting of $shrpdir
5775 conflicts with the value of $archlibexp/CORE
5776 that installperl will use.
5783 # How will the perl executable find the installed shared $libperl?
5784 # Add $xxx to ccdlflags.
5785 # If we can't figure out a command-line option, use $shrpenv to
5786 # set env LD_RUN_PATH. The main perl makefile uses this.
5787 shrpdir=$archlibexp/CORE
5790 if "$useshrplib"; then
5793 # We'll set it in Makefile.SH...
5799 xxx="-Wl,-R$shrpdir"
5801 linux|irix*|dec_osf)
5802 xxx="-Wl,-rpath,$shrpdir"
5805 # next doesn't like the default...
5808 # beos doesn't like the default, either.
5811 # hpux doesn't like the default, either.
5812 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5815 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5821 # Only add $xxx if it isn't already in ccdlflags.
5822 case " $ccdlflags " in
5824 *) ccdlflags="$ccdlflags $xxx"
5827 Adding $xxx to the flags
5828 passed to $ld so that the perl executable will find the
5829 installed shared $libperl.
5837 # Fix ccdlflags in AIX for building external extensions.
5838 # (For building Perl itself bare -bE:perl.exp is needed,
5839 # Makefile.SH takes care of this.)
5841 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5843 # Respect a hint or command-line value.
5845 '') shrpenv="$tmp_shrpenv" ;;
5847 case "$ldlibpthname" in
5848 '') ldlibpthname=LD_LIBRARY_PATH ;;
5849 none) ldlibpthname='' ;;
5852 : determine where manual pages go
5853 set man1dir man1dir none
5857 $spackage has manual pages available in source form.
5861 echo "However, you don't have nroff, so they're probably useless to you."
5863 '') man1dir="none";;
5866 echo "If you don't want the manual sources installed, answer 'none'."
5871 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5872 lookpath="$lookpath $prefixexp/man/p_man/man1"
5873 lookpath="$lookpath $prefixexp/man/u_man/man1"
5874 lookpath="$lookpath $prefixexp/man/man.1"
5876 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5877 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5887 rp="Where do the main $spackage manual pages (source) go?"
5889 if $test "X$man1direxp" != "X$ansexp"; then
5893 man1direxp="$ansexp"
5899 : Change installation prefix, if necessary.
5900 if $test X"$prefix" != X"$installprefix"; then
5901 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5903 installman1dir="$man1direxp"
5906 : What suffix to use on installed man pages
5913 rp="What suffix should be used for the main $spackage man pages?"
5915 '') case "$man1dir" in
5929 *) dflt="$man1ext";;
5936 : see if we can have long filenames
5938 rmlist="$rmlist /tmp/cf$$"
5939 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5940 first=123456789abcdef
5941 second=/tmp/cf$$/$first
5942 $rm -f $first $second
5943 if (echo hi >$first) 2>/dev/null; then
5944 if $test -f 123456789abcde; then
5945 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5948 if (echo hi >$second) 2>/dev/null; then
5949 if $test -f /tmp/cf$$/123456789abcde; then
5951 That's peculiar... You can have filenames longer than 14 characters, but only
5952 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5953 I shall consider your system cannot support long filenames at all.
5957 echo 'You can have filenames longer than 14 characters.' >&4
5962 How confusing! Some of your filesystems are sane enough to allow filenames
5963 longer than 14 characters but some others like /tmp can't even think about them.
5964 So, for now on, I shall assume your kernel does not allow them at all.
5971 You can't have filenames longer than 14 chars. You can't even think about them!
5977 $rm -rf /tmp/cf$$ 123456789abcde*
5979 : determine where library module manual pages go
5980 set man3dir man3dir none
5984 $spackage has manual pages for many of the library modules.
5990 However, you don't have nroff, so they're probably useless to you.
5993 '') man3dir="none";;
5997 case "$d_flexfnam" in
6000 However, your system can't handle the long file names like File::Basename.3.
6003 '') man3dir="none";;
6007 echo "If you don't want the manual sources installed, answer 'none'."
6008 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6010 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6011 if $test -d "$privlib/man/man3"; then
6014 WARNING: Previous versions of perl installed man3 pages into
6015 $privlib/man/man3. This version will suggest a
6016 new default of $dflt.
6020 rp='Do you wish to preserve the old behavior?(y/n)'
6023 y*) dflt="$privlib/man/man3" ;;
6029 *) dflt="$man3dir" ;;
6033 rp="Where do the $package library man pages (source) go?"
6036 man3direxp="$ansexp"
6042 : Change installation prefix, if necessary.
6043 if $test X"$prefix" != X"$installprefix"; then
6044 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6046 installman3dir="$man3direxp"
6049 : What suffix to use on installed man pages
6055 rp="What suffix should be used for the $package library man pages?"
6057 '') case "$man3dir" in
6071 *) dflt="$man3ext";;
6078 : see if we have to deal with yellow pages, now NIS.
6079 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6080 if $test -f /usr/etc/nibindd; then
6082 echo "I'm fairly confident you're on a NeXT."
6084 rp='Do you get the hosts file via NetInfo?'
6093 y*) hostcat='nidump hosts .';;
6094 *) case "$hostcat" in
6095 nidump*) hostcat='';;
6105 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6113 rp='Are you getting the hosts file via yellow pages?'
6116 y*) hostcat='ypcat hosts';;
6117 *) hostcat='cat /etc/hosts';;
6123 '') hostcat='cat /etc/hosts';;
6126 '') groupcat='cat /etc/group';;
6129 '') passcat='cat /etc/passwd';;
6132 : now get the host name
6134 echo "Figuring out host name..." >&4
6135 case "$myhostname" in
6137 echo 'Maybe "hostname" will work...'
6138 if tans=`sh -c hostname 2>&1` ; then
6146 if $test "$cont"; then
6148 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6149 if tans=`cat /etc/systemid 2>&1` ; then
6151 phostname='cat /etc/systemid'
6152 echo "Whadyaknow. Xenix always was a bit strange..."
6155 elif $test -r /etc/systemid; then
6156 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6159 if $test "$cont"; then
6160 echo 'No, maybe "uuname -l" will work...'
6161 if tans=`sh -c 'uuname -l' 2>&1` ; then
6163 phostname='uuname -l'
6165 echo 'Strange. Maybe "uname -n" will work...'
6166 if tans=`sh -c 'uname -n' 2>&1` ; then
6168 phostname='uname -n'
6170 echo 'Oh well, maybe I can mine it out of whoami.h...'
6171 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6172 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6173 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6175 case "$myhostname" in
6176 '') echo "Does this machine have an identity crisis or something?"
6179 echo "Well, you said $myhostname before..."
6180 phostname='echo $myhostname';;
6186 : you do not want to know about this
6191 if $test "$myhostname" ; then
6193 rp='Your host name appears to be "'$myhostname'".'" Right?"
6201 : bad guess or no guess
6202 while $test "X$myhostname" = X ; do
6204 rp="Please type the (one word) name of your host:"
6209 : translate upper to lower if necessary
6210 case "$myhostname" in
6212 echo "(Normalizing case in your host name)"
6213 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6217 case "$myhostname" in
6219 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6220 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6221 echo "(Trimming domain name from host name--host name is now $myhostname)"
6223 *) case "$mydomain" in
6226 test "X$hostcat" = "Xypcat hosts" &&
6227 ypmatch "$myhostname" hosts 2>/dev/null |\
6228 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6231 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6232 /[ ]$myhostname[ . ]/p" > hosts
6235 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6236 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6237 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6238 hosts | $sort | $uniq | \
6239 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6240 case `$echo X$dflt` in
6241 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6244 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6249 tans=`./loc resolv.conf X /etc /usr/etc`
6250 if $test -f "$tans"; then
6251 echo "(Attempting domain name extraction from $tans)"
6252 dflt=.`$sed -n -e 's/ / /g' \
6253 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6254 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6256 .) dflt=.`$sed -n -e 's/ / /g' \
6257 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6258 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6265 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6266 dflt=.`sh -c domainname 2>/dev/null`
6269 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6274 .) echo "(Lost all hope -- silly guess then)"
6280 *) dflt="$mydomain";;
6284 rp="What is your domain name?"
6294 : translate upper to lower if necessary
6297 echo "(Normalizing case in your domain name)"
6298 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6302 : a little sanity check here
6303 case "$phostname" in
6306 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6307 $myhostname$mydomain|$myhostname) ;;
6309 case "$phostname" in
6311 echo "(That doesn't agree with your whoami.h file, by the way.)"
6314 echo "(That doesn't agree with your $phostname command, by the way.)"
6324 I need to get your e-mail address in Internet format if possible, i.e.
6325 something like user@host.domain. Please answer accurately since I have
6326 no easy means to double check it. The default value provided below
6327 is most probably close to the reality but may not be valid from outside
6328 your organization...
6332 while test "$cont"; do
6334 '') dflt="$cf_by@$myhostname$mydomain";;
6335 *) dflt="$cf_email";;
6337 rp='What is your e-mail address?'
6343 rp='Address does not look like an Internet one. Use it anyway?'
6359 If you or somebody else will be maintaining perl at your site, please
6360 fill in the correct e-mail address here so that they may be contacted
6361 if necessary. Currently, the "perlbug" program included with perl
6362 will send mail to this address in addition to perlbug@perl.com. You may
6363 enter "none" for no administrator.
6366 case "$perladmin" in
6367 '') dflt="$cf_email";;
6368 *) dflt="$perladmin";;
6370 rp='Perl administrator e-mail address'
6374 : figure out how to guarantee perl startup
6375 case "$startperl" in
6377 case "$sharpbang" in
6381 I can use the #! construct to start perl on your system. This will
6382 make startup of perl scripts faster, but may cause problems if you
6383 want to share those scripts and perl is not in a standard place
6384 ($binexp/perl) on all your platforms. The alternative is to force
6385 a shell by starting the script with a single ':' character.
6389 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6392 none) startperl=": # use perl";;
6393 *) startperl="#!$ans"
6394 if $test 30 -lt `echo "$ans" | wc -c`; then
6397 WARNING: Some systems limit the #! command to 32 characters.
6398 If you experience difficulty running Perl scripts with #!, try
6399 installing Perl in a directory with a shorter pathname.
6405 *) startperl=": # use perl"
6410 echo "I'll use $startperl to start perl scripts."
6412 : figure best path for perl in scripts
6415 perlpath="$binexp/perl"
6416 case "$startperl" in
6421 I will use the "eval 'exec'" idiom to start Perl on your system.
6422 I can use the full path of your Perl binary for this purpose, but
6423 doing so may cause problems if you want to share those scripts and
6424 Perl is not always in a standard place ($binexp/perl).
6428 rp="What path shall I use in \"eval 'exec'\"?"
6435 case "$startperl" in
6437 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6440 : determine where public executable scripts go
6441 set scriptdir scriptdir
6443 case "$scriptdir" in
6446 : guess some guesses
6447 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6448 $test -d /usr/share/bin && dflt=/usr/share/bin
6449 $test -d /usr/local/script && dflt=/usr/local/script
6450 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6451 $test -d $prefixexp/script && dflt=$prefixexp/script
6455 *) dflt="$scriptdir"
6460 Some installations have a separate directory just for executable scripts so
6461 that they can mount it across multiple architectures but keep the scripts in
6462 one spot. You might, for example, have a subdirectory of /usr/share for this.
6463 Or you might just lump your scripts in with all your other executables.
6467 rp='Where do you keep publicly executable scripts?'
6469 if $test "X$ansexp" != "X$scriptdirexp"; then
6473 scriptdirexp="$ansexp"
6474 : Change installation prefix, if necessary.
6475 if $test X"$prefix" != X"$installprefix"; then
6476 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6478 installscript="$scriptdirexp"
6483 After $package is installed, you may wish to install various
6484 add-on modules and utilities. Typically, these add-ons will
6485 be installed under $prefix with the rest
6486 of this package. However, you may wish to install such add-ons
6487 elsewhere under a different prefix.
6489 If you do not wish to put everything under a single prefix, that's
6490 ok. You will be prompted for the individual locations; this siteprefix
6491 is only used to suggest the defaults.
6493 The default should be fine for most people.
6497 rp='Installation prefix to use for add-on modules and utilities?'
6498 : XXX Here might be another good place for an installstyle setting.
6499 case "$siteprefix" in
6501 *) dflt=$siteprefix ;;
6505 case "$siteprefix" in
6510 *) oldsiteprefix="$prefix";;
6515 siteprefixexp="$ansexp"
6517 : determine where site specific libraries go.
6518 : Usual default is /usr/local/lib/perl5/site_perl
6519 : The default "style" setting is made in installstyle.U
6520 : XXX No longer works with Prefixit stuff.
6521 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6522 case "$installstyle" in
6523 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6524 *) dflt=$siteprefix/lib/site_$prog ;;
6528 The installation process will create a directory for
6529 site-specific extensions and modules. Most users find it convenient
6530 to place all site-specific files in this directory rather than in the
6531 main distribution directory.
6535 rp='Pathname for the site-specific library files?'
6538 sitelibexp="$ansexp"
6539 : Change installation prefix, if necessary.
6540 if $test X"$prefix" != X"$installprefix"; then
6541 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6543 installsitelib="$sitelibexp"
6546 : determine where site specific architecture-dependent libraries go.
6547 : sitelib default is /usr/local/lib/perl5/site_perl/
6548 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6549 : sitelib may have an optional trailing /share.
6550 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6551 tdflt="$tdflt/$apiversion/$archname"
6552 set sitearch sitearch none
6555 '') dflt="$tdflt" ;;
6556 *) dflt="$sitearch" ;;
6560 The installation process will also create a directory for
6561 architecture-dependent site-specific extensions and modules.
6565 rp='Pathname for the site-specific architecture-dependent library files?'
6568 sitearchexp="$ansexp"
6569 : Change installation prefix, if necessary.
6570 if $test X"$prefix" != X"$installprefix"; then
6571 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6573 installsitearch="$sitearchexp"
6576 : determine where add-on public executables go
6578 '') dflt=$siteprefix/bin ;;
6582 rp='Pathname where the add-on public executables should be installed?'
6585 sitebinexp="$ansexp"
6586 : Change installation prefix, if necessary.
6587 if $test X"$prefix" != X"$installprefix"; then
6588 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6590 installsitebin="$sitebinexp"
6595 Perl can be built to take advantage of long doubles which
6596 (if available) may give more accuracy and range for floating point numbers.
6598 If this doesn't make any sense to you, just accept the default 'n'.
6602 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6605 case "$uselongdouble" in
6606 $define|true|[yY]*) dflt='y';;
6609 rp='Try to use long doubles if available?'
6612 y|Y) val="$define" ;;
6618 case "$uselongdouble" in
6619 true|[yY]*) uselongdouble="$define" ;;
6622 case "$uselongdouble" in
6624 : Look for a hint-file generated 'call-back-unit'. If the
6625 : user has specified that long doubles should be used,
6626 : we may need to set or change some other defaults.
6627 if $test -f uselongdouble.cbu; then
6628 echo "Your platform has some specific hints for long doubles, using them..."
6629 . ./uselongdouble.cbu
6632 (Your platform doesn't have any specific hints for long doubles.)
6640 Perl can be built to take advantage of long longs which
6641 (if available) may give more range for integer numbers.
6643 If this doesn't make any sense to you, just accept the default 'n'.
6647 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6650 case "$uselonglong" in
6651 $define|true|[yY]*) dflt='y';;
6654 rp='Try to use long longs if available?'
6657 y|Y) val="$define" ;;
6663 case "$uselonglong" in
6664 true|[yY]*) uselonglong="$define" ;;
6667 case "$uselonglong" in
6669 : Look for a hint-file generated 'call-back-unit'. If the
6670 : user has specified that long longs should be used,
6671 : we may need to set or change some other defaults.
6672 if $test -f uselonglong.cbu; then
6673 echo "Your platform has some specific hints for long longs, using them..."
6677 (Your platform doesn't have any specific hints for long longs.)
6685 Previous version of $package used the standard IO mechanisms as defined
6686 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6687 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6688 the default. This abstraction layer can use AT&T's sfio (if you already
6689 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6690 problems with some extension modules. Using PerlIO with stdio is safe,
6691 but it is slower than plain stdio and therefore is not the default.
6693 If this doesn't make any sense to you, just accept the default 'n'.
6695 case "$useperlio" in
6696 $define|true|[yY]*) dflt='y';;
6699 rp='Use the experimental PerlIO abstraction layer?'
6706 echo "Ok, doing things the stdio way"
6713 case "$vendorprefix" in
6714 '') d_vendorbin="$undef"
6718 *) d_vendorbin="$define"
6719 : determine where vendor-supplied executables go.
6720 dflt=$vendorprefix/bin
6722 rp='Pathname for the vendor-supplied executables directory?'
6725 vendorbinexp="$ansexp"
6726 : Change installation prefix, if necessary.
6727 if $test X"$prefix" != X"$installprefix"; then
6728 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6730 installvendorbin="$vendorbinexp"
6735 : Check how to convert floats to strings.
6736 if test "X$d_Gconvert" = X; then
6738 echo "Checking for an efficient way to convert floats to strings."
6741 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6742 char *myname = "gconvert";
6745 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6746 char *myname = "gcvt";
6749 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6750 char *myname = "sprintf";
6756 checkit(expect, got)
6760 if (strcmp(expect, got)) {
6761 printf("%s oddity: Expected %s, got %s\n",
6762 myname, expect, got);
6772 /* This must be 1st test on (which?) platform */
6773 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6774 Gconvert(0.1, 8, 0, buf);
6775 checkit("0.1", buf);
6777 Gconvert(1.0, 8, 0, buf);
6780 Gconvert(0.0, 8, 0, buf);
6783 Gconvert(-1.0, 8, 0, buf);
6786 /* Some Linux gcvt's give 1.e+5 here. */
6787 Gconvert(100000.0, 8, 0, buf);
6788 checkit("100000", buf);
6790 /* Some Linux gcvt's give -1.e+5 here. */
6791 Gconvert(-100000.0, 8, 0, buf);
6792 checkit("-100000", buf);
6797 case "$d_Gconvert" in
6798 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6799 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6800 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6801 *) xxx_list='gconvert gcvt sprintf' ;;
6804 for xxx_convert in $xxx_list; do
6805 echo "Trying $xxx_convert"
6807 set try -DTRY_$xxx_convert
6808 if eval $compile; then
6809 echo "$xxx_convert" found. >&4
6811 echo "I'll use $xxx_convert to convert floats into a string." >&4
6814 echo "...But $xxx_convert didn't work as I expected."
6817 echo "$xxx_convert NOT found." >&4
6821 case "$xxx_convert" in
6822 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6823 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6824 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6828 : check for length of double
6830 case "$doublesize" in
6832 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6833 $cat >try.c <<'EOCP'
6837 printf("%d\n", (int)sizeof(double));
6842 if eval $compile_ok; then
6844 $echo " $doublesize bytes." >&4
6847 echo "(I can't seem to compile the test program. Guessing...)"
6848 rp="What is the size of a double precision number (in bytes)?"
6856 : check for long doubles
6858 $echo $n "Checking to see if your system supports long double..." $c >&4
6859 echo 'int main() { long double x = 7.0; }' > try.c
6861 if eval $compile; then
6863 echo " Yes, it does." >&4
6866 echo " No, it doesn't." >&4
6872 : check for length of long double
6873 case "${d_longdbl}${longdblsize}" in
6876 $echo $n "Checking to see how big your long doubles are..." $c >&4
6877 $cat >try.c <<'EOCP'
6881 printf("%d\n", sizeof(long double));
6886 if eval $compile; then
6887 longdblsize=`./try$exe_ext`
6888 $echo " $longdblsize bytes." >&4
6892 echo "(I can't seem to compile the test program. Guessing...)" >&4
6893 rp="What is the size of a long double (in bytes)?"
6897 if $test "X$doublesize" = "X$longdblsize"; then
6898 echo "(That isn't any different from an ordinary double.)"
6906 if $test X"$d_longdbl" = X"$define"; then
6908 echo "Checking how to print long doubles..." >&4
6910 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6911 $cat >try.c <<'EOCP'
6912 #include <sys/types.h>
6916 printf("%.3f\n", d);
6920 if eval $compile; then
6924 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6925 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6926 echo "We will use %f."
6932 if $test X"$sPRIfldbl" = X; then
6933 $cat >try.c <<'EOCP'
6934 #include <sys/types.h>
6937 long double d = 123.456;
6938 printf("%.3llf\n", d);
6942 if eval $compile; then
6946 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6947 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
6948 echo "We will use %llf."
6954 if $test X"$sPRIfldbl" = X; then
6955 $cat >try.c <<'EOCP'
6956 #include <sys/types.h>
6959 long double d = 123.456;
6960 printf("%.3Lf\n", d);
6964 if eval $compile; then
6968 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6969 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
6970 echo "We will use %Lf."
6976 if $test X"$sPRIfldbl" = X; then
6977 $cat >try.c <<'EOCP'
6978 #include <sys/types.h>
6981 long double d = 123.456;
6982 printf("%.3lf\n", d);
6986 if eval $compile; then
6990 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6991 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
6992 echo "We will use %lf."
6998 if $test X"$sPRIfldbl" = X; then
6999 echo "Cannot figure out how to print long doubles." >&4
7006 case "$sPRIfldbl" in
7007 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7008 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7010 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7011 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7015 : Initialize h_fcntl
7018 : Initialize h_sysfile
7021 : access call always available on UNIX
7025 : locate the flags for 'access()'
7029 $cat >access.c <<'EOCP'
7030 #include <sys/types.h>
7035 #include <sys/file.h>
7044 : check sys/file.h first, no particular reason here
7045 if $test `./findhdr sys/file.h` && \
7046 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7048 echo "<sys/file.h> defines the *_OK access constants." >&4
7049 elif $test `./findhdr fcntl.h` && \
7050 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7052 echo "<fcntl.h> defines the *_OK access constants." >&4
7053 elif $test `./findhdr unistd.h` && \
7054 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7055 echo "<unistd.h> defines the *_OK access constants." >&4
7057 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7063 : see if accessx exists
7064 set accessx d_accessx
7067 : see if alarm exists
7071 : see if atolf exists
7075 : see if atoll exists
7079 : Look for GNU-cc style attribute checking
7081 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7082 $cat >attrib.c <<'EOCP'
7084 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7086 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7087 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7088 echo "Your C compiler doesn't fully support __attribute__."
7091 echo "Your C compiler supports __attribute__."
7095 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7102 : see if bcmp exists
7106 : see if bcopy exists
7110 : see if this is a unistd.h system
7111 set unistd.h i_unistd
7114 : see if getpgrp exists
7115 set getpgrp d_getpgrp
7118 case "$d_getpgrp" in
7121 echo "Checking to see which flavor of getpgrp is in use..."
7124 #include <sys/types.h>
7126 # include <unistd.h>
7130 if (getuid() == 0) {
7131 printf("(I see you are running Configure as super-user...)\n");
7135 if (getpgrp(1) == 0)
7144 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7145 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7147 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7148 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7151 echo "I can't seem to compile and run the test program."
7153 xxx="a USG one, i.e. you use getpgrp()."
7155 # SVR4 systems can appear rather BSD-ish.
7158 xxx="a BSD one, i.e. you use getpgrp(pid)."
7162 xxx="probably a USG one, i.e. you use getpgrp()."
7167 echo "Assuming your getpgrp is $xxx" >&4
7176 : see if setpgrp exists
7177 set setpgrp d_setpgrp
7180 case "$d_setpgrp" in
7183 echo "Checking to see which flavor of setpgrp is in use..."
7186 #include <sys/types.h>
7188 # include <unistd.h>
7192 if (getuid() == 0) {
7193 printf("(I see you are running Configure as super-user...)\n");
7197 if (-1 == setpgrp(1, 1))
7200 if (setpgrp() != -1)
7206 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7207 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7209 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7210 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7213 echo "(I can't seem to compile and run the test program.)"
7215 xxx="a USG one, i.e. you use setpgrp()."
7217 # SVR4 systems can appear rather BSD-ish.
7220 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7224 xxx="probably a USG one, i.e. you use setpgrp()."
7229 echo "Assuming your setpgrp is $xxx" >&4
7237 : see if bzero exists
7241 : check for lengths of integral types
7245 echo "Checking to see how big your integers are..." >&4
7246 $cat >intsize.c <<'EOCP'
7250 printf("intsize=%d;\n", (int)sizeof(int));
7251 printf("longsize=%d;\n", (int)sizeof(long));
7252 printf("shortsize=%d;\n", (int)sizeof(short));
7257 if eval $compile_ok && ./intsize > /dev/null; then
7259 echo "Your integers are $intsize bytes long."
7260 echo "Your long integers are $longsize bytes long."
7261 echo "Your short integers are $shortsize bytes long."
7265 Help! I can't compile and run the intsize test program: please enlighten me!
7266 (This is probably a misconfiguration in your system or libraries, and
7267 you really ought to fix it. Still, I'll try anyway.)
7271 rp="What is the size of an integer (in bytes)?"
7275 rp="What is the size of a long integer (in bytes)?"
7279 rp="What is the size of a short integer (in bytes)?"
7285 $rm -f intsize intsize.*
7287 : see if signal is declared as pointer to function returning int or void
7289 xxx=`./findhdr signal.h`
7290 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7291 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7292 echo "You have int (*signal())() instead of void." >&4
7294 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7295 echo "You have void (*signal())()." >&4
7297 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7298 echo "You have int (*signal())() instead of void." >&4
7300 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7301 echo "You have void (*signal())()." >&4
7304 case "$d_voidsig" in
7306 echo "I can't determine whether signal handler returns void or int..." >&4
7308 rp="What type does your signal handler return?"
7315 echo "As you already told me, signal handler returns void." >&4
7318 *) echo "As you already told me, signal handler returns int." >&4
7325 case "$d_voidsig" in
7326 "$define") signal_t="void";;
7331 : check for ability to cast large floats to 32-bit ints.
7333 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7334 if $test "$intsize" -ge 4; then
7341 #include <sys/types.h>
7343 $signal_t blech(s) int s; { exit(3); }
7350 signal(SIGFPE, blech);
7352 /* Don't let compiler optimize the test away. Store the number
7353 in a writable string for gcc to pass to sscanf under HP/UX.
7355 sprintf(str, "2147483647");
7356 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7360 /* x86 processors will probably give 0x8000 0000, which is a
7361 sign change. We don't want that. We want to mimic SPARC
7362 behavior here, which is to preserve the sign and give
7365 if (i32 != ($xxx) f)
7371 if eval $compile_ok; then
7375 echo "(I can't seem to compile the test program--assuming it can't)"
7383 echo "Nope, it can't."
7390 : check for ability to cast negative floats to unsigned
7392 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7395 #include <sys/types.h>
7397 $signal_t blech(s) int s; { exit(7); }
7398 $signal_t blech_in_list(s) int s; { exit(4); }
7399 unsigned long dummy_long(p) unsigned long p; { return p; }
7400 unsigned int dummy_int(p) unsigned int p; { return p; }
7401 unsigned short dummy_short(p) unsigned short p; { return p; }
7405 unsigned long along;
7407 unsigned short ashort;
7411 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7412 a direct f = -123. assignment. gcc-2.8.0 reportedly
7413 optimized the whole file away
7415 /* Store the number in a writable string for gcc to pass to
7418 sprintf(str, "-123");
7419 sscanf(str, "%lf", &f); /* f = -123.; */
7421 signal(SIGFPE, blech);
7422 along = (unsigned long)f;
7423 aint = (unsigned int)f;
7424 ashort = (unsigned short)f;
7425 if (along != (unsigned long)-123)
7427 if (aint != (unsigned int)-123)
7429 if (ashort != (unsigned short)-123)
7431 sprintf(str, "1073741824.");
7432 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7435 along = (unsigned long)f;
7436 if (along != 0x80000000)
7440 along = (unsigned long)f;
7441 if (along != 0x7fffffff)
7445 along = (unsigned long)f;
7446 if (along != 0x80000001)
7450 signal(SIGFPE, blech_in_list);
7451 sprintf(str, "123.");
7452 sscanf(str, "%lf", &f); /* f = 123.; */
7453 along = dummy_long((unsigned long)f);
7454 aint = dummy_int((unsigned int)f);
7455 ashort = dummy_short((unsigned short)f);
7456 if (along != (unsigned long)123)
7458 if (aint != (unsigned int)123)
7460 if (ashort != (unsigned short)123)
7467 if eval $compile_ok; then
7471 echo "(I can't seem to compile the test program--assuming it can't)"
7474 case "$castflags" in
7479 echo "Nope, it can't."
7486 : see if vprintf exists
7488 if set vprintf val -f d_vprintf; eval $csym; $val; then
7489 echo 'vprintf() found.' >&4
7491 $cat >vprintf.c <<'EOF'
7492 #include <varargs.h>
7494 int main() { xxx("foo"); }
7503 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7507 if eval $compile && ./vprintf; then
7508 echo "Your vsprintf() returns (int)." >&4
7511 echo "Your vsprintf() returns (char*)." >&4
7515 echo 'vprintf() NOT found.' >&4
7525 : see if chown exists
7529 : see if chroot exists
7533 : see if chsize exists
7537 : check for const keyword
7539 echo 'Checking to see if your C compiler knows about "const"...' >&4
7540 $cat >const.c <<'EOCP'
7541 typedef struct spug { int drokk; } spug;
7548 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7550 echo "Yup, it does."
7553 echo "Nope, it doesn't."
7558 : see if crypt exists
7560 if set crypt val -f d_crypt; eval $csym; $val; then
7561 echo 'crypt() found.' >&4
7565 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7566 if $test -z "$cryptlib"; then
7567 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7571 if $test -z "$cryptlib"; then
7572 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7576 if $test -z "$cryptlib"; then
7577 cryptlib=`./loc libcrypt$_a "" $libpth`
7581 if $test -z "$cryptlib"; then
7582 echo 'crypt() NOT found.' >&4
7591 : get csh whereabouts
7593 'csh') val="$undef" ;;
7598 : Respect a hint or command line value for full_csh.
7600 '') full_csh=$csh ;;
7603 : see if cuserid exists
7604 set cuserid d_cuserid
7607 : see if this is a limits.h system
7608 set limits.h i_limits
7611 : see if this is a float.h system
7615 : See if number of significant digits in a double precision number is known
7617 $cat >dbl_dig.c <<EOM
7627 printf("Contains DBL_DIG");
7630 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7631 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7632 echo "DBL_DIG found." >&4
7635 echo "DBL_DIG NOT found." >&4
7642 : see if difftime exists
7643 set difftime d_difftime
7646 : see if this is a dirent system
7648 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7650 echo "<dirent.h> found." >&4
7653 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7654 echo "<sys/dir.h> found." >&4
7657 xinc=`./findhdr sys/ndir.h`
7659 echo "<dirent.h> NOT found." >&4
7664 : Look for type of directory structure.
7666 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7668 case "$direntrytype" in
7671 $define) guess1='struct dirent' ;;
7672 *) guess1='struct direct' ;;
7675 *) guess1="$direntrytype"
7680 'struct dirent') guess2='struct direct' ;;
7681 *) guess2='struct dirent' ;;
7684 if $contains "$guess1" try.c >/dev/null 2>&1; then
7685 direntrytype="$guess1"
7686 echo "Your directory entries are $direntrytype." >&4
7687 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7688 direntrytype="$guess2"
7689 echo "Your directory entries seem to be $direntrytype." >&4
7691 echo "I don't recognize your system's directory entries." >&4
7692 rp="What type is used for directory entries on this system?"
7700 : see if the directory entry stores field length
7702 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7703 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7704 echo "Good, your directory entry keeps length information in d_namlen." >&4
7707 echo "Your directory entry does not know about the d_namlen field." >&4
7714 : see if dlerror exists
7717 set dlerror d_dlerror
7721 : see if dlfcn is available
7729 On a few systems, the dynamically loaded modules that perl generates and uses
7730 will need a different extension than shared libs. The default will probably
7738 rp='What is the extension of dynamically loaded modules'
7747 : Check if dlsym need a leading underscore
7753 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7754 $cat >dyna.c <<'EOM'
7763 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7765 #include <sys/types.h>
7779 int mode = RTLD_LAZY ;
7781 handle = dlopen("./dyna.$dlext", mode) ;
7782 if (handle == NULL) {
7787 symbol = dlsym(handle, "fred") ;
7788 if (symbol == NULL) {
7789 /* try putting a leading underscore */
7790 symbol = dlsym(handle, "_fred") ;
7791 if (symbol == NULL) {
7804 : Call the object file tmp-dyna.o in case dlext=o.
7805 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7806 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7807 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7808 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7811 1) echo "Test program failed using dlopen." >&4
7812 echo "Perhaps you should not use dynamic loading." >&4;;
7813 2) echo "Test program failed using dlsym." >&4
7814 echo "Perhaps you should not use dynamic loading." >&4;;
7815 3) echo "dlsym needs a leading underscore" >&4
7817 4) echo "dlsym doesn't need a leading underscore." >&4;;
7820 echo "I can't compile and run the test program." >&4
7821 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7826 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7831 hasproto='varname=$1; func=$2; shift; shift;
7832 while $test $# -ge 2; do
7834 $define) echo "#include <$2>";;
7838 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7839 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7840 echo "$func() prototype found.";
7843 echo "$func() prototype NOT found.";
7848 $rm -f try.c tryout.c'
7850 : see if prototype for drand48 is available
7852 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7855 : see if dup2 exists
7859 : see if eaccess exists
7860 set eaccess d_eaccess
7863 : see if endgrent exists
7864 set endgrent d_endgrent
7867 : see if endhostent exists
7868 set endhostent d_endhent
7871 : see if endnetent exists
7872 set endnetent d_endnent
7875 : see if endprotoent exists
7876 set endprotoent d_endpent
7879 : see if endpwent exists
7880 set endpwent d_endpwent
7883 : see if endservent exists
7884 set endservent d_endsent
7887 : see if endspent exists
7888 set endspent d_endspent
7891 : Locate the flags for 'open()'
7893 $cat >open3.c <<'EOCP'
7894 #include <sys/types.h>
7899 #include <sys/file.h>
7910 : check sys/file.h first to get FREAD on Sun
7911 if $test `./findhdr sys/file.h` && \
7912 set open3 -DI_SYS_FILE && eval $compile; then
7914 echo "<sys/file.h> defines the O_* constants..." >&4
7916 echo "and you have the 3 argument form of open()." >&4
7919 echo "but not the 3 argument form of open(). Oh, well." >&4
7922 elif $test `./findhdr fcntl.h` && \
7923 set open3 -DI_FCNTL && eval $compile; then
7925 echo "<fcntl.h> defines the O_* constants..." >&4
7927 echo "and you have the 3 argument form of open()." >&4
7930 echo "but not the 3 argument form of open(). Oh, well." >&4
7935 echo "I can't find the O_* constant definitions! You got problems." >&4
7941 : see which of string.h or strings.h is needed
7943 strings=`./findhdr string.h`
7944 if $test "$strings" && $test -r "$strings"; then
7945 echo "Using <string.h> instead of <strings.h>." >&4
7949 strings=`./findhdr strings.h`
7950 if $test "$strings" && $test -r "$strings"; then
7951 echo "Using <strings.h> instead of <string.h>." >&4
7953 echo "No string header found -- You'll surely have problems." >&4
7959 "$undef") strings=`./findhdr strings.h`;;
7960 *) strings=`./findhdr string.h`;;
7963 : check for non-blocking I/O stuff
7964 case "$h_sysfile" in
7965 true) echo "#include <sys/file.h>" > head.c;;
7968 true) echo "#include <fcntl.h>" > head.c;;
7969 *) echo "#include <sys/fcntl.h>" > head.c;;
7974 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7975 case "$o_nonblock" in
7978 $cat >>try.c <<'EOCP'
7982 printf("O_NONBLOCK\n");
7986 printf("O_NDELAY\n");
7990 printf("FNDELAY\n");
7997 if eval $compile_ok; then
7999 case "$o_nonblock" in
8000 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8001 *) echo "Seems like we can use $o_nonblock.";;
8004 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8007 *) echo "Using $hint value $o_nonblock.";;
8009 $rm -f try try.* .out core
8012 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8018 #include <sys/types.h>
8021 #define MY_O_NONBLOCK $o_nonblock
8022 #ifndef errno /* XXX need better Configure test */
8032 #include <strings.h>
8034 $signal_t blech(x) int x; { exit(3); }
8036 $cat >> try.c <<'EOCP'
8044 pipe(pd); /* Down: child -> parent */
8045 pipe(pu); /* Up: parent -> child */
8048 close(pd[1]); /* Parent reads from pd[0] */
8049 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8050 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8052 signal(SIGALRM, blech);
8054 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8056 sprintf(string, "%d\n", ret);
8057 write(2, string, strlen(string));
8060 if (errno == EAGAIN) {
8066 if (errno == EWOULDBLOCK)
8067 printf("EWOULDBLOCK\n");
8070 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8071 sleep(2); /* Give it time to close our pipe */
8073 ret = read(pd[0], buf, 1); /* Should read EOF */
8075 sprintf(string, "%d\n", ret);
8076 write(3, string, strlen(string));
8080 close(pd[0]); /* We write to pd[1] */
8081 close(pu[1]); /* We read from pu[0] */
8082 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8083 close(pd[1]); /* Pipe pd is now fully closed! */
8084 exit(0); /* Bye bye, thank you for playing! */
8088 if eval $compile_ok; then
8089 echo "$startsh" >mtry
8090 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8092 ./mtry >/dev/null 2>&1
8094 0) eagain=`$cat try.out`;;
8095 1) echo "Could not perform non-blocking setting!";;
8096 2) echo "I did a successful read() for something that was not there!";;
8097 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8098 *) echo "Something terribly wrong happened during testing.";;
8100 rd_nodata=`$cat try.ret`
8101 echo "A read() system call with no data present returns $rd_nodata."
8102 case "$rd_nodata" in
8105 echo "(That's peculiar, fixing that to be -1.)"
8111 echo "Forcing errno EAGAIN on read() with no data available."
8115 echo "Your read() sets errno to $eagain when no data is available."
8118 status=`$cat try.err`
8120 0) echo "And it correctly returns 0 to signal EOF.";;
8121 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8122 *) echo "However, your read() returns '$status' on EOF??";;
8125 if test "$status" = "$rd_nodata"; then
8126 echo "WARNING: you can't distinguish between EOF and no data!"
8130 echo "I can't compile the test program--assuming errno EAGAIN will do."
8137 echo "Using $hint value $eagain."
8138 echo "Your read() returns $rd_nodata when no data is present."
8139 case "$d_eofnblk" in
8140 "$define") echo "And you can see EOF because read() returns 0.";;
8141 "$undef") echo "But you can't see EOF status from read() returned value.";;
8143 echo "(Assuming you can't see EOF status from read anyway.)"
8149 $rm -f try try.* .out core head.c mtry
8151 : see if fchmod exists
8155 : see if fchown exists
8159 : see if this is an fcntl system
8163 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8164 while $test $# -ge 2; do
8166 $define) echo "#include <$2>";;
8170 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8172 if eval $compile; then
8183 : see whether socket exists
8185 $echo $n "Hmm... $c" >&4
8186 if set socket val -f d_socket; eval $csym; $val; then
8187 echo "Looks like you have Berkeley networking support." >&4
8189 if set setsockopt val -f; eval $csym; $val; then
8192 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8196 if $contains socklib libc.list >/dev/null 2>&1; then
8197 echo "Looks like you have Berkeley networking support." >&4
8199 : we will have to assume that it supports the 4.2 BSD interface
8202 echo "You don't have Berkeley networking in libc$_a..." >&4
8203 if test "X$d_socket" = "X$define"; then
8204 echo "...but you seem to believe that you have sockets." >&4
8206 for net in net socket
8208 if test -f /usr/lib/lib$net$_a; then
8209 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8210 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8211 if $contains socket libc.list >/dev/null 2>&1; then
8216 echo "...but the Wollongong group seems to have hacked it in." >&4
8217 sockethdr="-I/usr/netinclude"
8220 echo "Found Berkeley sockets interface in lib$net." >& 4
8221 if $contains setsockopt libc.list >/dev/null 2>&1; then
8224 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8231 if test "X$d_socket" != "X$define"; then
8232 echo "or anywhere else I see." >&4
8240 : see if socketpair exists
8241 set socketpair d_sockpair
8246 echo "Checking the availability of certain socket constants..." >& 4
8247 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8248 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8250 #include <sys/types.h>
8251 #include <sys/socket.h>
8257 set try; if eval $compile; then
8260 set d_${enum}; eval $setvar
8264 : see if sys/select.h has to be included
8265 set sys/select.h i_sysselct
8268 : see if we should include time.h, sys/time.h, or both
8270 if test "X$timeincl" = X; then
8271 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8272 $echo $n "I'm now running the test program...$c"
8273 $cat >try.c <<'EOCP'
8274 #include <sys/types.h>
8279 #ifdef SYSTIMEKERNEL
8282 #include <sys/time.h>
8285 #include <sys/select.h>
8294 struct timezone tzp;
8296 if (foo.tm_sec == foo.tm_sec)
8299 if (bar.tv_sec == bar.tv_sec)
8306 for s_timezone in '-DS_TIMEZONE' ''; do
8308 for s_timeval in '-DS_TIMEVAL' ''; do
8309 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8310 for i_time in '' '-DI_TIME'; do
8311 for i_systime in '-DI_SYSTIME' ''; do
8314 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8315 if eval $compile; then
8316 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8320 $echo $n "Succeeded with $flags$c"
8332 *SYSTIMEKERNEL*) i_systimek="$define"
8333 timeincl=`./findhdr sys/time.h`
8334 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8335 *) i_systimek="$undef";;
8338 *I_TIME*) i_time="$define"
8339 timeincl=`./findhdr time.h`" $timeincl"
8340 echo "We'll include <time.h>." >&4;;
8341 *) i_time="$undef";;
8344 *I_SYSTIME*) i_systime="$define"
8345 timeincl=`./findhdr sys/time.h`" $timeincl"
8346 echo "We'll include <sys/time.h>." >&4;;
8347 *) i_systime="$undef";;
8352 : check for fd_set items
8355 Checking to see how well your C compiler handles fd_set and friends ...
8357 $cat >fd_set.c <<EOCP
8358 #$i_systime I_SYS_TIME
8359 #$i_sysselct I_SYS_SELECT
8360 #$d_socket HAS_SOCKET
8361 #include <sys/types.h>
8363 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8366 #include <sys/time.h>
8369 #include <sys/select.h>
8378 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8385 set fd_set -DTRYBITS
8386 if eval $compile; then
8387 d_fds_bits="$define"
8389 echo "Well, your system knows about the normal fd_set typedef..." >&4
8391 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8392 d_fd_macros="$define"
8395 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8397 d_fd_macros="$undef"
8401 Hmm, your compiler has some difficulty with fd_set. Checking further...
8404 if eval $compile; then
8407 echo "Well, your system has some sort of fd_set available..." >&4
8409 echo "and you have the normal fd_set macros." >&4
8410 d_fd_macros="$define"
8413 but not the normal fd_set macros! Gross! More work for me...
8415 d_fd_macros="$undef"
8418 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8421 d_fd_macros="$undef"
8426 : see if fgetpos exists
8427 set fgetpos d_fgetpos
8430 : see if flock exists
8434 : see if fork exists
8438 : see if pathconf exists
8439 set pathconf d_pathconf
8442 : see if fpathconf exists
8443 set fpathconf d_fpathconf
8446 : define an is-a-typedef? function
8447 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8449 "") inclist="sys/types.h";;
8451 eval "varval=\$$var";
8455 for inc in $inclist; do
8456 echo "#include <$inc>" >>temp.c;
8458 echo "#ifdef $type" >> temp.c;
8459 echo "printf(\"We have $type\");" >> temp.c;
8460 echo "#endif" >> temp.c;
8461 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8462 if $contains $type temp.E >/dev/null 2>&1; then
8468 *) eval "$var=\$varval";;
8471 : define an is-a-typedef? function that prompts if the type is not available.
8472 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8474 "") inclist="sys/types.h";;
8476 eval "varval=\$$var";
8480 for inc in $inclist; do
8481 echo "#include <$inc>" >>temp.c;
8483 echo "#ifdef $type" >> temp.c;
8484 echo "printf(\"We have $type\");" >> temp.c;
8485 echo "#endif" >> temp.c;
8486 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8488 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8489 if $contains $type temp.E >/dev/null 2>&1; then
8490 echo "$type found." >&4;
8493 echo "$type NOT found." >&4;
8499 *) eval "$var=\$varval";;
8502 : see what type lseek is declared as in the kernel
8503 rp="What is the type used for lseek's offset on this system?"
8504 set off_t lseektype long stdio.h sys/types.h
8508 $echo $n "Checking to see how big your file offsets are...$c" >&4
8510 #include <sys/types.h>
8514 printf("%d\n", (int)sizeof($lseektype));
8519 if eval $compile_ok; then
8521 $echo " $lseeksize bytes." >&4
8525 echo "(I can't seem to compile the test program. Guessing...)"
8526 rp="What is the size of your file offsets (in bytes)?"
8532 : see what type file positions are declared as in the library
8533 rp="What is the type for file position used by fsetpos()?"
8534 set fpos_t fpostype long stdio.h sys/types.h
8539 *_t) zzz="$fpostype" ;;
8542 echo "Checking the size of $zzz..." >&4
8544 #include <sys/types.h>
8547 printf("%d\n", (int)sizeof($fpostype));
8552 if eval $compile_ok; then
8556 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8559 echo "Your $zzz size is $fpossize bytes."
8564 echo "(I can't compile the test program--guessing $fpossize.)" >&4
8571 echo "Checking to see if your system supports off64_t..." >&4
8573 #include <sys/types.h>
8575 int main() { off64_t x = 7; }'
8578 if eval $compile; then
8580 echo "Yes, it does."
8583 echo "No, it doesn't."
8584 case "$lseeksize" in
8585 8) echo "(This is okay because your off_t is 64 bits wide.)" ;;
8592 : check for fpos64_t
8594 echo "Checking to see if your system supports fpos64_t..." >&4
8596 #include <sys/stdio.h>
8597 int main() { fpos64_t x x = 7; }'
8600 if eval $compile; then
8602 echo "Yes, it does."
8605 echo "No, it doesn't."
8607 8) echo "(This is okay because your fpos_t is 64 bits wide.)" >&4 ;;
8614 hasstruct='varname=$1; struct=$2; shift; shift;
8615 while $test $# -ge 2; do
8617 $define) echo "#include <$2>";;
8621 echo "int main () { struct $struct foo; }" >> try.c;
8623 if eval $compile; then
8632 : see if this is a sys/param system
8633 set sys/param.h i_sysparam
8636 : see if this is a sys/mount.h system
8637 set sys/mount.h i_sysmount
8640 : see if sys/types.h has to be included
8641 set sys/types.h i_systypes
8646 echo "Checking to see if your system supports struct fs_data..." >&4
8647 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8649 case "$d_fs_data_s" in
8650 "$define") echo "Yes, it does." ;;
8651 *) echo "No, it doesn't." ;;
8654 : see if fseeko exists
8658 : see if fsetpos exists
8659 set fsetpos d_fsetpos
8663 : see if fstatfs exists
8664 set fstatfs d_fstatfs
8668 : see if statvfs exists
8669 set statvfs d_statvfs
8672 : see if fstatvfs exists
8673 set fstatvfs d_fstatvfs
8677 : see if ftello exists
8681 : see if getgrent exists
8682 set getgrent d_getgrent
8685 : see if gethostbyaddr exists
8686 set gethostbyaddr d_gethbyaddr
8689 : see if gethostbyname exists
8690 set gethostbyname d_gethbyname
8693 : see if gethostent exists
8694 set gethostent d_gethent
8697 : see how we will look up host name
8700 if set gethostname val -f d_gethname; eval $csym; $val; then
8701 echo 'gethostname() found.' >&4
8702 d_gethname="$define"
8705 if set uname val -f d_uname; eval $csym; $val; then
8708 uname() was found, but you're running xenix, and older versions of xenix
8709 have a broken uname(). If you don't really know whether your xenix is old
8710 enough to have a broken system call, use the default answer.
8717 rp='Is your uname() broken?'
8720 n*) d_uname="$define"; call=uname;;
8723 echo 'uname() found.' >&4
8730 case "$d_gethname" in
8731 '') d_gethname="$undef";;
8734 '') d_uname="$undef";;
8736 case "$d_uname$d_gethname" in
8741 Every now and then someone has a $call() that lies about the hostname
8742 but can't be fixed for political or economic reasons. If you wish, I can
8743 pretend $call() isn't there and maybe compute hostname at run-time
8744 thanks to the '$phostname' command.
8747 rp="Shall I ignore $call() from now on?"
8750 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8753 case "$phostname" in
8755 *) case "$aphostname" in
8761 file=`./loc $file $file $pth`
8762 aphostname=`echo $file $*`
8767 case "$d_uname$d_gethname" in
8770 case "$phostname" in
8772 echo "There will be no way for $package to get your hostname." >&4;;
8774 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8778 case "$d_phostname" in
8779 '') d_phostname="$undef";;
8782 : see if this is a netdb.h system
8786 : see if prototypes for various gethostxxx netdb.h functions are available
8788 set d_gethostprotos gethostent $i_netdb netdb.h
8791 : see if getlogin exists
8792 set getlogin d_getlogin
8795 : see if getmnt exists
8799 : see if getmntent exists
8800 set getmntent d_getmntent
8803 : see if getnetbyaddr exists
8804 set getnetbyaddr d_getnbyaddr
8807 : see if getnetbyname exists
8808 set getnetbyname d_getnbyname
8811 : see if getnetent exists
8812 set getnetent d_getnent
8815 : see if prototypes for various getnetxxx netdb.h functions are available
8817 set d_getnetprotos getnetent $i_netdb netdb.h
8821 : see if getprotobyname exists
8822 set getprotobyname d_getpbyname
8825 : see if getprotobynumber exists
8826 set getprotobynumber d_getpbynumber
8829 : see if getprotoent exists
8830 set getprotoent d_getpent
8833 : see if getpgid exists
8834 set getpgid d_getpgid
8837 : see if getpgrp2 exists
8838 set getpgrp2 d_getpgrp2
8841 : see if getppid exists
8842 set getppid d_getppid
8845 : see if getpriority exists
8846 set getpriority d_getprior
8849 : see if prototypes for various getprotoxxx netdb.h functions are available
8851 set d_getprotoprotos getprotoent $i_netdb netdb.h
8854 : see if getpwent exists
8855 set getpwent d_getpwent
8859 : see if getservbyname exists
8860 set getservbyname d_getsbyname
8863 : see if getservbyport exists
8864 set getservbyport d_getsbyport
8867 : see if getservent exists
8868 set getservent d_getsent
8871 : see if prototypes for various getservxxx netdb.h functions are available
8873 set d_getservprotos getservent $i_netdb netdb.h
8876 : see if getspent exists
8877 set getspent d_getspent
8880 : see if getspnam exists
8881 set getspnam d_getspnam
8884 : see if gettimeofday or ftime exists
8885 set gettimeofday d_gettimeod
8887 case "$d_gettimeod" in
8893 val="$undef"; set d_ftime; eval $setvar
8896 case "$d_gettimeod$d_ftime" in
8899 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8903 : see if this is an grp system
8909 xxx=`./findhdr grp.h`
8910 $cppstdin $cppflags $cppminus < $xxx >$$.h
8912 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8924 set d_grpasswd; eval $setvar
8928 : see if hasmntopt exists
8929 set hasmntopt d_hasmntopt
8932 : see if this is a netinet/in.h or sys/in.h system
8933 set netinet/in.h i_niin sys/in.h i_sysin
8936 : see if arpa/inet.h has to be included
8937 set arpa/inet.h i_arpainet
8940 : see if htonl --and friends-- exists
8945 : Maybe they are macros.
8950 #include <sys/types.h>
8951 #$i_niin I_NETINET_IN
8953 #$i_arpainet I_ARPA_INET
8955 #include <netinet/in.h>
8961 #include <arpa/inet.h>
8964 printf("Defined as a macro.");
8967 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8968 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8970 echo "But it seems to be defined as a macro." >&4
8980 if set index val -f; eval $csym; $val; then
8981 if set strchr val -f d_strchr; eval $csym; $val; then
8982 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8985 echo "strchr() found." >&4
8989 echo "index() found." >&4
8994 echo "index() found." >&4
8997 if set strchr val -f d_strchr; eval $csym; $val; then
9000 echo "strchr() found." >&4
9002 echo "No index() or strchr() found!" >&4
9007 set d_strchr; eval $setvar
9009 set d_index; eval $setvar
9011 : check whether inet_aton exists
9012 set inet_aton d_inetaton
9015 : see if inttypes.h is available
9016 : we want a real compile instead of Inhdr because some systems
9017 : have an inttypes.h which includes non-existent headers
9020 #include <inttypes.h>
9022 static int32_t foo32 = 0x12345678;
9026 if eval $compile; then
9027 echo "<inttypes.h> found." >&4
9030 echo "<inttypes.h> NOT found." >&4
9039 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9041 #include <sys/types.h>
9042 #$i_inttypes I_INTTYPES
9044 #include <inttypes.h>
9046 int main() { int64_t x = 7; }
9049 if eval $compile; then
9051 echo " Yes, it does." >&4
9054 echo " No, it doesn't." >&4
9062 $cat >isascii.c <<'EOCP'
9074 if eval $compile; then
9075 echo "isascii() found." >&4
9078 echo "isascii() NOT found." >&4
9085 : see if killpg exists
9089 : see if lchown exists
9091 $cat > try.c <<'EOCP'
9092 /* System header to define __stub macros and hopefully few prototypes,
9093 which can conflict with char lchown(); below. */
9095 /* Override any gcc2 internal prototype to avoid an error. */
9096 /* We use char because int might match the return type of a gcc2
9097 builtin and then its argument prototype would still apply. */
9100 /* The GNU C library defines this for functions which it implements
9101 to always fail with ENOSYS. Some functions are actually named
9102 something starting with __ and the normal name is an alias. */
9103 #if defined (__stub_lchown) || defined (__stub___lchown)
9111 if eval $compile; then
9112 $echo "lchown() found." >&4
9115 $echo "lchown() NOT found." >&4
9121 : See if number of significant digits in a double precision number is known
9123 $cat >ldbl_dig.c <<EOM
9133 printf("Contains LDBL_DIG");
9136 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9137 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9138 echo "LDBL_DIG found." >&4
9141 echo "LDBL_DIG NOT found." >&4
9148 : see if link exists
9152 : see if localeconv exists
9153 set localeconv d_locconv
9156 : see if lockf exists
9160 : check for long long
9162 $echo $n "Checking to see if your system supports long long..." $c >&4
9163 echo 'int main() { long long x = 7; return 0; }' > try.c
9165 if eval $compile; then
9167 echo " Yes, it does." >&4
9170 echo " No, it doesn't." >&4
9176 : check for length of long long
9177 case "${d_longlong}${longlongsize}" in
9180 $echo $n "Checking to see how big your long longs are..." $c >&4
9181 $cat >try.c <<'EOCP'
9185 printf("%d\n", (int)sizeof(long long));
9190 if eval $compile_ok; then
9191 longlongsize=`./try$exe_ext`
9192 $echo " $longlongsize bytes." >&4
9196 echo "(I can't seem to compile the test program. Guessing...)"
9197 rp="What is the size of a long long (in bytes)?"
9201 if $test "X$longsize" = "X$longlongsize"; then
9202 echo "(That isn't any different from an ordinary long.)"
9208 : see if lstat exists
9212 : see if mblen exists
9216 : see if mbstowcs exists
9217 set mbstowcs d_mbstowcs
9220 : see if mbtowc exists
9224 : see if memchr exists
9228 : see if memcmp exists
9232 : see if memcpy exists
9236 : see if memmove exists
9237 set memmove d_memmove
9240 : see if memset exists
9244 : see if mkdir exists
9248 : see if mkfifo exists
9252 : see if mktime exists
9256 : see if msgctl exists
9260 : see if msgget exists
9264 : see if msgsnd exists
9268 : see if msgrcv exists
9272 : see how much of the 'msg*(2)' library is present.
9275 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9276 *"$undef"*) h_msg=false;;
9280 case "`ipcs 2>&1`" in
9281 "SVID messages"*"not configured"*)
9282 echo "Your $osname does not have the msg*(2) configured." >&4
9297 : we could also check for sys/ipc.h ...
9298 if $h_msg && $test `./findhdr sys/msg.h`; then
9299 echo "You have the full msg*(2) library." >&4
9302 echo "You don't have the full msg*(2) library." >&4
9308 : see if nice exists
9312 : see if POSIX threads are available
9313 set pthread.h i_pthread
9319 : how to create joinable pthreads
9320 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9322 echo "Checking what constant to use for creating joinable pthreads..." >&4
9323 $cat >try.c <<'EOCP'
9324 #include <pthread.h>
9326 int detachstate = JOINABLE;
9329 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9330 if eval $compile; then
9331 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9332 val="$undef" # Yes, undef.
9333 set d_old_pthread_create_joinable
9336 set old_pthread_create_joinable
9339 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9340 if eval $compile; then
9341 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9343 set d_old_pthread_create_joinable
9345 val=PTHREAD_CREATE_UNDETACHED
9346 set old_pthread_create_joinable
9349 set try -DJOINABLE=__UNDETACHED
9350 if eval $compile; then
9351 echo "You seem to use __UNDETACHED." >&4
9353 set d_old_pthread_create_joinable
9356 set old_pthread_create_joinable
9359 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9361 set d_old_pthread_create_joinable
9364 set old_pthread_create_joinable
9371 d_old_pthread_create_joinable="$undef"
9372 old_pthread_create_joinable=""
9375 : see if pause exists
9379 : see if pipe exists
9383 : see if poll exists
9388 : see whether the various POSIXish _yields exist
9390 #include <pthread.h>
9396 #ifdef PTHREAD_YIELD
9399 #ifdef PTHREAD_YIELD_NULL
9400 pthread_yield(NULL);
9406 : see if sched_yield exists
9407 set try -DSCHED_YIELD
9408 if eval $compile; then
9410 sched_yield='sched_yield()'
9414 case "$usethreads" in
9417 $define) echo 'sched_yield() found.' >&4 ;;
9418 *) echo 'sched_yield() NOT found.' >&4 ;;
9424 : see if pthread_yield exists
9425 set try -DPTHREAD_YIELD
9426 if eval $compile; then
9428 case "$sched_yield" in
9429 '') sched_yield='pthread_yield()' ;;
9432 set try -DPTHREAD_YIELD_NULL
9433 if eval $compile; then
9435 case "$sched_yield" in
9436 '') sched_yield='pthread_yield(NULL)' ;;
9442 case "$usethreads" in
9445 $define) echo 'pthread_yield() found.' >&4 ;;
9446 *) echo 'pthread_yield() NOT found.' >&4 ;;
9453 case "$sched_yield" in
9454 '') sched_yield=undef ;;
9459 : see if this is a pwd.h system
9465 xxx=`./findhdr pwd.h`
9466 $cppstdin $cppflags $cppminus < $xxx >$$.h
9468 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9476 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9484 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9492 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9500 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9508 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9516 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9524 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9536 set d_pwquota; eval $setvar
9537 set d_pwage; eval $setvar
9538 set d_pwchange; eval $setvar
9539 set d_pwclass; eval $setvar
9540 set d_pwexpire; eval $setvar
9541 set d_pwcomment; eval $setvar
9542 set d_pwgecos; eval $setvar
9543 set d_pwpasswd; eval $setvar
9549 echo "Checking which 64-bit integer type we could use..." >&4
9555 val='"unsigned int"'
9560 *) case "$longsize" in
9564 val='"unsigned long"'
9569 *) case "$uselonglong:$d_longlong:$longlongsize" in
9574 val='"unsigned long long"'
9579 *) case "$d_int64t" in
9598 '') case "$uselonglong:$d_longlong:$longlongsize" in
9600 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9601 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9605 *) echo "We could use '$quadtype' for 64-bit integers." >&4
9610 : see if readdir and friends exist
9611 set readdir d_readdir
9613 set seekdir d_seekdir
9615 set telldir d_telldir
9617 set rewinddir d_rewinddir
9620 : see if readlink exists
9621 set readlink d_readlink
9624 : see if rename exists
9628 : see if rmdir exists
9632 : see if memory.h is available.
9637 : See if it conflicts with string.h
9643 $cppstdin $cppflags $cppminus < $strings > mem.h
9644 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9646 echo "We won't be including <memory.h>."
9656 : can bcopy handle overlapping blocks?
9661 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9668 $cat >>try.c <<'EOCP'
9671 # include <memory.h>
9674 # include <stdlib.h>
9677 # include <string.h>
9679 # include <strings.h>
9682 # include <unistd.h> /* Needed for NetBSD */
9686 char buf[128], abc[128];
9692 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9694 for (align = 7; align >= 0; align--) {
9695 for (len = 36; len; len--) {
9698 for (off = 1; off <= len; off++) {
9699 bcopy(b, b+off, len);
9700 bcopy(b+off, b, len);
9701 if (bcmp(b, abc, len))
9710 if eval $compile_ok; then
9711 if ./try 2>/dev/null; then
9715 echo "It can't, sorry."
9716 case "$d_memmove" in
9717 "$define") echo "But that's Ok since you have memmove()." ;;
9721 echo "(I can't compile the test program, so we'll assume not...)"
9722 case "$d_memmove" in
9723 "$define") echo "But that's Ok since you have memmove()." ;;
9728 $rm -f try.* try core
9732 : can memcpy handle overlapping blocks?
9737 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9744 $cat >>try.c <<'EOCP'
9747 # include <memory.h>
9750 # include <stdlib.h>
9753 # include <string.h>
9755 # include <strings.h>
9758 # include <unistd.h> /* Needed for NetBSD */
9762 char buf[128], abc[128];
9768 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9769 try to store the string in read-only memory. */
9770 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9772 for (align = 7; align >= 0; align--) {
9773 for (len = 36; len; len--) {
9775 memcpy(b, abc, len);
9776 for (off = 1; off <= len; off++) {
9777 memcpy(b+off, b, len);
9778 memcpy(b, b+off, len);
9779 if (memcmp(b, abc, len))
9788 if eval $compile_ok; then
9789 if ./try 2>/dev/null; then
9793 echo "It can't, sorry."
9794 case "$d_memmove" in
9795 "$define") echo "But that's Ok since you have memmove()." ;;
9799 echo "(I can't compile the test program, so we'll assume not...)"
9800 case "$d_memmove" in
9801 "$define") echo "But that's Ok since you have memmove()." ;;
9806 $rm -f try.* try core
9810 : can memcmp be trusted to compare relative magnitude?
9815 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9822 $cat >>try.c <<'EOCP'
9825 # include <memory.h>
9828 # include <stdlib.h>
9831 # include <string.h>
9833 # include <strings.h>
9836 # include <unistd.h> /* Needed for NetBSD */
9842 if ((a < b) && memcmp(&a, &b, 1) < 0)
9848 if eval $compile_ok; then
9849 if ./try 2>/dev/null; then
9853 echo "No, it can't (it uses signed chars)."
9856 echo "(I can't compile the test program, so we'll assume not...)"
9860 $rm -f try.* try core
9864 : see if select exists
9868 : see if semctl exists
9872 : see if semget exists
9876 : see if semop exists
9880 : see how much of the 'sem*(2)' library is present.
9883 case "$d_semctl$d_semget$d_semop" in
9884 *"$undef"*) h_sem=false;;
9888 case "`ipcs 2>&1`" in
9889 "SVID messages"*"not configured"*)
9890 echo "Your $osname does not have the sem*(2) configured." >&4
9903 : we could also check for sys/ipc.h ...
9904 if $h_sem && $test `./findhdr sys/sem.h`; then
9905 echo "You have the full sem*(2) library." >&4
9908 echo "You don't have the full sem*(2) library." >&4
9914 : see whether sys/sem.h defines union semun
9916 $cat > try.c <<'END'
9917 #include <sys/types.h>
9918 #include <sys/ipc.h>
9919 #include <sys/sem.h>
9920 int main () { union semun semun; semun.buf = 0; }
9923 if eval $compile; then
9924 echo "You have union semun in <sys/sem.h>." >&4
9927 echo "You do not have union semun in <sys/sem.h>." >&4
9930 $rm -f try try.c try.h
9934 : see how to do semctl IPC_STAT
9937 : see whether semctl IPC_STAT can use union semun
9942 # define S_IRUSR S_IREAD
9943 # define S_IWUSR S_IWRITE
9944 # define S_IXUSR S_IEXEC
9946 # define S_IRUSR 0400
9947 # define S_IWUSR 0200
9948 # define S_IXUSR 0100
9950 # define S_IRGRP (S_IRUSR>>3)
9951 # define S_IWGRP (S_IWUSR>>3)
9952 # define S_IXGRP (S_IXUSR>>3)
9953 # define S_IROTH (S_IRUSR>>6)
9954 # define S_IWOTH (S_IWUSR>>6)
9955 # define S_IXOTH (S_IXUSR>>6)
9958 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9959 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9960 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9965 #include <sys/types.h>
9966 #include <sys/ipc.h>
9967 #include <sys/sem.h>
9968 #include <sys/stat.h>
9975 #$d_union_semun HAS_UNION_SEMUN
9978 #ifndef HAS_UNION_SEMUN
9981 struct semid_ds *buf;
9982 unsigned short *array;
9988 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9989 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9991 struct semid_ds argbuf;
9994 st = semctl(sem, 0, IPC_STAT, arg);
9998 # endif /* IPC_STAT */
9999 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10001 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10002 # endif /* IPC_RMID */
10003 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10005 #endif /* IPC_PRIVATE && ... */
10006 printf("semget failed: errno = %d\n", errno);
10012 if eval $compile; then
10015 semun) val="$define" ;;
10021 case "$d_semctl_semun" in
10023 echo "You can use union semun for semctl IPC_STAT." >&4
10026 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10031 : see whether semctl IPC_STAT can use struct semid_ds pointer
10032 $cat > try.c <<'END'
10033 #include <sys/types.h>
10034 #include <sys/ipc.h>
10035 #include <sys/sem.h>
10036 #include <sys/stat.h>
10044 struct semid_ds arg;
10047 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10048 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10051 st = semctl(sem, 0, IPC_STAT, &arg);
10053 printf("semid_ds\n");
10055 # endif /* IPC_STAT */
10056 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10058 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10059 # endif /* IPC_RMID */
10060 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10062 #endif /* IPC_PRIVATE && ... */
10063 printf("semget failed: errno = %d\n", errno);
10070 if eval $compile; then
10073 semid_ds) val="$define" ;;
10077 set d_semctl_semid_ds
10079 case "$d_semctl_semid_ds" in
10081 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10083 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10090 # We do not have the full sem*(2) library, so assume we can not
10096 set d_semctl_semid_ds
10101 : see if setegid exists
10102 set setegid d_setegid
10105 : see if seteuid exists
10106 set seteuid d_seteuid
10109 : see if setgrent exists
10110 set setgrent d_setgrent
10113 : see if sethostent exists
10114 set sethostent d_sethent
10117 : see if setlinebuf exists
10118 set setlinebuf d_setlinebuf
10121 : see if setlocale exists
10122 set setlocale d_setlocale
10125 : see if setnetent exists
10126 set setnetent d_setnent
10129 : see if setprotoent exists
10130 set setprotoent d_setpent
10133 : see if setpgid exists
10134 set setpgid d_setpgid
10137 : see if setpgrp2 exists
10138 set setpgrp2 d_setpgrp2
10141 : see if setpriority exists
10142 set setpriority d_setprior
10145 : see if setpwent exists
10146 set setpwent d_setpwent
10149 : see if setregid exists
10150 set setregid d_setregid
10152 set setresgid d_setresgid
10155 : see if setreuid exists
10156 set setreuid d_setreuid
10158 set setresuid d_setresuid
10161 : see if setrgid exists
10162 set setrgid d_setrgid
10165 : see if setruid exists
10166 set setruid d_setruid
10169 : see if setservent exists
10170 set setservent d_setsent
10173 : see if setsid exists
10174 set setsid d_setsid
10177 : see if setspent exists
10178 set setspent d_setspent
10181 : see if setvbuf exists
10182 set setvbuf d_setvbuf
10185 : see if sfio.h is available
10190 : see if sfio library is available
10201 : Ok, but do we want to use it.
10205 true|$define|[yY]*) dflt='y';;
10208 echo "$package can use the sfio library, but it is experimental."
10209 rp="You seem to have sfio available, do you want to try using it?"
10213 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10215 : Remove sfio from list of libraries to use
10216 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10219 echo "libs = $libs" >&4
10223 *) case "$usesfio" in
10224 true|$define|[yY]*)
10225 echo "Sorry, cannot find sfio on this machine" >&4
10226 echo "Ignoring your setting of usesfio=$usesfio" >&4
10234 $define) usesfio='true';;
10235 *) usesfio='false';;
10238 : see if shmctl exists
10239 set shmctl d_shmctl
10242 : see if shmget exists
10243 set shmget d_shmget
10246 : see if shmat exists
10249 : see what shmat returns
10252 $cat >shmat.c <<'END'
10253 #include <sys/shm.h>
10256 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10261 echo "and it returns ($shmattype)." >&4
10262 : see if a prototype for shmat is available
10263 xxx=`./findhdr sys/shm.h`
10264 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10265 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10276 set d_shmatprototype
10279 : see if shmdt exists
10283 : see how much of the 'shm*(2)' library is present.
10286 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10287 *"$undef"*) h_shm=false;;
10291 case "`ipcs 2>&1`" in
10292 "SVID shared memory"*"not configured"*)
10293 echo "Your $osname does not have the shm*(2) configured." >&4
10296 set shmctl d_shmctl
10298 set shmget d_shmget
10308 : we could also check for sys/ipc.h ...
10309 if $h_shm && $test `./findhdr sys/shm.h`; then
10310 echo "You have the full shm*(2) library." >&4
10313 echo "You don't have the full shm*(2) library." >&4
10320 : see if we have sigaction
10321 if set sigaction val -f d_sigaction; eval $csym; $val; then
10322 echo 'sigaction() found.' >&4
10323 $cat > try.c <<'EOP'
10325 #include <sys/types.h>
10326 #include <signal.h>
10329 struct sigaction act, oact;
10331 oact.sa_handler = 0;
10332 /* so that act and oact are used */
10333 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10337 if eval $compile_ok; then
10340 echo "But you don't seem to have a useable struct sigaction." >&4
10344 echo 'sigaction NOT found.' >&4
10347 set d_sigaction; eval $setvar
10348 $rm -f try try$_o try.c
10350 : see if sigsetjmp exists
10352 case "$d_sigsetjmp" in
10354 $cat >try.c <<'EOP'
10355 #include <setjmp.h>
10360 if (sigsetjmp(env,1))
10363 siglongjmp(env, 1);
10368 if eval $compile; then
10369 if ./try >/dev/null 2>&1; then
10370 echo "POSIX sigsetjmp found." >&4
10374 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10380 echo "sigsetjmp not found." >&4
10384 *) val="$d_sigsetjmp"
10385 case "$d_sigsetjmp" in
10386 $define) echo "POSIX sigsetjmp found." >&4;;
10387 $undef) echo "sigsetjmp not found." >&4;;
10395 : see if sqrtl exists
10399 : see if sys/stat.h is available
10400 set sys/stat.h i_sysstat
10404 : see if stat knows about block sizes
10406 echo "Checking to see if your struct stat has st_blocks field..." >&4
10407 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10411 : see if this is a sys/vfs.h system
10412 set sys/vfs.h i_sysvfs
10416 : see if this is a sys/statfs.h system
10417 set sys/statfs.h i_sysstatfs
10422 echo "Checking to see if your system supports struct statfs..." >&4
10423 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
10425 case "$d_statfs_s" in
10426 "$define") echo "Yes, it does." ;;
10427 *) echo "No, it doesn't." ;;
10432 : see if struct statfs knows about f_flags
10433 case "$d_statfs_s" in
10436 echo "Checking to see if your struct statfs has f_flags field..." >&4
10437 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
10441 set d_statfs_f_flags
10445 case "$d_statfs_f_flags" in
10446 "$define") echo "Yes, it does." ;;
10447 *) echo "No, it doesn't." ;;
10450 : see if _ptr and _cnt from stdio act std
10452 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10453 echo "(Looks like you have stdio.h from Linux.)"
10454 case "$stdio_ptr" in
10455 '') stdio_ptr='((fp)->_IO_read_ptr)'
10458 *) ptr_lval=$d_stdio_ptr_lval;;
10460 case "$stdio_cnt" in
10461 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10464 *) cnt_lval=$d_stdio_cnt_lval;;
10466 case "$stdio_base" in
10467 '') stdio_base='((fp)->_IO_read_base)';;
10469 case "$stdio_bufsiz" in
10470 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10473 case "$stdio_ptr" in
10474 '') stdio_ptr='((fp)->_ptr)'
10477 *) ptr_lval=$d_stdio_ptr_lval;;
10479 case "$stdio_cnt" in
10480 '') stdio_cnt='((fp)->_cnt)'
10483 *) cnt_lval=$d_stdio_cnt_lval;;
10485 case "$stdio_base" in
10486 '') stdio_base='((fp)->_base)';;
10488 case "$stdio_bufsiz" in
10489 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10492 : test whether _ptr and _cnt really work
10493 echo "Checking how std your stdio is..." >&4
10496 #define FILE_ptr(fp) $stdio_ptr
10497 #define FILE_cnt(fp) $stdio_cnt
10499 FILE *fp = fopen("try.c", "r");
10502 18 <= FILE_cnt(fp) &&
10503 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10511 if eval $compile; then
10513 echo "Your stdio acts pretty std."
10516 echo "Your stdio isn't very std."
10519 echo "Your stdio doesn't appear very std."
10525 : Can _ptr be used as an lvalue?
10526 case "$d_stdstdio$ptr_lval" in
10527 $define$define) val=$define ;;
10530 set d_stdio_ptr_lval
10533 : Can _cnt be used as an lvalue?
10534 case "$d_stdstdio$cnt_lval" in
10535 $define$define) val=$define ;;
10538 set d_stdio_cnt_lval
10541 : see if _base is also standard
10543 case "$d_stdstdio" in
10547 #define FILE_base(fp) $stdio_base
10548 #define FILE_bufsiz(fp) $stdio_bufsiz
10550 FILE *fp = fopen("try.c", "r");
10553 19 <= FILE_bufsiz(fp) &&
10554 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10561 if eval $compile; then
10563 echo "And its _base field acts std."
10566 echo "But its _base field isn't std."
10569 echo "However, it seems to be lacking the _base field."
10578 Checking how to access stdio streams by file descriptor number...
10580 case "$stdio_stream_array" in
10581 '') $cat >try.c <<EOCP
10584 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10588 for s in _iob __iob __sF
10590 set try -DSTDIO_STREAM_ARRAY=$s
10591 if eval $compile; then
10592 case "`./try$exe_ext`" in
10593 yes) stdio_stream_array=$s; break ;;
10597 $rm -f try.* try$exe_ext
10599 case "$stdio_stream_array" in
10601 I can't figure out how to access stdio streams by file descriptor number.
10603 d_stdio_stream_array="$undef"
10606 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10608 d_stdio_stream_array="$define"
10612 : see if strcoll exists
10613 set strcoll d_strcoll
10616 : check for structure copying
10618 echo "Checking to see if your C compiler can copy structs..." >&4
10619 $cat >try.c <<'EOCP'
10629 if $cc -c try.c >/dev/null 2>&1 ; then
10631 echo "Yup, it can."
10634 echo "Nope, it can't."
10640 : see if strerror and/or sys_errlist[] exist
10642 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10643 if set strerror val -f d_strerror; eval $csym; $val; then
10644 echo 'strerror() found.' >&4
10645 d_strerror="$define"
10646 d_strerrm='strerror(e)'
10647 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10648 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10649 d_syserrlst="$define"
10651 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10652 d_syserrlst="$undef"
10654 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10655 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10656 echo 'strerror() found in string header.' >&4
10657 d_strerror="$define"
10658 d_strerrm='strerror(e)'
10659 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10660 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10661 d_syserrlst="$define"
10663 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10664 d_syserrlst="$undef"
10666 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10667 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10668 d_strerror="$undef"
10669 d_syserrlst="$define"
10670 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10672 echo 'strerror() and sys_errlist[] NOT found.' >&4
10673 d_strerror="$undef"
10674 d_syserrlst="$undef"
10675 d_strerrm='"unknown"'
10679 : see if strtod exists
10680 set strtod d_strtod
10683 : see if strtol exists
10684 set strtol d_strtol
10687 : see if strtoul exists
10688 set strtoul d_strtoul
10691 : see if strtoull exists
10692 set strtoull d_strtoull
10695 : see if strxfrm exists
10696 set strxfrm d_strxfrm
10699 : see if symlink exists
10700 set symlink d_symlink
10703 : see if syscall exists
10704 set syscall d_syscall
10707 : see if sysconf exists
10708 set sysconf d_sysconf
10711 : see if system exists
10712 set system d_system
10715 : see if tcgetpgrp exists
10716 set tcgetpgrp d_tcgetpgrp
10719 : see if tcsetpgrp exists
10720 set tcsetpgrp d_tcsetpgrp
10723 : see if prototype for telldir is available
10725 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10728 : see if this is a sys/times.h system
10729 set sys/times.h i_systimes
10732 : see if times exists
10734 if set times val -f d_times; eval $csym; $val; then
10735 echo 'times() found.' >&4
10738 case "$i_systimes" in
10739 "$define") inc='sys/times.h';;
10741 rp="What is the type returned by times() on this system?"
10742 set clock_t clocktype long stdio.h sys/types.h $inc
10745 echo 'times() NOT found, hope that will do.' >&4
10750 : see if truncate exists
10751 set truncate d_truncate
10754 : see if tzname[] exists
10756 if set tzname val -a d_tzname; eval $csym; $val; then
10758 echo 'tzname[] found.' >&4
10761 echo 'tzname[] NOT found.' >&4
10766 : see if umask exists
10770 : see if ustat exists
10774 : backward compatibility for d_hvfork
10775 if test X$d_hvfork != X; then
10776 d_vfork="$d_hvfork"
10779 : see if there is a vfork
10784 : Ok, but do we want to use it. vfork is reportedly unreliable in
10785 : perl on Solaris 2.x, and probably elsewhere.
10789 case "$usevfork" in
10795 Perl can only use a vfork() that doesn't suffer from strict
10796 restrictions on calling functions or modifying global data in
10797 the child. For example, glibc-2.1 contains such a vfork()
10798 that is unsuitable. If your system provides a proper fork()
10799 call, chances are that you do NOT want perl to use vfork().
10802 rp="Do you still want to use vfork()?"
10807 echo "Ok, we won't use vfork()."
10816 $define) usevfork='true';;
10817 *) usevfork='false';;
10820 : see if this is an sysdir system
10821 set sys/dir.h i_sysdir
10824 : see if this is an sysndir system
10825 set sys/ndir.h i_sysndir
10828 : see if closedir exists
10829 set closedir d_closedir
10832 case "$d_closedir" in
10835 echo "Checking whether closedir() returns a status..." >&4
10836 cat > closedir.c <<EOM
10837 #$i_dirent I_DIRENT /**/
10838 #$i_sysdir I_SYS_DIR /**/
10839 #$i_sysndir I_SYS_NDIR /**/
10840 #$i_systypes I_SYS_TYPES /**/
10842 #if defined(I_SYS_TYPES)
10843 #include <sys/types.h>
10845 #if defined(I_DIRENT)
10846 #include <dirent.h>
10847 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10848 #include <sys/dir.h>
10852 #include <sys/ndir.h>
10856 #include <ndir.h> /* may be wrong in the future */
10858 #include <sys/dir.h>
10863 int main() { return closedir(opendir(".")); }
10866 if eval $compile_ok; then
10867 if ./closedir > /dev/null 2>&1 ; then
10868 echo "Yes, it does."
10871 echo "No, it doesn't."
10875 echo "(I can't seem to compile the test program--assuming it doesn't)"
10883 set d_void_closedir
10886 : check for volatile keyword
10888 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10889 $cat >try.c <<'EOCP'
10892 typedef struct _goo_struct goo_struct;
10893 goo_struct * volatile goo = ((goo_struct *)0);
10894 struct _goo_struct {
10899 typedef unsigned short foo_t;
10900 char *volatile foo;
10902 volatile foo_t blech;
10906 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10908 echo "Yup, it does."
10911 echo "Nope, it doesn't."
10917 : see if there is a wait4
10921 : see if waitpid exists
10922 set waitpid d_waitpid
10925 : see if wcstombs exists
10926 set wcstombs d_wcstombs
10929 : see if wctomb exists
10930 set wctomb d_wctomb
10933 : preserve RCS keywords in files with variable substitution, grrr
10938 Revision='$Revision'
10940 case "$crosscompile" in
10941 ''|[nN]*) crosscompile="$undef" ;;
10945 next|rhapsody) multiarch="$define" ;;
10947 case "$multiarch" in
10948 ''|[nN]*) multiarch="$undef" ;;
10951 : check for alignment requirements
10953 case "$crosscompile$multiarch" in
10956 You seem to be either cross-compiling or doing a multiarchitecture build,
10957 skipping the memory alignment check.
10960 case "$alignbytes" in
10961 '') alignbytes=8 ;;
10965 case "$alignbytes" in
10966 '') echo "Checking alignment constraints..." >&4
10967 $cat >try.c <<'EOCP'
10975 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
10980 if eval $compile_ok; then
10984 echo "(I can't seem to compile the test program...)"
10987 *) dflt="$alignbytes"
10990 rp="Doubles must be aligned on a how-many-byte boundary?"
10998 : check for ordering of bytes in a long
11000 case "$crosscompile$multiarch" in
11003 You seem to be either cross-compiling or doing a multiarchitecture build,
11004 skipping the byteorder check.
11010 case "$byteorder" in
11013 In the following, larger digits indicate more significance. A big-endian
11014 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11015 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11016 machines may have weird orders like 3412. A Cray will report 87654321,
11017 an Alpha will report 12345678. If the test program works the default is
11019 I'm now running the test program...
11021 $cat >try.c <<'EOCP'
11028 char c[sizeof(long)];
11031 if (sizeof(long) > 4)
11032 u.l = (0x08070605L << 32) | 0x04030201L;
11035 for (i = 0; i < sizeof(long); i++)
11036 printf("%c", u.c[i]+'0');
11043 if eval $compile && ./try > /dev/null; then
11046 [1-4][1-4][1-4][1-4]|12345678|87654321)
11047 echo "(The test program ran ok.)"
11048 echo "byteorder=$dflt"
11051 ????|????????) echo "(The test program ran ok.)" ;;
11052 *) echo "(The test program didn't run right for some reason.)" ;;
11057 (I can't seem to compile the test program. Guessing big-endian...)
11060 case "$xxx_prompt" in
11062 rp="What is the order of bytes in a long?"
11076 : how do we catenate cpp tokens here?
11078 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11079 $cat >cpp_stuff.c <<'EOCP'
11080 #define RCAT(a,b)a/**/b
11081 #define ACAT(a,b)a ## b
11085 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11086 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11087 echo "Oh! Smells like ANSI's been here." >&4
11088 echo "We can catify or stringify, separately or together!"
11090 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11091 echo "Ah, yes! The good old days!" >&4
11092 echo "However, in the good old days we don't know how to stringify and"
11093 echo "catify at the same time."
11097 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11098 to have to edit the values of CAT[2-5] in config.h...
11100 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11104 : see if this is a db.h system
11110 : Check db version.
11112 echo "Checking Berkeley DB version ..." >&4
11118 #include <sys/types.h>
11123 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11124 int Major, Minor, Patch ;
11125 unsigned long Version ;
11126 (void)db_version(&Major, &Minor, &Patch) ;
11127 printf("You have Berkeley DB Version 2 or greater\n");
11129 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11130 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11131 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11132 Major, Minor, Patch) ;
11134 /* check that db.h & libdb are compatible */
11135 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11136 printf("db.h and libdb are incompatible\n") ;
11140 printf("db.h and libdb are compatible\n") ;
11142 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11143 + DB_VERSION_PATCH ;
11145 /* needs to be >= 2.3.4 */
11146 if (Version < 2003004) {
11147 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11148 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11154 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11155 printf("You have Berkeley DB Version 1\n");
11156 exit(0); /* DB version < 2: the coast is clear. */
11158 exit(1); /* <db.h> not Berkeley DB? */
11164 if eval $compile && ./try; then
11165 echo 'Looks OK.' >&4
11167 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11171 : Remove db from list of libraries to use
11172 echo "Removing unusable -ldb from library list" >&4
11173 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11176 echo "libs = $libs" >&4
11186 : Check the return type needed for hash
11188 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11194 #include <sys/types.h>
11197 #ifndef DB_VERSION_MAJOR
11198 u_int32_t hash_cb (ptr, size)
11206 info.hash = hash_cb;
11210 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11211 if $contains warning try.out >>/dev/null 2>&1 ; then
11214 db_hashtype='u_int32_t'
11217 : XXX Maybe we should just give up here.
11218 db_hashtype=u_int32_t
11220 echo "Help: I can't seem to compile the db test program." >&4
11221 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11224 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11226 *) db_hashtype=u_int32_t
11231 : Check the return type needed for prefix
11233 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11239 #include <sys/types.h>
11242 #ifndef DB_VERSION_MAJOR
11243 size_t prefix_cb (key1, key2)
11251 info.prefix = prefix_cb;
11255 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11256 if $contains warning try.out >>/dev/null 2>&1 ; then
11257 db_prefixtype='int'
11259 db_prefixtype='size_t'
11262 db_prefixtype='size_t'
11263 : XXX Maybe we should just give up here.
11265 echo "Help: I can't seem to compile the db test program." >&4
11266 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11269 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11271 *) db_prefixtype='size_t'
11275 : check for void type
11277 echo "Checking to see how well your C compiler groks the void type..." >&4
11278 case "$voidflags" in
11280 $cat >try.c <<'EOCP'
11286 extern void moo(); /* function returning void */
11287 void (*goo)(); /* ptr to func returning void */
11289 void *hue; /* generic ptr */
11302 int main() { sub(); }
11304 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11305 voidflags=$defvoidused
11306 echo "Good. It appears to support void to the level $package wants.">&4
11307 if $contains warning .out >/dev/null 2>&1; then
11308 echo "However, you might get some warnings that look like this:"
11312 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11313 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11314 echo "It supports 1..."
11315 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11316 echo "It also supports 2..."
11317 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11319 echo "And it supports 4 but not 8 definitely."
11321 echo "It doesn't support 4..."
11322 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11324 echo "But it supports 8."
11327 echo "Neither does it support 8."
11331 echo "It does not support 2..."
11332 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11334 echo "But it supports 4 and 8."
11336 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11338 echo "And it supports 4 but has not heard about 8."
11340 echo "However it supports 8 but not 4."
11345 echo "There is no support at all for void."
11350 case "$voidflags" in
11352 *) $cat >&4 <<'EOM'
11353 Support flag bits are:
11354 1: basic void declarations.
11355 2: arrays of pointers to functions returning void.
11356 4: operations between pointers to and addresses of void functions.
11357 8: generic void pointers.
11360 rp="Your void support flags add up to what?"
11368 : How can we generate normalized random numbers ?
11370 echo "Looking for a random number function..." >&4
11371 case "$randfunc" in
11373 if set drand48 val -f; eval $csym; $val; then
11375 echo "Good, found drand48()." >&4
11376 elif set random val -f; eval $csym; $val; then
11378 echo "OK, found random()." >&4
11381 echo "Yick, looks like I have to use rand()." >&4
11392 *-Dmy_rand=*|*-Dmy_srand=*)
11393 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11394 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11395 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11396 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11400 while $test "$cont"; do
11401 rp="Use which function to generate random numbers?"
11403 if $test "$ans" = "$dflt"; then
11409 if set $ans val -f; eval $csym; $val; then
11413 rp="I cannot find function $ans. Use that name anyway?"
11422 case "$randfunc" in
11424 drand01="drand48()"
11430 case "$randbits" in
11432 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11434 #$i_unistd I_UNISTD
11435 #$i_stdlib I_STDLIB
11438 # include <unistd.h>
11441 # include <stdlib.h>
11446 register unsigned long tmp;
11447 register unsigned long max = 0L;
11449 for (i = 1000; i; i--) {
11450 tmp = (unsigned long) $randfunc();
11451 if (tmp > max) max = tmp;
11453 for (i = 0; max; i++)
11459 if eval $compile_ok; then
11463 echo "(I can't seem to compile the test program...)"
11470 rp="How many bits does your $randfunc() function produce?"
11474 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11475 seedfunc="s$randfunc"
11476 randseedtype=unsigned
11480 rp="How many bits does your $randfunc() function produce?"
11483 seedfunc="s$randfunc"
11484 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11485 if set $seedfunc val -f; eval $csym; $val; then
11486 echo "(Using $seedfunc() to seed random generator)"
11488 echo "(Warning: no $seedfunc() to seed random generator)"
11491 randseedtype=unsigned
11499 echo "Determining whether or not we are on an EBCDIC system..." >&4
11500 $cat >tebcdic.c <<'EOM'
11503 if ('M'==0xd4) return 0;
11510 if eval $compile_ok; then
11512 echo "You have EBCDIC." >&4
11515 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11518 echo "I'm unable to compile the test program." >&4
11519 echo "I'll assume ASCII or some ISO Latin." >&4
11521 $rm -f tebcdic.c tebcdic
11527 Checking how to flush all pending stdio output...
11529 # I only know how to find the first 32 possibly open files on SunOS.
11530 # See also hints/sunos_4_1.sh and util.c --AD
11532 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11534 $cat >>try.c <<EOCP
11536 #$i_unistd I_UNISTD
11538 # include <unistd.h>
11540 #$d_sysconf HAS_SYSCONF
11541 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11542 #ifdef HAS_STDIO_STREAM_ARRAY
11543 # define STDIO_STREAM_ARRAY $stdio_stream_array
11546 FILE* p = fopen("try.out", "w");
11550 # ifdef TRY_FPRINTF
11554 #ifdef TRY_FFLUSH_NULL
11557 #ifdef TRY_FFLUSH_ALL
11559 long open_max = -1;
11560 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11561 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11563 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11564 open_max = sysconf(_SC_OPEN_MAX);
11567 open_max = FOPEN_MAX;
11570 open_max = OPEN_MAX;
11579 # ifdef HAS_STDIO_STREAM_ARRAY
11580 if (open_max > 0) {
11582 for (i = 0; i < open_max; i++)
11583 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11584 STDIO_STREAM_ARRAY[i]._file < open_max &&
11585 STDIO_STREAM_ARRAY[i]._flag)
11586 fflush(&STDIO_STREAM_ARRAY[i]);
11594 : first we have to find out how _not_ to flush
11595 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11597 set try -DTRY_FPUTC
11598 if eval $compile; then
11600 ./try$exe_ext 2>/dev/null
11601 if $test ! -s try.out -a "X$?" = X42; then
11607 set try -DTRY_FPRINTF
11609 if eval $compile; then
11611 ./try$exe_ext 2>/dev/null
11612 if $test ! -s try.out -a "X$?" = X42; then
11613 output=-DTRY_FPRINTF
11619 : check for fflush NULL behaviour
11620 case "$fflushNULL" in
11621 '') set try -DTRY_FFLUSH_NULL $output
11622 if eval $compile; then
11624 ./try$exe_ext 2>/dev/null
11626 if $test -s try.out -a "X$code" = X42; then
11627 fflushNULL="`$cat try.out`"
11629 if $test "X$code" != X42; then
11631 (If this test failed, don't worry, we'll try another method shortly.)
11636 $rm -f core try.core core.try.*
11637 case "$fflushNULL" in
11639 Your fflush(NULL) works okay.
11641 fflushNULL="$define"
11644 Your fflush(NULL) isn't working (contrary to ANSI C).
11646 fflushNULL="$undef"
11649 Cannot figure out whether your fflush(NULL) works or not.
11650 I'm assuming it doesn't (contrary to ANSI C).
11652 fflushNULL="$undef"
11656 $define|true|[yY]*)
11657 fflushNULL="$define"
11660 fflushNULL="$undef"
11663 : check explicit looping only if NULL did not work
11664 case "$fflushNULL" in
11666 : check for fflush all behaviour
11667 case "$fflushall" in
11668 '') set try -DTRY_FFLUSH_ALL $output
11669 if eval $compile; then
11671 (Now testing the other method--but note that also this may fail.)
11674 ./try$exe_ext 2>/dev/null
11675 if $test -s try.out -a "X$?" = X42; then
11676 fflushall="`$cat try.out`"
11679 $rm -f core try.core core.try.*
11680 case "$fflushall" in
11682 Whew. Flushing explicitly all the stdio streams works.
11684 fflushall="$define"
11687 Sigh. Flushing explicitly all the stdio streams doesn't work.
11692 Cannot figure out whether flushing stdio streams explicitly works or not.
11693 I'm assuming it doesn't.
11699 "$define"|true|[yY]*)
11700 fflushall="$define"
11707 *) fflushall="$undef"
11710 case "$fflushNULL$fflushall" in
11713 I cannot figure out how to flush pending stdio output.
11717 $rm -f try.* try$exe_ext
11719 : Store the full pathname to the ar program for use in the C program
11720 : Respect a hint or command line value for full_ar.
11725 : Store the full pathname to the sed program for use in the C program
11728 : see what type gids are declared as in the kernel
11730 echo "Looking for the type for group ids returned by getgid()."
11731 set gid_t gidtype xxx stdio.h sys/types.h
11735 xxx=`./findhdr sys/user.h`
11736 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11738 unsigned) dflt="$1 $2" ;;
11742 *) dflt="$gidtype";;
11745 gid_t) echo "gid_t found." ;;
11746 *) rp="What is the type for group ids returned by getgid()?"
11754 *_t) zzz="$gidtype" ;;
11757 echo "Checking the size of $zzz..." >&4
11759 #include <sys/types.h>
11762 printf("%d\n", (int)sizeof($gidtype));
11767 if eval $compile_ok; then
11771 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11774 echo "Your $zzz size is $gidsize bytes."
11779 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11785 *_t) zzz="$gidtype" ;;
11788 echo "Checking the sign of $zzz..." >&4
11790 #include <sys/types.h>
11801 if eval $compile; then
11805 echo "(I can't execute the test program--guessing unsigned.)" >&4
11809 1) echo "Your $zzz is unsigned." ;;
11810 -1) echo "Your $zzz is signed." ;;
11816 echo "(I can't compile the test program--guessing unsigned.)" >&4
11820 : check for length of character
11822 case "$charsize" in
11824 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11825 $cat >try.c <<'EOCP'
11829 printf("%d\n", (int)sizeof(char));
11834 if eval $compile_ok; then
11838 echo "(I can't seem to compile the test program. Guessing...)"
11845 rp="What is the size of a character (in bytes)?"
11852 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11854 case "$use64bits:$d_quad:$quadtype" in
11857 uvtype="$uquadtype"
11862 uvtype="unsigned long"
11868 case "$uselongdouble:$d_longdbl" in
11870 nvtype="long double"
11871 nvsize=$longdblsize
11878 echo "(IV will be "$ivtype", $ivsize bytes)"
11879 echo "(UV will be "$uvtype", $uvsize bytes)"
11880 echo "(NV will be "$nvtype", $nvsize bytes)"
11883 #$i_inttypes I_INTTYPES
11885 #include <inttypes.h>
11890 int8_t i = INT8_MAX;
11891 uint8_t u = UINT8_MAX;
11892 printf("int8_t\n");
11895 int16_t i = INT16_MAX;
11896 uint16_t i = UINT16_MAX;
11897 printf("int16_t\n");
11900 int32_t i = INT32_MAX;
11901 uint32_t u = UINT32_MAX;
11902 printf("int32_t\n");
11908 '') case "$charsize" in
11910 u8type="unsigned char"
11919 if eval $compile; then
11920 case "`./try$exe_ext`" in
11921 int8_t) i8type=int8_t
11931 '') if $test $charsize -ge 1; then
11933 u8type="unsigned char"
11941 '') case "$shortsize" in
11943 u16type="unsigned short"
11951 '') set try -DINT16
11952 if eval $compile; then
11953 case "`./try$exe_ext`" in
11965 '') if $test $shortsize -ge 2; then
11967 u16type="unsigned short"
11975 '') case "$longsize" in
11977 u32type="unsigned long"
11981 *) case "$intsize" in
11983 u32type="unsigned int"
11993 '') set try -DINT32
11994 if eval $compile; then
11995 case "`./try$exe_ext`" in
12007 '') if $test $intsize -ge 4; then
12009 u32type="unsigned int"
12017 '') case "$d_quad:$quadtype" in
12019 i64type="$quadtype"
12020 u64type="$uquadtype"
12032 if $test X"$quadtype" != X; then
12034 echo "Checking how to print 64-bit integers..." >&4
12036 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12037 $cat >try.c <<'EOCP'
12038 #include <sys/types.h>
12041 int q = 12345678901;
12042 printf("%ld\n", q);
12046 if eval $compile; then
12047 yyy=`./try$exe_ext`
12050 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12051 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12052 echo "We will use %d."
12058 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12059 $cat >try.c <<'EOCP'
12060 #include <sys/types.h>
12063 long q = 12345678901;
12064 printf("%ld\n", q);
12068 if eval $compile; then
12069 yyy=`./try$exe_ext`
12072 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12073 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12074 echo "We will use %ld."
12080 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12081 $cat >try.c <<'EOCP'
12082 #include <sys/types.h>
12083 #include <inttypes.h>
12086 int64_t q = 12345678901;
12087 printf("%" PRId64 "\n", q);
12091 if eval $compile; then
12092 yyy=`./try$exe_ext`
12095 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12096 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12097 echo "We will use the C9X style."
12103 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12104 $cat >try.c <<'EOCP'
12105 #include <sys/types.h>
12108 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12109 printf("%lld\n", q);
12113 if eval $compile; then
12114 yyy=`./try$exe_ext`
12117 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12118 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12119 echo "We will use the %lld style."
12125 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12127 #include <sys/types.h>
12130 $quadtype q = 12345678901;
12131 printf("%Ld\n", q);
12135 if eval $compile; then
12136 yyy=`./try$exe_ext`
12139 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12140 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12141 echo "We will use %Ld."
12147 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12149 #include <sys/types.h>
12152 $quadtype q = 12345678901;
12153 printf("%qd\n", q);
12157 if eval $compile; then
12158 yyy=`./try$exe_ext`
12161 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12162 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12163 echo "We will use %qd."
12169 if $test X"$sPRId64" = X; then
12170 echo "Cannot figure out how to print 64-bit integers." >&4
12178 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12179 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12181 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12182 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12188 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12190 if $test X"$ivsize" = X8; then
12191 ivdformat="$sPRId64"
12192 uvuformat="$sPRIu64"
12193 uvoformat="$sPRIo64"
12194 uvxformat="$sPRIx64"
12196 if $test X"$ivsize" = X"$longsize"; then
12202 if $test X"$ivsize" = X"$intsize"; then
12209 if $test X"$ivsize" = X"$shortsize"; then
12219 case "$ivdformat" in
12220 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12227 $echo "Checking the format string to be used for gids..." >&4
12230 -1) if $test X"$gidsize" = X"$ivsize"; then
12231 gidformat="$ivdformat"
12233 if $test X"$gidsize" = X"$longsize"; then
12236 if $test X"$gidsize" = X"$intsize"; then
12239 if $test X"$gidsize" = X"$shortsize"; then
12246 *) if $test X"$gidsize" = X"$uvsize"; then
12247 gidformat="$uvuformat"
12249 if $test X"$gidsize" = X"$longsize"; then
12252 if $test X"$gidsize" = X"$intsize"; then
12255 if $test X"$gidsize" = X"$shortsize"; then
12264 : see if getgroups exists
12265 set getgroups d_getgrps
12268 : see if setgroups exists
12269 set setgroups d_setgrps
12273 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12275 case "$d_getgrps$d_setgrps" in
12277 case "$groupstype" in
12278 '') dflt="$gidtype" ;;
12279 *) dflt="$groupstype" ;;
12282 What type of pointer is the second argument to getgroups() and setgroups()?
12283 Usually this is the same as group ids, $gidtype, but not always.
12286 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12290 *) groupstype="$gidtype";;
12294 echo "Checking if your $make program sets \$(MAKE)..." >&4
12295 case "$make_set_make" in
12297 $sed 's/^X //' > testmake.mak << 'EOF'
12299 X @echo 'maketemp="$(MAKE)"'
12301 case "`$make -f testmake.mak 2>/dev/null`" in
12302 *maketemp=*) make_set_make='#' ;;
12303 *) make_set_make="MAKE=$make" ;;
12305 $rm -f testmake.mak
12308 case "$make_set_make" in
12309 '#') echo "Yup, it does.";;
12310 *) echo "Nope, it doesn't.";;
12313 : see what type is used for mode_t
12314 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12315 set mode_t modetype int stdio.h sys/types.h
12318 : define a fucntion to check prototypes
12319 $cat > protochk <<EOSH
12322 optimize="$optimize"
12324 prototype="$prototype"
12329 $cat >> protochk <<'EOSH'
12334 while test $# -ge 2; do
12336 $define) echo "#include <$2>" >> try.c ;;
12337 literal) echo "$2" >> try.c ;;
12341 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12342 cat >> try.c <<'EOCP'
12343 #ifdef CAN_PROTOTYPE
12344 #define _(args) args
12349 echo "$foo" >> try.c
12350 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12351 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12357 $eunicefix protochk
12359 : see what type is used for size_t
12360 rp="What is the type used for the length parameter for string functions?"
12361 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12364 : check for type of arguments to gethostbyaddr.
12365 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12366 case "$d_gethbyaddr" in
12370 Checking to see what type of arguments are accepted by gethostbyaddr().
12372 hdrs="$define sys/types.h
12373 $d_socket sys/socket.h
12374 $i_niin netinet/in.h
12376 $i_unistd unistd.h"
12377 : The first arg can 'char *' or 'void *'
12378 : The second arg is some of integral type
12379 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12380 for yyy in size_t long int; do
12381 case "$netdb_host_type" in
12382 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12383 if ./protochk "$try" $hdrs; then
12384 echo "Your system accepts $xxx for the first arg."
12385 echo "...and $yyy for the second arg."
12386 netdb_host_type="$xxx"
12387 netdb_hlen_type="$yyy"
12393 : In case none of those worked, prompt the user.
12394 case "$netdb_host_type" in
12395 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12398 netdb_host_type=$ans
12399 rp='What is the type for the 2nd argument to gethostbyaddr?'
12402 netdb_hlen_type=$ans
12406 *) : no gethostbyaddr, so pick harmless defaults
12407 netdb_host_type='char *'
12408 netdb_hlen_type="$sizetype"
12411 # Remove the "const" if needed. -- but then we'll have a
12413 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12416 : check for type of argument to gethostbyname.
12417 if test "X$netdb_name_type" = X ; then
12418 case "$d_gethbyname" in
12422 Checking to see what type of argument is accepted by gethostbyname().
12424 hdrs="$define sys/types.h
12425 $d_socket sys/socket.h
12426 $i_niin netinet/in.h
12428 $i_unistd unistd.h"
12429 for xxx in "const char *" "char *"; do
12430 case "$netdb_name_type" in
12431 '') try="extern struct hostent *gethostbyname($xxx);"
12432 if ./protochk "$try" $hdrs; then
12433 echo "Your system accepts $xxx."
12434 netdb_name_type="$xxx"
12439 : In case none of those worked, prompt the user.
12440 case "$netdb_name_type" in
12441 '') rp='What is the type for the 1st argument to gethostbyname?'
12444 netdb_name_type=$ans
12448 *) : no gethostbyname, so pick harmless default
12449 netdb_name_type='char *'
12454 : check for type of 1st argument to getnetbyaddr.
12455 if test "X$netdb_net_type" = X ; then
12456 case "$d_getnbyaddr" in
12460 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12462 hdrs="$define sys/types.h
12463 $d_socket sys/socket.h
12464 $i_niin netinet/in.h
12466 $i_unistd unistd.h"
12467 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12468 case "$netdb_net_type" in
12469 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12470 if ./protochk "$try" $hdrs; then
12471 echo "Your system accepts $xxx."
12472 netdb_net_type="$xxx"
12477 : In case none of those worked, prompt the user.
12478 case "$netdb_net_type" in
12479 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12482 netdb_net_type=$ans
12486 *) : no getnetbyaddr, so pick harmless default
12487 netdb_net_type='long'
12491 : locate the preferred pager for this system
12505 '') dflt=/usr/ucb/more;;
12512 rp='What pager is used on your system?'
12516 : see what type pids are declared as in the kernel
12517 rp="What is the type of process ids on this system?"
12518 set pid_t pidtype int stdio.h sys/types.h
12521 : Find earliest binary compatible site_perl subdirectory perl can use.
12522 case "$bincompat5005" in
12523 "$define") xs_apiversion='5.005' ;;
12524 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12526 : Find earliest pure perl site_perl subdirectory perl can use.
12527 : The versioned directories started at 5.005.
12528 pm_apiversion='5.005'
12530 : check for length of pointer
12534 $echo $n "Checking to see how big your pointers are...$c" >&4
12535 if test "$voidflags" -gt 7; then
12536 echo '#define VOID_PTR char *' > try.c
12538 echo '#define VOID_PTR void *' > try.c
12540 $cat >>try.c <<'EOCP'
12544 printf("%d\n", (int)sizeof(VOID_PTR));
12549 if eval $compile_ok; then
12551 $echo " $ptrsize bytes." >&4
12554 echo "(I can't seem to compile the test program. Guessing...)" >&4
12555 rp="What is the size of a pointer (in bytes)?"
12563 : see if ar generates random libraries by itself
12565 echo "Checking how to generate random libraries on your machine..." >&4
12566 echo 'int bar1() { return bar2(); }' > bar1.c
12567 echo 'int bar2() { return 2; }' > bar2.c
12568 $cat > foo.c <<'EOP'
12569 int main() { printf("%d\n", bar1()); exit(0); }
12571 $cc $ccflags -c bar1.c >/dev/null 2>&1
12572 $cc $ccflags -c bar2.c >/dev/null 2>&1
12573 $cc $ccflags -c foo.c >/dev/null 2>&1
12574 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12575 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12576 ./foobar >/dev/null 2>&1; then
12577 echo "$ar appears to generate random libraries itself."
12580 elif $ar ts bar$_a >/dev/null 2>&1 &&
12581 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12582 ./foobar >/dev/null 2>&1; then
12583 echo "a table of contents needs to be added with '$ar ts'."
12590 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12591 $test -f $ranlib || ranlib=''
12594 if $test -n "$ranlib"; then
12595 echo "your system has '$ranlib'; we'll use that."
12598 echo "your system doesn't seem to support random libraries"
12599 echo "so we'll use lorder and tsort to order the libraries."
12606 : check for type of arguments to select.
12607 case "$selecttype" in
12608 '') case "$d_select" in
12611 Checking to see what type of arguments are accepted by select().
12613 hdrs="$define sys/types.h
12614 $i_systime sys/time.h
12615 $i_sysselct sys/select.h
12616 $d_socket sys/socket.h"
12617 : The first arg can be int, unsigned, or size_t
12618 : The last arg may or may not be 'const'
12620 : void pointer has been seen but using that
12621 : breaks the selectminbits test
12622 for xxx in 'fd_set *' 'int *'; do
12623 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12624 for tmo in 'struct timeval *' 'const struct timeval *'; do
12626 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12627 if ./protochk "$try" $hdrs; then
12628 echo "Your system accepts $xxx."
12637 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12638 case "$d_fd_set" in
12639 $define) dflt="fd_set *" ;;
12648 *) : no select, so pick a harmless default
12655 : check for the select 'width'
12656 case "$selectminbits" in
12657 '') case "$d_select" in
12661 Checking to see on how many bits at a time your select() operates...
12664 #include <sys/types.h>
12666 #$i_systime I_SYS_TIME
12667 #$i_systimek I_SYS_TIME_KERNEL
12672 # ifdef I_SYS_TIME_KERNEL
12675 # include <sys/time.h>
12676 # ifdef I_SYS_TIME_KERNEL
12680 #$i_sysselct I_SYS_SELECT
12681 #ifdef I_SYS_SELECT
12682 #include <sys/select.h>
12684 #$d_socket HAS_SOCKET
12686 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12690 #define S sizeof(*(b))
12692 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12693 #define NBITS (NBYTES * 8)
12702 fp = fopen("try.c", "r");
12708 b = ($selecttype)s;
12709 for (i = 0; i < NBITS; i++)
12713 select(fd + 1, b, 0, 0, &t);
12714 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12715 printf("%d\n", i + 1);
12720 if eval $compile_ok; then
12721 selectminbits=`./try`
12722 case "$selectminbits" in
12724 Cannot figure out on how many bits at a time your select() operates.
12725 I'll play safe and guess it is 32 bits.
12731 *) bits="$selectminbits bits" ;;
12733 echo "Your select() operates on $bits at a time." >&4
12735 rp='What is the minimum number of bits your select() operates on?'
12736 case "$byteorder" in
12737 1234|12345678) dflt=32 ;;
12742 selectminbits="$val"
12746 *) : no select, so pick a harmless default
12753 : Trace out the files included by signal.h, then look for SIGxxx names.
12754 : Remove SIGARRAYSIZE used by HPUX.
12755 : Remove SIGSTKSIZE used by Linux.
12756 : Remove SIGSTKSZ used by Posix.
12757 : Remove SIGTYP void lines used by OS2.
12758 xxx=`echo '#include <signal.h>' |
12759 $cppstdin $cppminus $cppflags 2>/dev/null |
12760 $grep '^[ ]*#.*include' |
12761 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12762 : Check this list of files to be sure we have parsed the cpp output ok.
12763 : This will also avoid potentially non-existent files, such
12766 for xx in $xxx /dev/null ; do
12767 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12769 : If we have found no files, at least try signal.h
12770 case "$xxxfiles" in
12771 '') xxxfiles=`./findhdr signal.h` ;;
12774 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12775 print substr($2, 4, 20)
12777 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12778 print substr($3, 4, 20)
12780 : Append some common names just in case the awk scan failed.
12781 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12782 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12783 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12784 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12785 : generate a few handy files for later
12786 $cat > signal.c <<'EOCP'
12787 #include <sys/types.h>
12788 #include <signal.h>
12792 /* Strange style to avoid deeply-nested #if/#else/#endif */
12795 # define NSIG (_NSIG)
12801 # define NSIG (SIGMAX+1)
12807 # define NSIG (SIG_MAX+1)
12813 # define NSIG (MAXSIG+1)
12819 # define NSIG (MAX_SIG+1)
12824 # ifdef SIGARRAYSIZE
12825 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12831 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12835 /* Default to some arbitrary number that's big enough to get most
12836 of the common signals.
12842 printf("NSIG %d\n", NSIG);
12848 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12850 printf "#ifdef SIG"; printf $1; printf "\n"
12851 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12852 printf $1; printf ");\n"
12856 printf "#endif /* JUST_NSIG */\n";
12857 printf "exit(0);\n}\n";
12860 $cat >signal.awk <<'EOP'
12861 BEGIN { ndups = 0 }
12862 $1 ~ /^NSIG$/ { nsig = $2 }
12863 ($1 !~ /^NSIG$/) && (NF == 2) {
12864 if ($2 > maxsig) { maxsig = $2 }
12865 if (sig_name[$2]) {
12866 dup_name[ndups] = $1
12867 dup_num[ndups] = $2
12879 printf("NSIG %d\n", nsig);
12880 for (n = 1; n < nsig; n++) {
12882 printf("%s %d\n", sig_name[n], sig_num[n])
12885 printf("NUM%d %d\n", n, n)
12888 for (n = 0; n < ndups; n++) {
12889 printf("%s %d\n", dup_name[n], dup_num[n])
12893 $cat >signal_cmd <<EOS
12895 if $test -s signal.lst; then
12896 echo "Using your existing signal.lst file"
12901 $cat >>signal_cmd <<'EOS'
12904 if eval $compile_ok; then
12905 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12907 echo "(I can't seem be able to compile the whole test program)" >&4
12908 echo "(I'll try it in little pieces.)" >&4
12909 set signal -DJUST_NSIG
12910 if eval $compile_ok; then
12911 ./signal$_exe > signal.nsg
12914 echo "I can't seem to figure out how many signals you have." >&4
12915 echo "Guessing 50." >&4
12916 echo 'NSIG 50' > signal.nsg
12918 : Now look at all the signal names, one at a time.
12919 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12920 $cat > signal.c <<EOCP
12921 #include <sys/types.h>
12922 #include <signal.h>
12925 printf("$xx %d\n", SIG${xx});
12930 if eval $compile; then
12931 echo "SIG${xx} found."
12932 ./signal$_exe >> signal.ls1
12934 echo "SIG${xx} NOT found."
12937 if $test -s signal.ls1; then
12938 $cat signal.nsg signal.ls1 |
12939 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12943 if $test -s signal.lst; then
12946 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12947 echo 'kill -l' >signal
12948 set X `csh -f <signal`
12952 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12954 echo $@ | $tr ' ' $trnl | \
12955 $awk '{ printf "%s %d\n", $1, ++s; }
12956 END { printf "NSIG %d\n", ++s }' >signal.lst
12958 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12960 chmod a+x signal_cmd
12961 $eunicefix signal_cmd
12963 : generate list of signal names
12965 case "$sig_name_init" in
12967 *) case "$sig_num_init" in
12968 ''|*,*) doinit=yes ;;
12973 echo "Generating a list of signal names and numbers..." >&4
12975 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12976 sig_name=`$awk 'BEGIN { printf "ZERO " }
12977 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12978 sig_num=`$awk 'BEGIN { printf "0 " }
12979 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12980 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12981 !/^NSIG/ { printf "\"%s\", ", $1 }
12982 END { printf "0\n" }' signal.lst`
12983 sig_num_init=`$awk 'BEGIN { printf "0, " }
12984 !/^NSIG/ { printf "%d, ", $2}
12985 END { printf "0\n"}' signal.lst`
12988 echo "The following $sig_count signals are available:"
12990 echo $sig_name | $awk \
12991 'BEGIN { linelen = 0 }
12993 for (i = 1; i <= NF; i++) {
12994 name = "SIG" $i " "
12995 linelen = linelen + length(name)
12996 if (linelen > 70) {
12998 linelen = length(name)
13004 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13007 case "$sizetype" in
13008 *_t) zzz="$sizetype" ;;
13009 *) zzz="filesize" ;;
13011 echo "Checking the size of $zzz..." >&4
13013 #include <sys/types.h>
13016 printf("%d\n", (int)sizeof($sizetype));
13021 if eval $compile_ok; then
13025 echo "(I can't execute the test program--guessing $sizesize.)" >&4
13028 echo "Your $zzz size is $sizesize bytes."
13033 echo "(I can't compile the test program--guessing $sizesize.)" >&4
13037 : see what type is used for signed size_t
13038 set ssize_t ssizetype int stdio.h sys/types.h
13041 $cat > ssize.c <<EOM
13043 #include <sys/types.h>
13044 #define Size_t $sizetype
13045 #define SSize_t $dflt
13048 if (sizeof(Size_t) == sizeof(SSize_t))
13050 else if (sizeof(Size_t) == sizeof(int))
13059 if eval $compile_ok && ./ssize > /dev/null; then
13060 ssizetype=`./ssize`
13061 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13064 Help! I can't compile and run the ssize_t test program: please enlighten me!
13065 (This is probably a misconfiguration in your system or libraries, and
13066 you really ought to fix it. Still, I'll try anyway.)
13068 I need a type that is the same size as $sizetype, but is guaranteed to
13069 be signed. Common values are ssize_t, int and long.
13072 rp="What signed type is the same size as $sizetype?"
13076 $rm -f ssize ssize.*
13078 : see what type of char stdio uses.
13080 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13081 echo "Your stdio uses unsigned chars." >&4
13082 stdchar="unsigned char"
13084 echo "Your stdio uses signed chars." >&4
13088 : see if time exists
13090 if test "X$d_time" = X -o X"$timetype" = X; then
13091 if set time val -f d_time; eval $csym; $val; then
13092 echo 'time() found.' >&4
13094 rp="What is the type returned by time() on this system?"
13095 set time_t timetype long stdio.h sys/types.h
13098 echo 'time() not found, hope that will do.' >&4
13106 : see what type uids are declared as in the kernel
13108 echo "Looking for the type for user ids returned by getuid()."
13109 set uid_t uidtype xxx stdio.h sys/types.h
13113 xxx=`./findhdr sys/user.h`
13114 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13116 unsigned) dflt="$1 $2" ;;
13120 *) dflt="$uidtype";;
13123 uid_t) echo "uid_t found." ;;
13124 *) rp="What is the type for user ids returned by getuid()?"
13132 *_t) zzz="$uidtype" ;;
13135 echo "Checking the size of $zzz..." >&4
13137 #include <sys/types.h>
13140 printf("%d\n", (int)sizeof($uidtype));
13145 if eval $compile_ok; then
13149 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13152 echo "Your $zzz size is $uidsize bytes."
13157 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13162 *_t) zzz="$uidtype" ;;
13165 echo "Checking the sign of $zzz..." >&4
13167 #include <sys/types.h>
13178 if eval $compile; then
13182 echo "(I can't execute the test program--guessing unsigned.)" >&4
13186 1) echo "Your $zzz is unsigned." ;;
13187 -1) echo "Your $zzz is signed." ;;
13193 echo "(I can't compile the test program--guessing unsigned.)" >&4
13199 $echo "Checking the format string to be used for uids..." >&4
13202 -1) if $test X"$uidsize" = X"$ivsize"; then
13203 uidformat="$ivdformat"
13205 if $test X"$uidsize" = X"$longsize"; then
13208 if $test X"$uidsize" = X"$intsize"; then
13211 if $test X"$uidsize" = X"$shortsize"; then
13218 *) if $test X"$uidsize" = X"$uvsize"; then
13219 uidformat="$uvuformat"
13221 if $test X"$uidsize" = X"$longsize"; then
13224 if $test X"$uidsize" = X"$intsize"; then
13227 if $test X"$uidsize" = X"$shortsize"; then
13236 : see if dbm.h is available
13237 : see if dbmclose exists
13238 set dbmclose d_dbmclose
13241 case "$d_dbmclose" in
13251 *) set rpcsvc/dbm.h i_rpcsvcdbm
13256 *) echo "We won't be including <dbm.h>"
13266 : see if this is a sys/file.h system
13271 : do we need to include sys/file.h ?
13275 if $h_sysfile; then
13277 echo "We'll be including <sys/file.h>." >&4
13280 echo "We won't be including <sys/file.h>." >&4
13290 : see if fcntl.h is there
13295 : see if we can include fcntl.h
13301 echo "We'll be including <fcntl.h>." >&4
13304 if $h_sysfile; then
13305 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13307 echo "We won't be including <fcntl.h>." >&4
13319 : see if locale.h is available
13320 set locale.h i_locale
13323 : see if mach cthreads are available
13324 if test "X$usethreads" = "X$define"; then
13325 set mach/cthreads.h i_machcthr
13328 i_machcthr="$undef"
13333 : see if this is a math.h system
13337 : see if this is a mntent.h system
13338 set mntent.h i_mntent
13341 : see if ndbm.h is available
13346 : see if dbm_open exists
13347 set dbm_open d_dbm_open
13349 case "$d_dbm_open" in
13352 echo "We won't be including <ndbm.h>"
13361 : see if net/errno.h is available
13363 set net/errno.h val
13366 : Unfortunately, it causes problems on some systems. Arrgh.
13369 cat > try.c <<'EOM'
13372 #include <net/errno.h>
13378 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13379 echo "We'll be including <net/errno.h>." >&4
13381 echo "We won't be including <net/errno.h>." >&4
13390 : see if netinet/tcp.h is available
13391 set netinet/tcp.h i_netinettcp
13394 : see if this is a poll.h system
13398 : get C preprocessor symbols handy
13400 $echo $n "Hmm... $c"
13401 echo $al | $tr ' ' $trnl >Cppsym.know
13402 $cat <<EOSS >Cppsym
13410 case "\$list\$#" in
13413 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13415 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13418 unknown="\$unknown \$sym"
13428 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13430 exit 0; _ _ _ _\1\\ \1\\
13433 echo "exit 1; _ _ _" >>Cppsym\$\$
13434 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13436 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13442 $rm -f Cppsym\$\$ Cppsym2\$\$
13447 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13449 : now check the C compiler for additional symbols
13450 postprocess_cc_v=''
13452 aix) postprocess_cc_v="|$tr , ' '" ;;
13459 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13462 -D*) echo "\$i" | $sed 's/^-D//';;
13463 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13468 postprocess_cc_v=''
13471 ./ccsym > ccsym1.raw
13472 if $test -s ccsym1.raw; then
13473 $sort ccsym1.raw | $uniq >ccsym.raw
13475 mv ccsym1.raw ccsym.raw
13478 $awk '/\=/ { print $0; next }
13479 { print $0"=1" }' ccsym.raw >ccsym.list
13480 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13481 $comm -13 ccsym.true ccsym.list >ccsym.own
13482 $comm -12 ccsym.true ccsym.list >ccsym.com
13483 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13485 if $test -z ccsym.raw; then
13486 echo "Your C compiler doesn't seem to define any symbols!" >&4
13488 echo "However, your C preprocessor defines the following symbols:"
13491 cppsymbols=`$cat Cppsym.true`
13492 cppsymbols=`echo $cppsymbols`
13493 cppccsymbols="$cppsymbols"
13495 if $test -s ccsym.com; then
13496 echo "Your C compiler and pre-processor define these symbols:"
13497 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13500 cppccsymbols=`$cat ccsym.com`
13501 cppccsymbols=`echo $cppccsymbols`
13502 $test "$silent" || sleep 1
13504 if $test -s ccsym.cpp; then
13505 $test "$also" && echo " "
13506 echo "Your C pre-processor ${also}defines the following symbols:"
13507 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13509 cppsymbols=`$cat ccsym.cpp`
13510 cppsymbols=`echo $cppsymbols`
13511 $test "$silent" || sleep 1
13513 if $test -s ccsym.own; then
13514 $test "$also" && echo " "
13515 echo "Your C compiler ${also}defines the following cpp symbols:"
13516 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13517 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13518 ccsymbols=`$cat ccsym.own`
13519 ccsymbols=`echo $ccsymbols`
13520 $test "$silent" || sleep 1
13525 : see if this is a termio system
13529 if $test `./findhdr termios.h`; then
13530 set tcsetattr i_termios
13536 "$define") echo "You have POSIX termios.h... good!" >&4;;
13537 *) if ./Cppsym pyr; then
13538 case "`/bin/universe`" in
13539 ucb) if $test `./findhdr sgtty.h`; then
13541 echo "<sgtty.h> found." >&4
13543 echo "System is pyramid with BSD universe."
13544 echo "<sgtty.h> not found--you could have problems." >&4
13546 *) if $test `./findhdr termio.h`; then
13548 echo "<termio.h> found." >&4
13550 echo "System is pyramid with USG universe."
13551 echo "<termio.h> not found--you could have problems." >&4
13555 if $test `./findhdr termio.h`; then
13556 echo "<termio.h> found." >&4
13558 elif $test `./findhdr sgtty.h`; then
13559 echo "<sgtty.h> found." >&4
13562 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13565 if $test `./findhdr sgtty.h`; then
13566 echo "<sgtty.h> found." >&4
13568 elif $test `./findhdr termio.h`; then
13569 echo "<termio.h> found." >&4
13572 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13576 set i_termio; eval $setvar
13577 val=$val2; set i_sgtty; eval $setvar
13578 val=$val3; set i_termios; eval $setvar
13580 : see if this is a shadow.h system
13581 set shadow.h i_shadow
13584 : see if this is a socks.h system
13585 set socks.h i_socks
13588 : see if stdarg is available
13590 if $test `./findhdr stdarg.h`; then
13591 echo "<stdarg.h> found." >&4
13594 echo "<stdarg.h> NOT found." >&4
13598 : see if varags is available
13600 if $test `./findhdr varargs.h`; then
13601 echo "<varargs.h> found." >&4
13603 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13606 : set up the varargs testing programs
13607 $cat > varargs.c <<EOP
13609 #include <stdarg.h>
13612 #include <varargs.h>
13616 int f(char *p, ...)
13630 p = va_arg(ap, char *);
13635 $cat > varargs <<EOP
13637 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13646 : now check which varargs header should be included
13651 if `./varargs I_STDARG`; then
13653 elif `./varargs I_VARARGS`; then
13658 if `./varargs I_VARARGS`; then
13665 echo "I could not find the definition for va_dcl... You have problems..." >&4
13666 val="$undef"; set i_stdarg; eval $setvar
13667 val="$undef"; set i_varargs; eval $setvar
13672 case "$i_varhdr" in
13674 val="$define"; set i_stdarg; eval $setvar
13675 val="$undef"; set i_varargs; eval $setvar
13678 val="$undef"; set i_stdarg; eval $setvar
13679 val="$define"; set i_varargs; eval $setvar
13682 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13686 : see if stddef is available
13687 set stddef.h i_stddef
13690 : see if sys/access.h is available
13691 set sys/access.h i_sysaccess
13694 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13695 set sys/filio.h i_sysfilio
13698 if $test `./findhdr sys/ioctl.h`; then
13700 echo '<sys/ioctl.h> found.' >&4
13703 if $test $i_sysfilio = "$define"; then
13704 echo '<sys/ioctl.h> NOT found.' >&4
13706 $test $i_sgtty = "$define" && xxx="sgtty.h"
13707 $test $i_termio = "$define" && xxx="termio.h"
13708 $test $i_termios = "$define" && xxx="termios.h"
13709 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13715 : see if sys/resource.h has to be included
13716 set sys/resource.h i_sysresrc
13719 : see if sys/security.h is available
13720 set sys/security.h i_syssecrt
13723 : see if this is a sys/statvfs.h system
13724 set sys/statvfs.h i_sysstatvfs
13727 : see if this is a sys/uio.h system
13728 set sys/uio.h i_sysuio
13731 : see if this is a sys/un.h system
13732 set sys/un.h i_sysun
13735 : see if this is a syswait system
13736 set sys/wait.h i_syswait
13739 : see if this is a ustat.h system
13740 set ustat.h i_ustat
13743 : see if this is an utime system
13744 set utime.h i_utime
13747 : see if this is a values.h system
13748 set values.h i_values
13751 : see if this is a vfork system
13754 set vfork.h i_vfork
13762 : see if gdbm.h is available
13767 : see if gdbm_open exists
13768 set gdbm_open d_gdbm_open
13770 case "$d_gdbm_open" in
13773 echo "We won't be including <gdbm.h>"
13783 echo "Looking for extensions..." >&4
13784 : If we are using the old config.sh, known_extensions may contain
13785 : old or inaccurate or duplicate values.
13786 known_extensions=''
13787 nonxs_extensions=''
13788 : We do not use find because it might not be available.
13789 : We do not just use MANIFEST because the user may have dropped
13790 : some additional extensions into the source tree and expect them
13793 : Function to recursively find available extensions, ignoring DynaLoader
13794 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13798 DynaLoader|dynaload) ;;
13800 if $test -f $xxx/$xxx.xs; then
13801 known_extensions="$known_extensions $1$xxx";
13802 elif $test -f $xxx/Makefile.PL; then
13803 nonxs_extensions="$nonxs_extensions $1$xxx";
13805 if $test -d $xxx -a $# -lt 10; then
13808 eval $find_extensions;
13820 eval $find_extensions
13821 set X $nonxs_extensions
13823 nonxs_extensions="$*"
13824 set X $known_extensions
13826 known_extensions="$*"
13829 : Now see which are supported on this system.
13831 for xxx in $known_extensions ; do
13835 $define) avail_ext="$avail_ext $xxx" ;;
13838 GDBM_File|gdbm_fil)
13840 $define) avail_ext="$avail_ext $xxx" ;;
13843 NDBM_File|ndbm_fil)
13845 $define) avail_ext="$avail_ext $xxx" ;;
13848 ODBM_File|odbm_fil)
13849 case "${i_dbm}${i_rpcsvcdbm}" in
13850 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13854 case "$useposix" in
13855 true|define|y) avail_ext="$avail_ext $xxx" ;;
13859 case "$useopcode" in
13860 true|define|y) avail_ext="$avail_ext $xxx" ;;
13864 case "$d_socket" in
13865 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13869 case "$usethreads" in
13870 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13874 : XXX Do we need a useipcsysv variable here
13875 case "${d_msg}${d_sem}${d_shm}" in
13876 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13879 *) avail_ext="$avail_ext $xxx"
13888 : Now see which nonxs extensions are supported on this system.
13889 : For now assume all are.
13891 for xxx in $nonxs_extensions ; do
13893 *) nonxs_ext="$nonxs_ext $xxx"
13905 A number of extensions are supplied with $package. You may choose to
13906 compile these extensions for dynamic loading (the default), compile
13907 them into the $package executable (static loading), or not include
13908 them at all. Answer "none" to include no extensions.
13909 Note that DynaLoader is always built and need not be mentioned here.
13912 case "$dynamic_ext" in
13913 '') dflt="$avail_ext" ;;
13914 *) dflt="$dynamic_ext"
13915 # Perhaps we are reusing an old out-of-date config.sh.
13918 if test X"$dynamic_ext" != X"$avail_ext"; then
13920 NOTICE: Your previous config.sh list may be incorrect.
13921 The extensions now available to you are
13923 but the default list from your previous config.sh is
13935 rp="What extensions do you wish to load dynamically?"
13938 none) dynamic_ext=' ' ;;
13939 *) dynamic_ext="$ans" ;;
13942 case "$static_ext" in
13944 : Exclude those already listed in dynamic linking
13946 for xxx in $avail_ext; do
13947 case " $dynamic_ext " in
13949 *) dflt="$dflt $xxx" ;;
13956 *) dflt="$static_ext"
13963 rp="What extensions do you wish to load statically?"
13966 none) static_ext=' ' ;;
13967 *) static_ext="$ans" ;;
13972 A number of extensions are supplied with $package. Answer "none"
13973 to include no extensions.
13974 Note that DynaLoader is always built and need not be mentioned here.
13977 case "$static_ext" in
13978 '') dflt="$avail_ext" ;;
13979 *) dflt="$static_ext"
13980 # Perhaps we are reusing an old out-of-date config.sh.
13983 if test X"$static_ext" != X"$avail_ext"; then
13985 NOTICE: Your previous config.sh list may be incorrect.
13986 The extensions now available to you are
13988 but the default list from your previous config.sh is
13997 : Exclude those that are not xs extensions
14001 rp="What extensions do you wish to include?"
14004 none) static_ext=' ' ;;
14005 *) static_ext="$ans" ;;
14010 set X $dynamic_ext $static_ext $nonxs_ext
14014 : Remove build directory name from cppstdin so it can be used from
14015 : either the present location or the final installed location.
14017 : Get out of the UU directory to get correct path name.
14019 case "$cppstdin" in
14021 echo "Stripping down cppstdin path name"
14027 : end of configuration questions
14029 echo "End of configuration questions."
14032 : back to where it started
14033 if test -d ../UU; then
14037 : configuration may be patched via a 'config.over' file
14038 if $test -f config.over; then
14041 rp='I see a config.over file. Do you wish to load it?'
14044 n*) echo "OK, I'll ignore it.";;
14046 echo "Configuration override changes have been loaded."
14051 : in case they want portability, strip down executable paths
14052 case "$d_portable" in
14055 echo "Stripping down executable paths..." >&4
14056 for file in $loclist $trylist; do
14058 eval $file=`basename $temp`
14063 : create config.sh file
14065 echo "Creating config.sh..." >&4
14066 $spitshell <<EOT >config.sh
14069 # This file was produced by running the Configure script. It holds all the
14070 # definitions figured out by Configure. Should you modify one of these values,
14071 # do not forget to propagate your changes by running "Configure -der". You may
14072 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14075 # Package name : $package
14076 # Source directory : $src
14077 # Configuration time: $cf_time
14078 # Configured by : $cf_by
14079 # Target system : $myuname
14089 Revision='$Revision'
14096 alignbytes='$alignbytes'
14097 ansi2knr='$ansi2knr'
14098 aphostname='$aphostname'
14099 apiversion='$apiversion'
14102 archlibexp='$archlibexp'
14103 archname64='$archname64'
14104 archname='$archname'
14105 archobjs='$archobjs'
14110 bincompat5005='$bincompat5005'
14114 byteorder='$byteorder'
14116 castflags='$castflags'
14119 cccdlflags='$cccdlflags'
14120 ccdlflags='$ccdlflags'
14122 ccsymbols='$ccsymbols'
14124 cf_email='$cf_email'
14126 charsize='$charsize'
14130 clocktype='$clocktype'
14132 compress='$compress'
14133 contains='$contains'
14137 cpp_stuff='$cpp_stuff'
14138 cppccsymbols='$cppccsymbols'
14139 cppflags='$cppflags'
14141 cppminus='$cppminus'
14143 cppstdin='$cppstdin'
14144 cppsymbols='$cppsymbols'
14145 crosscompile='$crosscompile'
14146 cryptlib='$cryptlib'
14148 d_Gconvert='$d_Gconvert'
14149 d_PRIEldbl='$d_PRIEldbl'
14150 d_PRIFldbl='$d_PRIFldbl'
14151 d_PRIGldbl='$d_PRIGldbl'
14152 d_PRIX64='$d_PRIX64'
14153 d_PRId64='$d_PRId64'
14154 d_PRIeldbl='$d_PRIeldbl'
14155 d_PRIfldbl='$d_PRIfldbl'
14156 d_PRIgldbl='$d_PRIgldbl'
14157 d_PRIi64='$d_PRIi64'
14158 d_PRIo64='$d_PRIo64'
14159 d_PRIu64='$d_PRIu64'
14160 d_PRIx64='$d_PRIx64'
14161 d_access='$d_access'
14162 d_accessx='$d_accessx'
14164 d_archlib='$d_archlib'
14167 d_attribut='$d_attribut'
14170 d_bincompat5005='$d_bincompat5005'
14172 d_bsdgetpgrp='$d_bsdgetpgrp'
14173 d_bsdsetpgrp='$d_bsdsetpgrp'
14175 d_casti32='$d_casti32'
14176 d_castneg='$d_castneg'
14177 d_charvspr='$d_charvspr'
14179 d_chroot='$d_chroot'
14180 d_chsize='$d_chsize'
14181 d_closedir='$d_closedir'
14185 d_cuserid='$d_cuserid'
14186 d_dbl_dig='$d_dbl_dig'
14187 d_difftime='$d_difftime'
14188 d_dirnamlen='$d_dirnamlen'
14189 d_dlerror='$d_dlerror'
14190 d_dlopen='$d_dlopen'
14191 d_dlsymun='$d_dlsymun'
14192 d_dosuid='$d_dosuid'
14193 d_drand48proto='$d_drand48proto'
14195 d_eaccess='$d_eaccess'
14196 d_endgrent='$d_endgrent'
14197 d_endhent='$d_endhent'
14198 d_endnent='$d_endnent'
14199 d_endpent='$d_endpent'
14200 d_endpwent='$d_endpwent'
14201 d_endsent='$d_endsent'
14202 d_endspent='$d_endspent'
14203 d_eofnblk='$d_eofnblk'
14204 d_eunice='$d_eunice'
14205 d_fchmod='$d_fchmod'
14206 d_fchown='$d_fchown'
14208 d_fd_macros='$d_fd_macros'
14209 d_fd_set='$d_fd_set'
14210 d_fds_bits='$d_fds_bits'
14211 d_fgetpos='$d_fgetpos'
14212 d_flexfnam='$d_flexfnam'
14215 d_fpathconf='$d_fpathconf'
14216 d_fpos64_t='$d_fpos64_t'
14217 d_fs_data_s='$d_fs_data_s'
14218 d_fseeko='$d_fseeko'
14219 d_fsetpos='$d_fsetpos'
14220 d_fstatfs='$d_fstatfs'
14221 d_fstatvfs='$d_fstatvfs'
14222 d_ftello='$d_ftello'
14224 d_getgrent='$d_getgrent'
14225 d_getgrps='$d_getgrps'
14226 d_gethbyaddr='$d_gethbyaddr'
14227 d_gethbyname='$d_gethbyname'
14228 d_gethent='$d_gethent'
14229 d_gethname='$d_gethname'
14230 d_gethostprotos='$d_gethostprotos'
14231 d_getlogin='$d_getlogin'
14232 d_getmnt='$d_getmnt'
14233 d_getmntent='$d_getmntent'
14234 d_getnbyaddr='$d_getnbyaddr'
14235 d_getnbyname='$d_getnbyname'
14236 d_getnent='$d_getnent'
14237 d_getnetprotos='$d_getnetprotos'
14238 d_getpbyname='$d_getpbyname'
14239 d_getpbynumber='$d_getpbynumber'
14240 d_getpent='$d_getpent'
14241 d_getpgid='$d_getpgid'
14242 d_getpgrp2='$d_getpgrp2'
14243 d_getpgrp='$d_getpgrp'
14244 d_getppid='$d_getppid'
14245 d_getprior='$d_getprior'
14246 d_getprotoprotos='$d_getprotoprotos'
14247 d_getpwent='$d_getpwent'
14248 d_getsbyname='$d_getsbyname'
14249 d_getsbyport='$d_getsbyport'
14250 d_getsent='$d_getsent'
14251 d_getservprotos='$d_getservprotos'
14252 d_getspent='$d_getspent'
14253 d_getspnam='$d_getspnam'
14254 d_gettimeod='$d_gettimeod'
14255 d_gnulibc='$d_gnulibc'
14256 d_grpasswd='$d_grpasswd'
14257 d_hasmntopt='$d_hasmntopt'
14260 d_inetaton='$d_inetaton'
14261 d_int64t='$d_int64t'
14262 d_isascii='$d_isascii'
14263 d_killpg='$d_killpg'
14264 d_lchown='$d_lchown'
14265 d_ldbl_dig='$d_ldbl_dig'
14267 d_locconv='$d_locconv'
14269 d_longdbl='$d_longdbl'
14270 d_longlong='$d_longlong'
14273 d_mbstowcs='$d_mbstowcs'
14274 d_mbtowc='$d_mbtowc'
14275 d_memchr='$d_memchr'
14276 d_memcmp='$d_memcmp'
14277 d_memcpy='$d_memcpy'
14278 d_memmove='$d_memmove'
14279 d_memset='$d_memset'
14281 d_mkfifo='$d_mkfifo'
14282 d_mktime='$d_mktime'
14284 d_msg_ctrunc='$d_msg_ctrunc'
14285 d_msg_dontroute='$d_msg_dontroute'
14286 d_msg_oob='$d_msg_oob'
14287 d_msg_peek='$d_msg_peek'
14288 d_msg_proxy='$d_msg_proxy'
14289 d_msgctl='$d_msgctl'
14290 d_msgget='$d_msgget'
14291 d_msgrcv='$d_msgrcv'
14292 d_msgsnd='$d_msgsnd'
14293 d_mymalloc='$d_mymalloc'
14295 d_off64_t='$d_off64_t'
14296 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14297 d_oldpthreads='$d_oldpthreads'
14298 d_oldsock='$d_oldsock'
14300 d_pathconf='$d_pathconf'
14302 d_phostname='$d_phostname'
14305 d_portable='$d_portable'
14306 d_pthread_yield='$d_pthread_yield'
14308 d_pwchange='$d_pwchange'
14309 d_pwclass='$d_pwclass'
14310 d_pwcomment='$d_pwcomment'
14311 d_pwexpire='$d_pwexpire'
14312 d_pwgecos='$d_pwgecos'
14313 d_pwpasswd='$d_pwpasswd'
14314 d_pwquota='$d_pwquota'
14316 d_readdir='$d_readdir'
14317 d_readlink='$d_readlink'
14318 d_rename='$d_rename'
14319 d_rewinddir='$d_rewinddir'
14321 d_safebcpy='$d_safebcpy'
14322 d_safemcpy='$d_safemcpy'
14323 d_sanemcmp='$d_sanemcmp'
14324 d_sched_yield='$d_sched_yield'
14325 d_scm_rights='$d_scm_rights'
14326 d_seekdir='$d_seekdir'
14327 d_select='$d_select'
14329 d_semctl='$d_semctl'
14330 d_semctl_semid_ds='$d_semctl_semid_ds'
14331 d_semctl_semun='$d_semctl_semun'
14332 d_semget='$d_semget'
14334 d_setegid='$d_setegid'
14335 d_seteuid='$d_seteuid'
14336 d_setgrent='$d_setgrent'
14337 d_setgrps='$d_setgrps'
14338 d_sethent='$d_sethent'
14339 d_setlinebuf='$d_setlinebuf'
14340 d_setlocale='$d_setlocale'
14341 d_setnent='$d_setnent'
14342 d_setpent='$d_setpent'
14343 d_setpgid='$d_setpgid'
14344 d_setpgrp2='$d_setpgrp2'
14345 d_setpgrp='$d_setpgrp'
14346 d_setprior='$d_setprior'
14347 d_setpwent='$d_setpwent'
14348 d_setregid='$d_setregid'
14349 d_setresgid='$d_setresgid'
14350 d_setresuid='$d_setresuid'
14351 d_setreuid='$d_setreuid'
14352 d_setrgid='$d_setrgid'
14353 d_setruid='$d_setruid'
14354 d_setsent='$d_setsent'
14355 d_setsid='$d_setsid'
14356 d_setspent='$d_setspent'
14357 d_setvbuf='$d_setvbuf'
14361 d_shmatprototype='$d_shmatprototype'
14362 d_shmctl='$d_shmctl'
14364 d_shmget='$d_shmget'
14365 d_sigaction='$d_sigaction'
14366 d_sigsetjmp='$d_sigsetjmp'
14367 d_socket='$d_socket'
14368 d_sockpair='$d_sockpair'
14370 d_statblks='$d_statblks'
14371 d_statfs_f_flags='$d_statfs_f_flags'
14372 d_statfs_s='$d_statfs_s'
14373 d_statvfs='$d_statvfs'
14374 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14375 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14376 d_stdio_stream_array='$d_stdio_stream_array'
14377 d_stdiobase='$d_stdiobase'
14378 d_stdstdio='$d_stdstdio'
14379 d_strchr='$d_strchr'
14380 d_strcoll='$d_strcoll'
14381 d_strctcpy='$d_strctcpy'
14382 d_strerrm='$d_strerrm'
14383 d_strerror='$d_strerror'
14384 d_strtod='$d_strtod'
14385 d_strtol='$d_strtol'
14386 d_strtoul='$d_strtoul'
14387 d_strtoull='$d_strtoull'
14388 d_strxfrm='$d_strxfrm'
14389 d_suidsafe='$d_suidsafe'
14390 d_symlink='$d_symlink'
14391 d_syscall='$d_syscall'
14392 d_sysconf='$d_sysconf'
14393 d_sysernlst='$d_sysernlst'
14394 d_syserrlst='$d_syserrlst'
14395 d_system='$d_system'
14396 d_tcgetpgrp='$d_tcgetpgrp'
14397 d_tcsetpgrp='$d_tcsetpgrp'
14398 d_telldir='$d_telldir'
14399 d_telldirproto='$d_telldirproto'
14402 d_truncate='$d_truncate'
14403 d_tzname='$d_tzname'
14406 d_union_semun='$d_union_semun'
14408 d_vendorbin='$d_vendorbin'
14409 d_vendorlib='$d_vendorlib'
14411 d_void_closedir='$d_void_closedir'
14412 d_voidsig='$d_voidsig'
14413 d_voidtty='$d_voidtty'
14414 d_volatile='$d_volatile'
14415 d_vprintf='$d_vprintf'
14417 d_waitpid='$d_waitpid'
14418 d_wcstombs='$d_wcstombs'
14419 d_wctomb='$d_wctomb'
14422 db_hashtype='$db_hashtype'
14423 db_prefixtype='$db_prefixtype'
14424 defvoidused='$defvoidused'
14425 direntrytype='$direntrytype'
14428 doublesize='$doublesize'
14430 dynamic_ext='$dynamic_ext'
14436 eunicefix='$eunicefix'
14439 extensions='$extensions'
14440 fflushNULL='$fflushNULL'
14441 fflushall='$fflushall'
14443 firstmakefile='$firstmakefile'
14445 fpossize='$fpossize'
14446 fpostype='$fpostype'
14447 freetype='$freetype'
14449 full_csh='$full_csh'
14450 full_sed='$full_sed'
14451 gccversion='$gccversion'
14452 gidformat='$gidformat'
14458 groupcat='$groupcat'
14459 groupstype='$groupstype'
14462 h_sysfile='$h_sysfile'
14474 i_arpainet='$i_arpainet'
14475 i_bsdioctl='$i_bsdioctl'
14478 i_dirent='$i_dirent'
14485 i_inttypes='$i_inttypes'
14486 i_limits='$i_limits'
14487 i_locale='$i_locale'
14488 i_machcthr='$i_machcthr'
14489 i_malloc='$i_malloc'
14491 i_memory='$i_memory'
14492 i_mntent='$i_mntent'
14495 i_neterrno='$i_neterrno'
14496 i_netinettcp='$i_netinettcp'
14499 i_pthread='$i_pthread'
14501 i_rpcsvcdbm='$i_rpcsvcdbm'
14504 i_shadow='$i_shadow'
14506 i_stdarg='$i_stdarg'
14507 i_stddef='$i_stddef'
14508 i_stdlib='$i_stdlib'
14509 i_string='$i_string'
14510 i_sysaccess='$i_sysaccess'
14511 i_sysdir='$i_sysdir'
14512 i_sysfile='$i_sysfile'
14513 i_sysfilio='$i_sysfilio'
14515 i_sysioctl='$i_sysioctl'
14516 i_sysmount='$i_sysmount'
14517 i_sysndir='$i_sysndir'
14518 i_sysparam='$i_sysparam'
14519 i_sysresrc='$i_sysresrc'
14520 i_syssecrt='$i_syssecrt'
14521 i_sysselct='$i_sysselct'
14522 i_syssockio='$i_syssockio'
14523 i_sysstat='$i_sysstat'
14524 i_sysstatfs='$i_sysstatfs'
14525 i_sysstatvfs='$i_sysstatvfs'
14526 i_systime='$i_systime'
14527 i_systimek='$i_systimek'
14528 i_systimes='$i_systimes'
14529 i_systypes='$i_systypes'
14530 i_sysuio='$i_sysuio'
14532 i_sysvfs='$i_sysvfs'
14533 i_syswait='$i_syswait'
14534 i_termio='$i_termio'
14535 i_termios='$i_termios'
14537 i_unistd='$i_unistd'
14540 i_values='$i_values'
14541 i_varargs='$i_varargs'
14542 i_varhdr='$i_varhdr'
14544 ignore_versioned_solibs='$ignore_versioned_solibs'
14547 installarchlib='$installarchlib'
14548 installbin='$installbin'
14549 installman1dir='$installman1dir'
14550 installman3dir='$installman3dir'
14551 installprefix='$installprefix'
14552 installprefixexp='$installprefixexp'
14553 installprivlib='$installprivlib'
14554 installscript='$installscript'
14555 installsitearch='$installsitearch'
14556 installsitebin='$installsitebin'
14557 installsitelib='$installsitelib'
14558 installstyle='$installstyle'
14559 installusrbinperl='$installusrbinperl'
14560 installvendorbin='$installvendorbin'
14561 installvendorlib='$installvendorlib'
14563 ivdformat='$ivdformat'
14566 known_extensions='$known_extensions'
14570 lddlflags='$lddlflags'
14572 ldlibpthname='$ldlibpthname'
14579 libswanted='$libswanted'
14585 locincpth='$locincpth'
14586 loclibpth='$loclibpth'
14587 longdblsize='$longdblsize'
14588 longlongsize='$longlongsize'
14589 longsize='$longsize'
14593 lseeksize='$lseeksize'
14594 lseektype='$lseektype'
14598 make_set_make='$make_set_make'
14599 mallocobj='$mallocobj'
14600 mallocsrc='$mallocsrc'
14601 malloctype='$malloctype'
14603 man1direxp='$man1direxp'
14606 man3direxp='$man3direxp'
14609 mips_type='$mips_type'
14612 modetype='$modetype'
14614 multiarch='$multiarch'
14616 myarchname='$myarchname'
14617 mydomain='$mydomain'
14618 myhostname='$myhostname'
14621 netdb_hlen_type='$netdb_hlen_type'
14622 netdb_host_type='$netdb_host_type'
14623 netdb_name_type='$netdb_name_type'
14624 netdb_net_type='$netdb_net_type'
14627 nm_so_opt='$nm_so_opt'
14628 nonxs_ext='$nonxs_ext'
14632 o_nonblock='$o_nonblock'
14634 old_pthread_create_joinable='$old_pthread_create_joinable'
14635 optimize='$optimize'
14636 orderlib='$orderlib'
14642 patchlevel='$patchlevel'
14643 path_sep='$path_sep'
14645 perladmin='$perladmin'
14646 perlpath='$perlpath'
14648 phostname='$phostname'
14651 pm_apiversion='$pm_apiversion'
14655 prefixexp='$prefixexp'
14657 privlibexp='$privlibexp'
14658 prototype='$prototype'
14660 quadkind='$quadkind'
14661 quadtype='$quadtype'
14662 randbits='$randbits'
14663 randfunc='$randfunc'
14664 randseedtype='$randseedtype'
14666 rd_nodata='$rd_nodata'
14670 sPRIEldbl='$sPRIEldbl'
14671 sPRIFldbl='$sPRIFldbl'
14672 sPRIGldbl='$sPRIGldbl'
14675 sPRIeldbl='$sPRIeldbl'
14676 sPRIfldbl='$sPRIfldbl'
14677 sPRIgldbl='$sPRIgldbl'
14682 sched_yield='$sched_yield'
14683 scriptdir='$scriptdir'
14684 scriptdirexp='$scriptdirexp'
14686 seedfunc='$seedfunc'
14687 selectminbits='$selectminbits'
14688 selecttype='$selecttype'
14689 sendmail='$sendmail'
14692 sharpbang='$sharpbang'
14693 shmattype='$shmattype'
14694 shortsize='$shortsize'
14697 sig_count='$sig_count'
14698 sig_name='$sig_name'
14699 sig_name_init='$sig_name_init'
14701 sig_num_init='$sig_num_init'
14702 signal_t='$signal_t'
14703 sitearch='$sitearch'
14704 sitearchexp='$sitearchexp'
14706 sitebinexp='$sitebinexp'
14708 sitelibexp='$sitelibexp'
14709 siteprefix='$siteprefix'
14710 siteprefixexp='$siteprefixexp'
14711 sizesize='$sizesize'
14712 sizetype='$sizetype'
14717 sockethdr='$sockethdr'
14718 socketlib='$socketlib'
14720 spackage='$spackage'
14721 spitshell='$spitshell'
14724 ssizetype='$ssizetype'
14725 startperl='$startperl'
14727 static_ext='$static_ext'
14729 stdio_base='$stdio_base'
14730 stdio_bufsiz='$stdio_bufsiz'
14731 stdio_cnt='$stdio_cnt'
14732 stdio_filbuf='$stdio_filbuf'
14733 stdio_ptr='$stdio_ptr'
14734 stdio_stream_array='$stdio_stream_array'
14737 subversion='$subversion'
14744 timeincl='$timeincl'
14745 timetype='$timetype'
14758 uidformat='$uidformat'
14764 uquadtype='$uquadtype'
14765 use64bits='$use64bits'
14767 uselargefiles='$uselargefiles'
14768 uselongdouble='$uselongdouble'
14769 uselonglong='$uselonglong'
14770 usemorebits='$usemorebits'
14771 usemultiplicity='$usemultiplicity'
14772 usemymalloc='$usemymalloc'
14774 useopcode='$useopcode'
14775 useperlio='$useperlio'
14776 useposix='$useposix'
14778 useshrplib='$useshrplib'
14779 usesocks='$usesocks'
14780 usethreads='$usethreads'
14781 usevendorprefix='$usevendorprefix'
14782 usevfork='$usevfork'
14785 uvoformat='$uvoformat'
14788 uvuformat='$uvuformat'
14789 uvxformat='$uvxformat'
14790 vendorbin='$vendorbin'
14791 vendorbinexp='$vendorbinexp'
14792 vendorlib='$vendorlib'
14793 vendorlibexp='$vendorlibexp'
14794 vendorprefix='$vendorprefix'
14795 vendorprefixexp='$vendorprefixexp'
14798 voidflags='$voidflags'
14800 xs_apiversion='$xs_apiversion'
14805 : Add in command line options if available
14806 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14808 : add special variables
14809 $test -f $src/patchlevel.h && \
14810 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14811 echo "CONFIGDOTSH=true" >>config.sh
14813 : propagate old symbols
14814 if $test -f UU/config.sh; then
14815 <UU/config.sh sort | uniq >UU/oldconfig.sh
14816 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14817 sort | uniq -u >UU/oldsyms
14818 set X `cat UU/oldsyms`
14824 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14826 echo "# Variables propagated from previous config.sh file." >>config.sh
14827 for sym in `cat UU/oldsyms`; do
14828 echo " Propagating $hint variable "'$'"$sym..."
14829 eval 'tmp="$'"${sym}"'"'
14831 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14837 : Finish up by extracting the .SH files
14851 If you'd like to make any changes to the config.sh file before I begin
14852 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14855 rp="Press return or use a shell escape to edit config.sh:"
14860 *) : in case they cannot read
14861 sh 1>&4 -c "$ans";;
14866 : if this fails, just run all the .SH files by hand
14873 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14880 Now you need to generate make dependencies by running "$make depend".
14881 You might prefer to run it in background: "$make depend > makedepend.out &"
14882 It can take a while, so you might not want to run it right now.
14887 rp="Run $make depend now?"
14891 $make depend && echo "Now you must run a $make."
14894 echo "You must run '$make depend' then '$make'."
14897 elif test -f [Mm]akefile; then
14899 echo "Now you must run a $make."
14904 if $test -f Policy.sh; then
14907 If you compile $package on a different machine or from a different object
14908 directory, copy the Policy.sh file from this object directory to the
14909 new one before you run Configure -- this will help you with most of
14910 the policy defaults.
14914 if $test -f config.msg; then
14915 echo "Hmm. I also noted the following information while running:"
14917 $cat config.msg >&4
14920 $rm -f kit*isdone ark*isdone