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 Sun Nov 7 02:39:34 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
439 d_old_pthread_create_joinable=''
440 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
888 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
891 : We must find out about Eunice early
893 if test -f /etc/unixtovms; then
894 eunicefix=/etc/unixtovms
896 if test -f /etc/unixtovms.exe; then
897 eunicefix=/etc/unixtovms.exe
901 : Possible local include directories to search.
902 : Set locincpth to "" in a hint file to defeat local include searches.
903 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
904 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
906 : no include file wanted by default
909 : list of known cpp symbols, sorted alphabetically
910 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
911 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
912 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
913 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
914 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
915 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
916 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
917 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
918 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
919 al="$al VMS Xenix286"
920 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
921 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
922 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
923 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
924 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
925 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
926 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
927 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
928 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
929 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
930 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
931 al="$al __SVR4_2__ __UMAXV__"
932 al="$al ____386BSD____ __alpha __alpha__ __amiga"
933 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
934 al="$al __host_mips__"
935 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
936 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
937 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
938 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
939 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
940 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
941 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
942 al="$al __mc88100 __mc88100__ __mips __mips__"
943 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
944 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
945 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
946 al="$al _host_mips _mips _unix"
947 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
948 al="$al apollo ardent att386 att3b"
949 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
950 al="$al cadmus clipper concurrent convex cray ctix"
951 al="$al dmert encore gcos gcx gimpel gould"
952 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
953 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
954 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
955 al="$al i186 i286 i386 i486 i8086"
956 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
957 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
958 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
959 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
960 al="$al mc88000 mc88100 merlin mert mips mvs n16"
961 al="$al ncl_el ncl_mr"
962 al="$al news1500 news1700 news1800 news1900 news3700"
963 al="$al news700 news800 news900 ns16000 ns32000"
964 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
965 al="$al parisc pc532 pdp11 plexus posix pyr"
966 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
967 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
968 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
969 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
970 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
971 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
974 : Trailing extension. Override this in a hint file, if needed.
976 : Extra object files, if any, needed on this platform.
979 : change the next line if compiling for Xenix/286 on Xenix/386
980 xlibpth='/usr/lib/386 /lib/386'
982 : Possible local library directories to search.
983 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
984 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
986 : general looking path for locating libraries
987 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
988 glibpth="$glibpth /lib /usr/lib $xlibpth"
989 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
990 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
992 : Private path used by Configure to find libraries. Its value
993 : is prepended to libpth. This variable takes care of special
994 : machines, like the mips. Usually, it should be empty.
997 : default library list
999 : some systems want to use only the non-versioned libso:s
1000 ignore_versioned_solibs=''
1001 : full support for void wanted by default
1004 : set useposix=false in your hint file to disable the POSIX extension.
1006 : set useopcode=false in your hint file to disable the Opcode extension.
1008 : set usemultiplicity on the Configure command line to enable multiplicity.
1009 : set usesocks on the Configure command line to enable socks.
1010 : set usethreads on the Configure command line to enable threads.
1011 : List of libraries we want.
1012 : If anyone needs -lnet, put it in a hint file.
1013 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1014 libswanted="$libswanted dld ld sun m c cposix posix"
1015 libswanted="$libswanted ndir dir crypt sec"
1016 libswanted="$libswanted ucb bsd BSD PW x"
1017 : We probably want to search /usr/shlib before most other libraries.
1018 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1019 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1020 glibpth="/usr/shlib $glibpth"
1021 : Do not use vfork unless overridden by a hint file.
1024 : Find the basic shell for Bourne shell scripts
1028 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1031 if test -f "$xxx"; then
1034 : Build up a list and do a single loop so we can 'break' out.
1035 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1036 for xxx in sh bash ksh pdksh ash; do
1038 try="$try ${p}/${xxx}"
1042 if test -f "$xxx"; then
1045 elif test -f "$xxx.exe"; then
1056 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1058 Usually it's in /bin/sh. How did you even get this far?
1059 Please contact me (Perl Maintainers) at perlbug@perl.com and
1060 we'll try to straighten this all out.
1066 : see if sh knows # comments
1067 if `$sh -c '#' >/dev/null 2>&1`; then
1071 test -f $xcat || xcat=/usr/bin/cat
1076 if test -s today; then
1079 echo "#! $xcat" > try
1083 if test -s today; then
1091 echo "Your $sh doesn't grok # comments--I will strip them later on."
1094 echo "exec grep -v '^[ ]*#'" >spitshell
1096 $eunicefix spitshell
1097 spitshell=`pwd`/spitshell
1099 echo "I presume that if # doesn't work, #! won't work either!"
1104 : figure out how to guarantee sh startup
1106 '') startsh=${sharpbang}${sh} ;;
1118 : echo "Yup, it does."
1120 echo "Hmm... '$startsh' does not guarantee sh startup..."
1121 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1126 : Save command line options in file UU/cmdline.opt for later use in
1127 : generating config.sh.
1128 cat > cmdline.opt <<EOSH
1129 # Configure command line arguments.
1136 cat >>cmdline.opt <<EOSH
1137 config_arg$argn='$arg'
1139 argn=`expr $argn + 1`
1142 : produce awk script to parse command line options
1143 cat >options.awk <<'EOF'
1145 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1147 len = length(optstr);
1148 for (i = 1; i <= len; i++) {
1149 c = substr(optstr, i, 1);
1150 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1161 if (substr(str, 1, 1) != "-") {
1162 printf("'%s'\n", str);
1166 for (i = 2; i <= len; i++) {
1167 c = substr(str, i, 1);
1169 printf("-%s\n", substr(str, i));
1175 printf("'%s'\n", substr(str, i + 1));
1188 : process the command line options
1189 set X `for arg in "$@"; do echo "X$arg"; done |
1190 sed -e s/X// | awk -f options.awk`
1195 : set up default values
1205 rm -f optdef.sh posthint.sh
1206 cat >optdef.sh <<EOS
1212 while test $# -gt 0; do
1214 -d) shift; fastread=yes;;
1215 -e) shift; alldone=cont;;
1219 if test -r "$1"; then
1222 echo "$me: cannot read config file $1." >&2
1227 -h) shift; error=true;;
1228 -r) shift; reuseval=true;;
1229 -s) shift; silent=true; realsilent=true;;
1230 -E) shift; alldone=exit;;
1231 -K) shift; knowitall=true;;
1232 -O) shift; override=true;;
1233 -S) shift; silent=true; extractsh=true;;
1238 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1239 echo "$me: ignoring -D $1" >&2
1242 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1243 *) echo "$1='define'" >> optdef.sh;;
1250 *=) echo "$1" >> optdef.sh;;
1252 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1253 echo "$me: ignoring -U $1" >&2
1255 *) echo "$1='undef'" >> optdef.sh;;
1266 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1270 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1271 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1277 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1278 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1279 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1281 *) xxx=`echo $yyy|sed 's!:.*!!'`
1282 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1288 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1290 echo "$yyy=''" >> posthint.sh ;;
1295 echo "$yyy='$zzz'" >> posthint.sh ;;
1297 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1304 echo "$yyy=$zzz" >> posthint.sh ;;
1305 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1308 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1311 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1319 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1320 [-U symbol] [-U symbol=] [-A command:symbol...]
1321 -d : use defaults for all answers.
1322 -e : go on without questioning past the production of config.sh.
1323 -f : specify an alternate default configuration file.
1324 -h : print this help message and exit (with an error status).
1325 -r : reuse C symbols value if possible (skips costly nm extraction).
1326 -s : silent mode, only echoes questions and essential information.
1327 -D : define symbol to have some value:
1328 -D symbol symbol gets the value 'define'
1329 -D symbol=value symbol gets the value 'value'
1330 -E : stop at the end of questions, after having produced config.sh.
1331 -K : do not use unless you know what you are doing.
1332 -O : let -D and -U override definitions from loaded configuration file.
1333 -S : perform variable substitutions on all .SH files (can mix with -f)
1334 -U : undefine symbol:
1335 -U symbol symbol gets the value 'undef'
1336 -U symbol= symbol gets completely empty
1337 -A : manipulate symbol after the platform specific hints have been applied:
1338 -A symbol=value append " "value to symbol
1339 -A append:symbol=value append value to symbol
1340 -A define:symbol=value define symbol to have value
1341 -A clear:symbol define symbol to be ''
1342 -A define:symbol define symbol to be 'define'
1343 -A eval:symbol=value define symbol to be eval of value
1344 -A prepend:symbol=value prepend value to symbol
1345 -A undef:symbol define symbol to be 'undef'
1346 -A undef:symbol= define symbol to be ''
1347 -V : print version number and exit (with a zero status).
1354 case "$fastread$alldone" in
1357 if test ! -t 0; then
1358 echo "Say 'sh Configure', not 'sh <Configure'"
1366 true) exec 1>/dev/null;;
1369 : run the defines and the undefines, if any, but leave the file out there...
1372 : create the posthint manipulation script and leave the file out there...
1377 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1378 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1379 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1380 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1381 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1384 : Some greps do not return status, grrr.
1385 echo "grimblepritz" >grimble
1386 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1388 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1394 : the following should work in any shell
1398 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1399 cat >contains <<'EOSS'
1400 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1405 : Find the path to the source tree
1408 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1411 *) src=`cd ../$src && pwd` ;;
1424 if test -f $rsrc/Configure && \
1425 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1427 : found it, so we are ok.
1430 for src in . .. ../.. ../../.. ../../../..; do
1431 if test -f ../$src/Configure && \
1432 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1443 Sorry, I can't seem to locate the source dir for $package. Please start
1444 Configure with an explicit path -- i.e. /some/path/Configure.
1452 echo "Sources for $package found in \"$src\"." >&4
1456 : script used to extract .SH files with variable substitutions
1457 cat >extract <<'EOS'
1459 echo "Doing variable substitutions on .SH files..."
1460 if test -f $src/MANIFEST; then
1461 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1463 echo "(Looking for .SH files under the source directory.)"
1464 set x `(cd $src; find . -name "*.SH" -print)`
1468 0) set x `(cd $src; echo *.SH)`; shift;;
1470 if test ! -f $src/$1; then
1476 while test $name; do
1477 if test ! -d "$name"; then
1478 create="$name $create";
1479 name=`echo $name | sed -e "s|^[^/]*$||"`;
1480 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1485 for file in $create; do
1494 dir=`expr X$file : 'X\(.*\)/'`
1495 file=`expr X$file : 'X.*/\(.*\)'`
1496 (cd $dir && . ./$file)
1506 dir=`expr X$file : 'X\(.*\)/'`
1507 file=`expr X$file : 'X.*/\(.*\)'`
1508 (set x $dir; shift; eval $mkdir_p)
1518 if test -f $src/config_h.SH; then
1519 if test ! -f config.h; then
1520 : oops, they left it out of MANIFEST, probably, so do it anyway.
1526 : extract files and exit if asked to do so
1527 case "$extractsh" in
1529 case "$realsilent" in
1533 case "$config_sh" in
1534 '') config_sh='config.sh';;
1537 echo "Fetching answers from $config_sh..."
1540 test "$override" && . ./optdef.sh
1549 : Eunice requires " " instead of "", can you believe it
1552 echo "Beginning of configuration questions for $package."
1554 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1556 : first determine how to suppress newline on echo command
1558 echo "Checking echo to see how to suppress newlines..."
1559 (echo "hi there\c" ; echo " ") >.echotmp
1560 if $contains c .echotmp >/dev/null 2>&1 ; then
1571 echo $n "The star should be here-->$c"
1575 : Now test for existence of everything in MANIFEST
1577 if test -f $rsrc/MANIFEST; then
1578 echo "First let's make sure your kit is complete. Checking..." >&4
1579 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1582 for filelist in x??; do
1583 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1585 if test -s missing; then
1589 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1591 You have the option of continuing the configuration process, despite the
1592 distinct possibility that your kit is damaged, by typing 'y'es. If you
1593 do, don't blame me if something goes wrong. I advise you to type 'n'o
1594 and contact the author (perlbug@perl.com).
1597 echo $n "Continue? [n] $c" >&4
1601 echo "Continuing..." >&4
1605 echo "ABORTING..." >&4
1610 echo "Looks good..."
1613 echo "There is no MANIFEST file. I hope your kit is complete !"
1618 : Find the appropriate value for a newline for tr
1619 if test -n "$DJGPP"; then
1622 if test X"$trnl" = X; then
1623 case "`echo foo|tr '\n' x 2>/dev/null`" in
1627 if test X"$trnl" = X; then
1628 case "`echo foo|tr '\012' x 2>/dev/null`" in
1629 foox) trnl='\012' ;;
1632 if test X"$trnl" = X; then
1635 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1641 : compute the number of columns on the terminal for proper question formatting
1646 : set up the echo used in my read
1647 myecho="case \"\$xxxm\" in
1648 '') echo $n \"\$rp $c\" >&4;;
1650 '') echo $n \"[\$xxxm] $c\";;
1652 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1654 echo $n \"[\$xxxm] $c\" >&4
1656 echo $n \"\$rp [\$xxxm] $c\" >&4
1662 : now set up to do reads with possible shell escape and default assignment
1668 case "\$fastread" in
1669 yes) case "\$dflt" in
1672 case "\$silent-\$rp" in
1677 *) case "\$silent" in
1678 true) case "\$rp" in
1683 while expr "X\$ans" : "X!" >/dev/null; do
1687 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1695 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1704 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1709 echo "(OK, I'll run with -d after this question.)" >&4
1712 echo "*** Sorry, \$1 not supported yet." >&4
1722 echo "*** Substitution done -- please confirm."
1724 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1729 echo "*** Error -- try again."
1736 case "\$ans\$xxxm\$nostick" in
1748 : create .config dir to save info across Configure sessions
1749 test -d ../.config || mkdir ../.config
1750 cat >../.config/README <<EOF
1751 This directory created by Configure to save information that should
1752 persist across sessions for $package.
1754 You may safely delete it if you wish.
1757 : general instructions
1760 user=`(logname) 2>/dev/null`
1762 '') user=`whoami 2>&1`;;
1764 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1767 rp='Would you like to see the instructions?'
1778 This installation shell script will examine your system and ask you questions
1779 to determine how the perl5 package should be installed. If you get
1780 stuck on a question, you may use a ! shell escape to start a subshell or
1781 execute a command. Many of the questions will have default answers in square
1782 brackets; typing carriage return will give you the default.
1784 On some of the questions which ask for file or directory names you are allowed
1785 to use the ~name construct to specify the login directory belonging to "name",
1786 even if you don't have a shell which knows about that. Questions where this is
1787 allowed will be marked "(~name ok)".
1791 dflt='Type carriage return to continue'
1795 The prompter used in this script allows you to use shell variables and
1796 backticks in your answers. You may use $1, $2, etc... to refer to the words
1797 in the default answer, as if the default line was a set of arguments given to a
1798 script shell. This means you may also use $* to repeat the whole default line,
1799 so you do not have to re-type everything to add something to the default.
1801 Everytime there is a substitution, you will have to confirm. If there is an
1802 error (e.g. an unmatched backtick), the default answer will remain unchanged
1803 and you will be prompted again.
1805 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1806 the questions and use the computed defaults (or the previous answers if there
1807 was already a config.sh file). Type 'Configure -h' for a list of options.
1808 You may also start interactively and then answer '& -d' at any prompt to turn
1809 on the non-interactive behaviour for the remainder of the execution.
1815 Much effort has been expended to ensure that this shell script will run on any
1816 Unix system. If despite that it blows up on yours, your best bet is to edit
1817 Configure and run it again. If you can't run Configure for some reason,
1818 you'll have to generate a config.sh file by hand. Whatever problems you
1819 have, let me (perlbug@perl.com) know how I blew it.
1821 This installation script affects things in two ways:
1823 1) it may do direct variable substitutions on some of the files included
1825 2) it builds a config.h file for inclusion in C programs. You may edit
1826 any of these files as the need arises after running this script.
1828 If you make a mistake on a question, there is no easy way to back up to it
1829 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1830 files. Configure will offer to let you do this before it runs the SH files.
1833 dflt='Type carriage return to continue'
1835 case "$firsttime" in
1836 true) echo $user >>../.config/instruct;;
1840 : find out where common programs are
1842 echo "Locating common programs..." >&4
1855 if test -d \$dir/\$thing; then
1861 for thisthing in \$dir/\$thing; do
1862 : just loop through to pick last item
1864 if test -f \$thisthing; then
1867 elif test -f \$dir/\$thing.exe; then
1868 if test -n "$DJGPP"; then
1869 echo \$dir/\$thing.exe
1871 : on Eunice apparently
1921 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1922 pth="$pth /lib /usr/lib"
1923 for file in $loclist; do
1927 if test -f "$xxx"; then
1930 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1931 xxx=`./loc $file $file $pth`
1934 '') xxx=`./loc $file $file $pth`;;
1935 *) xxx=`./loc $xxx $xxx $pth`;;
1941 echo $file is in $xxx.
1944 echo $file is in $xxx.
1947 echo "I don't know where '$file' is, and my life depends on it." >&4
1948 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1954 echo "Don't worry if any of the following aren't found..."
1956 for file in $trylist; do
1960 if test -f "$xxx"; then
1963 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1964 xxx=`./loc $file $file $pth`
1967 '') xxx=`./loc $file $file $pth`;;
1968 *) xxx=`./loc $xxx $xxx $pth`;;
1974 echo $file is in $xxx.
1977 echo $file is in $xxx.
1980 echo "I don't see $file out there, $say."
1987 echo "Substituting grep for egrep."
1993 echo "Substituting cp for ln."
1999 echo "Hopefully test is built into your sh."
2002 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2003 echo "Using the test built into your sh."
2011 echo "Hopefully echo is built into your sh."
2016 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2017 $echo $n "hi there$c" >foo1
2018 echo $n "hi there$c" >foo2
2019 if cmp foo1 foo2 >/dev/null 2>&1; then
2020 echo "They are compatible. In fact, they may be identical."
2027 They are not compatible! You are probably running ksh on a non-USG system.
2028 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2029 have echo built in and we may have to run some Bourne shell scripts. That
2030 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2033 $echo $n "The star should be here-->$c"
2040 : determine whether symbolic links are supported
2043 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2044 echo "Symbolic links are supported." >&4
2047 echo "Symbolic links are NOT supported." >&4
2052 : see whether [:lower:] and [:upper:] are supported character classes
2054 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2056 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2060 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2061 # (0xc9 and 0xd1), therefore that is a nice testing point.
2062 if test "X$up" = X -o "X$low" = X; then
2063 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2069 if test "X$up" = X -o "X$low" = X; then
2070 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2076 if test "X$up" = X -o "X$low" = X; then
2077 case "`echo IJ | od -x 2>/dev/null`" in
2079 echo "Hey, this might be EBCDIC." >&4
2080 if test "X$up" = X -o "X$low" = X; then
2081 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2082 ij) up='[A-IJ-RS-Z]'
2087 if test "X$up" = X -o "X$low" = X; then
2088 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2098 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2100 echo "Using $up and $low to convert case." >&4
2103 echo "I don't know how to translate letters from upper to lower case." >&4
2104 echo "Your tr is not acting any way I know of." >&4
2108 : set up the translation script tr, must be called with ./tr of course
2112 '[A-Z][a-z]') exec $tr '$up' '$low';;
2113 '[a-z][A-Z]') exec $tr '$low' '$up';;
2120 : Try to determine whether config.sh was made on this system
2121 case "$config_sh" in
2123 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2124 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2125 # because the A-Z/a-z are not consecutive.
2126 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2127 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2128 newmyuname="$myuname"
2130 case "$knowitall" in
2132 if test -f ../config.sh; then
2133 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2134 eval "`grep myuname= ../config.sh`"
2136 if test "X$myuname" = "X$newmyuname"; then
2144 : Get old answers from old config file if Configure was run on the
2145 : same system, otherwise use the hints.
2148 if test -f config.sh; then
2150 rp="I see a config.sh file. Shall I use it to set the defaults?"
2153 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2154 *) echo "Fetching default answers from your old config.sh file..." >&4
2162 : Older versions did not always set $sh. Catch re-use of such
2171 if test ! -f config.sh; then
2174 First time through, eh? I have some defaults handy for some systems
2175 that need some extra help getting the Configure answers right:
2178 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2180 : Half the following guesses are probably wrong... If you have better
2181 : tests or hints, please send them to perlbug@perl.com
2182 : The metaconfig authors would also appreciate a copy...
2183 $test -f /irix && osname=irix
2184 $test -f /xenix && osname=sco_xenix
2185 $test -f /dynix && osname=dynix
2186 $test -f /dnix && osname=dnix
2187 $test -f /lynx.os && osname=lynxos
2188 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2189 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2190 $test -f /bin/mips && /bin/mips && osname=mips
2191 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2192 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2193 $test -d /usr/apollo/bin && osname=apollo
2194 $test -f /etc/saf/_sactab && osname=svr4
2195 $test -d /usr/include/minix && osname=minix
2196 if $test -d /MachTen -o -d /MachTen_Folder; then
2198 if $test -x /sbin/version; then
2199 osvers=`/sbin/version | $awk '{print $2}' |
2200 $sed -e 's/[A-Za-z]$//'`
2201 elif $test -x /usr/etc/version; then
2202 osvers=`/usr/etc/version | $awk '{print $2}' |
2203 $sed -e 's/[A-Za-z]$//'`
2208 $test -f /sys/posix.dll &&
2209 $test -f /usr/bin/what &&
2210 set X `/usr/bin/what /sys/posix.dll` &&
2211 $test "$3" = UWIN &&
2214 if $test -f $uname; then
2222 umips) osname=umips ;;
2225 [23]100) osname=mips ;;
2226 next*) osname=next ;;
2228 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2229 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2232 elif $test -f /etc/kconfig; then
2234 if test "$lns" = "$ln -s"; then
2236 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2238 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2245 if test -n "$DJGPP"; then
2254 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2256 'not found') osvers="$4"."$3" ;;
2257 '<3240'|'<>3240') osvers=3.2.0 ;;
2258 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2259 '=3250'|'>3250') osvers=3.2.5 ;;
2263 *dc.osx) osname=dcosx
2269 domainos) osname=apollo
2275 dynixptx*) osname=dynixptx
2276 osvers=`echo "$4"|sed 's/^v//'`
2278 freebsd) osname=freebsd
2280 genix) osname=genix ;;
2282 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2298 netbsd*) osname=netbsd
2301 news-os) osvers="$3"
2303 4*) osname=newsos4 ;;
2307 bsd386) osname=bsd386
2310 POSIX-BC | posix-bc ) osname=posix-bc
2313 powerux | power_ux | powermax_os | powermaxos | \
2314 powerunix | power_unix) osname=powerux
2317 next*) osname=next ;;
2318 solaris) osname=solaris
2320 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2327 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2331 titanos) osname=titanos
2340 ultrix) osname=ultrix
2343 osf1|mls+) case "$5" in
2346 osvers=`echo "$3" | sed 's/^[xvt]//'`
2348 hp*) osname=hp_osf1 ;;
2349 mips) osname=mips_osf1 ;;
2352 unixware) osname=svr5
2361 $2) case "$osname" in
2365 : svr4.x or possibly later
2375 if test -f /stand/boot ; then
2376 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2377 if test -n "$INITPROG" -a -f "$INITPROG"; then
2378 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2379 if test -n "$isesix"; then
2387 *) if test -f /etc/systemid; then
2389 set `echo $3 | $sed 's/\./ /g'` $4
2390 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2392 elif $test -f $src/hints/sco_$1_$2.sh; then
2394 elif $test -f $src/hints/sco_$1.sh; then
2399 '') : Still unknown. Probably a generic Sys V.
2408 *) case "$osname" in
2409 '') : Still unknown. Probably a generic BSD.
2417 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2418 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2419 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2422 $rm -f UU/kernel.what
2423 elif test -d c:/.; then
2430 : Now look for a hint file osname_osvers, unless one has been
2431 : specified already.
2434 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2435 : Also try without trailing minor version numbers.
2436 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2437 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2438 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2439 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2442 *) case "$osvers" in
2445 *) if $test -f $src/hints/$file.sh ; then
2447 elif $test -f $src/hints/$xfile.sh ; then
2449 elif $test -f $src/hints/$xxfile.sh ; then
2451 elif $test -f $src/hints/$xxxfile.sh ; then
2453 elif $test -f $src/hints/$xxxxfile.sh ; then
2455 elif $test -f "$src/hints/${osname}.sh" ; then
2464 if $test -f Policy.sh ; then
2467 none) dflt="Policy" ;;
2468 *) dflt="Policy $dflt" ;;
2473 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2477 if $test -f Policy.sh ; then
2480 There's also a Policy hint file available, which should make the
2481 site-specific (policy) questions easier to answer.
2488 You may give one or more space-separated answers, or "none" if appropriate.
2489 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2490 is a good thing. DO NOT give a wrong version or a wrong OS.
2494 rp="Which of these apply, if any?"
2497 for file in $tans; do
2498 if $test X$file = XPolicy -a -f Policy.sh; then
2500 $cat Policy.sh >> UU/config.sh
2501 elif $test -f $src/hints/$file.sh; then
2502 . $src/hints/$file.sh
2503 $cat $src/hints/$file.sh >> UU/config.sh
2504 elif $test X$tans = X -o X$tans = Xnone ; then
2507 : Give one chance to correct a possible typo.
2508 echo "$file.sh does not exist"
2510 rp="hint to use instead?"
2512 for file in $ans; do
2513 if $test -f "$src/hints/$file.sh"; then
2514 . $src/hints/$file.sh
2515 $cat $src/hints/$file.sh >> UU/config.sh
2516 elif $test X$ans = X -o X$ans = Xnone ; then
2519 echo "$file.sh does not exist -- ignored."
2526 : Remember our hint file for later.
2527 if $test -f "$src/hints/$file.sh" ; then
2537 echo "Fetching default answers from $config_sh..." >&4
2541 cp $config_sh config.sh 2>/dev/null
2551 test "$override" && . ./optdef.sh
2552 myuname="$newmyuname"
2554 : Restore computed paths
2555 for file in $loclist $trylist; do
2556 eval $file="\$_$file"
2561 Configure uses the operating system name and version to set some defaults.
2562 The default value is probably right if the name rings a bell. Otherwise,
2563 since spelling matters for me, either accept the default or answer "none"
2570 ''|' '|none) dflt=none ;;
2571 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2574 *) dflt="$osname" ;;
2576 rp="Operating system name?"
2580 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2586 ''|' '|none) dflt=none ;;
2587 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2588 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2590 ''|' ') dflt=none ;;
2595 *) dflt="$osvers" ;;
2597 rp="Operating system version?"
2607 : who configured the system
2608 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2609 cf_by=`(logname) 2>/dev/null`
2612 cf_by=`(whoami) 2>/dev/null`
2614 "") cf_by=unknown ;;
2618 : set up the script used to warn in case of inconsistency
2625 echo "*** WHOA THERE!!! ***" >&4
2626 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2627 rp=" Keep the $hint value?"
2630 y) td=$was; tu=$was;;
2634 : function used to set $1 to $val
2635 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2637 $define$undef) . ./whoa; eval "$var=\$td";;
2638 $undef$define) . ./whoa; eval "$var=\$tu";;
2639 *) eval "$var=$val";;
2644 Perl can be built to take advantage of threads, on some systems.
2645 To do so, Configure must be run with -Dusethreads.
2647 Note that threading is a highly experimental feature, and
2648 some known race conditions still remain. If you choose to try
2649 it, be very sure to not actually deploy it for production
2650 purposes. README.threads has more details, and is required
2651 reading if you enable threads.
2653 case "$usethreads" in
2654 $define|true|[yY]*) dflt='y';;
2657 rp='Build a threading Perl?'
2660 y|Y) val="$define" ;;
2666 case "$d_oldpthreads" in
2667 '') : Configure tests would be welcome here. For now, assume undef.
2669 *) val="$d_oldpthreads" ;;
2675 case "$usethreads" in
2676 "$define"|true|[yY]*)
2677 : Look for a hint-file generated 'call-back-unit'. If the
2678 : user has specified that a threading perl is to be built,
2679 : we may need to set or change some other defaults.
2680 if $test -f usethreads.cbu; then
2681 echo "Your platform has some specific hints for threaded builds, using them..."
2685 (Your platform doesn't have any specific hints for threaded builds.
2686 Assuming POSIX threads, then.)
2694 Perl can be built so that multiple Perl interpreters can coexist
2695 within the same Perl executable. To do so, Configure must be run with
2698 Normally you do not need this and you should answer no.
2701 case "$usemultiplicity" in
2702 $define|true|[yY]*) dflt='y';;
2705 rp='Build Perl for multiplicity?'
2708 y|Y) val="$define" ;;
2714 : determine where manual pages are on this system
2718 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2719 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2720 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2721 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2722 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2723 sysman=`./loc . /usr/man/man1 $syspath`
2726 if $test -d "$sysman"; then
2727 echo "System manual is in $sysman." >&4
2729 echo "Could not find manual pages in source form." >&4
2732 : see what memory models we can support
2735 $cat >pdp11.c <<'EOP'
2744 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2745 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2746 dflt='unsplit split'
2748 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2751 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2756 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2759 if $test -d /lib/large || $test -d /usr/lib/large; then
2762 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2771 Some systems have different model sizes. On most systems they are called
2772 small, medium, large, and huge. On the PDP11 they are called unsplit and
2773 split. If your system doesn't support different memory models, say "none".
2774 If you wish to force everything to one memory model, say "none" here and
2775 put the appropriate flags later when it asks you for other cc and ld flags.
2776 Venix systems may wish to put "none" and let the compiler figure things out.
2777 (In the following question multiple model names should be space separated.)
2779 The default for most systems is "none".
2782 rp="Which memory models are supported?"
2797 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2798 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2805 rp="What flag indicates separate I and D space?"
2813 *large*|*small*|*medium*|*huge*)
2820 rp="What flag indicates large model?"
2830 *huge*) case "$huge" in
2834 rp="What flag indicates huge model?"
2844 *medium*) case "$medium" in
2848 rp="What flag indicates medium model?"
2855 *) medium="$large";;
2858 *small*) case "$small" in
2862 rp="What flag indicates small model?"
2873 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2876 $rm -f pdp11.* pdp11
2878 : make some quick guesses about what we are up against
2880 $echo $n "Hmm... $c"
2890 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2891 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2893 echo "Looks kind of like an OSF/1 system, but we'll see..."
2895 elif test `echo abc | tr a-z A-Z` = Abc ; then
2896 xxx=`./loc addbib blurfl $pth`
2897 if $test -f $xxx; then
2898 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2902 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2903 echo "Looks kind of like an extended USG system, but we'll see..."
2905 echo "Looks kind of like a USG system, but we'll see..."
2909 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2910 echo "Looks kind of like a BSD system, but we'll see..."
2914 echo "Looks kind of like a Version 7 system, but we'll see..."
2917 case "$eunicefix" in
2920 There is, however, a strange, musty smell in the air that reminds me of
2921 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2925 : it so happens the Eunice I know will not run shell scripts in Unix format
2929 echo "Congratulations. You aren't running Eunice."
2933 : Detect OS2. The p_ variable is set above in the Head.U unit.
2938 I have the feeling something is not exactly right, however...don't tell me...
2939 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2944 if test -f /xenix; then
2945 echo "Actually, this looks more like a XENIX system..."
2950 echo "It's not Xenix..."
2955 if test -f /venix; then
2956 echo "Actually, this looks more like a VENIX system..."
2963 echo "Nor is it Venix..."
2966 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2967 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2970 : see if we need a special compiler
2978 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2979 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2993 On some older systems the default C compiler will not resolve multiple global
2994 references that happen to have the same name. On some such systems the "Mcc"
2995 command may be used to force these to be resolved. On other systems a "cc -M"
2996 command is required. (Note that the -M flag on other systems indicates a
2997 memory model to use!) If you have the Gnu C compiler, you might wish to use
3003 rp="Use which C compiler?"
3011 rp="Use which C compiler?"
3015 : Look for a hint-file generated 'call-back-unit'. Now that the
3016 : user has specified the compiler, we may need to set or change some
3018 if $test -f cc.cbu; then
3022 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3023 $cat >gccvers.c <<EOM
3028 printf("%s\n", __VERSION__);
3030 printf("%s\n", "1");
3036 if $cc -o gccvers gccvers.c; then
3037 gccversion=`./gccvers`
3038 case "$gccversion" in
3039 '') echo "You are not using GNU cc." ;;
3040 *) echo "You are using GNU cc $gccversion." ;;
3044 echo "*** WHOA THERE!!! ***" >&4
3045 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3046 case "$knowitall" in
3048 echo " You'd better start hunting for one and let me know about it." >&4
3054 case "$gccversion" in
3055 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3059 case "$usemorebits" in
3060 "$define"|true|[yY]*)
3062 uselongdouble="$define"
3063 usemorebits="$define"
3065 *) usemorebits="$undef"
3072 Perl can be built to understand large files (files larger than 2 gigabytes)
3073 on some systems. To do so, Configure must be run with -Duselargefiles.
3075 If this doesn't make any sense to you, just accept the default.
3077 case "$uselargefiles" in
3078 "$define"|true|[yY]*) dflt='y' ;;
3081 rp='Try to understand large files?'
3084 y|Y) val="$define" ;;
3089 case "$uselargefiles" in
3090 "$define") use64bits="$define" ;;
3095 Perl can be built to take advantage of explicit 64-bit interfaces,
3096 on some systems. To do so, Configure must be run with -Duse64bits.
3098 If this doesn't make any sense to you, just accept the default.
3100 case "$use64bits" in
3101 $define|true|[yY]*) dflt='y';;
3104 rp='Try to use explicit 64-bit interfaces, if available?'
3117 case "$archname64" in
3118 '') archname64='' ;; # not a typo
3121 case "$use64bits" in
3122 "$define"|true|[yY]*)
3123 : Look for a hint-file generated 'call-back-unit'. If the
3124 : user has specified that a 64 bit perl is to be built,
3125 : we may need to set or change some other defaults.
3126 if $test -f use64bits.cbu; then
3127 echo "Your platform has some specific hints for 64-bit builds, using them..."
3131 (Your platform doesn't have any specific hints for 64-bit builds.
3132 This is probably okay, especially if your system is a true 64-bit system.)
3134 case "$gccversion" in
3137 But since you seem to be using gcc,
3138 I will now add -DUSE_LONG_LONG to the compilation flags.
3140 ccflags="$ccflags -DUSE_LONG_LONG"
3147 : determine the architecture name
3149 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3150 tarch=`arch`"-$osname"
3151 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3152 if uname -m > tmparch 2>&1 ; then
3153 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3154 -e 's/$/'"-$osname/" tmparch`
3162 case "$myarchname" in
3165 echo "(Your architecture name used to be $myarchname.)"
3172 *) dflt="$archname";;
3174 rp='What is your architecture name'
3177 case "$usethreads" in
3179 echo "Threads selected." >&4
3181 *-thread*) echo "...and architecture name already has -thread." >&4
3183 *) archname="$archname-thread"
3184 echo "...setting architecture name to $archname." >&4
3189 case "$usemultiplicity" in
3191 echo "Multiplicity selected." >&4
3193 *-multi*) echo "...and architecture name already has -multi." >&4
3195 *) archname="$archname-multi"
3196 echo "...setting architecture name to $archname." >&4
3201 case "$use64bits" in
3203 echo "Explicit 64-bitness selected." >&4
3204 case "$archname64" in
3209 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3211 *) archname="$archname-$archname64"
3212 echo "...setting architecture name to $archname." >&4
3219 : decide how portable to be. Allow command line overrides.
3220 case "$d_portable" in
3222 *) d_portable="$define" ;;
3225 : set up shell script to do ~ expansion
3231 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3234 if $test -f /bin/csh; then
3235 /bin/csh -f -c "glob \$1"
3240 name=\`$expr x\$1 : '..\([^/]*\)'\`
3241 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3242 if $test ! -d "\$dir"; then
3244 echo "\$me: can't locate home directory for: \$name" >&2
3249 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3265 : now set up to get a file name
3269 cat <<'EOSC' >>getfile
3285 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3286 fn=`echo $fn | sed 's/(.*)//'`
3292 loc_file=`expr $fn : '.*:\(.*\)'`
3293 fn=`expr $fn : '\(.*\):.*'`
3301 */*) fullpath=true;;
3310 *e*) exp_file=true;;
3313 *p*) nopath_ok=true;;
3318 *d*) type='Directory';;
3319 *l*) type='Locate';;
3324 Locate) what='File';;
3329 case "$d_portable" in
3337 while test "$type"; do
3342 true) rp="$rp (~name ok)";;
3345 if test -f UU/getfile.ok && \
3346 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3365 value=`UU/filexp $ans`
3368 if test "$ans" != "$value"; then
3369 echo "(That expands to $value on this system.)"
3383 /*) value="$ansexp" ;;
3388 echo "I shall only accept a full path name, as in /bin/ls." >&4
3389 echo "Use a ! shell escape if you wish to check pathnames." >&4
3392 echo "Please give a full path name, starting with slash." >&4
3395 echo "Note that using ~name is ok provided it expands well." >&4
3408 for fp in $gfpth; do
3409 if test "X$fp" = X.; then
3414 if test -f "$pf"; then
3416 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3418 echo "($value is not a plain file, but that's ok.)"
3421 if test X"$type" = X; then
3428 for fp in $gfpth; do
3429 if test "X$fp" = X.; then
3434 if test -d "$pf"; then
3442 if test -d "$ansexp"; then
3443 echo "(Looking for $loc_file in directory $value.)"
3444 value="$value/$loc_file"
3445 ansexp="$ansexp/$loc_file"
3447 if test -f "$ansexp"; then
3450 case "$nopath_ok" in
3451 true) case "$value" in
3453 *) echo "Assuming $value will be in people's path."
3469 if test "$fastread" = yes; then
3474 rp="$what $value doesn't exist. Use that name anyway?"
3493 test "X$gfpthkeep" != Xy && gfpth=""
3496 : determine root of directory hierarchy where package will be installed.
3499 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3507 By default, $package will be installed in $dflt/bin, manual pages
3508 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3509 installation directories. Typically this is something like /usr/local.
3510 If you wish to have binaries under /usr/bin but other parts of the
3511 installation under /usr/local, that's ok: you will be prompted
3512 separately for each of the installation directories, the prefix being
3513 only used to set the defaults.
3517 rp='Installation prefix to use?'
3525 *) oldprefix="$prefix";;
3535 $define|true) afs=true ;;
3536 $undef|false) afs=false ;;
3537 *) if test -d /afs; then
3545 echo "AFS may be running... I'll be extra cautious then..." >&4
3547 echo "AFS does not seem to be running..." >&4
3550 : determine installation prefix for where package is to be installed.
3554 Since you are running AFS, I need to distinguish the directory in which
3555 files will reside from the directory in which they are installed (and from
3556 which they are presumably copied to the former directory by occult means).
3559 case "$installprefix" in
3560 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3561 *) dflt="$installprefix";;
3566 In some special cases, particularly when building $package for distribution,
3567 it is convenient to distinguish between the directory in which files should
3568 be installed from the directory ($prefix) in which they
3569 will eventually reside. For most users, these two directories are the same.
3572 case "$installprefix" in
3574 *) dflt=$installprefix;;
3578 rp='What installation prefix should I use for installing files?'
3580 installprefix="$ans"
3581 installprefixexp="$ansexp"
3583 : set the prefixit variable, to compute a suitable default value
3584 prefixit='case "$3" in
3586 case "$oldprefix" in
3587 "") eval "$1=\"\$$2\"";;
3594 ""|" ") eval "$1=\"\$$2\"";;
3600 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3602 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3603 /*-$oldprefix/*|\~*-$oldprefix/*)
3604 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3605 *) eval "$1=\"\$$2\"";;
3609 : set the base revision
3612 : get the patchlevel
3614 echo "Getting the current patchlevel..." >&4
3615 if $test -r $rsrc/patchlevel.h;then
3616 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3617 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3618 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3624 $echo $n "(You have $package" $c
3627 *) $echo $n " $baserev" $c ;;
3629 $echo $n " patchlevel $patchlevel" $c
3630 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3633 if test 0 -eq "$subversion"; then
3634 version=`LC_ALL=C; export LC_ALL; \
3635 echo $baserev $patchlevel | \
3636 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3638 version=`LC_ALL=C; export LC_ALL; \
3639 echo $baserev $patchlevel $subversion | \
3640 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3643 : determine installation style
3644 : For now, try to deduce it from prefix unless it is already set.
3645 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3646 case "$installstyle" in
3647 '') case "$prefix" in
3648 *perl*) dflt='lib';;
3649 *) dflt='lib/perl5' ;;
3652 *) dflt='lib/perl5' ;;
3654 : Probably not worth prompting for this since we prompt for all
3655 : the directories individually, and the prompt would be too long and
3659 : determine where private library files go
3660 : Usual default is /usr/local/lib/perl5/$version.
3661 : Also allow things like /opt/perl/lib/$version, since
3662 : /opt/perl/lib/perl5... would be redundant.
3663 : The default "style" setting is made in installstyle.U
3664 case "$installstyle" in
3665 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3666 *) set dflt privlib lib/$version ;;
3671 There are some auxiliary files for $package that need to be put into a
3672 private library directory that is accessible by everyone.
3676 rp='Pathname where the private library files will reside?'
3679 privlibexp="$ansexp"
3680 : Change installation prefix, if necessary.
3681 if $test X"$prefix" != X"$installprefix"; then
3682 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3684 installprivlib="$privlibexp"
3687 : set the prefixup variable, to restore leading tilda escape
3688 prefixup='case "$prefixexp" in
3690 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3693 : determine where public architecture dependent libraries go
3696 : privlib default is /usr/local/lib/$package/$version
3697 : archlib default is /usr/local/lib/$package/$version/$archname
3698 : privlib may have an optional trailing /share.
3699 tdflt=`echo $privlib | $sed 's,/share$,,'`
3700 tdflt=$tdflt/$archname
3709 $spackage contains architecture-dependent library files. If you are
3710 sharing libraries in a heterogeneous environment, you might store
3711 these files in a separate location. Otherwise, you can just include
3712 them with the rest of the public library files.
3716 rp='Where do you want to put the public architecture-dependent libraries?'
3719 archlibexp="$ansexp"
3720 if $test X"$archlib" = X"$privlib"; then
3725 : Change installation prefix, if necessary.
3726 if $test X"$prefix" != X"$installprefix"; then
3727 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3729 installarchlib="$archlibexp"
3733 : Binary compatibility with 5.005 is not possible for builds
3734 : with advanced features
3735 case "$usethreads$usemultiplicity" in
3737 bincompat5005="$undef"
3738 d_bincompat5005="$undef"
3742 Perl 5.006 can be compiled for binary compatibility with 5.005.
3743 If you decide to do so, you will be able to continue using most
3744 of the extensions that were compiled for Perl 5.005.
3747 case "$bincompat5005$d_bincompat5005" in
3748 *"$undef"*) dflt=n ;;
3751 rp='Binary compatibility with Perl 5.005?'
3754 y*) val="$define" ;;
3759 case "$d_bincompat5005" in
3761 bincompat5005="$define"
3763 *) bincompat5005="$undef"
3764 d_bincompat5005="$undef"
3771 : see if setuid scripts can be secure
3774 Some kernels have a bug that prevents setuid #! scripts from being
3775 secure. Some sites have disabled setuid #! scripts because of this.
3777 First let's decide if your kernel supports secure setuid #! scripts.
3778 (If setuid #! scripts would be secure but have been disabled anyway,
3779 don't say that they are secure if asked.)
3784 if $test -d /dev/fd; then
3785 echo "#!$ls" >reflect
3786 chmod +x,u+s reflect
3787 ./reflect >flect 2>&1
3788 if $contains "/dev/fd" flect >/dev/null; then
3789 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3793 If you are not sure if they are secure, I can check but I'll need a
3794 username and password different from the one you are using right now.
3795 If you don't have such a username or don't want me to test, simply
3799 rp='Other username to test security of setuid scripts with?'
3804 case "$d_suidsafe" in
3805 '') echo "I'll assume setuid scripts are *not* secure." >&4
3808 echo "Well, the $hint value is *not* secure." >&4
3810 *) echo "Well, the $hint value *is* secure." >&4
3815 $rm -f reflect flect
3816 echo "#!$ls" >reflect
3817 chmod +x,u+s reflect
3820 echo '"su" will (probably) prompt you for '"$ans's password."
3821 su $ans -c './reflect >flect'
3822 if $contains "/dev/fd" flect >/dev/null; then
3823 echo "Okay, it looks like setuid scripts are secure." >&4
3826 echo "I don't think setuid scripts are secure." >&4
3831 rp='Does your kernel have *secure* setuid scripts?'
3834 [yY]*) val="$define";;
3839 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3840 echo "(That's for file descriptors, not floppy disks.)"
3846 $rm -f reflect flect
3848 : now see if they want to do setuid emulation
3851 case "$d_suidsafe" in
3854 echo "No need to emulate SUID scripts since they are secure here." >& 4
3858 Some systems have disabled setuid scripts, especially systems where
3859 setuid scripts cannot be secure. On systems where setuid scripts have
3860 been disabled, the setuid/setgid bits on scripts are currently
3861 useless. It is possible for $package to detect those bits and emulate
3862 setuid/setgid in a secure fashion. This emulation will only work if
3863 setuid scripts have been disabled in your kernel.
3867 "$define") dflt=y ;;
3870 rp="Do you want to do setuid/setgid emulation?"
3873 [yY]*) val="$define";;
3881 : What should the include directory be ?
3883 $echo $n "Hmm... $c"
3887 if $test -f /bin/mips && /bin/mips; then
3888 echo "Looks like a MIPS system..."
3889 $cat >usr.c <<'EOCP'
3890 #ifdef SYSTYPE_BSD43
3894 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3895 dflt='/bsd43/usr/include'
3899 mips_type='System V'
3901 $rm -f usr.c usr.out
3902 echo "and you're compiling with the $mips_type compiler and libraries."
3906 echo "Doesn't look like a MIPS system."
3916 case "$xxx_prompt" in
3919 rp='Where are the include files you want to use?'
3927 : see how we invoke the C preprocessor
3929 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3930 cat <<'EOT' >testcpp.c
3936 if test ! -f cppstdin; then
3937 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3938 # AIX cc -E doesn't show the absolute headerfile
3939 # locations but we'll cheat by using the -M flag.
3940 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
3942 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3945 echo "Keeping your $hint cppstdin wrapper."
3948 wrapper=`pwd`/cppstdin
3952 if $test "X$cppstdin" != "X" && \
3953 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3954 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3956 echo "You used to use $cppstdin $cppminus so we'll use that again."
3958 '') echo "But let's see if we can live without a wrapper..." ;;
3960 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3961 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3963 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3966 echo "(However, $cpprun $cpplast does not work, let's see...)"
3974 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3981 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3982 $cc -E <testcpp.c >testcpp.out 2>&1; \
3983 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3984 echo "Yup, it does."
3987 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3988 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3989 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3990 echo "Yup, it does."
3993 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3994 $cc -P <testcpp.c >testcpp.out 2>&1; \
3995 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3996 echo "Yipee, that works!"
3999 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4000 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4001 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4002 echo "At long last!"
4005 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4006 $cpp <testcpp.c >testcpp.out 2>&1; \
4007 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4011 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4012 $cpp - <testcpp.c >testcpp.out 2>&1; \
4013 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4014 echo "Hooray, it works! I was beginning to wonder."
4017 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4018 $wrapper <testcpp.c >testcpp.out 2>&1; \
4019 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4025 rp="No dice. I can't find a C preprocessor. Name one:"
4029 $x_cpp <testcpp.c >testcpp.out 2>&1
4030 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4031 echo "OK, that will do." >&4
4033 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4048 echo "Perhaps can we force $cc -E using a wrapper..."
4049 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4050 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4056 echo "Nope, we'll have to live without it..."
4070 "$wrapper"|'cppstdin') ;;
4071 *) $rm -f $wrapper;;
4073 $rm -f testcpp.c testcpp.out
4075 : Set private lib path
4078 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4083 '') dlist="$loclibpth $plibpth $glibpth";;
4084 *) dlist="$libpth";;
4087 : Now check and see which directories actually exist, avoiding duplicates
4091 if $test -d $xxx; then
4094 *) libpth="$libpth $xxx";;
4100 Some systems have incompatible or broken versions of libraries. Among
4101 the directories listed in the question below, please remove any you
4102 know not to be holding relevant libraries, and add any that are needed.
4103 Say "none" for none.
4114 rp="Directories to use for library searches?"
4121 : compute shared library extension
4124 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4134 On some systems, shared libraries may be available. Answer 'none' if
4135 you want to suppress searching of shared libraries for the remaining
4136 of this configuration.
4139 rp='What is the file extension used for shared libraries?'
4143 : Define several unixisms.
4144 : Hints files or command line option can be used to override them.
4145 : The convoluted testing is in case hints files set either the old
4148 '') case "$exe_ext" in
4150 *) _exe="$exe_ext" ;;
4155 '') case "$lib_ext" in
4162 '') case "$obj_ext" in
4169 '') case "$path_sep" in
4180 : Which makefile gets called first. This is used by make depend.
4181 case "$firstmakefile" in
4182 '') firstmakefile='makefile';;
4187 Perl can be built to use the SOCKS proxy protocol library. To do so,
4188 Configure must be run with -Dusesocks.
4190 Normally you do not need this and you should answer no.
4194 $define|true|[yY]*) dflt='y';;
4197 rp='Build Perl for SOCKS?'
4200 y|Y) val="$define" ;;
4206 : Looking for optional libraries
4208 echo "Checking for optional libraries..." >&4
4213 case "$libswanted" in
4214 '') libswanted='c_s';;
4218 libswanted="$libswanted socks5 socks5_sh"
4221 for thislib in $libswanted; do
4223 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4224 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4225 echo "Found -l$thislib (shared)."
4228 *) dflt="$dflt -l$thislib";;
4230 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4231 echo "Found -l$thislib (shared)."
4234 *) dflt="$dflt -l$thislib";;
4236 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4237 echo "Found -l$thislib."
4240 *) dflt="$dflt -l$thislib";;
4242 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4243 echo "Found -l$thislib."
4246 *) dflt="$dflt -l$thislib";;
4248 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4249 echo "Found -l${thislib}_s."
4252 *) dflt="$dflt -l${thislib}_s";;
4254 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4255 echo "Found -l$thislib."
4258 *) dflt="$dflt -l$thislib";;
4261 echo "No -l$thislib."
4272 ' '|'') dflt='none';;
4277 In order to compile $package on your machine, a number of libraries
4278 are usually needed. Include any other special libraries here as well.
4279 Say "none" for none. The default list is almost always right.
4283 rp="What libraries to use?"
4290 : determine optimization, if desired, or use for debug flag also
4292 ' '|$undef) dflt='none';;
4294 *) dflt="$optimize";;
4298 By default, $package compiles with the -O flag to use the optimizer.
4299 Alternately, you might want to use the symbolic debugger, which uses
4300 the -g flag (on traditional Unix systems). Either flag can be
4301 specified here. To use neither flag, specify the word "none".
4304 rp="What optimizer/debugger flag should be used?"
4308 'none') optimize=" ";;
4312 : We will not override a previous value, but we might want to
4313 : augment a hint file
4315 default|recommended)
4316 case "$gccversion" in
4317 1*) dflt='-fpcc-struct-return' ;;
4320 *-g*) dflt="$dflt -DDEBUGGING";;
4322 case "$gccversion" in
4323 2*) if test -d /etc/conf/kconfig.d &&
4324 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4330 case "$gccversion" in
4334 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4335 echo 'int main(void) { return 0; }' > gcctest.c
4336 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4337 echo "Yes, it does." 2>&1
4340 echo "Leaving current flags $ccflags alone." 2>&1
4342 *) dflt="$dflt -fno-strict-aliasing" ;;
4345 echo "Nope, it doesn't, but that's ok." 2>&1
4352 case "$mips_type" in
4353 *BSD*|'') inclwanted="$locincpth $usrinc";;
4354 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4356 for thisincl in $inclwanted; do
4357 if $test -d $thisincl; then
4358 if $test x$thisincl != x$usrinc; then
4361 *) dflt="$dflt -I$thisincl";;
4367 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4369 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4377 *) dflt="$dflt -D$2";;
4381 set signal.h LANGUAGE_C; eval $inctest
4385 ccflags="$ccflags -DSOCKS"
4390 default|recommended) dflt="$ccflags $dflt" ;;
4391 *) dflt="$ccflags";;
4399 Your C compiler may want other flags. For this question you should include
4400 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4401 but you should NOT include libraries or ld flags like -lwhatever. If you
4402 want $package to honor its debug switch, you should include -DDEBUGGING here.
4403 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4405 To use no flags, specify the word "none".
4411 rp="Any additional cc flags?"
4418 : the following weeds options from ccflags that are of no interest to cpp
4420 case "$gccversion" in
4421 1*) cppflags="$cppflags -D__GNUC__"
4423 case "$mips_type" in
4425 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4431 echo "Let me guess what the preprocessor flags are..." >&4
4445 *) ftry="$previous $flag";;
4447 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4448 >cpp1.out 2>/dev/null && \
4449 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4450 >cpp2.out 2>/dev/null && \
4451 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4452 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4454 cppflags="$cppflags $ftry"
4464 *-*) echo "They appear to be: $cppflags";;
4466 $rm -f cpp.c cpp?.out
4470 : flags used in final linking phase
4472 '') if ./venix; then
4478 *-posix*) dflt="$dflt -posix" ;;
4481 *) dflt="$ldflags";;
4484 : Try to guess additional flags to pick up local libraries.
4485 for thislibdir in $libpth; do
4486 case " $loclibpth " in
4489 *"-L$thislibdir "*) ;;
4490 *) dflt="$dflt -L$thislibdir" ;;
4502 Your C linker may need flags. For this question you should
4503 include -L/whatever and any other flags used by the C linker, but you
4504 should NOT include libraries like -lwhatever.
4506 Make sure you include the appropriate -L/path flags if your C linker
4507 does not normally search all of the directories you specified above,
4510 To use no flags, specify the word "none".
4514 rp="Any additional ld flags (NOT including libraries)?"
4520 rmlist="$rmlist pdp11"
4524 echo "Checking your choice of C compiler and flags for coherency..." >&4
4525 $cat > try.c <<'EOF'
4527 int main() { printf("Ok\n"); exit(0); }
4529 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4531 $cat >try.msg <<'EOM'
4532 I've tried to compile and run the following simple program:
4535 $cat try.c >> try.msg
4537 $cat >> try.msg <<EOM
4544 and I got the following output:
4548 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4549 if sh -c './try' >>try.msg 2>&1; then
4553 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4556 cat >> try.msg <<'EOQS'
4557 If $libs contains -lsfio, and sfio is mis-configured, then it
4558 sometimes (apparently) runs and exits with a 0 status, but with no
4559 output! It may have to do with sfio's use of _exit vs. exit.
4562 rp="You have a big problem. Shall I abort Configure"
4569 echo "The program compiled OK, but exited with status $?." >>try.msg
4570 rp="You have a problem. Shall I abort Configure"
4574 echo "I can't compile the test program." >>try.msg
4575 rp="You have a BIG problem. Shall I abort Configure"
4581 case "$knowitall" in
4583 echo "(The supplied flags or libraries might be incorrect.)"
4591 *) echo "Ok. Stopping Configure." >&4
4596 n) echo "OK, that should do.";;
4598 $rm -f try try.* core
4600 : determine filename position in cpp output
4602 echo "Computing filename position in cpp output for #include directives..." >&4
4603 echo '#include <stdio.h>' > foo.c
4606 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4607 $grep '^[ ]*#.*stdio\.h' | \
4608 while read cline; do
4611 while $test \$# -gt 0; do
4612 if $test -r \`echo \$1 | $tr -d '"'\`; then
4617 pos=\`expr \$pos + 1\`
4629 *) pos="${fieldn}th";;
4631 echo "Your cpp writes the filename in the $pos field of the line."
4633 : locate header file
4638 for usrincdir in $usrinc
4640 if test -f \$usrincdir/\$wanted; then
4641 echo "\$usrincdir/\$wanted"
4645 awkprg='{ print \$$fieldn }'
4646 echo "#include <\$wanted>" > foo\$\$.c
4647 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4648 $grep "^[ ]*#.*\$wanted" | \
4649 while read cline; do
4650 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4652 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4653 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4658 # status = 0: grep returned 0 lines, case statement not executed
4659 # status = 1: headerfile found
4660 # status = 2: while loop executed, no headerfile found
4664 if test \$status -eq 1; then
4671 : define an alternate in-header-list? function
4672 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4673 cont=true; xxf="echo \"<\$1> found.\" >&4";
4674 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4675 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4677 case $# in 4) instead=instead;; *) instead="at last";; esac;
4678 while $test "$cont"; do
4680 var=$2; eval "was=\$$2";
4681 if $test "$xxx" && $test -r "$xxx";
4683 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4686 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4687 set $yyy; shift; shift; yyy=$@;
4688 case $# in 0) cont="";;
4689 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4690 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4691 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4692 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4696 do set $yyy; var=$2; eval "was=\$$2";
4697 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4698 set $yyy; shift; shift; yyy=$@;
4701 : see if this is a malloc.h system
4702 set malloc.h i_malloc
4705 : see if stdlib is available
4706 set stdlib.h i_stdlib
4709 : determine which malloc to compile in
4711 case "$usemymalloc" in
4712 ''|[yY]*|true|$define) dflt='y' ;;
4715 rp="Do you wish to attempt to use the malloc that comes with $package?"
4721 mallocsrc='malloc.c'
4722 mallocobj="malloc$_o"
4723 d_mymalloc="$define"
4726 : Remove malloc from list of libraries to use
4727 echo "Removing unneeded -lmalloc from library list" >&4
4728 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4731 echo "libs = $libs" >&4
4743 : compute the return types of malloc and free
4745 $cat >malloc.c <<END
4749 #include <sys/types.h>
4763 case "$malloctype" in
4765 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4772 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4776 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4783 echo "Your system uses $freetype free(), it would seem." >&4
4787 The installation process will also create a directory for
4788 vendor-supplied add-ons. Vendors who supply perl with their system
4789 may find it convenient to place all vendor-supplied files in this
4790 directory rather than in the main distribution directory. This will
4791 ease upgrades between binary-compatible maintenance versions of perl.
4793 Of course you may also use these directories in whatever way you see
4794 fit. For example, you might use them to access modules shared over a
4795 company-wide network.
4797 The default answer should be fine for most people.
4798 This causes further questions about vendor add-ons to be skipped
4799 and no vendor-specific directories will be configured for perl.
4802 rp='Do you want to configure vendor-specific add-on directories?'
4803 case "$usevendorprefix" in
4804 define|true|[yY]*) dflt=y ;;
4810 rp='Installation prefix to use for vendor-supplied add-ons?'
4811 case "$vendorprefix" in
4813 *) dflt=$vendorprefix ;;
4817 case "$vendorprefix" in
4821 *) oldvendorprefix="$prefix";;
4825 usevendorprefix="$define"
4827 vendorprefixexp="$ansexp"
4829 *) usevendorprefix="$undef"
4835 case "$vendorprefix" in
4836 '') d_vendorlib="$undef"
4840 *) d_vendorlib="$define"
4841 : determine where vendor-supplied modules go.
4842 : Usual default is /usr/local/lib/perl5/vendor_perl
4843 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4844 case "$installstyle" in
4845 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4846 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4849 rp='Pathname for the vendor-supplied library files?'
4852 vendorlibexp="$ansexp"
4853 : Change installation prefix, if necessary.
4854 if $test X"$prefix" != X"$installprefix"; then
4855 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4857 installvendorlib="$vendorlibexp"
4862 : Cruising for prototypes
4864 echo "Checking out function prototypes..." >&4
4865 $cat >prototype.c <<'EOCP'
4866 int main(int argc, char *argv[]) {
4869 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4870 echo "Your C compiler appears to support function prototypes."
4873 echo "Your C compiler doesn't seem to understand function prototypes."
4880 case "$prototype" in
4882 *) ansi2knr='ansi2knr'
4887 This version of $package can only be compiled by a compiler that
4888 understands function prototypes. Unfortunately, your C compiler
4890 doesn't seem to understand them. Sorry about that.
4892 If GNU cc is available for your system, perhaps you could try that instead.
4894 Eventually, we hope to support building Perl with pre-ANSI compilers.
4895 If you would like to help in that effort, please contact <perlbug@perl.org>.
4897 Aborting Configure now.
4903 : determine where public executables go
4908 rp='Pathname where the public executables will reside?'
4910 if $test "X$ansexp" != "X$binexp"; then
4915 : Change installation prefix, if necessary.
4916 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4917 if $test X"$prefix" != X"$installprefix"; then
4918 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4920 installbin="$binexp"
4923 : determine whether to install perl also as /usr/bin/perl
4926 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4928 Many scripts expect to perl to be installed as /usr/bin/perl.
4929 I can install the perl you are about to compile also as /usr/bin/perl
4930 (in addition to $installbin/perl).
4932 case "$installusrbinperl" in
4933 "$undef"|[nN]*) dflt='n';;
4936 rp="Do you want to install perl as /usr/bin/perl?"
4939 [yY]*) val="$define";;
4945 set installusrbinperl
4948 : define a shorthand compile call
4952 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4953 : define a shorthand compile call for compilations that should be ok.
4957 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4960 echo "Checking for GNU C Library..." >&4
4961 cat >gnulibc.c <<EOM
4973 if eval $compile_ok && ./gnulibc; then
4975 echo "You are using the GNU C Library"
4978 echo "You are not using the GNU C Library"
4984 : see if nm is to be used to determine whether a symbol is defined or not
4988 case "$d_gnulibc" in
4991 echo "nm probably won't work on the GNU C Library." >&4
4997 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4999 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5000 echo "'nm' won't be sufficient on this sytem." >&4
5006 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5007 if $test $dflt -gt 20; then
5017 true|$define) dflt=y;;
5024 I can use $nm to extract the symbols from your C libraries. This
5025 is a time consuming task which may generate huge output on the disk (up
5026 to 3 megabytes) but that should make the symbols extraction faster. The
5027 alternative is to skip the 'nm' extraction part and to compile a small
5028 test program instead to determine whether each symbol is present. If
5029 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5030 this may be the best solution.
5032 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5035 rp="Shall I use $nm to extract C symbols from the libraries?"
5038 [Nn]*) usenm=false;;
5047 : nm options which may be necessary
5049 '') if $test -f /mach_boot; then
5051 elif $test -d /usr/ccs/lib; then
5052 nm_opt='-p' # Solaris (and SunOS?)
5053 elif $test -f /dgux; then
5055 elif $test -f /lib64/rld; then
5056 nm_opt='-p' # 64-bit Irix
5062 : nm options which may be necessary for shared libraries but illegal
5063 : for archive libraries. Thank you, Linux.
5064 case "$nm_so_opt" in
5065 '') case "$myuname" in
5067 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5068 nm_so_opt='--dynamic'
5077 : get list of predefined functions in a handy place
5082 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5089 *) for thislib in $libs; do
5092 : Handle C library specially below.
5095 thislib=`echo $thislib | $sed -e 's/^-l//'`
5096 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5098 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5100 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5102 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5104 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5106 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5108 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5113 libnames="$libnames $try"
5115 *) libnames="$libnames $thislib" ;;
5124 for xxx in $libpth; do
5125 $test -r $1 || set $xxx/libc.$so
5126 : The messy sed command sorts on library version numbers.
5128 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5129 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5131 s/[0-9][0-9]*/0000&/g
5132 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5135 sort | $sed -e 's/^.* //'`
5138 $test -r $1 || set /usr/ccs/lib/libc.$so
5139 $test -r $1 || set /lib/libsys_s$_a
5145 if $test -r "$1"; then
5146 echo "Your (shared) C library seems to be in $1."
5148 elif $test -r /lib/libc && $test -r /lib/clib; then
5149 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5151 libc='/lib/clib /lib/libc'
5152 if $test -r /lib/syslib; then
5153 echo "(Your math library is in /lib/syslib.)"
5154 libc="$libc /lib/syslib"
5156 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5157 echo "Your C library seems to be in $libc, as you said before."
5158 elif $test -r $incpath/usr/lib/libc$_a; then
5159 libc=$incpath/usr/lib/libc$_a;
5160 echo "Your C library seems to be in $libc. That's fine."
5161 elif $test -r /lib/libc$_a; then
5163 echo "Your C library seems to be in $libc. You're normal."
5165 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5167 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5168 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5169 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5171 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5173 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5176 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5178 if $test -r "$tans"; then
5179 echo "Your C library seems to be in $tans, of all places."
5185 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5189 If the guess above is wrong (which it might be if you're using a strange
5190 compiler, or your machine supports multiple models), you can override it here.
5195 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5197 I can't seem to find your C library. I've looked in the following places:
5200 $sed 's/^/ /' libpath
5203 None of these seems to contain your C library. I need to get its name...
5208 rp='Where is your C library?'
5213 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5214 set X `cat libnames`
5217 case $# in 1) xxx=file; esac
5218 echo "Extracting names from the following $xxx for later perusal:" >&4
5220 $sed 's/^/ /' libnames >&4
5222 $echo $n "This may take a while...$c" >&4
5226 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5227 *) $nm $nm_opt $file 2>/dev/null;;
5232 $grep fprintf libc.tmp > libc.ptf
5233 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5234 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5236 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5238 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5240 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5242 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5244 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5246 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5248 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5250 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5252 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5254 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5256 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5258 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5260 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5261 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5263 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5265 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5267 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5269 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5271 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5273 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5275 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5277 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5279 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5281 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5283 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5285 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5287 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5289 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5291 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5294 $nm -p $* 2>/dev/null >libc.tmp
5295 $grep fprintf libc.tmp > libc.ptf
5296 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5297 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5303 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5305 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5306 for thisname in $libnames $libc; do
5307 $ar t $thisname >>libc.tmp
5309 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5311 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5312 # Repeat libc to extract forwarders to DLL entries too
5313 for thisname in $libnames $libc; do
5314 $ar tv $thisname >>libc.tmp
5315 # Revision 50 of EMX has bug in $ar.
5316 # it will not extract forwarders to DLL entries
5317 # Use emximp which will extract exactly them.
5318 emximp -o tmp.imp $thisname \
5320 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5321 < tmp.imp >>libc.tmp
5324 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5327 echo "$ar didn't seem to work right." >&4
5328 echo "Maybe this is a Cray...trying bld instead..." >&4
5329 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5331 for thisname in $libnames; do
5333 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5334 $ar t $thisname >>libc.tmp
5338 echo "That didn't work either. Giving up." >&4
5345 if $test -f /lib/syscalls.exp; then
5347 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5348 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5352 $rm -f libnames libpath
5354 : see if dld is available
5358 : is a C symbol defined?
5361 -v) tf=libc.tmp; tc=""; tdc="";;
5362 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5363 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5366 case "$reuseval-$4" in
5368 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5374 if $contains $tlook $tf >/dev/null 2>&1;
5379 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5380 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5388 $define) tval=true;;
5394 : define an is-in-libc? function
5395 inlibc='echo " "; td=$define; tu=$undef;
5396 sym=$1; var=$2; eval "was=\$$2";
5398 case "$reuseval$was" in
5408 echo "$sym() found." >&4;
5409 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5411 echo "$sym() NOT found." >&4;
5412 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5416 $define) echo "$sym() found." >&4;;
5417 *) echo "$sym() NOT found." >&4;;
5421 : see if dlopen exists
5428 : determine which dynamic loading, if any, to compile in
5430 dldir="ext/DynaLoader"
5443 $define) dflt='y' ;;
5446 $define) dflt='y' ;;
5448 : Does a dl_xxx.xs file exist for this operating system
5449 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5452 rp="Do you wish to use dynamic loading?"
5459 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5460 dflt="$dldir/dl_${osname}.xs"
5461 elif $test "$d_dlopen" = "$define" ; then
5462 dflt="$dldir/dl_dlopen.xs"
5463 elif $test "$i_dld" = "$define" ; then
5464 dflt="$dldir/dl_dld.xs"
5469 *) dflt="$dldir/$dlsrc"
5472 echo "The following dynamic loading files are available:"
5473 : Can not go over to $dldir because getfile has path hard-coded in.
5474 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5475 rp="Source file to use for dynamic loading"
5481 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5485 Some systems may require passing special flags to $cc -c to
5486 compile modules that will be used to create a shared library.
5487 To use no flags, say "none".
5490 case "$cccdlflags" in
5491 '') case "$gccversion" in
5492 '') case "$osname" in
5494 next) dflt='none' ;;
5495 irix*) dflt='-KPIC' ;;
5496 svr4*|esix*|solaris) dflt='-KPIC' ;;
5497 sunos) dflt='-pic' ;;
5501 *) case "$osname" in
5502 svr4*|esix*|solaris) dflt='-fPIC' ;;
5507 *) dflt="$cccdlflags" ;;
5509 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5512 none) cccdlflags=' ' ;;
5513 *) cccdlflags="$ans" ;;
5518 Some systems use ld to create libraries that can be dynamically loaded,
5519 while other systems (such as those using ELF) use $cc.
5523 '') $cat >try.c <<'EOM'
5524 /* Test for whether ELF binaries are produced */
5529 int i = open("a.out",O_RDONLY);
5532 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5533 exit(0); /* succeed (yes, it's ELF) */
5538 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5540 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5544 echo "I'll use ld to build dynamic libraries."
5553 rp="What command should be used to create dynamic libraries?"
5559 Some systems may require passing special flags to $ld to create a
5560 library that can be dynamically loaded. If your ld flags include
5561 -L/other/path options to locate libraries outside your loader's normal
5562 search path, you may need to specify those -L options here as well. To
5563 use no flags, say "none".
5566 case "$lddlflags" in
5567 '') case "$osname" in
5568 beos) dflt='-nostart' ;;
5570 linux|irix*) dflt='-shared' ;;
5571 next) dflt='none' ;;
5572 solaris) dflt='-G' ;;
5573 sunos) dflt='-assert nodefinitions' ;;
5574 svr4*|esix*) dflt="-G $ldflags" ;;
5578 *) dflt="$lddlflags" ;;
5581 : Try to guess additional flags to pick up local libraries.
5582 : Be careful not to append to a plain 'none'
5586 for thisflag in $ldflags; do
5591 *) dflt="$dflt $thisflag" ;;
5598 ''|' ') dflt='none' ;;
5601 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5604 none) lddlflags=' ' ;;
5605 *) lddlflags="$ans" ;;
5610 Some systems may require passing special flags to $cc to indicate that
5611 the resulting executable will use dynamic linking. To use no flags,
5615 case "$ccdlflags" in
5616 '') case "$osname" in
5617 hpux) dflt='-Wl,-E' ;;
5618 linux) dflt='-rdynamic' ;;
5619 next) dflt='none' ;;
5620 sunos) dflt='none' ;;
5624 *) dflt="$ccdlflags" ;;
5626 rp="Any special flags to pass to $cc to use dynamic loading?"
5629 none) ccdlflags=' ' ;;
5630 *) ccdlflags="$ans" ;;
5644 # No dynamic loading being used, so don't bother even to prompt.
5647 *) case "$useshrplib" in
5648 '') case "$osname" in
5649 svr4*|dgux|dynixptx|esix|powerux|beos)
5651 also='Building a shared libperl is required for dynamic loading to work on your system.'
5656 also='Building a shared libperl is needed for MAB support.'
5674 The perl executable is normally obtained by linking perlmain.c with
5675 libperl${_a}, any static extensions (usually just DynaLoader), and
5676 any other libraries needed on this system (such as -lm, etc.). Since
5677 your system supports dynamic loading, it is probably possible to build
5678 a shared libperl.$so. If you will have more than one executable linked
5679 to libperl.$so, this will significantly reduce the size of each
5680 executable, but it may have a noticeable affect on performance. The
5681 default is probably sensible for your system.
5685 rp="Build a shared libperl.$so (y/n)"
5689 useshrplib='true' ;;
5690 *) useshrplib='false' ;;
5695 case "$useshrplib" in
5699 # Figure out a good name for libperl.so. Since it gets stored in
5700 # a version-specific architecture-dependent library, the version
5701 # number isn't really that important, except for making cc/ld happy.
5703 # A name such as libperl.so.3.1
5704 majmin="libperl.$so.$patchlevel.$subversion"
5705 # A name such as libperl.so.301
5706 majonly=`echo $patchlevel $subversion |
5707 $awk '{printf "%d%02d", $1, $2}'`
5708 majonly=libperl.$so.$majonly
5709 # I'd prefer to keep the os-specific stuff here to a minimum, and
5710 # rely on figuring it out from the naming of libc.
5711 case "${osname}${osvers}" in
5714 # XXX How handle the --version stuff for MAB?
5716 linux*) # ld won't link with a bare -lperl otherwise.
5719 *) # Try to guess based on whether libc has major.minor.
5721 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5722 *libc.$so.[0-9]*) dflt=$majonly ;;
5723 *) dflt=libperl.$so ;;
5733 I need to select a good name for the shared libperl. If your system uses
5734 library names with major and minor numbers, then you might want something
5735 like $majmin. Alternatively, if your system uses a single version
5736 number for shared libraries, then you might want to use $majonly.
5737 Or, your system might be quite happy with a simple libperl.$so.
5739 Since the shared libperl will get installed into a version-specific
5740 architecture-dependent directory, the version number of the shared perl
5741 library probably isn't important, so the default should be o.k.
5744 rp='What name do you want to give to the shared libperl?'
5747 echo "Ok, I'll use $libperl"
5750 libperl="libperl${_a}"
5754 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5758 WARNING: Use of the shrpdir variable for the installation location of
5759 the shared $libperl is not supported. It was never documented and
5760 will not work in this version. Let me (perlbug@perl.com)
5761 know of any problems this may cause.
5767 But your current setting of $shrpdir is
5768 the default anyway, so it's harmless.
5773 Further, your current attempted setting of $shrpdir
5774 conflicts with the value of $archlibexp/CORE
5775 that installperl will use.
5782 # How will the perl executable find the installed shared $libperl?
5783 # Add $xxx to ccdlflags.
5784 # If we can't figure out a command-line option, use $shrpenv to
5785 # set env LD_RUN_PATH. The main perl makefile uses this.
5786 shrpdir=$archlibexp/CORE
5789 if "$useshrplib"; then
5792 # We'll set it in Makefile.SH...
5798 xxx="-Wl,-R$shrpdir"
5800 linux|irix*|dec_osf)
5801 xxx="-Wl,-rpath,$shrpdir"
5804 # next doesn't like the default...
5807 # beos doesn't like the default, either.
5810 # hpux doesn't like the default, either.
5811 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5814 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5820 # Only add $xxx if it isn't already in ccdlflags.
5821 case " $ccdlflags " in
5823 *) ccdlflags="$ccdlflags $xxx"
5826 Adding $xxx to the flags
5827 passed to $ld so that the perl executable will find the
5828 installed shared $libperl.
5836 # Fix ccdlflags in AIX for building external extensions.
5837 # (For building Perl itself bare -bE:perl.exp is needed,
5838 # Makefile.SH takes care of this.)
5840 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5842 # Respect a hint or command-line value.
5844 '') shrpenv="$tmp_shrpenv" ;;
5846 case "$ldlibpthname" in
5847 '') ldlibpthname=LD_LIBRARY_PATH ;;
5848 none) ldlibpthname='' ;;
5851 : determine where manual pages go
5852 set man1dir man1dir none
5856 $spackage has manual pages available in source form.
5860 echo "However, you don't have nroff, so they're probably useless to you."
5862 '') man1dir="none";;
5865 echo "If you don't want the manual sources installed, answer 'none'."
5870 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5871 lookpath="$lookpath $prefixexp/man/p_man/man1"
5872 lookpath="$lookpath $prefixexp/man/u_man/man1"
5873 lookpath="$lookpath $prefixexp/man/man.1"
5875 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5876 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5886 rp="Where do the main $spackage manual pages (source) go?"
5888 if $test "X$man1direxp" != "X$ansexp"; then
5892 man1direxp="$ansexp"
5898 : Change installation prefix, if necessary.
5899 if $test X"$prefix" != X"$installprefix"; then
5900 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5902 installman1dir="$man1direxp"
5905 : What suffix to use on installed man pages
5912 rp="What suffix should be used for the main $spackage man pages?"
5914 '') case "$man1dir" in
5928 *) dflt="$man1ext";;
5935 : see if we can have long filenames
5937 rmlist="$rmlist /tmp/cf$$"
5938 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5939 first=123456789abcdef
5940 second=/tmp/cf$$/$first
5941 $rm -f $first $second
5942 if (echo hi >$first) 2>/dev/null; then
5943 if $test -f 123456789abcde; then
5944 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5947 if (echo hi >$second) 2>/dev/null; then
5948 if $test -f /tmp/cf$$/123456789abcde; then
5950 That's peculiar... You can have filenames longer than 14 characters, but only
5951 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5952 I shall consider your system cannot support long filenames at all.
5956 echo 'You can have filenames longer than 14 characters.' >&4
5961 How confusing! Some of your filesystems are sane enough to allow filenames
5962 longer than 14 characters but some others like /tmp can't even think about them.
5963 So, for now on, I shall assume your kernel does not allow them at all.
5970 You can't have filenames longer than 14 chars. You can't even think about them!
5976 $rm -rf /tmp/cf$$ 123456789abcde*
5978 : determine where library module manual pages go
5979 set man3dir man3dir none
5983 $spackage has manual pages for many of the library modules.
5989 However, you don't have nroff, so they're probably useless to you.
5992 '') man3dir="none";;
5996 case "$d_flexfnam" in
5999 However, your system can't handle the long file names like File::Basename.3.
6002 '') man3dir="none";;
6006 echo "If you don't want the manual sources installed, answer 'none'."
6007 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6009 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6010 if $test -d "$privlib/man/man3"; then
6013 WARNING: Previous versions of perl installed man3 pages into
6014 $privlib/man/man3. This version will suggest a
6015 new default of $dflt.
6019 rp='Do you wish to preserve the old behavior?(y/n)'
6022 y*) dflt="$privlib/man/man3" ;;
6028 *) dflt="$man3dir" ;;
6032 rp="Where do the $package library man pages (source) go?"
6035 man3direxp="$ansexp"
6041 : Change installation prefix, if necessary.
6042 if $test X"$prefix" != X"$installprefix"; then
6043 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6045 installman3dir="$man3direxp"
6048 : What suffix to use on installed man pages
6054 rp="What suffix should be used for the $package library man pages?"
6056 '') case "$man3dir" in
6070 *) dflt="$man3ext";;
6077 : see if we have to deal with yellow pages, now NIS.
6078 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6079 if $test -f /usr/etc/nibindd; then
6081 echo "I'm fairly confident you're on a NeXT."
6083 rp='Do you get the hosts file via NetInfo?'
6092 y*) hostcat='nidump hosts .';;
6093 *) case "$hostcat" in
6094 nidump*) hostcat='';;
6104 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6112 rp='Are you getting the hosts file via yellow pages?'
6115 y*) hostcat='ypcat hosts';;
6116 *) hostcat='cat /etc/hosts';;
6122 '') hostcat='cat /etc/hosts';;
6125 '') groupcat='cat /etc/group';;
6128 '') passcat='cat /etc/passwd';;
6131 : now get the host name
6133 echo "Figuring out host name..." >&4
6134 case "$myhostname" in
6136 echo 'Maybe "hostname" will work...'
6137 if tans=`sh -c hostname 2>&1` ; then
6145 if $test "$cont"; then
6147 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6148 if tans=`cat /etc/systemid 2>&1` ; then
6150 phostname='cat /etc/systemid'
6151 echo "Whadyaknow. Xenix always was a bit strange..."
6154 elif $test -r /etc/systemid; then
6155 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6158 if $test "$cont"; then
6159 echo 'No, maybe "uuname -l" will work...'
6160 if tans=`sh -c 'uuname -l' 2>&1` ; then
6162 phostname='uuname -l'
6164 echo 'Strange. Maybe "uname -n" will work...'
6165 if tans=`sh -c 'uname -n' 2>&1` ; then
6167 phostname='uname -n'
6169 echo 'Oh well, maybe I can mine it out of whoami.h...'
6170 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6171 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6172 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6174 case "$myhostname" in
6175 '') echo "Does this machine have an identity crisis or something?"
6178 echo "Well, you said $myhostname before..."
6179 phostname='echo $myhostname';;
6185 : you do not want to know about this
6190 if $test "$myhostname" ; then
6192 rp='Your host name appears to be "'$myhostname'".'" Right?"
6200 : bad guess or no guess
6201 while $test "X$myhostname" = X ; do
6203 rp="Please type the (one word) name of your host:"
6208 : translate upper to lower if necessary
6209 case "$myhostname" in
6211 echo "(Normalizing case in your host name)"
6212 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6216 case "$myhostname" in
6218 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6219 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6220 echo "(Trimming domain name from host name--host name is now $myhostname)"
6222 *) case "$mydomain" in
6225 test "X$hostcat" = "Xypcat hosts" &&
6226 ypmatch "$myhostname" hosts 2>/dev/null |\
6227 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6230 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6231 /[ ]$myhostname[ . ]/p" > hosts
6234 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6235 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6236 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6237 hosts | $sort | $uniq | \
6238 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6239 case `$echo X$dflt` in
6240 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6243 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6248 tans=`./loc resolv.conf X /etc /usr/etc`
6249 if $test -f "$tans"; then
6250 echo "(Attempting domain name extraction from $tans)"
6251 dflt=.`$sed -n -e 's/ / /g' \
6252 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6253 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6255 .) dflt=.`$sed -n -e 's/ / /g' \
6256 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6257 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6264 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6265 dflt=.`sh -c domainname 2>/dev/null`
6268 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6273 .) echo "(Lost all hope -- silly guess then)"
6279 *) dflt="$mydomain";;
6283 rp="What is your domain name?"
6293 : translate upper to lower if necessary
6296 echo "(Normalizing case in your domain name)"
6297 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6301 : a little sanity check here
6302 case "$phostname" in
6305 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6306 $myhostname$mydomain|$myhostname) ;;
6308 case "$phostname" in
6310 echo "(That doesn't agree with your whoami.h file, by the way.)"
6313 echo "(That doesn't agree with your $phostname command, by the way.)"
6323 I need to get your e-mail address in Internet format if possible, i.e.
6324 something like user@host.domain. Please answer accurately since I have
6325 no easy means to double check it. The default value provided below
6326 is most probably close to the reality but may not be valid from outside
6327 your organization...
6331 while test "$cont"; do
6333 '') dflt="$cf_by@$myhostname$mydomain";;
6334 *) dflt="$cf_email";;
6336 rp='What is your e-mail address?'
6342 rp='Address does not look like an Internet one. Use it anyway?'
6358 If you or somebody else will be maintaining perl at your site, please
6359 fill in the correct e-mail address here so that they may be contacted
6360 if necessary. Currently, the "perlbug" program included with perl
6361 will send mail to this address in addition to perlbug@perl.com. You may
6362 enter "none" for no administrator.
6365 case "$perladmin" in
6366 '') dflt="$cf_email";;
6367 *) dflt="$perladmin";;
6369 rp='Perl administrator e-mail address'
6373 : figure out how to guarantee perl startup
6374 case "$startperl" in
6376 case "$sharpbang" in
6380 I can use the #! construct to start perl on your system. This will
6381 make startup of perl scripts faster, but may cause problems if you
6382 want to share those scripts and perl is not in a standard place
6383 ($binexp/perl) on all your platforms. The alternative is to force
6384 a shell by starting the script with a single ':' character.
6388 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6391 none) startperl=": # use perl";;
6392 *) startperl="#!$ans"
6393 if $test 30 -lt `echo "$ans" | wc -c`; then
6396 WARNING: Some systems limit the #! command to 32 characters.
6397 If you experience difficulty running Perl scripts with #!, try
6398 installing Perl in a directory with a shorter pathname.
6404 *) startperl=": # use perl"
6409 echo "I'll use $startperl to start perl scripts."
6411 : figure best path for perl in scripts
6414 perlpath="$binexp/perl"
6415 case "$startperl" in
6420 I will use the "eval 'exec'" idiom to start Perl on your system.
6421 I can use the full path of your Perl binary for this purpose, but
6422 doing so may cause problems if you want to share those scripts and
6423 Perl is not always in a standard place ($binexp/perl).
6427 rp="What path shall I use in \"eval 'exec'\"?"
6434 case "$startperl" in
6436 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6439 : determine where public executable scripts go
6440 set scriptdir scriptdir
6442 case "$scriptdir" in
6445 : guess some guesses
6446 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6447 $test -d /usr/share/bin && dflt=/usr/share/bin
6448 $test -d /usr/local/script && dflt=/usr/local/script
6449 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6450 $test -d $prefixexp/script && dflt=$prefixexp/script
6454 *) dflt="$scriptdir"
6459 Some installations have a separate directory just for executable scripts so
6460 that they can mount it across multiple architectures but keep the scripts in
6461 one spot. You might, for example, have a subdirectory of /usr/share for this.
6462 Or you might just lump your scripts in with all your other executables.
6466 rp='Where do you keep publicly executable scripts?'
6468 if $test "X$ansexp" != "X$scriptdirexp"; then
6472 scriptdirexp="$ansexp"
6473 : Change installation prefix, if necessary.
6474 if $test X"$prefix" != X"$installprefix"; then
6475 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6477 installscript="$scriptdirexp"
6482 After $package is installed, you may wish to install various
6483 add-on modules and utilities. Typically, these add-ons will
6484 be installed under $prefix with the rest
6485 of this package. However, you may wish to install such add-ons
6486 elsewhere under a different prefix.
6488 If you do not wish to put everything under a single prefix, that's
6489 ok. You will be prompted for the individual locations; this siteprefix
6490 is only used to suggest the defaults.
6492 The default should be fine for most people.
6496 rp='Installation prefix to use for add-on modules and utilities?'
6497 : XXX Here might be another good place for an installstyle setting.
6498 case "$siteprefix" in
6500 *) dflt=$siteprefix ;;
6504 case "$siteprefix" in
6509 *) oldsiteprefix="$prefix";;
6514 siteprefixexp="$ansexp"
6516 : determine where site specific libraries go.
6517 : Usual default is /usr/local/lib/perl5/site_perl
6518 : The default "style" setting is made in installstyle.U
6519 : XXX No longer works with Prefixit stuff.
6520 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6521 case "$installstyle" in
6522 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6523 *) dflt=$siteprefix/lib/site_$prog ;;
6527 The installation process will create a directory for
6528 site-specific extensions and modules. Most users find it convenient
6529 to place all site-specific files in this directory rather than in the
6530 main distribution directory.
6534 rp='Pathname for the site-specific library files?'
6537 sitelibexp="$ansexp"
6538 : Change installation prefix, if necessary.
6539 if $test X"$prefix" != X"$installprefix"; then
6540 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6542 installsitelib="$sitelibexp"
6545 : determine where site specific architecture-dependent libraries go.
6546 : sitelib default is /usr/local/lib/perl5/site_perl/
6547 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6548 : sitelib may have an optional trailing /share.
6549 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6550 tdflt="$tdflt/$apiversion/$archname"
6551 set sitearch sitearch none
6554 '') dflt="$tdflt" ;;
6555 *) dflt="$sitearch" ;;
6559 The installation process will also create a directory for
6560 architecture-dependent site-specific extensions and modules.
6564 rp='Pathname for the site-specific architecture-dependent library files?'
6567 sitearchexp="$ansexp"
6568 : Change installation prefix, if necessary.
6569 if $test X"$prefix" != X"$installprefix"; then
6570 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6572 installsitearch="$sitearchexp"
6575 : determine where add-on public executables go
6577 '') dflt=$siteprefix/bin ;;
6581 rp='Pathname where the add-on public executables should be installed?'
6584 sitebinexp="$ansexp"
6585 : Change installation prefix, if necessary.
6586 if $test X"$prefix" != X"$installprefix"; then
6587 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6589 installsitebin="$sitebinexp"
6594 Perl can be built to take advantage of long doubles which
6595 (if available) may give more accuracy and range for floating point numbers.
6597 If this doesn't make any sense to you, just accept the default 'n'.
6601 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6604 case "$uselongdouble" in
6605 $define|true|[yY]*) dflt='y';;
6608 rp='Try to use long doubles if available?'
6611 y|Y) val="$define" ;;
6617 case "$uselongdouble" in
6618 true|[yY]*) uselongdouble="$define" ;;
6621 case "$uselongdouble" in
6623 : Look for a hint-file generated 'call-back-unit'. If the
6624 : user has specified that long doubles should be used,
6625 : we may need to set or change some other defaults.
6626 if $test -f uselongdouble.cbu; then
6627 echo "Your platform has some specific hints for long doubles, using them..."
6628 . ./uselongdouble.cbu
6631 (Your platform doesn't have any specific hints for long doubles.)
6639 Perl can be built to take advantage of long longs which
6640 (if available) may give more range for integer numbers.
6642 If this doesn't make any sense to you, just accept the default 'n'.
6646 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6649 case "$uselonglong" in
6650 $define|true|[yY]*) dflt='y';;
6653 rp='Try to use long longs if available?'
6656 y|Y) val="$define" ;;
6662 case "$uselonglong" in
6663 true|[yY]*) uselonglong="$define" ;;
6666 case "$uselonglong" in
6668 : Look for a hint-file generated 'call-back-unit'. If the
6669 : user has specified that long longs should be used,
6670 : we may need to set or change some other defaults.
6671 if $test -f uselonglong.cbu; then
6672 echo "Your platform has some specific hints for long longs, using them..."
6676 (Your platform doesn't have any specific hints for long longs.)
6684 Previous version of $package used the standard IO mechanisms as defined
6685 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6686 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6687 the default. This abstraction layer can use AT&T's sfio (if you already
6688 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6689 problems with some extension modules. Using PerlIO with stdio is safe,
6690 but it is slower than plain stdio and therefore is not the default.
6692 If this doesn't make any sense to you, just accept the default 'n'.
6694 case "$useperlio" in
6695 $define|true|[yY]*) dflt='y';;
6698 rp='Use the experimental PerlIO abstraction layer?'
6705 echo "Ok, doing things the stdio way"
6712 case "$vendorprefix" in
6713 '') d_vendorbin="$undef"
6717 *) d_vendorbin="$define"
6718 : determine where vendor-supplied executables go.
6719 dflt=$vendorprefix/bin
6721 rp='Pathname for the vendor-supplied executables directory?'
6724 vendorbinexp="$ansexp"
6725 : Change installation prefix, if necessary.
6726 if $test X"$prefix" != X"$installprefix"; then
6727 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6729 installvendorbin="$vendorbinexp"
6734 : Check how to convert floats to strings.
6735 if test "X$d_Gconvert" = X; then
6737 echo "Checking for an efficient way to convert floats to strings."
6740 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6741 char *myname = "gconvert";
6744 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6745 char *myname = "gcvt";
6748 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6749 char *myname = "sprintf";
6755 checkit(expect, got)
6759 if (strcmp(expect, got)) {
6760 printf("%s oddity: Expected %s, got %s\n",
6761 myname, expect, got);
6771 /* This must be 1st test on (which?) platform */
6772 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6773 Gconvert(0.1, 8, 0, buf);
6774 checkit("0.1", buf);
6776 Gconvert(1.0, 8, 0, buf);
6779 Gconvert(0.0, 8, 0, buf);
6782 Gconvert(-1.0, 8, 0, buf);
6785 /* Some Linux gcvt's give 1.e+5 here. */
6786 Gconvert(100000.0, 8, 0, buf);
6787 checkit("100000", buf);
6789 /* Some Linux gcvt's give -1.e+5 here. */
6790 Gconvert(-100000.0, 8, 0, buf);
6791 checkit("-100000", buf);
6796 case "$d_Gconvert" in
6797 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6798 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6799 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6800 *) xxx_list='gconvert gcvt sprintf' ;;
6803 for xxx_convert in $xxx_list; do
6804 echo "Trying $xxx_convert"
6806 set try -DTRY_$xxx_convert
6807 if eval $compile; then
6808 echo "$xxx_convert" found. >&4
6810 echo "I'll use $xxx_convert to convert floats into a string." >&4
6813 echo "...But $xxx_convert didn't work as I expected."
6816 echo "$xxx_convert NOT found." >&4
6820 case "$xxx_convert" in
6821 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6822 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6823 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6827 : check for length of double
6829 case "$doublesize" in
6831 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6832 $cat >try.c <<'EOCP'
6836 printf("%d\n", (int)sizeof(double));
6841 if eval $compile_ok; then
6843 $echo " $doublesize bytes." >&4
6846 echo "(I can't seem to compile the test program. Guessing...)"
6847 rp="What is the size of a double precision number (in bytes)?"
6855 : check for long doubles
6857 $echo $n "Checking to see if your system supports long double..." $c >&4
6858 echo 'int main() { long double x = 7.0; }' > try.c
6860 if eval $compile; then
6862 echo " Yes, it does." >&4
6865 echo " No, it doesn't." >&4
6871 : check for length of long double
6872 case "${d_longdbl}${longdblsize}" in
6875 $echo $n "Checking to see how big your long doubles are..." $c >&4
6876 $cat >try.c <<'EOCP'
6880 printf("%d\n", sizeof(long double));
6885 if eval $compile; then
6886 longdblsize=`./try$exe_ext`
6887 $echo " $longdblsize bytes." >&4
6891 echo "(I can't seem to compile the test program. Guessing...)" >&4
6892 rp="What is the size of a long double (in bytes)?"
6896 if $test "X$doublesize" = "X$longdblsize"; then
6897 echo "(That isn't any different from an ordinary double.)"
6905 if $test X"$d_longdbl" = X"$define"; then
6907 echo "Checking how to print long doubles..." >&4
6909 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6910 $cat >try.c <<'EOCP'
6911 #include <sys/types.h>
6915 printf("%.3f\n", d);
6919 if eval $compile; then
6923 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6924 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6925 echo "We will use %f."
6931 if $test X"$sPRIfldbl" = X; then
6932 $cat >try.c <<'EOCP'
6933 #include <sys/types.h>
6936 long double d = 123.456;
6937 printf("%.3llf\n", d);
6941 if eval $compile; then
6945 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6946 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
6947 echo "We will use %llf."
6953 if $test X"$sPRIfldbl" = X; then
6954 $cat >try.c <<'EOCP'
6955 #include <sys/types.h>
6958 long double d = 123.456;
6959 printf("%.3Lf\n", d);
6963 if eval $compile; then
6967 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6968 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
6969 echo "We will use %Lf."
6975 if $test X"$sPRIfldbl" = X; then
6976 $cat >try.c <<'EOCP'
6977 #include <sys/types.h>
6980 long double d = 123.456;
6981 printf("%.3lf\n", d);
6985 if eval $compile; then
6989 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6990 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
6991 echo "We will use %lf."
6997 if $test X"$sPRIfldbl" = X; then
6998 echo "Cannot figure out how to print long doubles." >&4
7005 case "$sPRIfldbl" in
7006 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7007 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7009 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7010 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7014 : Initialize h_fcntl
7017 : Initialize h_sysfile
7020 : access call always available on UNIX
7024 : locate the flags for 'access()'
7028 $cat >access.c <<'EOCP'
7029 #include <sys/types.h>
7034 #include <sys/file.h>
7043 : check sys/file.h first, no particular reason here
7044 if $test `./findhdr sys/file.h` && \
7045 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7047 echo "<sys/file.h> defines the *_OK access constants." >&4
7048 elif $test `./findhdr fcntl.h` && \
7049 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7051 echo "<fcntl.h> defines the *_OK access constants." >&4
7052 elif $test `./findhdr unistd.h` && \
7053 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7054 echo "<unistd.h> defines the *_OK access constants." >&4
7056 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7062 : see if accessx exists
7063 set accessx d_accessx
7066 : see if alarm exists
7070 : see if atolf exists
7074 : see if atoll exists
7078 : Look for GNU-cc style attribute checking
7080 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7081 $cat >attrib.c <<'EOCP'
7083 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7085 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7086 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7087 echo "Your C compiler doesn't fully support __attribute__."
7090 echo "Your C compiler supports __attribute__."
7094 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7101 : see if bcmp exists
7105 : see if bcopy exists
7109 : see if this is a unistd.h system
7110 set unistd.h i_unistd
7113 : see if getpgrp exists
7114 set getpgrp d_getpgrp
7117 case "$d_getpgrp" in
7120 echo "Checking to see which flavor of getpgrp is in use..."
7123 #include <sys/types.h>
7125 # include <unistd.h>
7129 if (getuid() == 0) {
7130 printf("(I see you are running Configure as super-user...)\n");
7134 if (getpgrp(1) == 0)
7143 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7144 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7146 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7147 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7150 echo "I can't seem to compile and run the test program."
7152 xxx="a USG one, i.e. you use getpgrp()."
7154 # SVR4 systems can appear rather BSD-ish.
7157 xxx="a BSD one, i.e. you use getpgrp(pid)."
7161 xxx="probably a USG one, i.e. you use getpgrp()."
7166 echo "Assuming your getpgrp is $xxx" >&4
7175 : see if setpgrp exists
7176 set setpgrp d_setpgrp
7179 case "$d_setpgrp" in
7182 echo "Checking to see which flavor of setpgrp is in use..."
7185 #include <sys/types.h>
7187 # include <unistd.h>
7191 if (getuid() == 0) {
7192 printf("(I see you are running Configure as super-user...)\n");
7196 if (-1 == setpgrp(1, 1))
7199 if (setpgrp() != -1)
7205 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7206 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7208 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7209 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7212 echo "(I can't seem to compile and run the test program.)"
7214 xxx="a USG one, i.e. you use setpgrp()."
7216 # SVR4 systems can appear rather BSD-ish.
7219 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7223 xxx="probably a USG one, i.e. you use setpgrp()."
7228 echo "Assuming your setpgrp is $xxx" >&4
7236 : see if bzero exists
7240 : check for lengths of integral types
7244 echo "Checking to see how big your integers are..." >&4
7245 $cat >intsize.c <<'EOCP'
7249 printf("intsize=%d;\n", (int)sizeof(int));
7250 printf("longsize=%d;\n", (int)sizeof(long));
7251 printf("shortsize=%d;\n", (int)sizeof(short));
7256 if eval $compile_ok && ./intsize > /dev/null; then
7258 echo "Your integers are $intsize bytes long."
7259 echo "Your long integers are $longsize bytes long."
7260 echo "Your short integers are $shortsize bytes long."
7264 Help! I can't compile and run the intsize test program: please enlighten me!
7265 (This is probably a misconfiguration in your system or libraries, and
7266 you really ought to fix it. Still, I'll try anyway.)
7270 rp="What is the size of an integer (in bytes)?"
7274 rp="What is the size of a long integer (in bytes)?"
7278 rp="What is the size of a short integer (in bytes)?"
7284 $rm -f intsize intsize.*
7286 : see if signal is declared as pointer to function returning int or void
7288 xxx=`./findhdr signal.h`
7289 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7290 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7291 echo "You have int (*signal())() instead of void." >&4
7293 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7294 echo "You have void (*signal())()." >&4
7296 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7297 echo "You have int (*signal())() instead of void." >&4
7299 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7300 echo "You have void (*signal())()." >&4
7303 case "$d_voidsig" in
7305 echo "I can't determine whether signal handler returns void or int..." >&4
7307 rp="What type does your signal handler return?"
7314 echo "As you already told me, signal handler returns void." >&4
7317 *) echo "As you already told me, signal handler returns int." >&4
7324 case "$d_voidsig" in
7325 "$define") signal_t="void";;
7330 : check for ability to cast large floats to 32-bit ints.
7332 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7333 if $test "$intsize" -ge 4; then
7340 #include <sys/types.h>
7342 $signal_t blech(s) int s; { exit(3); }
7349 signal(SIGFPE, blech);
7351 /* Don't let compiler optimize the test away. Store the number
7352 in a writable string for gcc to pass to sscanf under HP/UX.
7354 sprintf(str, "2147483647");
7355 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7359 /* x86 processors will probably give 0x8000 0000, which is a
7360 sign change. We don't want that. We want to mimic SPARC
7361 behavior here, which is to preserve the sign and give
7364 if (i32 != ($xxx) f)
7370 if eval $compile_ok; then
7374 echo "(I can't seem to compile the test program--assuming it can't)"
7382 echo "Nope, it can't."
7389 : check for ability to cast negative floats to unsigned
7391 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7394 #include <sys/types.h>
7396 $signal_t blech(s) int s; { exit(7); }
7397 $signal_t blech_in_list(s) int s; { exit(4); }
7398 unsigned long dummy_long(p) unsigned long p; { return p; }
7399 unsigned int dummy_int(p) unsigned int p; { return p; }
7400 unsigned short dummy_short(p) unsigned short p; { return p; }
7404 unsigned long along;
7406 unsigned short ashort;
7410 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7411 a direct f = -123. assignment. gcc-2.8.0 reportedly
7412 optimized the whole file away
7414 /* Store the number in a writable string for gcc to pass to
7417 sprintf(str, "-123");
7418 sscanf(str, "%lf", &f); /* f = -123.; */
7420 signal(SIGFPE, blech);
7421 along = (unsigned long)f;
7422 aint = (unsigned int)f;
7423 ashort = (unsigned short)f;
7424 if (along != (unsigned long)-123)
7426 if (aint != (unsigned int)-123)
7428 if (ashort != (unsigned short)-123)
7430 sprintf(str, "1073741824.");
7431 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7434 along = (unsigned long)f;
7435 if (along != 0x80000000)
7439 along = (unsigned long)f;
7440 if (along != 0x7fffffff)
7444 along = (unsigned long)f;
7445 if (along != 0x80000001)
7449 signal(SIGFPE, blech_in_list);
7450 sprintf(str, "123.");
7451 sscanf(str, "%lf", &f); /* f = 123.; */
7452 along = dummy_long((unsigned long)f);
7453 aint = dummy_int((unsigned int)f);
7454 ashort = dummy_short((unsigned short)f);
7455 if (along != (unsigned long)123)
7457 if (aint != (unsigned int)123)
7459 if (ashort != (unsigned short)123)
7466 if eval $compile_ok; then
7470 echo "(I can't seem to compile the test program--assuming it can't)"
7473 case "$castflags" in
7478 echo "Nope, it can't."
7485 : see if vprintf exists
7487 if set vprintf val -f d_vprintf; eval $csym; $val; then
7488 echo 'vprintf() found.' >&4
7490 $cat >vprintf.c <<'EOF'
7491 #include <varargs.h>
7493 int main() { xxx("foo"); }
7502 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7506 if eval $compile && ./vprintf; then
7507 echo "Your vsprintf() returns (int)." >&4
7510 echo "Your vsprintf() returns (char*)." >&4
7514 echo 'vprintf() NOT found.' >&4
7524 : see if chown exists
7528 : see if chroot exists
7532 : see if chsize exists
7536 : check for const keyword
7538 echo 'Checking to see if your C compiler knows about "const"...' >&4
7539 $cat >const.c <<'EOCP'
7540 typedef struct spug { int drokk; } spug;
7547 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7549 echo "Yup, it does."
7552 echo "Nope, it doesn't."
7557 : see if crypt exists
7559 if set crypt val -f d_crypt; eval $csym; $val; then
7560 echo 'crypt() found.' >&4
7564 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7565 if $test -z "$cryptlib"; then
7566 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7570 if $test -z "$cryptlib"; then
7571 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7575 if $test -z "$cryptlib"; then
7576 cryptlib=`./loc libcrypt$_a "" $libpth`
7580 if $test -z "$cryptlib"; then
7581 echo 'crypt() NOT found.' >&4
7590 : get csh whereabouts
7592 'csh') val="$undef" ;;
7597 : Respect a hint or command line value for full_csh.
7599 '') full_csh=$csh ;;
7602 : see if cuserid exists
7603 set cuserid d_cuserid
7606 : see if this is a limits.h system
7607 set limits.h i_limits
7610 : see if this is a float.h system
7614 : See if number of significant digits in a double precision number is known
7616 $cat >dbl_dig.c <<EOM
7626 printf("Contains DBL_DIG");
7629 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7630 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7631 echo "DBL_DIG found." >&4
7634 echo "DBL_DIG NOT found." >&4
7641 : see if difftime exists
7642 set difftime d_difftime
7645 : see if this is a dirent system
7647 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7649 echo "<dirent.h> found." >&4
7652 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7653 echo "<sys/dir.h> found." >&4
7656 xinc=`./findhdr sys/ndir.h`
7658 echo "<dirent.h> NOT found." >&4
7663 : Look for type of directory structure.
7665 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7667 case "$direntrytype" in
7670 $define) guess1='struct dirent' ;;
7671 *) guess1='struct direct' ;;
7674 *) guess1="$direntrytype"
7679 'struct dirent') guess2='struct direct' ;;
7680 *) guess2='struct dirent' ;;
7683 if $contains "$guess1" try.c >/dev/null 2>&1; then
7684 direntrytype="$guess1"
7685 echo "Your directory entries are $direntrytype." >&4
7686 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7687 direntrytype="$guess2"
7688 echo "Your directory entries seem to be $direntrytype." >&4
7690 echo "I don't recognize your system's directory entries." >&4
7691 rp="What type is used for directory entries on this system?"
7699 : see if the directory entry stores field length
7701 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7702 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7703 echo "Good, your directory entry keeps length information in d_namlen." >&4
7706 echo "Your directory entry does not know about the d_namlen field." >&4
7713 : see if dlerror exists
7716 set dlerror d_dlerror
7720 : see if dlfcn is available
7728 On a few systems, the dynamically loaded modules that perl generates and uses
7729 will need a different extension than shared libs. The default will probably
7737 rp='What is the extension of dynamically loaded modules'
7746 : Check if dlsym need a leading underscore
7752 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7753 $cat >dyna.c <<'EOM'
7762 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7764 #include <sys/types.h>
7778 int mode = RTLD_LAZY ;
7780 handle = dlopen("./dyna.$dlext", mode) ;
7781 if (handle == NULL) {
7786 symbol = dlsym(handle, "fred") ;
7787 if (symbol == NULL) {
7788 /* try putting a leading underscore */
7789 symbol = dlsym(handle, "_fred") ;
7790 if (symbol == NULL) {
7803 : Call the object file tmp-dyna.o in case dlext=o.
7804 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7805 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7806 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7807 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7810 1) echo "Test program failed using dlopen." >&4
7811 echo "Perhaps you should not use dynamic loading." >&4;;
7812 2) echo "Test program failed using dlsym." >&4
7813 echo "Perhaps you should not use dynamic loading." >&4;;
7814 3) echo "dlsym needs a leading underscore" >&4
7816 4) echo "dlsym doesn't need a leading underscore." >&4;;
7819 echo "I can't compile and run the test program." >&4
7820 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7825 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7830 hasproto='varname=$1; func=$2; shift; shift;
7831 while $test $# -ge 2; do
7833 $define) echo "#include <$2>";;
7837 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7838 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7839 echo "$func() prototype found.";
7842 echo "$func() prototype NOT found.";
7847 $rm -f try.c tryout.c'
7849 : see if prototype for drand48 is available
7851 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7854 : see if dup2 exists
7858 : see if eaccess exists
7859 set eaccess d_eaccess
7862 : see if endgrent exists
7863 set endgrent d_endgrent
7866 : see if endhostent exists
7867 set endhostent d_endhent
7870 : see if endnetent exists
7871 set endnetent d_endnent
7874 : see if endprotoent exists
7875 set endprotoent d_endpent
7878 : see if endpwent exists
7879 set endpwent d_endpwent
7882 : see if endservent exists
7883 set endservent d_endsent
7886 : see if endspent exists
7887 set endspent d_endspent
7890 : Locate the flags for 'open()'
7892 $cat >open3.c <<'EOCP'
7893 #include <sys/types.h>
7898 #include <sys/file.h>
7909 : check sys/file.h first to get FREAD on Sun
7910 if $test `./findhdr sys/file.h` && \
7911 set open3 -DI_SYS_FILE && eval $compile; then
7913 echo "<sys/file.h> defines the O_* constants..." >&4
7915 echo "and you have the 3 argument form of open()." >&4
7918 echo "but not the 3 argument form of open(). Oh, well." >&4
7921 elif $test `./findhdr fcntl.h` && \
7922 set open3 -DI_FCNTL && eval $compile; then
7924 echo "<fcntl.h> defines the O_* constants..." >&4
7926 echo "and you have the 3 argument form of open()." >&4
7929 echo "but not the 3 argument form of open(). Oh, well." >&4
7934 echo "I can't find the O_* constant definitions! You got problems." >&4
7940 : see which of string.h or strings.h is needed
7942 strings=`./findhdr string.h`
7943 if $test "$strings" && $test -r "$strings"; then
7944 echo "Using <string.h> instead of <strings.h>." >&4
7948 strings=`./findhdr strings.h`
7949 if $test "$strings" && $test -r "$strings"; then
7950 echo "Using <strings.h> instead of <string.h>." >&4
7952 echo "No string header found -- You'll surely have problems." >&4
7958 "$undef") strings=`./findhdr strings.h`;;
7959 *) strings=`./findhdr string.h`;;
7962 : check for non-blocking I/O stuff
7963 case "$h_sysfile" in
7964 true) echo "#include <sys/file.h>" > head.c;;
7967 true) echo "#include <fcntl.h>" > head.c;;
7968 *) echo "#include <sys/fcntl.h>" > head.c;;
7973 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7974 case "$o_nonblock" in
7977 $cat >>try.c <<'EOCP'
7981 printf("O_NONBLOCK\n");
7985 printf("O_NDELAY\n");
7989 printf("FNDELAY\n");
7996 if eval $compile_ok; then
7998 case "$o_nonblock" in
7999 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8000 *) echo "Seems like we can use $o_nonblock.";;
8003 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8006 *) echo "Using $hint value $o_nonblock.";;
8008 $rm -f try try.* .out core
8011 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8017 #include <sys/types.h>
8020 #define MY_O_NONBLOCK $o_nonblock
8021 #ifndef errno /* XXX need better Configure test */
8030 #include <strings.h>
8032 $signal_t blech(x) int x; { exit(3); }
8034 $cat >> try.c <<'EOCP'
8042 pipe(pd); /* Down: child -> parent */
8043 pipe(pu); /* Up: parent -> child */
8046 close(pd[1]); /* Parent reads from pd[0] */
8047 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8048 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8050 signal(SIGALRM, blech);
8052 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8054 sprintf(string, "%d\n", ret);
8055 write(2, string, strlen(string));
8058 if (errno == EAGAIN) {
8064 if (errno == EWOULDBLOCK)
8065 printf("EWOULDBLOCK\n");
8068 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8069 sleep(2); /* Give it time to close our pipe */
8071 ret = read(pd[0], buf, 1); /* Should read EOF */
8073 sprintf(string, "%d\n", ret);
8074 write(3, string, strlen(string));
8078 close(pd[0]); /* We write to pd[1] */
8079 close(pu[1]); /* We read from pu[0] */
8080 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8081 close(pd[1]); /* Pipe pd is now fully closed! */
8082 exit(0); /* Bye bye, thank you for playing! */
8086 if eval $compile_ok; then
8087 echo "$startsh" >mtry
8088 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8090 ./mtry >/dev/null 2>&1
8092 0) eagain=`$cat try.out`;;
8093 1) echo "Could not perform non-blocking setting!";;
8094 2) echo "I did a successful read() for something that was not there!";;
8095 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8096 *) echo "Something terribly wrong happened during testing.";;
8098 rd_nodata=`$cat try.ret`
8099 echo "A read() system call with no data present returns $rd_nodata."
8100 case "$rd_nodata" in
8103 echo "(That's peculiar, fixing that to be -1.)"
8109 echo "Forcing errno EAGAIN on read() with no data available."
8113 echo "Your read() sets errno to $eagain when no data is available."
8116 status=`$cat try.err`
8118 0) echo "And it correctly returns 0 to signal EOF.";;
8119 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8120 *) echo "However, your read() returns '$status' on EOF??";;
8123 if test "$status" = "$rd_nodata"; then
8124 echo "WARNING: you can't distinguish between EOF and no data!"
8128 echo "I can't compile the test program--assuming errno EAGAIN will do."
8135 echo "Using $hint value $eagain."
8136 echo "Your read() returns $rd_nodata when no data is present."
8137 case "$d_eofnblk" in
8138 "$define") echo "And you can see EOF because read() returns 0.";;
8139 "$undef") echo "But you can't see EOF status from read() returned value.";;
8141 echo "(Assuming you can't see EOF status from read anyway.)"
8147 $rm -f try try.* .out core head.c mtry
8149 : see if fchmod exists
8153 : see if fchown exists
8157 : see if this is an fcntl system
8161 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8162 while $test $# -ge 2; do
8164 $define) echo "#include <$2>";;
8168 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8170 if eval $compile; then
8181 : see whether socket exists
8183 $echo $n "Hmm... $c" >&4
8184 if set socket val -f d_socket; eval $csym; $val; then
8185 echo "Looks like you have Berkeley networking support." >&4
8187 if set setsockopt val -f; eval $csym; $val; then
8190 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8194 if $contains socklib libc.list >/dev/null 2>&1; then
8195 echo "Looks like you have Berkeley networking support." >&4
8197 : we will have to assume that it supports the 4.2 BSD interface
8200 echo "You don't have Berkeley networking in libc$_a..." >&4
8201 if test "X$d_socket" = "X$define"; then
8202 echo "...but you seem to believe that you have sockets." >&4
8204 for net in net socket
8206 if test -f /usr/lib/lib$net$_a; then
8207 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8208 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8209 if $contains socket libc.list >/dev/null 2>&1; then
8214 echo "...but the Wollongong group seems to have hacked it in." >&4
8215 sockethdr="-I/usr/netinclude"
8218 echo "Found Berkeley sockets interface in lib$net." >& 4
8219 if $contains setsockopt libc.list >/dev/null 2>&1; then
8222 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8229 if test "X$d_socket" != "X$define"; then
8230 echo "or anywhere else I see." >&4
8238 : see if socketpair exists
8239 set socketpair d_sockpair
8244 echo "Checking the availability of certain socket constants..." >& 4
8245 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8246 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8248 #include <sys/types.h>
8249 #include <sys/socket.h>
8255 set try; if eval $compile; then
8258 set d_${enum}; eval $setvar
8262 : see if sys/select.h has to be included
8263 set sys/select.h i_sysselct
8266 : see if we should include time.h, sys/time.h, or both
8268 if test "X$timeincl" = X; then
8269 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8270 $echo $n "I'm now running the test program...$c"
8271 $cat >try.c <<'EOCP'
8272 #include <sys/types.h>
8277 #ifdef SYSTIMEKERNEL
8280 #include <sys/time.h>
8283 #include <sys/select.h>
8292 struct timezone tzp;
8294 if (foo.tm_sec == foo.tm_sec)
8297 if (bar.tv_sec == bar.tv_sec)
8304 for s_timezone in '-DS_TIMEZONE' ''; do
8306 for s_timeval in '-DS_TIMEVAL' ''; do
8307 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8308 for i_time in '' '-DI_TIME'; do
8309 for i_systime in '-DI_SYSTIME' ''; do
8312 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8313 if eval $compile; then
8314 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8318 $echo $n "Succeeded with $flags$c"
8330 *SYSTIMEKERNEL*) i_systimek="$define"
8331 timeincl=`./findhdr sys/time.h`
8332 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8333 *) i_systimek="$undef";;
8336 *I_TIME*) i_time="$define"
8337 timeincl=`./findhdr time.h`" $timeincl"
8338 echo "We'll include <time.h>." >&4;;
8339 *) i_time="$undef";;
8342 *I_SYSTIME*) i_systime="$define"
8343 timeincl=`./findhdr sys/time.h`" $timeincl"
8344 echo "We'll include <sys/time.h>." >&4;;
8345 *) i_systime="$undef";;
8350 : check for fd_set items
8353 Checking to see how well your C compiler handles fd_set and friends ...
8355 $cat >fd_set.c <<EOCP
8356 #$i_systime I_SYS_TIME
8357 #$i_sysselct I_SYS_SELECT
8358 #$d_socket HAS_SOCKET
8359 #include <sys/types.h>
8361 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8364 #include <sys/time.h>
8367 #include <sys/select.h>
8376 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8383 set fd_set -DTRYBITS
8384 if eval $compile; then
8385 d_fds_bits="$define"
8387 echo "Well, your system knows about the normal fd_set typedef..." >&4
8389 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8390 d_fd_macros="$define"
8393 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8395 d_fd_macros="$undef"
8399 Hmm, your compiler has some difficulty with fd_set. Checking further...
8402 if eval $compile; then
8405 echo "Well, your system has some sort of fd_set available..." >&4
8407 echo "and you have the normal fd_set macros." >&4
8408 d_fd_macros="$define"
8411 but not the normal fd_set macros! Gross! More work for me...
8413 d_fd_macros="$undef"
8416 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8419 d_fd_macros="$undef"
8424 : see if fgetpos exists
8425 set fgetpos d_fgetpos
8428 : see if flock exists
8432 : see if fork exists
8436 : see if pathconf exists
8437 set pathconf d_pathconf
8440 : see if fpathconf exists
8441 set fpathconf d_fpathconf
8444 : define an is-a-typedef? function
8445 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8447 "") inclist="sys/types.h";;
8449 eval "varval=\$$var";
8453 for inc in $inclist; do
8454 echo "#include <$inc>" >>temp.c;
8456 echo "#ifdef $type" >> temp.c;
8457 echo "printf(\"We have $type\");" >> temp.c;
8458 echo "#endif" >> temp.c;
8459 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8460 if $contains $type temp.E >/dev/null 2>&1; then
8466 *) eval "$var=\$varval";;
8469 : define an is-a-typedef? function that prompts if the type is not available.
8470 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8472 "") inclist="sys/types.h";;
8474 eval "varval=\$$var";
8478 for inc in $inclist; do
8479 echo "#include <$inc>" >>temp.c;
8481 echo "#ifdef $type" >> temp.c;
8482 echo "printf(\"We have $type\");" >> temp.c;
8483 echo "#endif" >> temp.c;
8484 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8486 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8487 if $contains $type temp.E >/dev/null 2>&1; then
8488 echo "$type found." >&4;
8491 echo "$type NOT found." >&4;
8497 *) eval "$var=\$varval";;
8500 : see what type lseek is declared as in the kernel
8501 rp="What is the type used for lseek's offset on this system?"
8502 set off_t lseektype long stdio.h sys/types.h
8506 $echo $n "Checking to see how big your file offsets are...$c" >&4
8508 #include <sys/types.h>
8512 printf("%d\n", (int)sizeof($lseektype));
8517 if eval $compile_ok; then
8519 $echo " $lseeksize bytes." >&4
8523 echo "(I can't seem to compile the test program. Guessing...)"
8524 rp="What is the size of your file offsets (in bytes)?"
8530 : see what type file positions are declared as in the library
8531 rp="What is the type for file position used by fsetpos()?"
8532 set fpos_t fpostype long stdio.h sys/types.h
8537 *_t) zzz="$fpostype" ;;
8540 echo "Checking the size of $zzz..." >&4
8542 #include <sys/types.h>
8545 printf("%d\n", (int)sizeof($fpostype));
8550 if eval $compile_ok; then
8554 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8557 echo "Your $zzz size is $fpossize bytes."
8562 echo "(I can't compile the test program--guessing $fpossize.)" >&4
8569 echo "Checking to see if your system supports off64_t..." >&4
8571 #include <sys/types.h>
8573 int main() { off64_t x = 7; }'
8576 if eval $compile; then
8578 echo "Yes, it does."
8581 echo "No, it doesn't."
8582 case "$lseeksize" in
8583 8) echo "(This is okay because your off_t is 64 bits wide.)" ;;
8590 : check for fpos64_t
8592 echo "Checking to see if your system supports fpos64_t..." >&4
8594 #include <sys/stdio.h>
8595 int main() { fpos64_t x x = 7; }'
8598 if eval $compile; then
8600 echo "Yes, it does."
8603 echo "No, it doesn't."
8605 8) echo "(This is okay because your fpos_t is 64 bits wide.)" ;;
8612 hasstruct='varname=$1; struct=$2; shift; shift;
8613 while $test $# -ge 2; do
8615 $define) echo "#include <$2>";;
8619 echo "int main () { struct $struct foo; }" >> try.c;
8621 if eval $compile; then
8630 : see if this is a sys/param system
8631 set sys/param.h i_sysparam
8634 : see if this is a sys/mount.h system
8635 set sys/mount.h i_sysmount
8638 : see if sys/types.h has to be included
8639 set sys/types.h i_systypes
8644 echo "Checking to see if your system supports struct fs_data..." >&4
8645 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8647 case "$d_fs_data_s" in
8648 "$define") echo "Yes, it does." ;;
8649 *) echo "No, it doesn't." ;;
8652 : see if fseeko exists
8656 : see if fsetpos exists
8657 set fsetpos d_fsetpos
8661 : see if fstatfs exists
8662 set fstatfs d_fstatfs
8666 : see if statvfs exists
8667 set statvfs d_statvfs
8670 : see if fstatvfs exists
8671 set fstatvfs d_fstatvfs
8675 : see if ftello exists
8679 : see if getgrent exists
8680 set getgrent d_getgrent
8683 : see if gethostbyaddr exists
8684 set gethostbyaddr d_gethbyaddr
8687 : see if gethostbyname exists
8688 set gethostbyname d_gethbyname
8691 : see if gethostent exists
8692 set gethostent d_gethent
8695 : see how we will look up host name
8698 if set gethostname val -f d_gethname; eval $csym; $val; then
8699 echo 'gethostname() found.' >&4
8700 d_gethname="$define"
8703 if set uname val -f d_uname; eval $csym; $val; then
8706 uname() was found, but you're running xenix, and older versions of xenix
8707 have a broken uname(). If you don't really know whether your xenix is old
8708 enough to have a broken system call, use the default answer.
8715 rp='Is your uname() broken?'
8718 n*) d_uname="$define"; call=uname;;
8721 echo 'uname() found.' >&4
8728 case "$d_gethname" in
8729 '') d_gethname="$undef";;
8732 '') d_uname="$undef";;
8734 case "$d_uname$d_gethname" in
8739 Every now and then someone has a $call() that lies about the hostname
8740 but can't be fixed for political or economic reasons. If you wish, I can
8741 pretend $call() isn't there and maybe compute hostname at run-time
8742 thanks to the '$phostname' command.
8745 rp="Shall I ignore $call() from now on?"
8748 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8751 case "$phostname" in
8753 *) case "$aphostname" in
8759 file=`./loc $file $file $pth`
8760 aphostname=`echo $file $*`
8765 case "$d_uname$d_gethname" in
8768 case "$phostname" in
8770 echo "There will be no way for $package to get your hostname." >&4;;
8772 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8776 case "$d_phostname" in
8777 '') d_phostname="$undef";;
8780 : see if this is a netdb.h system
8784 : see if prototypes for various gethostxxx netdb.h functions are available
8786 set d_gethostprotos gethostent $i_netdb netdb.h
8789 : see if getlogin exists
8790 set getlogin d_getlogin
8793 : see if getmnt exists
8797 : see if getmntent exists
8798 set getmntent d_getmntent
8801 : see if getnetbyaddr exists
8802 set getnetbyaddr d_getnbyaddr
8805 : see if getnetbyname exists
8806 set getnetbyname d_getnbyname
8809 : see if getnetent exists
8810 set getnetent d_getnent
8813 : see if prototypes for various getnetxxx netdb.h functions are available
8815 set d_getnetprotos getnetent $i_netdb netdb.h
8819 : see if getprotobyname exists
8820 set getprotobyname d_getpbyname
8823 : see if getprotobynumber exists
8824 set getprotobynumber d_getpbynumber
8827 : see if getprotoent exists
8828 set getprotoent d_getpent
8831 : see if getpgid exists
8832 set getpgid d_getpgid
8835 : see if getpgrp2 exists
8836 set getpgrp2 d_getpgrp2
8839 : see if getppid exists
8840 set getppid d_getppid
8843 : see if getpriority exists
8844 set getpriority d_getprior
8847 : see if prototypes for various getprotoxxx netdb.h functions are available
8849 set d_getprotoprotos getprotoent $i_netdb netdb.h
8852 : see if getpwent exists
8853 set getpwent d_getpwent
8857 : see if getservbyname exists
8858 set getservbyname d_getsbyname
8861 : see if getservbyport exists
8862 set getservbyport d_getsbyport
8865 : see if getservent exists
8866 set getservent d_getsent
8869 : see if prototypes for various getservxxx netdb.h functions are available
8871 set d_getservprotos getservent $i_netdb netdb.h
8874 : see if getspent exists
8875 set getspent d_getspent
8878 : see if getspnam exists
8879 set getspnam d_getspnam
8882 : see if gettimeofday or ftime exists
8883 set gettimeofday d_gettimeod
8885 case "$d_gettimeod" in
8891 val="$undef"; set d_ftime; eval $setvar
8894 case "$d_gettimeod$d_ftime" in
8897 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8901 : see if this is an grp system
8907 xxx=`./findhdr grp.h`
8908 $cppstdin $cppflags $cppminus < $xxx >$$.h
8910 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8922 set d_grpasswd; eval $setvar
8926 : see if hasmntopt exists
8927 set hasmntopt d_hasmntopt
8930 : see if this is a netinet/in.h or sys/in.h system
8931 set netinet/in.h i_niin sys/in.h i_sysin
8934 : see if arpa/inet.h has to be included
8935 set arpa/inet.h i_arpainet
8938 : see if htonl --and friends-- exists
8943 : Maybe they are macros.
8948 #include <sys/types.h>
8949 #$i_niin I_NETINET_IN
8951 #$i_arpainet I_ARPA_INET
8953 #include <netinet/in.h>
8959 #include <arpa/inet.h>
8962 printf("Defined as a macro.");
8965 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8966 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8968 echo "But it seems to be defined as a macro." >&4
8978 if set index val -f; eval $csym; $val; then
8979 if set strchr val -f d_strchr; eval $csym; $val; then
8980 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8983 echo "strchr() found." >&4
8987 echo "index() found." >&4
8992 echo "index() found." >&4
8995 if set strchr val -f d_strchr; eval $csym; $val; then
8998 echo "strchr() found." >&4
9000 echo "No index() or strchr() found!" >&4
9005 set d_strchr; eval $setvar
9007 set d_index; eval $setvar
9009 : check whether inet_aton exists
9010 set inet_aton d_inetaton
9013 : see if inttypes.h is available
9014 : we want a real compile instead of Inhdr because some systems
9015 : have an inttypes.h which includes non-existent headers
9018 #include <inttypes.h>
9020 static int32_t foo32 = 0x12345678;
9024 if eval $compile; then
9025 echo "<inttypes.h> found." >&4
9028 echo "<inttypes.h> NOT found." >&4
9036 case "$use64bits" in
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
9067 $cat >isascii.c <<'EOCP'
9079 if eval $compile; then
9080 echo "isascii() found." >&4
9083 echo "isascii() NOT found." >&4
9090 : see if killpg exists
9094 : see if lchown exists
9096 $cat > try.c <<'EOCP'
9097 /* System header to define __stub macros and hopefully few prototypes,
9098 which can conflict with char lchown(); below. */
9100 /* Override any gcc2 internal prototype to avoid an error. */
9101 /* We use char because int might match the return type of a gcc2
9102 builtin and then its argument prototype would still apply. */
9105 /* The GNU C library defines this for functions which it implements
9106 to always fail with ENOSYS. Some functions are actually named
9107 something starting with __ and the normal name is an alias. */
9108 #if defined (__stub_lchown) || defined (__stub___lchown)
9116 if eval $compile; then
9117 $echo "lchown() found." >&4
9120 $echo "lchown() NOT found." >&4
9126 : See if number of significant digits in a double precision number is known
9128 $cat >ldbl_dig.c <<EOM
9138 printf("Contains LDBL_DIG");
9141 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9142 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9143 echo "LDBL_DIG found." >&4
9146 echo "LDBL_DIG NOT found." >&4
9153 : see if link exists
9157 : see if localeconv exists
9158 set localeconv d_locconv
9161 : see if lockf exists
9165 : check for long long
9167 $echo $n "Checking to see if your system supports long long..." $c >&4
9168 echo 'int main() { long long x = 7; return 0; }' > try.c
9170 if eval $compile; then
9172 echo " Yes, it does." >&4
9175 echo " No, it doesn't." >&4
9181 : check for length of long long
9182 case "${d_longlong}${longlongsize}" in
9185 $echo $n "Checking to see how big your long longs are..." $c >&4
9186 $cat >try.c <<'EOCP'
9190 printf("%d\n", (int)sizeof(long long));
9195 if eval $compile_ok; then
9196 longlongsize=`./try$exe_ext`
9197 $echo " $longlongsize bytes." >&4
9201 echo "(I can't seem to compile the test program. Guessing...)"
9202 rp="What is the size of a long long (in bytes)?"
9206 if $test "X$longsize" = "X$longlongsize"; then
9207 echo "(That isn't any different from an ordinary long.)"
9213 : see if lstat exists
9217 : see if mblen exists
9221 : see if mbstowcs exists
9222 set mbstowcs d_mbstowcs
9225 : see if mbtowc exists
9229 : see if memchr exists
9233 : see if memcmp exists
9237 : see if memcpy exists
9241 : see if memmove exists
9242 set memmove d_memmove
9245 : see if memset exists
9249 : see if mkdir exists
9253 : see if mkfifo exists
9257 : see if mktime exists
9261 : see if msgctl exists
9265 : see if msgget exists
9269 : see if msgsnd exists
9273 : see if msgrcv exists
9277 : see how much of the 'msg*(2)' library is present.
9280 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9281 *"$undef"*) h_msg=false;;
9285 case "`ipcs 2>&1`" in
9286 "SVID messages"*"not configured"*)
9287 echo "Your $osname does not have the msg*(2) configured." >&4
9302 : we could also check for sys/ipc.h ...
9303 if $h_msg && $test `./findhdr sys/msg.h`; then
9304 echo "You have the full msg*(2) library." >&4
9307 echo "You don't have the full msg*(2) library." >&4
9313 : see if nice exists
9317 : see if POSIX threads are available
9318 set pthread.h i_pthread
9324 : how to create joinable pthreads
9325 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9327 echo "Checking what constant to use for creating joinable pthreads..." >&4
9328 $cat >try.c <<'EOCP'
9329 #include <pthread.h>
9331 int detachstate = JOINABLE;
9334 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9335 if eval $compile; then
9336 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9337 val="$undef" # Yes, undef.
9338 set d_old_pthread_create_joinable
9341 set old_pthread_create_joinable
9344 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9345 if eval $compile; then
9346 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9348 set d_old_pthread_create_joinable
9350 val=PTHREAD_CREATE_UNDETACHED
9351 set old_pthread_create_joinable
9354 set try -DJOINABLE=__UNDETACHED
9355 if eval $compile; then
9356 echo "You seem to use __UNDETACHED." >&4
9358 set d_old_pthread_create_joinable
9361 set old_pthread_create_joinable
9364 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9366 set d_old_pthread_create_joinable
9369 set old_pthread_create_joinable
9376 d_old_pthread_create_joinable="$undef"
9377 old_pthread_create_joinable=""
9380 : see if pause exists
9384 : see if pipe exists
9388 : see if poll exists
9393 : see whether the various POSIXish _yields exist
9395 #include <pthread.h>
9401 #ifdef PTHREAD_YIELD
9404 #ifdef PTHREAD_YIELD_NULL
9405 pthread_yield(NULL);
9411 : see if sched_yield exists
9412 set try -DSCHED_YIELD
9413 if eval $compile; then
9415 sched_yield='sched_yield()'
9419 case "$usethreads" in
9422 $define) echo 'sched_yield() found.' >&4 ;;
9423 *) echo 'sched_yield() NOT found.' >&4 ;;
9429 : see if pthread_yield exists
9430 set try -DPTHREAD_YIELD
9431 if eval $compile; then
9433 case "$sched_yield" in
9434 '') sched_yield='pthread_yield()' ;;
9437 set try -DPTHREAD_YIELD_NULL
9438 if eval $compile; then
9440 case "$sched_yield" in
9441 '') sched_yield='pthread_yield(NULL)' ;;
9447 case "$usethreads" in
9450 $define) echo 'pthread_yield() found.' >&4 ;;
9451 *) echo 'pthread_yield() NOT found.' >&4 ;;
9458 case "$sched_yield" in
9459 '') sched_yield=undef ;;
9464 : see if this is a pwd.h system
9470 xxx=`./findhdr pwd.h`
9471 $cppstdin $cppflags $cppminus < $xxx >$$.h
9473 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9481 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9489 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9497 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9505 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9513 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9521 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9529 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9541 set d_pwquota; eval $setvar
9542 set d_pwage; eval $setvar
9543 set d_pwchange; eval $setvar
9544 set d_pwclass; eval $setvar
9545 set d_pwexpire; eval $setvar
9546 set d_pwcomment; eval $setvar
9547 set d_pwgecos; eval $setvar
9548 set d_pwpasswd; eval $setvar
9554 echo "Checking which 64-bit integer type to use..." >&4
9560 val='"unsigned int"'
9565 *) case "$longsize" in
9569 val='"unsigned long"'
9574 *) case "$uselonglong:$d_longlong:$longlongsize" in
9579 val='"unsigned long long"'
9584 *) case "$d_int64t" in
9603 '') echo "Alas, no 64-bit integer types in sight." >&4
9606 *) echo "Using '$quadtype' for 64-bit integers." >&4
9611 : see if readdir and friends exist
9612 set readdir d_readdir
9614 set seekdir d_seekdir
9616 set telldir d_telldir
9618 set rewinddir d_rewinddir
9621 : see if readlink exists
9622 set readlink d_readlink
9625 : see if rename exists
9629 : see if rmdir exists
9633 : see if memory.h is available.
9638 : See if it conflicts with string.h
9644 $cppstdin $cppflags $cppminus < $strings > mem.h
9645 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9647 echo "We won't be including <memory.h>."
9657 : can bcopy handle overlapping blocks?
9662 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9669 $cat >>try.c <<'EOCP'
9672 # include <memory.h>
9675 # include <stdlib.h>
9678 # include <string.h>
9680 # include <strings.h>
9683 # include <unistd.h> /* Needed for NetBSD */
9687 char buf[128], abc[128];
9693 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9695 for (align = 7; align >= 0; align--) {
9696 for (len = 36; len; len--) {
9699 for (off = 1; off <= len; off++) {
9700 bcopy(b, b+off, len);
9701 bcopy(b+off, b, len);
9702 if (bcmp(b, abc, len))
9711 if eval $compile_ok; then
9712 if ./try 2>/dev/null; then
9716 echo "It can't, sorry."
9717 case "$d_memmove" in
9718 "$define") echo "But that's Ok since you have memmove()." ;;
9722 echo "(I can't compile the test program, so we'll assume not...)"
9723 case "$d_memmove" in
9724 "$define") echo "But that's Ok since you have memmove()." ;;
9729 $rm -f try.* try core
9733 : can memcpy handle overlapping blocks?
9738 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9745 $cat >>try.c <<'EOCP'
9748 # include <memory.h>
9751 # include <stdlib.h>
9754 # include <string.h>
9756 # include <strings.h>
9759 # include <unistd.h> /* Needed for NetBSD */
9763 char buf[128], abc[128];
9769 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9770 try to store the string in read-only memory. */
9771 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9773 for (align = 7; align >= 0; align--) {
9774 for (len = 36; len; len--) {
9776 memcpy(b, abc, len);
9777 for (off = 1; off <= len; off++) {
9778 memcpy(b+off, b, len);
9779 memcpy(b, b+off, len);
9780 if (memcmp(b, abc, len))
9789 if eval $compile_ok; then
9790 if ./try 2>/dev/null; then
9794 echo "It can't, sorry."
9795 case "$d_memmove" in
9796 "$define") echo "But that's Ok since you have memmove()." ;;
9800 echo "(I can't compile the test program, so we'll assume not...)"
9801 case "$d_memmove" in
9802 "$define") echo "But that's Ok since you have memmove()." ;;
9807 $rm -f try.* try core
9811 : can memcmp be trusted to compare relative magnitude?
9816 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9823 $cat >>try.c <<'EOCP'
9826 # include <memory.h>
9829 # include <stdlib.h>
9832 # include <string.h>
9834 # include <strings.h>
9837 # include <unistd.h> /* Needed for NetBSD */
9843 if ((a < b) && memcmp(&a, &b, 1) < 0)
9849 if eval $compile_ok; then
9850 if ./try 2>/dev/null; then
9854 echo "No, it can't (it uses signed chars)."
9857 echo "(I can't compile the test program, so we'll assume not...)"
9861 $rm -f try.* try core
9865 : see if select exists
9869 : see if semctl exists
9873 : see if semget exists
9877 : see if semop exists
9881 : see how much of the 'sem*(2)' library is present.
9884 case "$d_semctl$d_semget$d_semop" in
9885 *"$undef"*) h_sem=false;;
9889 case "`ipcs 2>&1`" in
9890 "SVID messages"*"not configured"*)
9891 echo "Your $osname does not have the sem*(2) configured." >&4
9904 : we could also check for sys/ipc.h ...
9905 if $h_sem && $test `./findhdr sys/sem.h`; then
9906 echo "You have the full sem*(2) library." >&4
9909 echo "You don't have the full sem*(2) library." >&4
9915 : see whether sys/sem.h defines union semun
9917 $cat > try.c <<'END'
9918 #include <sys/types.h>
9919 #include <sys/ipc.h>
9920 #include <sys/sem.h>
9921 int main () { union semun semun; semun.buf = 0; }
9924 if eval $compile; then
9925 echo "You have union semun in <sys/sem.h>." >&4
9928 echo "You do not have union semun in <sys/sem.h>." >&4
9931 $rm -f try try.c try.h
9935 : see how to do semctl IPC_STAT
9938 : see whether semctl IPC_STAT can use union semun
9943 # define S_IRUSR S_IREAD
9944 # define S_IWUSR S_IWRITE
9945 # define S_IXUSR S_IEXEC
9947 # define S_IRUSR 0400
9948 # define S_IWUSR 0200
9949 # define S_IXUSR 0100
9951 # define S_IRGRP (S_IRUSR>>3)
9952 # define S_IWGRP (S_IWUSR>>3)
9953 # define S_IXGRP (S_IXUSR>>3)
9954 # define S_IROTH (S_IRUSR>>6)
9955 # define S_IWOTH (S_IWUSR>>6)
9956 # define S_IXOTH (S_IXUSR>>6)
9959 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9960 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9961 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9966 #include <sys/types.h>
9967 #include <sys/ipc.h>
9968 #include <sys/sem.h>
9969 #include <sys/stat.h>
9976 #$d_union_semun HAS_UNION_SEMUN
9979 #ifndef HAS_UNION_SEMUN
9982 struct semid_ds *buf;
9983 unsigned short *array;
9989 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9990 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9992 struct semid_ds argbuf;
9995 st = semctl(sem, 0, IPC_STAT, arg);
9999 # endif /* IPC_STAT */
10000 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10002 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10003 # endif /* IPC_RMID */
10004 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10006 #endif /* IPC_PRIVATE && ... */
10007 printf("semget failed: errno = %d\n", errno);
10013 if eval $compile; then
10016 semun) val="$define" ;;
10022 case "$d_semctl_semun" in
10024 echo "You can use union semun for semctl IPC_STAT." >&4
10027 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10032 : see whether semctl IPC_STAT can use struct semid_ds pointer
10033 $cat > try.c <<'END'
10034 #include <sys/types.h>
10035 #include <sys/ipc.h>
10036 #include <sys/sem.h>
10037 #include <sys/stat.h>
10045 struct semid_ds arg;
10048 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10049 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10052 st = semctl(sem, 0, IPC_STAT, &arg);
10054 printf("semid_ds\n");
10056 # endif /* IPC_STAT */
10057 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10059 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10060 # endif /* IPC_RMID */
10061 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10063 #endif /* IPC_PRIVATE && ... */
10064 printf("semget failed: errno = %d\n", errno);
10071 if eval $compile; then
10074 semid_ds) val="$define" ;;
10078 set d_semctl_semid_ds
10080 case "$d_semctl_semid_ds" in
10082 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10084 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10091 # We do not have the full sem*(2) library, so assume we can not
10097 set d_semctl_semid_ds
10102 : see if setegid exists
10103 set setegid d_setegid
10106 : see if seteuid exists
10107 set seteuid d_seteuid
10110 : see if setgrent exists
10111 set setgrent d_setgrent
10114 : see if sethostent exists
10115 set sethostent d_sethent
10118 : see if setlinebuf exists
10119 set setlinebuf d_setlinebuf
10122 : see if setlocale exists
10123 set setlocale d_setlocale
10126 : see if setnetent exists
10127 set setnetent d_setnent
10130 : see if setprotoent exists
10131 set setprotoent d_setpent
10134 : see if setpgid exists
10135 set setpgid d_setpgid
10138 : see if setpgrp2 exists
10139 set setpgrp2 d_setpgrp2
10142 : see if setpriority exists
10143 set setpriority d_setprior
10146 : see if setpwent exists
10147 set setpwent d_setpwent
10150 : see if setregid exists
10151 set setregid d_setregid
10153 set setresgid d_setresgid
10156 : see if setreuid exists
10157 set setreuid d_setreuid
10159 set setresuid d_setresuid
10162 : see if setrgid exists
10163 set setrgid d_setrgid
10166 : see if setruid exists
10167 set setruid d_setruid
10170 : see if setservent exists
10171 set setservent d_setsent
10174 : see if setsid exists
10175 set setsid d_setsid
10178 : see if setspent exists
10179 set setspent d_setspent
10182 : see if setvbuf exists
10183 set setvbuf d_setvbuf
10186 : see if sfio.h is available
10191 : see if sfio library is available
10202 : Ok, but do we want to use it.
10206 true|$define|[yY]*) dflt='y';;
10209 echo "$package can use the sfio library, but it is experimental."
10210 rp="You seem to have sfio available, do you want to try using it?"
10214 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10216 : Remove sfio from list of libraries to use
10217 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10220 echo "libs = $libs" >&4
10224 *) case "$usesfio" in
10225 true|$define|[yY]*)
10226 echo "Sorry, cannot find sfio on this machine" >&4
10227 echo "Ignoring your setting of usesfio=$usesfio" >&4
10235 $define) usesfio='true';;
10236 *) usesfio='false';;
10239 : see if shmctl exists
10240 set shmctl d_shmctl
10243 : see if shmget exists
10244 set shmget d_shmget
10247 : see if shmat exists
10250 : see what shmat returns
10253 $cat >shmat.c <<'END'
10254 #include <sys/shm.h>
10257 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10262 echo "and it returns ($shmattype)." >&4
10263 : see if a prototype for shmat is available
10264 xxx=`./findhdr sys/shm.h`
10265 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10266 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10277 set d_shmatprototype
10280 : see if shmdt exists
10284 : see how much of the 'shm*(2)' library is present.
10287 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10288 *"$undef"*) h_shm=false;;
10292 case "`ipcs 2>&1`" in
10293 "SVID shared memory"*"not configured"*)
10294 echo "Your $osname does not have the shm*(2) configured." >&4
10297 set shmctl d_shmctl
10299 set shmget d_shmget
10309 : we could also check for sys/ipc.h ...
10310 if $h_shm && $test `./findhdr sys/shm.h`; then
10311 echo "You have the full shm*(2) library." >&4
10314 echo "You don't have the full shm*(2) library." >&4
10321 : see if we have sigaction
10322 if set sigaction val -f d_sigaction; eval $csym; $val; then
10323 echo 'sigaction() found.' >&4
10324 $cat > try.c <<'EOP'
10326 #include <sys/types.h>
10327 #include <signal.h>
10330 struct sigaction act, oact;
10332 oact.sa_handler = 0;
10336 if eval $compile_ok; then
10339 echo "But you don't seem to have a useable struct sigaction." >&4
10343 echo 'sigaction NOT found.' >&4
10346 set d_sigaction; eval $setvar
10347 $rm -f try try$_o try.c
10349 : see if sigsetjmp exists
10351 case "$d_sigsetjmp" in
10353 $cat >try.c <<'EOP'
10354 #include <setjmp.h>
10359 if (sigsetjmp(env,1))
10362 siglongjmp(env, 1);
10367 if eval $compile; then
10368 if ./try >/dev/null 2>&1; then
10369 echo "POSIX sigsetjmp found." >&4
10373 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10379 echo "sigsetjmp not found." >&4
10383 *) val="$d_sigsetjmp"
10384 case "$d_sigsetjmp" in
10385 $define) echo "POSIX sigsetjmp found." >&4;;
10386 $undef) echo "sigsetjmp not found." >&4;;
10394 : see if sqrtl exists
10398 : see if sys/stat.h is available
10399 set sys/stat.h i_sysstat
10403 : see if stat knows about block sizes
10405 echo "Checking to see if your struct stat has st_blocks field..." >&4
10406 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10410 : see if this is a sys/vfs.h system
10411 set sys/vfs.h i_sysvfs
10415 : see if this is a sys/statfs.h system
10416 set sys/statfs.h i_sysstatfs
10421 echo "Checking to see if your system supports struct statfs..." >&4
10422 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
10424 case "$d_statfs_s" in
10425 "$define") echo "Yes, it does." ;;
10426 *) echo "No, it doesn't." ;;
10431 : see if struct statfs knows about f_flags
10432 case "$d_statfs_s" in
10435 echo "Checking to see if your struct statfs has f_flags field..." >&4
10436 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
10440 set d_statfs_f_flags
10444 case "$d_statfs_f_flags" in
10445 "$define") echo "Yes, it does." ;;
10446 *) echo "No, it doesn't." ;;
10449 : see if _ptr and _cnt from stdio act std
10451 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10452 echo "(Looks like you have stdio.h from Linux.)"
10453 case "$stdio_ptr" in
10454 '') stdio_ptr='((fp)->_IO_read_ptr)'
10457 *) ptr_lval=$d_stdio_ptr_lval;;
10459 case "$stdio_cnt" in
10460 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10463 *) cnt_lval=$d_stdio_cnt_lval;;
10465 case "$stdio_base" in
10466 '') stdio_base='((fp)->_IO_read_base)';;
10468 case "$stdio_bufsiz" in
10469 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10472 case "$stdio_ptr" in
10473 '') stdio_ptr='((fp)->_ptr)'
10476 *) ptr_lval=$d_stdio_ptr_lval;;
10478 case "$stdio_cnt" in
10479 '') stdio_cnt='((fp)->_cnt)'
10482 *) cnt_lval=$d_stdio_cnt_lval;;
10484 case "$stdio_base" in
10485 '') stdio_base='((fp)->_base)';;
10487 case "$stdio_bufsiz" in
10488 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10491 : test whether _ptr and _cnt really work
10492 echo "Checking how std your stdio is..." >&4
10495 #define FILE_ptr(fp) $stdio_ptr
10496 #define FILE_cnt(fp) $stdio_cnt
10498 FILE *fp = fopen("try.c", "r");
10501 18 <= FILE_cnt(fp) &&
10502 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10510 if eval $compile; then
10512 echo "Your stdio acts pretty std."
10515 echo "Your stdio isn't very std."
10518 echo "Your stdio doesn't appear very std."
10524 : Can _ptr be used as an lvalue?
10525 case "$d_stdstdio$ptr_lval" in
10526 $define$define) val=$define ;;
10529 set d_stdio_ptr_lval
10532 : Can _cnt be used as an lvalue?
10533 case "$d_stdstdio$cnt_lval" in
10534 $define$define) val=$define ;;
10537 set d_stdio_cnt_lval
10540 : see if _base is also standard
10542 case "$d_stdstdio" in
10546 #define FILE_base(fp) $stdio_base
10547 #define FILE_bufsiz(fp) $stdio_bufsiz
10549 FILE *fp = fopen("try.c", "r");
10552 19 <= FILE_bufsiz(fp) &&
10553 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10560 if eval $compile; then
10562 echo "And its _base field acts std."
10565 echo "But its _base field isn't std."
10568 echo "However, it seems to be lacking the _base field."
10577 Checking how to access stdio streams by file descriptor number...
10579 case "$stdio_stream_array" in
10580 '') $cat >try.c <<EOCP
10583 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10587 for s in _iob __iob __sF
10589 set try -DSTDIO_STREAM_ARRAY=$s
10590 if eval $compile; then
10591 case "`./try$exe_ext`" in
10592 yes) stdio_stream_array=$s; break ;;
10596 $rm -f try.* try$exe_ext
10598 case "$stdio_stream_array" in
10600 I can't figure out how to access stdio streams by file descriptor number.
10602 d_stdio_stream_array="$undef"
10605 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10607 d_stdio_stream_array="$define"
10611 : see if strcoll exists
10612 set strcoll d_strcoll
10615 : check for structure copying
10617 echo "Checking to see if your C compiler can copy structs..." >&4
10618 $cat >try.c <<'EOCP'
10628 if $cc -c try.c >/dev/null 2>&1 ; then
10630 echo "Yup, it can."
10633 echo "Nope, it can't."
10639 : see if strerror and/or sys_errlist[] exist
10641 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10642 if set strerror val -f d_strerror; eval $csym; $val; then
10643 echo 'strerror() found.' >&4
10644 d_strerror="$define"
10645 d_strerrm='strerror(e)'
10646 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10647 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10648 d_syserrlst="$define"
10650 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10651 d_syserrlst="$undef"
10653 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10654 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10655 echo 'strerror() found in string header.' >&4
10656 d_strerror="$define"
10657 d_strerrm='strerror(e)'
10658 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10659 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10660 d_syserrlst="$define"
10662 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10663 d_syserrlst="$undef"
10665 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10666 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10667 d_strerror="$undef"
10668 d_syserrlst="$define"
10669 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10671 echo 'strerror() and sys_errlist[] NOT found.' >&4
10672 d_strerror="$undef"
10673 d_syserrlst="$undef"
10674 d_strerrm='"unknown"'
10678 : see if strtod exists
10679 set strtod d_strtod
10682 : see if strtol exists
10683 set strtol d_strtol
10686 : see if strtoul exists
10687 set strtoul d_strtoul
10690 : see if strtoull exists
10691 set strtoull d_strtoull
10694 : see if strxfrm exists
10695 set strxfrm d_strxfrm
10698 : see if symlink exists
10699 set symlink d_symlink
10702 : see if syscall exists
10703 set syscall d_syscall
10706 : see if sysconf exists
10707 set sysconf d_sysconf
10710 : see if system exists
10711 set system d_system
10714 : see if tcgetpgrp exists
10715 set tcgetpgrp d_tcgetpgrp
10718 : see if tcsetpgrp exists
10719 set tcsetpgrp d_tcsetpgrp
10722 : see if prototype for telldir is available
10724 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10727 : see if this is a sys/times.h system
10728 set sys/times.h i_systimes
10731 : see if times exists
10733 if set times val -f d_times; eval $csym; $val; then
10734 echo 'times() found.' >&4
10737 case "$i_systimes" in
10738 "$define") inc='sys/times.h';;
10740 rp="What is the type returned by times() on this system?"
10741 set clock_t clocktype long stdio.h sys/types.h $inc
10744 echo 'times() NOT found, hope that will do.' >&4
10749 : see if truncate exists
10750 set truncate d_truncate
10753 : see if tzname[] exists
10755 if set tzname val -a d_tzname; eval $csym; $val; then
10757 echo 'tzname[] found.' >&4
10760 echo 'tzname[] NOT found.' >&4
10765 : see if umask exists
10769 : see if ustat exists
10773 : backward compatibility for d_hvfork
10774 if test X$d_hvfork != X; then
10775 d_vfork="$d_hvfork"
10778 : see if there is a vfork
10783 : Ok, but do we want to use it. vfork is reportedly unreliable in
10784 : perl on Solaris 2.x, and probably elsewhere.
10788 case "$usevfork" in
10794 Perl can only use a vfork() that doesn't suffer from strict
10795 restrictions on calling functions or modifying global data in
10796 the child. For example, glibc-2.1 contains such a vfork()
10797 that is unsuitable. If your system provides a proper fork()
10798 call, chances are that you do NOT want perl to use vfork().
10801 rp="Do you still want to use vfork()?"
10806 echo "Ok, we won't use vfork()."
10815 $define) usevfork='true';;
10816 *) usevfork='false';;
10819 : see if this is an sysdir system
10820 set sys/dir.h i_sysdir
10823 : see if this is an sysndir system
10824 set sys/ndir.h i_sysndir
10827 : see if closedir exists
10828 set closedir d_closedir
10831 case "$d_closedir" in
10834 echo "Checking whether closedir() returns a status..." >&4
10835 cat > closedir.c <<EOM
10836 #$i_dirent I_DIRENT /**/
10837 #$i_sysdir I_SYS_DIR /**/
10838 #$i_sysndir I_SYS_NDIR /**/
10839 #$i_systypes I_SYS_TYPES /**/
10841 #if defined(I_SYS_TYPES)
10842 #include <sys/types.h>
10844 #if defined(I_DIRENT)
10845 #include <dirent.h>
10846 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10847 #include <sys/dir.h>
10851 #include <sys/ndir.h>
10855 #include <ndir.h> /* may be wrong in the future */
10857 #include <sys/dir.h>
10862 int main() { return closedir(opendir(".")); }
10865 if eval $compile_ok; then
10866 if ./closedir > /dev/null 2>&1 ; then
10867 echo "Yes, it does."
10870 echo "No, it doesn't."
10874 echo "(I can't seem to compile the test program--assuming it doesn't)"
10882 set d_void_closedir
10885 : check for volatile keyword
10887 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10888 $cat >try.c <<'EOCP'
10891 typedef struct _goo_struct goo_struct;
10892 goo_struct * volatile goo = ((goo_struct *)0);
10893 struct _goo_struct {
10898 typedef unsigned short foo_t;
10899 char *volatile foo;
10901 volatile foo_t blech;
10905 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10907 echo "Yup, it does."
10910 echo "Nope, it doesn't."
10916 : see if there is a wait4
10920 : see if waitpid exists
10921 set waitpid d_waitpid
10924 : see if wcstombs exists
10925 set wcstombs d_wcstombs
10928 : see if wctomb exists
10929 set wctomb d_wctomb
10932 : preserve RCS keywords in files with variable substitution, grrr
10937 Revision='$Revision'
10939 case "$crosscompile" in
10940 ''|[nN]*) crosscompile="$undef" ;;
10944 next|rhapsody) multiarch="$define" ;;
10946 case "$multiarch" in
10947 ''|[nN]*) multiarch="$undef" ;;
10950 : check for alignment requirements
10952 case "$crosscompile$multiarch" in
10955 You seem to be either cross-compiling or doing a multiarchitecture build,
10956 skipping the memory alignment check.
10959 case "$alignbytes" in
10960 '') alignbytes=8 ;;
10964 case "$alignbytes" in
10965 '') echo "Checking alignment constraints..." >&4
10966 $cat >try.c <<'EOCP'
10973 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
10978 if eval $compile_ok; then
10982 echo "(I can't seem to compile the test program...)"
10985 *) dflt="$alignbytes"
10988 rp="Doubles must be aligned on a how-many-byte boundary?"
10996 : check for ordering of bytes in a long
10998 case "$crosscompile$multiarch" in
11001 You seem to be either cross-compiling or doing a multiarchitecture build,
11002 skipping the byteorder check.
11008 case "$byteorder" in
11011 In the following, larger digits indicate more significance. A big-endian
11012 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11013 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11014 machines may have weird orders like 3412. A Cray will report 87654321,
11015 an Alpha will report 12345678. If the test program works the default is
11017 I'm now running the test program...
11019 $cat >try.c <<'EOCP'
11026 char c[sizeof(long)];
11029 if (sizeof(long) > 4)
11030 u.l = (0x08070605L << 32) | 0x04030201L;
11033 for (i = 0; i < sizeof(long); i++)
11034 printf("%c", u.c[i]+'0');
11041 if eval $compile && ./try > /dev/null; then
11044 [1-4][1-4][1-4][1-4]|12345678|87654321)
11045 echo "(The test program ran ok.)"
11046 echo "byteorder=$dflt"
11049 ????|????????) echo "(The test program ran ok.)" ;;
11050 *) echo "(The test program didn't run right for some reason.)" ;;
11055 (I can't seem to compile the test program. Guessing big-endian...)
11058 case "$xxx_prompt" in
11060 rp="What is the order of bytes in a long?"
11074 : how do we catenate cpp tokens here?
11076 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11077 $cat >cpp_stuff.c <<'EOCP'
11078 #define RCAT(a,b)a/**/b
11079 #define ACAT(a,b)a ## b
11083 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11084 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11085 echo "Oh! Smells like ANSI's been here." >&4
11086 echo "We can catify or stringify, separately or together!"
11088 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11089 echo "Ah, yes! The good old days!" >&4
11090 echo "However, in the good old days we don't know how to stringify and"
11091 echo "catify at the same time."
11095 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11096 to have to edit the values of CAT[2-5] in config.h...
11098 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11102 : see if this is a db.h system
11108 : Check db version.
11110 echo "Checking Berkeley DB version ..." >&4
11116 #include <sys/types.h>
11121 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11122 int Major, Minor, Patch ;
11123 unsigned long Version ;
11124 (void)db_version(&Major, &Minor, &Patch) ;
11125 printf("You have Berkeley DB Version 2 or greater\n");
11127 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11128 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11129 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11130 Major, Minor, Patch) ;
11132 /* check that db.h & libdb are compatible */
11133 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11134 printf("db.h and libdb are incompatible\n") ;
11138 printf("db.h and libdb are compatible\n") ;
11140 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11141 + DB_VERSION_PATCH ;
11143 /* needs to be >= 2.3.4 */
11144 if (Version < 2003004) {
11145 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11146 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11152 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11153 printf("You have Berkeley DB Version 1\n");
11154 exit(0); /* DB version < 2: the coast is clear. */
11156 exit(1); /* <db.h> not Berkeley DB? */
11162 if eval $compile && ./try; then
11163 echo 'Looks OK.' >&4
11165 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11169 : Remove db from list of libraries to use
11170 echo "Removing unusable -ldb from library list" >&4
11171 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11174 echo "libs = $libs" >&4
11184 : Check the return type needed for hash
11186 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11192 #include <sys/types.h>
11195 #ifndef DB_VERSION_MAJOR
11196 u_int32_t hash_cb (ptr, size)
11204 info.hash = hash_cb;
11208 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11209 if $contains warning try.out >>/dev/null 2>&1 ; then
11212 db_hashtype='u_int32_t'
11215 : XXX Maybe we should just give up here.
11216 db_hashtype=u_int32_t
11218 echo "Help: I can't seem to compile the db test program." >&4
11219 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11222 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11224 *) db_hashtype=u_int32_t
11229 : Check the return type needed for prefix
11231 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11237 #include <sys/types.h>
11240 #ifndef DB_VERSION_MAJOR
11241 size_t prefix_cb (key1, key2)
11249 info.prefix = prefix_cb;
11253 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11254 if $contains warning try.out >>/dev/null 2>&1 ; then
11255 db_prefixtype='int'
11257 db_prefixtype='size_t'
11260 db_prefixtype='size_t'
11261 : XXX Maybe we should just give up here.
11263 echo "Help: I can't seem to compile the db test program." >&4
11264 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11267 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11269 *) db_prefixtype='size_t'
11273 : check for void type
11275 echo "Checking to see how well your C compiler groks the void type..." >&4
11276 case "$voidflags" in
11278 $cat >try.c <<'EOCP'
11284 extern void moo(); /* function returning void */
11285 void (*goo)(); /* ptr to func returning void */
11287 void *hue; /* generic ptr */
11300 int main() { sub(); }
11302 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11303 voidflags=$defvoidused
11304 echo "Good. It appears to support void to the level $package wants.">&4
11305 if $contains warning .out >/dev/null 2>&1; then
11306 echo "However, you might get some warnings that look like this:"
11310 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11311 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11312 echo "It supports 1..."
11313 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11314 echo "It also supports 2..."
11315 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11317 echo "And it supports 4 but not 8 definitely."
11319 echo "It doesn't support 4..."
11320 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11322 echo "But it supports 8."
11325 echo "Neither does it support 8."
11329 echo "It does not support 2..."
11330 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11332 echo "But it supports 4 and 8."
11334 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11336 echo "And it supports 4 but has not heard about 8."
11338 echo "However it supports 8 but not 4."
11343 echo "There is no support at all for void."
11348 case "$voidflags" in
11350 *) $cat >&4 <<'EOM'
11351 Support flag bits are:
11352 1: basic void declarations.
11353 2: arrays of pointers to functions returning void.
11354 4: operations between pointers to and addresses of void functions.
11355 8: generic void pointers.
11358 rp="Your void support flags add up to what?"
11366 : How can we generate normalized random numbers ?
11368 echo "Looking for a random number function..." >&4
11369 case "$randfunc" in
11371 if set drand48 val -f; eval $csym; $val; then
11373 echo "Good, found drand48()." >&4
11374 elif set random val -f; eval $csym; $val; then
11376 echo "OK, found random()." >&4
11379 echo "Yick, looks like I have to use rand()." >&4
11390 *-Dmy_rand=*|*-Dmy_srand=*)
11391 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11392 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11393 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11394 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11398 while $test "$cont"; do
11399 rp="Use which function to generate random numbers?"
11401 if $test "$ans" = "$dflt"; then
11407 if set $ans val -f; eval $csym; $val; then
11411 rp="I cannot find function $ans. Use that name anyway?"
11420 case "$randfunc" in
11422 drand01="drand48()"
11428 case "$randbits" in
11430 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11432 #$i_unistd I_UNISTD
11433 #$i_stdlib I_STDLIB
11436 # include <unistd.h>
11439 # include <stdlib.h>
11444 register unsigned long tmp;
11445 register unsigned long max = 0L;
11447 for (i = 1000; i; i--) {
11448 tmp = (unsigned long) $randfunc();
11449 if (tmp > max) max = tmp;
11451 for (i = 0; max; i++)
11457 if eval $compile_ok; then
11461 echo "(I can't seem to compile the test program...)"
11468 rp="How many bits does your $randfunc() function produce?"
11472 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11473 seedfunc="s$randfunc"
11474 randseedtype=unsigned
11478 rp="How many bits does your $randfunc() function produce?"
11481 seedfunc="s$randfunc"
11482 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11483 if set $seedfunc val -f; eval $csym; $val; then
11484 echo "(Using $seedfunc() to seed random generator)"
11486 echo "(Warning: no $seedfunc() to seed random generator)"
11489 randseedtype=unsigned
11497 echo "Determining whether or not we are on an EBCDIC system..." >&4
11498 $cat >tebcdic.c <<'EOM'
11501 if ('M'==0xd4) return 0;
11508 if eval $compile_ok; then
11510 echo "You have EBCDIC." >&4
11513 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11516 echo "I'm unable to compile the test program." >&4
11517 echo "I'll assume ASCII or some ISO Latin." >&4
11519 $rm -f tebcdic.c tebcdic
11525 Checking how to flush all pending stdio output...
11527 # I only know how to find the first 32 possibly open files on SunOS.
11528 # See also hints/sunos_4_1.sh and util.c --AD
11530 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11532 $cat >>try.c <<EOCP
11534 #$i_unistd I_UNISTD
11536 # include <unistd.h>
11538 #$d_sysconf HAS_SYSCONF
11539 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11540 #ifdef HAS_STDIO_STREAM_ARRAY
11541 # define STDIO_STREAM_ARRAY $stdio_stream_array
11544 FILE* p = fopen("try.out", "w");
11548 # ifdef TRY_FPRINTF
11552 #ifdef TRY_FFLUSH_NULL
11555 #ifdef TRY_FFLUSH_ALL
11557 long open_max = -1;
11558 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11559 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11561 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11562 open_max = sysconf(_SC_OPEN_MAX);
11565 open_max = FOPEN_MAX;
11568 open_max = OPEN_MAX;
11577 # ifdef HAS_STDIO_STREAM_ARRAY
11578 if (open_max > 0) {
11580 for (i = 0; i < open_max; i++)
11581 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11582 STDIO_STREAM_ARRAY[i]._file < open_max &&
11583 STDIO_STREAM_ARRAY[i]._flag)
11584 fflush(&STDIO_STREAM_ARRAY[i]);
11592 : first we have to find out how _not_ to flush
11593 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11595 set try -DTRY_FPUTC
11596 if eval $compile; then
11598 ./try$exe_ext 2>/dev/null
11599 if $test ! -s try.out -a "X$?" = X42; then
11605 set try -DTRY_FPRINTF
11607 if eval $compile; then
11609 ./try$exe_ext 2>/dev/null
11610 if $test ! -s try.out -a "X$?" = X42; then
11611 output=-DTRY_FPRINTF
11617 : check for fflush NULL behaviour
11618 case "$fflushNULL" in
11619 '') set try -DTRY_FFLUSH_NULL $output
11620 if eval $compile; then
11622 ./try$exe_ext 2>/dev/null
11624 if $test -s try.out -a "X$code" = X42; then
11625 fflushNULL="`$cat try.out`"
11627 if $test "X$code" != X42; then
11629 (If this test failed, don't worry, we'll try another method shortly.)
11634 $rm -f core try.core core.try.*
11635 case "$fflushNULL" in
11637 Your fflush(NULL) works okay.
11639 fflushNULL="$define"
11642 Your fflush(NULL) isn't working (contrary to ANSI C).
11644 fflushNULL="$undef"
11647 Cannot figure out whether your fflush(NULL) works or not.
11648 I'm assuming it doesn't (contrary to ANSI C).
11650 fflushNULL="$undef"
11654 $define|true|[yY]*)
11655 fflushNULL="$define"
11658 fflushNULL="$undef"
11661 : check explicit looping only if NULL did not work
11662 case "$fflushNULL" in
11664 : check for fflush all behaviour
11665 case "$fflushall" in
11666 '') set try -DTRY_FFLUSH_ALL $output
11667 if eval $compile; then
11669 (Now testing the other method--but note that also this may fail.)
11672 ./try$exe_ext 2>/dev/null
11673 if $test -s try.out -a "X$?" = X42; then
11674 fflushall="`$cat try.out`"
11677 $rm -f core try.core core.try.*
11678 case "$fflushall" in
11680 Whew. Flushing explicitly all the stdio streams works.
11682 fflushall="$define"
11685 Sigh. Flushing explicitly all the stdio streams doesn't work.
11690 Cannot figure out whether flushing stdio streams explicitly works or not.
11691 I'm assuming it doesn't.
11697 "$define"|true|[yY]*)
11698 fflushall="$define"
11705 *) fflushall="$undef"
11708 case "$fflushNULL$fflushall" in
11711 I cannot figure out how to flush pending stdio output.
11715 $rm -f try.* try$exe_ext
11717 : Store the full pathname to the ar program for use in the C program
11718 : Respect a hint or command line value for full_ar.
11723 : Store the full pathname to the sed program for use in the C program
11726 : see what type gids are declared as in the kernel
11728 echo "Looking for the type for group ids returned by getgid()."
11729 set gid_t gidtype xxx stdio.h sys/types.h
11733 xxx=`./findhdr sys/user.h`
11734 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11736 unsigned) dflt="$1 $2" ;;
11740 *) dflt="$gidtype";;
11743 gid_t) echo "gid_t found." ;;
11744 *) rp="What is the type for group ids returned by getgid()?"
11752 *_t) zzz="$gidtype" ;;
11755 echo "Checking the size of $zzz..." >&4
11757 #include <sys/types.h>
11760 printf("%d\n", (int)sizeof($gidtype));
11765 if eval $compile_ok; then
11769 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11772 echo "Your $zzz size is $gidsize bytes."
11777 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11783 *_t) zzz="$gidtype" ;;
11786 echo "Checking the sign of $zzz..." >&4
11788 #include <sys/types.h>
11799 if eval $compile; then
11803 echo "(I can't execute the test program--guessing unsigned.)" >&4
11807 1) echo "Your $zzz is unsigned." ;;
11808 -1) echo "Your $zzz is signed." ;;
11814 echo "(I can't compile the test program--guessing unsigned.)" >&4
11818 : check for length of character
11820 case "$charsize" in
11822 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11823 $cat >try.c <<'EOCP'
11827 printf("%d\n", (int)sizeof(char));
11832 if eval $compile_ok; then
11836 echo "(I can't seem to compile the test program. Guessing...)"
11843 rp="What is the size of a character (in bytes)?"
11850 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11852 case "$use64bits:$d_quad:$quadtype" in
11855 uvtype="$uquadtype"
11860 uvtype="unsigned long"
11866 case "$uselongdouble:$d_longdbl" in
11868 nvtype="long double"
11869 nvsize=$longdblsize
11876 echo "(IV will be "$ivtype", $ivsize bytes)"
11877 echo "(UV will be "$uvtype", $uvsize bytes)"
11878 echo "(NV will be "$nvtype", $nvsize bytes)"
11881 #$i_inttypes I_INTTYPES
11883 #include <inttypes.h>
11888 int8_t i = INT8_MAX;
11889 uint8_t u = UINT8_MAX;
11890 printf("int8_t\n");
11893 int16_t i = INT16_MAX;
11894 uint16_t i = UINT16_MAX;
11895 printf("int16_t\n");
11898 int32_t i = INT32_MAX;
11899 uint32_t u = UINT32_MAX;
11900 printf("int32_t\n");
11906 '') case "$charsize" in
11908 u8type="unsigned char"
11917 if eval $compile; then
11918 case "`./try$exe_ext`" in
11919 int8_t) i8type=int8_t
11929 '') if $test $charsize -ge 1; then
11931 u8type="unsigned char"
11939 '') case "$shortsize" in
11941 u16type="unsigned short"
11949 '') set try -DINT16
11950 if eval $compile; then
11951 case "`./try$exe_ext`" in
11963 '') if $test $shortsize -ge 2; then
11965 u16type="unsigned short"
11973 '') case "$longsize" in
11975 u32type="unsigned long"
11979 *) case "$intsize" in
11981 u32type="unsigned int"
11991 '') set try -DINT32
11992 if eval $compile; then
11993 case "`./try$exe_ext`" in
12005 '') if $test $intsize -ge 4; then
12007 u32type="unsigned int"
12015 '') case "$d_quad:$quadtype" in
12017 i64type="$quadtype"
12018 u64type="$uquadtype"
12030 if $test X"$quadtype" != X; then
12032 echo "Checking how to print 64-bit integers..." >&4
12034 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12035 $cat >try.c <<'EOCP'
12036 #include <sys/types.h>
12039 int q = 12345678901;
12040 printf("%ld\n", q);
12044 if eval $compile; then
12045 yyy=`./try$exe_ext`
12048 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12049 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12050 echo "We will use %d."
12056 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12057 $cat >try.c <<'EOCP'
12058 #include <sys/types.h>
12061 long q = 12345678901;
12062 printf("%ld\n", q);
12066 if eval $compile; then
12067 yyy=`./try$exe_ext`
12070 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12071 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12072 echo "We will use %ld."
12078 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12079 $cat >try.c <<'EOCP'
12080 #include <sys/types.h>
12081 #include <inttypes.h>
12084 int64_t q = 12345678901;
12085 printf("%" PRId64 "\n", q);
12089 if eval $compile; then
12090 yyy=`./try$exe_ext`
12093 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12094 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12095 echo "We will use the C9X style."
12101 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12102 $cat >try.c <<'EOCP'
12103 #include <sys/types.h>
12106 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12107 printf("%lld\n", q);
12111 if eval $compile; then
12112 yyy=`./try$exe_ext`
12115 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12116 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12117 echo "We will use the %lld style."
12123 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12125 #include <sys/types.h>
12128 $quadtype q = 12345678901;
12129 printf("%Ld\n", q);
12133 if eval $compile; then
12134 yyy=`./try$exe_ext`
12137 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12138 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12139 echo "We will use %Ld."
12145 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12147 #include <sys/types.h>
12150 $quadtype q = 12345678901;
12151 printf("%qd\n", q);
12155 if eval $compile; then
12156 yyy=`./try$exe_ext`
12159 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12160 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12161 echo "We will use %qd."
12167 if $test X"$sPRId64" = X; then
12168 echo "Cannot figure out how to print 64-bit integers." >&4
12176 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12177 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12179 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12180 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12186 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12188 if $test X"$ivsize" = X8; then
12189 ivdformat="$sPRId64"
12190 uvuformat="$sPRIu64"
12191 uvoformat="$sPRIo64"
12192 uvxformat="$sPRIx64"
12194 if $test X"$ivsize" = X"$longsize"; then
12200 if $test X"$ivsize" = X"$intsize"; then
12207 if $test X"$ivsize" = X"$shortsize"; then
12217 case "$ivdformat" in
12218 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12225 $echo "Checking the format string to be used for gids..." >&4
12228 -1) if $test X"$gidsize" = X"$ivsize"; then
12229 gidformat="$ivdformat"
12231 if $test X"$gidsize" = X"$longsize"; then
12234 if $test X"$gidsize" = X"$intsize"; then
12237 if $test X"$gidsize" = X"$shortsize"; then
12244 *) if $test X"$gidsize" = X"$uvsize"; then
12245 gidformat="$uvuformat"
12247 if $test X"$gidsize" = X"$longsize"; then
12250 if $test X"$gidsize" = X"$intsize"; then
12253 if $test X"$gidsize" = X"$shortsize"; then
12262 : see if getgroups exists
12263 set getgroups d_getgrps
12266 : see if setgroups exists
12267 set setgroups d_setgrps
12271 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12273 case "$d_getgrps$d_setgrps" in
12275 case "$groupstype" in
12276 '') dflt="$gidtype" ;;
12277 *) dflt="$groupstype" ;;
12280 What type of pointer is the second argument to getgroups() and setgroups()?
12281 Usually this is the same as group ids, $gidtype, but not always.
12284 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12288 *) groupstype="$gidtype";;
12292 echo "Checking if your $make program sets \$(MAKE)..." >&4
12293 case "$make_set_make" in
12295 $sed 's/^X //' > testmake.mak << 'EOF'
12297 X @echo 'maketemp="$(MAKE)"'
12299 case "`$make -f testmake.mak 2>/dev/null`" in
12300 *maketemp=*) make_set_make='#' ;;
12301 *) make_set_make="MAKE=$make" ;;
12303 $rm -f testmake.mak
12306 case "$make_set_make" in
12307 '#') echo "Yup, it does.";;
12308 *) echo "Nope, it doesn't.";;
12311 : see what type is used for mode_t
12312 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12313 set mode_t modetype int stdio.h sys/types.h
12316 : define a fucntion to check prototypes
12317 $cat > protochk <<EOSH
12320 optimize="$optimize"
12322 prototype="$prototype"
12327 $cat >> protochk <<'EOSH'
12332 while test $# -ge 2; do
12334 $define) echo "#include <$2>" >> try.c ;;
12335 literal) echo "$2" >> try.c ;;
12339 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12340 cat >> try.c <<'EOCP'
12341 #ifdef CAN_PROTOTYPE
12342 #define _(args) args
12347 echo "$foo" >> try.c
12348 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12349 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12355 $eunicefix protochk
12357 : see what type is used for size_t
12358 rp="What is the type used for the length parameter for string functions?"
12359 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12362 : check for type of arguments to gethostbyaddr.
12363 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12364 case "$d_gethbyaddr" in
12368 Checking to see what type of arguments are accepted by gethostbyaddr().
12370 hdrs="$define sys/types.h
12371 $d_socket sys/socket.h
12372 $i_niin netinet/in.h
12374 $i_unistd unistd.h"
12375 : The first arg can 'char *' or 'void *'
12376 : The second arg is some of integral type
12377 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12378 for yyy in size_t long int; do
12379 case "$netdb_host_type" in
12380 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12381 if ./protochk "$try" $hdrs; then
12382 echo "Your system accepts $xxx for the first arg."
12383 echo "...and $yyy for the second arg."
12384 netdb_host_type="$xxx"
12385 netdb_hlen_type="$yyy"
12391 : In case none of those worked, prompt the user.
12392 case "$netdb_host_type" in
12393 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12396 netdb_host_type=$ans
12397 rp='What is the type for the 2nd argument to gethostbyaddr?'
12400 netdb_hlen_type=$ans
12404 *) : no gethostbyaddr, so pick harmless defaults
12405 netdb_host_type='char *'
12406 netdb_hlen_type="$sizetype"
12409 # Remove the "const" if needed. -- but then we'll have a
12411 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12414 : check for type of argument to gethostbyname.
12415 if test "X$netdb_name_type" = X ; then
12416 case "$d_gethbyname" in
12420 Checking to see what type of argument is accepted by gethostbyname().
12422 hdrs="$define sys/types.h
12423 $d_socket sys/socket.h
12424 $i_niin netinet/in.h
12426 $i_unistd unistd.h"
12427 for xxx in "const char *" "char *"; do
12428 case "$netdb_name_type" in
12429 '') try="extern struct hostent *gethostbyname($xxx);"
12430 if ./protochk "$try" $hdrs; then
12431 echo "Your system accepts $xxx."
12432 netdb_name_type="$xxx"
12437 : In case none of those worked, prompt the user.
12438 case "$netdb_name_type" in
12439 '') rp='What is the type for the 1st argument to gethostbyname?'
12442 netdb_name_type=$ans
12446 *) : no gethostbyname, so pick harmless default
12447 netdb_name_type='char *'
12452 : check for type of 1st argument to getnetbyaddr.
12453 if test "X$netdb_net_type" = X ; then
12454 case "$d_getnbyaddr" in
12458 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12460 hdrs="$define sys/types.h
12461 $d_socket sys/socket.h
12462 $i_niin netinet/in.h
12464 $i_unistd unistd.h"
12465 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12466 case "$netdb_net_type" in
12467 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12468 if ./protochk "$try" $hdrs; then
12469 echo "Your system accepts $xxx."
12470 netdb_net_type="$xxx"
12475 : In case none of those worked, prompt the user.
12476 case "$netdb_net_type" in
12477 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12480 netdb_net_type=$ans
12484 *) : no getnetbyaddr, so pick harmless default
12485 netdb_net_type='long'
12489 : locate the preferred pager for this system
12503 '') dflt=/usr/ucb/more;;
12510 rp='What pager is used on your system?'
12514 : see what type pids are declared as in the kernel
12515 rp="What is the type of process ids on this system?"
12516 set pid_t pidtype int stdio.h sys/types.h
12519 : Find earliest binary compatible site_perl subdirectory perl can use.
12520 case "$bincompat5005" in
12521 "$define") xs_apiversion='5.005' ;;
12522 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12524 : Find earliest pure perl site_perl subdirectory perl can use.
12525 : The versioned directories started at 5.005.
12526 pm_apiversion='5.005'
12528 : check for length of pointer
12532 $echo $n "Checking to see how big your pointers are...$c" >&4
12533 if test "$voidflags" -gt 7; then
12534 echo '#define VOID_PTR char *' > try.c
12536 echo '#define VOID_PTR void *' > try.c
12538 $cat >>try.c <<'EOCP'
12542 printf("%d\n", (int)sizeof(VOID_PTR));
12547 if eval $compile_ok; then
12549 $echo " $ptrsize bytes." >&4
12552 echo "(I can't seem to compile the test program. Guessing...)" >&4
12553 rp="What is the size of a pointer (in bytes)?"
12561 : see if ar generates random libraries by itself
12563 echo "Checking how to generate random libraries on your machine..." >&4
12564 echo 'int bar1() { return bar2(); }' > bar1.c
12565 echo 'int bar2() { return 2; }' > bar2.c
12566 $cat > foo.c <<'EOP'
12567 int main() { printf("%d\n", bar1()); exit(0); }
12569 $cc $ccflags -c bar1.c >/dev/null 2>&1
12570 $cc $ccflags -c bar2.c >/dev/null 2>&1
12571 $cc $ccflags -c foo.c >/dev/null 2>&1
12572 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12573 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12574 ./foobar >/dev/null 2>&1; then
12575 echo "$ar appears to generate random libraries itself."
12578 elif $ar ts bar$_a >/dev/null 2>&1 &&
12579 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12580 ./foobar >/dev/null 2>&1; then
12581 echo "a table of contents needs to be added with '$ar ts'."
12588 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12589 $test -f $ranlib || ranlib=''
12592 if $test -n "$ranlib"; then
12593 echo "your system has '$ranlib'; we'll use that."
12596 echo "your system doesn't seem to support random libraries"
12597 echo "so we'll use lorder and tsort to order the libraries."
12604 : check for type of arguments to select.
12605 case "$selecttype" in
12606 '') case "$d_select" in
12609 Checking to see what type of arguments are accepted by select().
12611 hdrs="$define sys/types.h
12612 $i_systime sys/time.h
12613 $i_sysselct sys/select.h
12614 $d_socket sys/socket.h"
12615 : The first arg can be int, unsigned, or size_t
12616 : The last arg may or may not be 'const'
12618 : void pointer has been seen but using that
12619 : breaks the selectminbits test
12620 for xxx in 'fd_set *' 'int *'; do
12621 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12622 for tmo in 'struct timeval *' 'const struct timeval *'; do
12624 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12625 if ./protochk "$try" $hdrs; then
12626 echo "Your system accepts $xxx."
12635 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12636 case "$d_fd_set" in
12637 $define) dflt="fd_set *" ;;
12646 *) : no select, so pick a harmless default
12653 : check for the select 'width'
12654 case "$selectminbits" in
12655 '') case "$d_select" in
12659 Checking to see on how many bits at a time your select() operates...
12662 #include <sys/types.h>
12664 #$i_systime I_SYS_TIME
12665 #$i_systimek I_SYS_TIME_KERNEL
12670 # ifdef I_SYS_TIME_KERNEL
12673 # include <sys/time.h>
12674 # ifdef I_SYS_TIME_KERNEL
12678 #$i_sysselct I_SYS_SELECT
12679 #ifdef I_SYS_SELECT
12680 #include <sys/select.h>
12682 #$d_socket HAS_SOCKET
12684 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12688 #define S sizeof(*(b))
12690 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12691 #define NBITS (NBYTES * 8)
12700 fp = fopen("try.c", "r");
12706 b = ($selecttype)s;
12707 for (i = 0; i < NBITS; i++)
12711 select(fd + 1, b, 0, 0, &t);
12712 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12713 printf("%d\n", i + 1);
12718 if eval $compile_ok; then
12719 selectminbits=`./try`
12720 case "$selectminbits" in
12722 Cannot figure out on how many bits at a time your select() operates.
12723 I'll play safe and guess it is 32 bits.
12729 *) bits="$selectminbits bits" ;;
12731 echo "Your select() operates on $bits at a time." >&4
12733 rp='What is the minimum number of bits your select() operates on?'
12734 case "$byteorder" in
12735 1234|12345678) dflt=32 ;;
12740 selectminbits="$val"
12744 *) : no select, so pick a harmless default
12751 : Trace out the files included by signal.h, then look for SIGxxx names.
12752 : Remove SIGARRAYSIZE used by HPUX.
12753 : Remove SIGSTKSIZE used by Linux.
12754 : Remove SIGSTKSZ used by Posix.
12755 : Remove SIGTYP void lines used by OS2.
12756 xxx=`echo '#include <signal.h>' |
12757 $cppstdin $cppminus $cppflags 2>/dev/null |
12758 $grep '^[ ]*#.*include' |
12759 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12760 : Check this list of files to be sure we have parsed the cpp output ok.
12761 : This will also avoid potentially non-existent files, such
12764 for xx in $xxx /dev/null ; do
12765 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12767 : If we have found no files, at least try signal.h
12768 case "$xxxfiles" in
12769 '') xxxfiles=`./findhdr signal.h` ;;
12772 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12773 print substr($2, 4, 20)
12775 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12776 print substr($3, 4, 20)
12778 : Append some common names just in case the awk scan failed.
12779 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12780 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12781 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12782 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12783 : generate a few handy files for later
12784 $cat > signal.c <<'EOCP'
12785 #include <sys/types.h>
12786 #include <signal.h>
12790 /* Strange style to avoid deeply-nested #if/#else/#endif */
12793 # define NSIG (_NSIG)
12799 # define NSIG (SIGMAX+1)
12805 # define NSIG (SIG_MAX+1)
12811 # define NSIG (MAXSIG+1)
12817 # define NSIG (MAX_SIG+1)
12822 # ifdef SIGARRAYSIZE
12823 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12829 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12833 /* Default to some arbitrary number that's big enough to get most
12834 of the common signals.
12840 printf("NSIG %d\n", NSIG);
12846 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12848 printf "#ifdef SIG"; printf $1; printf "\n"
12849 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12850 printf $1; printf ");\n"
12854 printf "#endif /* JUST_NSIG */\n";
12858 $cat >signal.awk <<'EOP'
12859 BEGIN { ndups = 0 }
12860 $1 ~ /^NSIG$/ { nsig = $2 }
12861 ($1 !~ /^NSIG$/) && (NF == 2) {
12862 if ($2 > maxsig) { maxsig = $2 }
12863 if (sig_name[$2]) {
12864 dup_name[ndups] = $1
12865 dup_num[ndups] = $2
12877 printf("NSIG %d\n", nsig);
12878 for (n = 1; n < nsig; n++) {
12880 printf("%s %d\n", sig_name[n], sig_num[n])
12883 printf("NUM%d %d\n", n, n)
12886 for (n = 0; n < ndups; n++) {
12887 printf("%s %d\n", dup_name[n], dup_num[n])
12891 $cat >signal_cmd <<EOS
12893 if $test -s signal.lst; then
12894 echo "Using your existing signal.lst file"
12899 $cat >>signal_cmd <<'EOS'
12902 if eval $compile_ok; then
12903 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12905 echo "(I can't seem be able to compile the whole test program)" >&4
12906 echo "(I'll try it in little pieces.)" >&4
12907 set signal -DJUST_NSIG
12908 if eval $compile_ok; then
12909 ./signal$_exe > signal.nsg
12912 echo "I can't seem to figure out how many signals you have." >&4
12913 echo "Guessing 50." >&4
12914 echo 'NSIG 50' > signal.nsg
12916 : Now look at all the signal names, one at a time.
12917 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12918 $cat > signal.c <<EOCP
12919 #include <sys/types.h>
12920 #include <signal.h>
12923 printf("$xx %d\n", SIG${xx});
12928 if eval $compile; then
12929 echo "SIG${xx} found."
12930 ./signal$_exe >> signal.ls1
12932 echo "SIG${xx} NOT found."
12935 if $test -s signal.ls1; then
12936 $cat signal.nsg signal.ls1 |
12937 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12941 if $test -s signal.lst; then
12944 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12945 echo 'kill -l' >signal
12946 set X `csh -f <signal`
12950 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12952 echo $@ | $tr ' ' $trnl | \
12953 $awk '{ printf "%s %d\n", $1, ++s; }
12954 END { printf "NSIG %d\n", ++s }' >signal.lst
12956 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12958 chmod a+x signal_cmd
12959 $eunicefix signal_cmd
12961 : generate list of signal names
12963 case "$sig_name_init" in
12965 *) case "$sig_num_init" in
12966 ''|*,*) doinit=yes ;;
12971 echo "Generating a list of signal names and numbers..." >&4
12973 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12974 sig_name=`$awk 'BEGIN { printf "ZERO " }
12975 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12976 sig_num=`$awk 'BEGIN { printf "0 " }
12977 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12978 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12979 !/^NSIG/ { printf "\"%s\", ", $1 }
12980 END { printf "0\n" }' signal.lst`
12981 sig_num_init=`$awk 'BEGIN { printf "0, " }
12982 !/^NSIG/ { printf "%d, ", $2}
12983 END { printf "0\n"}' signal.lst`
12986 echo "The following $sig_count signals are available:"
12988 echo $sig_name | $awk \
12989 'BEGIN { linelen = 0 }
12991 for (i = 1; i <= NF; i++) {
12992 name = "SIG" $i " "
12993 linelen = linelen + length(name)
12994 if (linelen > 70) {
12996 linelen = length(name)
13002 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13004 : see what type is used for signed size_t
13005 set ssize_t ssizetype int stdio.h sys/types.h
13008 $cat > ssize.c <<EOM
13010 #include <sys/types.h>
13011 #define Size_t $sizetype
13012 #define SSize_t $dflt
13015 if (sizeof(Size_t) == sizeof(SSize_t))
13017 else if (sizeof(Size_t) == sizeof(int))
13026 if eval $compile_ok && ./ssize > /dev/null; then
13027 ssizetype=`./ssize`
13028 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13031 Help! I can't compile and run the ssize_t test program: please enlighten me!
13032 (This is probably a misconfiguration in your system or libraries, and
13033 you really ought to fix it. Still, I'll try anyway.)
13035 I need a type that is the same size as $sizetype, but is guaranteed to
13036 be signed. Common values are ssize_t, int and long.
13039 rp="What signed type is the same size as $sizetype?"
13043 $rm -f ssize ssize.*
13045 : see what type of char stdio uses.
13047 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13048 echo "Your stdio uses unsigned chars." >&4
13049 stdchar="unsigned char"
13051 echo "Your stdio uses signed chars." >&4
13055 : see if time exists
13057 if test "X$d_time" = X -o X"$timetype" = X; then
13058 if set time val -f d_time; eval $csym; $val; then
13059 echo 'time() found.' >&4
13061 rp="What is the type returned by time() on this system?"
13062 set time_t timetype long stdio.h sys/types.h
13065 echo 'time() not found, hope that will do.' >&4
13073 : see what type uids are declared as in the kernel
13075 echo "Looking for the type for user ids returned by getuid()."
13076 set uid_t uidtype xxx stdio.h sys/types.h
13080 xxx=`./findhdr sys/user.h`
13081 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13083 unsigned) dflt="$1 $2" ;;
13087 *) dflt="$uidtype";;
13090 uid_t) echo "uid_t found." ;;
13091 *) rp="What is the type for user ids returned by getuid()?"
13099 *_t) zzz="$uidtype" ;;
13102 echo "Checking the size of $zzz..." >&4
13104 #include <sys/types.h>
13107 printf("%d\n", (int)sizeof($uidtype));
13112 if eval $compile_ok; then
13116 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13119 echo "Your $zzz size is $uidsize bytes."
13124 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13129 *_t) zzz="$uidtype" ;;
13132 echo "Checking the sign of $zzz..." >&4
13134 #include <sys/types.h>
13145 if eval $compile; then
13149 echo "(I can't execute the test program--guessing unsigned.)" >&4
13153 1) echo "Your $zzz is unsigned." ;;
13154 -1) echo "Your $zzz is signed." ;;
13160 echo "(I can't compile the test program--guessing unsigned.)" >&4
13166 $echo "Checking the format string to be used for uids..." >&4
13169 -1) if $test X"$uidsize" = X"$ivsize"; then
13170 uidformat="$ivdformat"
13172 if $test X"$uidsize" = X"$longsize"; then
13175 if $test X"$uidsize" = X"$intsize"; then
13178 if $test X"$uidsize" = X"$shortsize"; then
13185 *) if $test X"$uidsize" = X"$uvsize"; then
13186 uidformat="$uvuformat"
13188 if $test X"$uidsize" = X"$longsize"; then
13191 if $test X"$uidsize" = X"$intsize"; then
13194 if $test X"$uidsize" = X"$shortsize"; then
13203 : see if dbm.h is available
13204 : see if dbmclose exists
13205 set dbmclose d_dbmclose
13208 case "$d_dbmclose" in
13218 *) set rpcsvc/dbm.h i_rpcsvcdbm
13223 *) echo "We won't be including <dbm.h>"
13233 : see if this is a sys/file.h system
13238 : do we need to include sys/file.h ?
13242 if $h_sysfile; then
13244 echo "We'll be including <sys/file.h>." >&4
13247 echo "We won't be including <sys/file.h>." >&4
13257 : see if fcntl.h is there
13262 : see if we can include fcntl.h
13268 echo "We'll be including <fcntl.h>." >&4
13271 if $h_sysfile; then
13272 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13274 echo "We won't be including <fcntl.h>." >&4
13286 : see if locale.h is available
13287 set locale.h i_locale
13290 : see if mach cthreads are available
13291 if test "X$usethreads" = "X$define"; then
13292 set mach/cthreads.h i_machcthr
13295 i_machcthr="$undef"
13300 : see if this is a math.h system
13304 : see if this is a mntent.h system
13305 set mntent.h i_mntent
13308 : see if ndbm.h is available
13313 : see if dbm_open exists
13314 set dbm_open d_dbm_open
13316 case "$d_dbm_open" in
13319 echo "We won't be including <ndbm.h>"
13328 : see if net/errno.h is available
13330 set net/errno.h val
13333 : Unfortunately, it causes problems on some systems. Arrgh.
13336 cat > try.c <<'EOM'
13339 #include <net/errno.h>
13345 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13346 echo "We'll be including <net/errno.h>." >&4
13348 echo "We won't be including <net/errno.h>." >&4
13357 : see if netinet/tcp.h is available
13358 set netinet/tcp.h i_netinettcp
13361 : see if this is a poll.h system
13365 : get C preprocessor symbols handy
13367 $echo $n "Hmm... $c"
13368 echo $al | $tr ' ' $trnl >Cppsym.know
13369 $cat <<EOSS >Cppsym
13377 case "\$list\$#" in
13380 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13382 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13385 unknown="\$unknown \$sym"
13395 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13397 exit 0; _ _ _ _\1\\ \1\\
13400 echo "exit 1; _ _ _" >>Cppsym\$\$
13401 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13403 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13409 $rm -f Cppsym\$\$ Cppsym2\$\$
13414 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13416 : now check the C compiler for additional symbols
13417 postprocess_cc_v=''
13419 aix) postprocess_cc_v="|$tr , ' '" ;;
13426 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13429 -D*) echo "\$i" | $sed 's/^-D//';;
13430 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13435 postprocess_cc_v=''
13438 ./ccsym > ccsym1.raw
13439 if $test -s ccsym1.raw; then
13440 $sort ccsym1.raw | $uniq >ccsym.raw
13442 mv ccsym1.raw ccsym.raw
13445 $awk '/\=/ { print $0; next }
13446 { print $0"=1" }' ccsym.raw >ccsym.list
13447 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13448 $comm -13 ccsym.true ccsym.list >ccsym.own
13449 $comm -12 ccsym.true ccsym.list >ccsym.com
13450 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13452 if $test -z ccsym.raw; then
13453 echo "Your C compiler doesn't seem to define any symbols!" >&4
13455 echo "However, your C preprocessor defines the following symbols:"
13458 cppsymbols=`$cat Cppsym.true`
13459 cppsymbols=`echo $cppsymbols`
13460 cppccsymbols="$cppsymbols"
13462 if $test -s ccsym.com; then
13463 echo "Your C compiler and pre-processor define these symbols:"
13464 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13467 cppccsymbols=`$cat ccsym.com`
13468 cppccsymbols=`echo $cppccsymbols`
13469 $test "$silent" || sleep 1
13471 if $test -s ccsym.cpp; then
13472 $test "$also" && echo " "
13473 echo "Your C pre-processor ${also}defines the following symbols:"
13474 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13476 cppsymbols=`$cat ccsym.cpp`
13477 cppsymbols=`echo $cppsymbols`
13478 $test "$silent" || sleep 1
13480 if $test -s ccsym.own; then
13481 $test "$also" && echo " "
13482 echo "Your C compiler ${also}defines the following cpp symbols:"
13483 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13484 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13485 ccsymbols=`$cat ccsym.own`
13486 ccsymbols=`echo $ccsymbols`
13487 $test "$silent" || sleep 1
13492 : see if this is a termio system
13496 if $test `./findhdr termios.h`; then
13497 set tcsetattr i_termios
13503 "$define") echo "You have POSIX termios.h... good!" >&4;;
13504 *) if ./Cppsym pyr; then
13505 case "`/bin/universe`" in
13506 ucb) if $test `./findhdr sgtty.h`; then
13508 echo "<sgtty.h> found." >&4
13510 echo "System is pyramid with BSD universe."
13511 echo "<sgtty.h> not found--you could have problems." >&4
13513 *) if $test `./findhdr termio.h`; then
13515 echo "<termio.h> found." >&4
13517 echo "System is pyramid with USG universe."
13518 echo "<termio.h> not found--you could have problems." >&4
13522 if $test `./findhdr termio.h`; then
13523 echo "<termio.h> found." >&4
13525 elif $test `./findhdr sgtty.h`; then
13526 echo "<sgtty.h> found." >&4
13529 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13532 if $test `./findhdr sgtty.h`; then
13533 echo "<sgtty.h> found." >&4
13535 elif $test `./findhdr termio.h`; then
13536 echo "<termio.h> found." >&4
13539 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13543 set i_termio; eval $setvar
13544 val=$val2; set i_sgtty; eval $setvar
13545 val=$val3; set i_termios; eval $setvar
13547 : see if this is a shadow.h system
13548 set shadow.h i_shadow
13551 : see if this is a socks.h system
13552 set socks.h i_socks
13555 : see if stdarg is available
13557 if $test `./findhdr stdarg.h`; then
13558 echo "<stdarg.h> found." >&4
13561 echo "<stdarg.h> NOT found." >&4
13565 : see if varags is available
13567 if $test `./findhdr varargs.h`; then
13568 echo "<varargs.h> found." >&4
13570 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13573 : set up the varargs testing programs
13574 $cat > varargs.c <<EOP
13576 #include <stdarg.h>
13579 #include <varargs.h>
13583 int f(char *p, ...)
13597 p = va_arg(ap, char *);
13602 $cat > varargs <<EOP
13604 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13613 : now check which varargs header should be included
13618 if `./varargs I_STDARG`; then
13620 elif `./varargs I_VARARGS`; then
13625 if `./varargs I_VARARGS`; then
13632 echo "I could not find the definition for va_dcl... You have problems..." >&4
13633 val="$undef"; set i_stdarg; eval $setvar
13634 val="$undef"; set i_varargs; eval $setvar
13639 case "$i_varhdr" in
13641 val="$define"; set i_stdarg; eval $setvar
13642 val="$undef"; set i_varargs; eval $setvar
13645 val="$undef"; set i_stdarg; eval $setvar
13646 val="$define"; set i_varargs; eval $setvar
13649 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13653 : see if stddef is available
13654 set stddef.h i_stddef
13657 : see if sys/access.h is available
13658 set sys/access.h i_sysaccess
13661 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13662 set sys/filio.h i_sysfilio
13665 if $test `./findhdr sys/ioctl.h`; then
13667 echo '<sys/ioctl.h> found.' >&4
13670 if $test $i_sysfilio = "$define"; then
13671 echo '<sys/ioctl.h> NOT found.' >&4
13673 $test $i_sgtty = "$define" && xxx="sgtty.h"
13674 $test $i_termio = "$define" && xxx="termio.h"
13675 $test $i_termios = "$define" && xxx="termios.h"
13676 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13682 : see if sys/resource.h has to be included
13683 set sys/resource.h i_sysresrc
13686 : see if sys/security.h is available
13687 set sys/security.h i_syssecrt
13690 : see if this is a sys/statvfs.h system
13691 set sys/statvfs.h i_sysstatvfs
13694 : see if this is a sys/uio.h system
13695 set sys/uio.h i_sysuio
13698 : see if this is a sys/un.h system
13699 set sys/un.h i_sysun
13702 : see if this is a syswait system
13703 set sys/wait.h i_syswait
13706 : see if this is a ustat.h system
13707 set ustat.h i_ustat
13710 : see if this is an utime system
13711 set utime.h i_utime
13714 : see if this is a values.h system
13715 set values.h i_values
13718 : see if this is a vfork system
13721 set vfork.h i_vfork
13729 : see if gdbm.h is available
13734 : see if gdbm_open exists
13735 set gdbm_open d_gdbm_open
13737 case "$d_gdbm_open" in
13740 echo "We won't be including <gdbm.h>"
13750 echo "Looking for extensions..." >&4
13751 : If we are using the old config.sh, known_extensions may contain
13752 : old or inaccurate or duplicate values.
13753 known_extensions=''
13754 nonxs_extensions=''
13755 : We do not use find because it might not be available.
13756 : We do not just use MANIFEST because the user may have dropped
13757 : some additional extensions into the source tree and expect them
13760 : Function to recursively find available extensions, ignoring DynaLoader
13761 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13765 DynaLoader|dynaload) ;;
13767 if $test -f $xxx/$xxx.xs; then
13768 known_extensions="$known_extensions $1$xxx";
13769 elif $test -f $xxx/Makefile.PL; then
13770 nonxs_extensions="$nonxs_extensions $1$xxx";
13772 if $test -d $xxx -a $# -lt 10; then
13775 eval $find_extensions;
13787 eval $find_extensions
13788 set X $nonxs_extensions
13790 nonxs_extensions="$*"
13791 set X $known_extensions
13793 known_extensions="$*"
13796 : Now see which are supported on this system.
13798 for xxx in $known_extensions ; do
13802 $define) avail_ext="$avail_ext $xxx" ;;
13805 GDBM_File|gdbm_fil)
13807 $define) avail_ext="$avail_ext $xxx" ;;
13810 NDBM_File|ndbm_fil)
13812 $define) avail_ext="$avail_ext $xxx" ;;
13815 ODBM_File|odbm_fil)
13816 case "${i_dbm}${i_rpcsvcdbm}" in
13817 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13821 case "$useposix" in
13822 true|define|y) avail_ext="$avail_ext $xxx" ;;
13826 case "$useopcode" in
13827 true|define|y) avail_ext="$avail_ext $xxx" ;;
13831 case "$d_socket" in
13832 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13836 case "$usethreads" in
13837 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13841 : XXX Do we need a useipcsysv variable here
13842 case "${d_msg}${d_sem}${d_shm}" in
13843 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13846 *) avail_ext="$avail_ext $xxx"
13855 : Now see which nonxs extensions are supported on this system.
13856 : For now assume all are.
13858 for xxx in $nonxs_extensions ; do
13860 *) nonxs_ext="$nonxs_ext $xxx"
13872 A number of extensions are supplied with $package. You may choose to
13873 compile these extensions for dynamic loading (the default), compile
13874 them into the $package executable (static loading), or not include
13875 them at all. Answer "none" to include no extensions.
13876 Note that DynaLoader is always built and need not be mentioned here.
13879 case "$dynamic_ext" in
13880 '') dflt="$avail_ext" ;;
13881 *) dflt="$dynamic_ext"
13882 # Perhaps we are reusing an old out-of-date config.sh.
13885 if test X"$dynamic_ext" != X"$avail_ext"; then
13887 NOTICE: Your previous config.sh list may be incorrect.
13888 The extensions now available to you are
13890 but the default list from your previous config.sh is
13902 rp="What extensions do you wish to load dynamically?"
13905 none) dynamic_ext=' ' ;;
13906 *) dynamic_ext="$ans" ;;
13909 case "$static_ext" in
13911 : Exclude those already listed in dynamic linking
13913 for xxx in $avail_ext; do
13914 case " $dynamic_ext " in
13916 *) dflt="$dflt $xxx" ;;
13923 *) dflt="$static_ext"
13930 rp="What extensions do you wish to load statically?"
13933 none) static_ext=' ' ;;
13934 *) static_ext="$ans" ;;
13939 A number of extensions are supplied with $package. Answer "none"
13940 to include no extensions.
13941 Note that DynaLoader is always built and need not be mentioned here.
13944 case "$static_ext" in
13945 '') dflt="$avail_ext" ;;
13946 *) dflt="$static_ext"
13947 # Perhaps we are reusing an old out-of-date config.sh.
13950 if test X"$static_ext" != X"$avail_ext"; then
13952 NOTICE: Your previous config.sh list may be incorrect.
13953 The extensions now available to you are
13955 but the default list from your previous config.sh is
13964 : Exclude those that are not xs extensions
13968 rp="What extensions do you wish to include?"
13971 none) static_ext=' ' ;;
13972 *) static_ext="$ans" ;;
13977 set X $dynamic_ext $static_ext $nonxs_ext
13981 : Remove build directory name from cppstdin so it can be used from
13982 : either the present location or the final installed location.
13984 : Get out of the UU directory to get correct path name.
13986 case "$cppstdin" in
13988 echo "Stripping down cppstdin path name"
13994 : end of configuration questions
13996 echo "End of configuration questions."
13999 : back to where it started
14000 if test -d ../UU; then
14004 : configuration may be patched via a 'config.over' file
14005 if $test -f config.over; then
14008 rp='I see a config.over file. Do you wish to load it?'
14011 n*) echo "OK, I'll ignore it.";;
14013 echo "Configuration override changes have been loaded."
14018 : in case they want portability, strip down executable paths
14019 case "$d_portable" in
14022 echo "Stripping down executable paths..." >&4
14023 for file in $loclist $trylist; do
14025 eval $file=`basename $temp`
14030 : create config.sh file
14032 echo "Creating config.sh..." >&4
14033 $spitshell <<EOT >config.sh
14036 # This file was produced by running the Configure script. It holds all the
14037 # definitions figured out by Configure. Should you modify one of these values,
14038 # do not forget to propagate your changes by running "Configure -der". You may
14039 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14042 # Package name : $package
14043 # Source directory : $src
14044 # Configuration time: $cf_time
14045 # Configured by : $cf_by
14046 # Target system : $myuname
14056 Revision='$Revision'
14063 alignbytes='$alignbytes'
14064 ansi2knr='$ansi2knr'
14065 aphostname='$aphostname'
14066 apiversion='$apiversion'
14069 archlibexp='$archlibexp'
14070 archname64='$archname64'
14071 archname='$archname'
14072 archobjs='$archobjs'
14077 bincompat5005='$bincompat5005'
14081 byteorder='$byteorder'
14083 castflags='$castflags'
14086 cccdlflags='$cccdlflags'
14087 ccdlflags='$ccdlflags'
14089 ccsymbols='$ccsymbols'
14091 cf_email='$cf_email'
14093 charsize='$charsize'
14097 clocktype='$clocktype'
14099 compress='$compress'
14100 contains='$contains'
14104 cpp_stuff='$cpp_stuff'
14105 cppccsymbols='$cppccsymbols'
14106 cppflags='$cppflags'
14108 cppminus='$cppminus'
14110 cppstdin='$cppstdin'
14111 cppsymbols='$cppsymbols'
14112 crosscompile='$crosscompile'
14113 cryptlib='$cryptlib'
14115 d_Gconvert='$d_Gconvert'
14116 d_PRIEldbl='$d_PRIEldbl'
14117 d_PRIFldbl='$d_PRIFldbl'
14118 d_PRIGldbl='$d_PRIGldbl'
14119 d_PRIX64='$d_PRIX64'
14120 d_PRId64='$d_PRId64'
14121 d_PRIeldbl='$d_PRIeldbl'
14122 d_PRIfldbl='$d_PRIfldbl'
14123 d_PRIgldbl='$d_PRIgldbl'
14124 d_PRIi64='$d_PRIi64'
14125 d_PRIo64='$d_PRIo64'
14126 d_PRIu64='$d_PRIu64'
14127 d_PRIx64='$d_PRIx64'
14128 d_access='$d_access'
14129 d_accessx='$d_accessx'
14131 d_archlib='$d_archlib'
14134 d_attribut='$d_attribut'
14137 d_bincompat5005='$d_bincompat5005'
14139 d_bsdgetpgrp='$d_bsdgetpgrp'
14140 d_bsdsetpgrp='$d_bsdsetpgrp'
14142 d_casti32='$d_casti32'
14143 d_castneg='$d_castneg'
14144 d_charvspr='$d_charvspr'
14146 d_chroot='$d_chroot'
14147 d_chsize='$d_chsize'
14148 d_closedir='$d_closedir'
14152 d_cuserid='$d_cuserid'
14153 d_dbl_dig='$d_dbl_dig'
14154 d_difftime='$d_difftime'
14155 d_dirnamlen='$d_dirnamlen'
14156 d_dlerror='$d_dlerror'
14157 d_dlopen='$d_dlopen'
14158 d_dlsymun='$d_dlsymun'
14159 d_dosuid='$d_dosuid'
14160 d_drand48proto='$d_drand48proto'
14162 d_eaccess='$d_eaccess'
14163 d_endgrent='$d_endgrent'
14164 d_endhent='$d_endhent'
14165 d_endnent='$d_endnent'
14166 d_endpent='$d_endpent'
14167 d_endpwent='$d_endpwent'
14168 d_endsent='$d_endsent'
14169 d_endspent='$d_endspent'
14170 d_eofnblk='$d_eofnblk'
14171 d_eunice='$d_eunice'
14172 d_fchmod='$d_fchmod'
14173 d_fchown='$d_fchown'
14175 d_fd_macros='$d_fd_macros'
14176 d_fd_set='$d_fd_set'
14177 d_fds_bits='$d_fds_bits'
14178 d_fgetpos='$d_fgetpos'
14179 d_flexfnam='$d_flexfnam'
14182 d_fpathconf='$d_fpathconf'
14183 d_fpos64_t='$d_fpos64_t'
14184 d_fs_data_s='$d_fs_data_s'
14185 d_fseeko='$d_fseeko'
14186 d_fsetpos='$d_fsetpos'
14187 d_fstatfs='$d_fstatfs'
14188 d_fstatvfs='$d_fstatvfs'
14189 d_ftello='$d_ftello'
14191 d_getgrent='$d_getgrent'
14192 d_getgrps='$d_getgrps'
14193 d_gethbyaddr='$d_gethbyaddr'
14194 d_gethbyname='$d_gethbyname'
14195 d_gethent='$d_gethent'
14196 d_gethname='$d_gethname'
14197 d_gethostprotos='$d_gethostprotos'
14198 d_getlogin='$d_getlogin'
14199 d_getmnt='$d_getmnt'
14200 d_getmntent='$d_getmntent'
14201 d_getnbyaddr='$d_getnbyaddr'
14202 d_getnbyname='$d_getnbyname'
14203 d_getnent='$d_getnent'
14204 d_getnetprotos='$d_getnetprotos'
14205 d_getpbyname='$d_getpbyname'
14206 d_getpbynumber='$d_getpbynumber'
14207 d_getpent='$d_getpent'
14208 d_getpgid='$d_getpgid'
14209 d_getpgrp2='$d_getpgrp2'
14210 d_getpgrp='$d_getpgrp'
14211 d_getppid='$d_getppid'
14212 d_getprior='$d_getprior'
14213 d_getprotoprotos='$d_getprotoprotos'
14214 d_getpwent='$d_getpwent'
14215 d_getsbyname='$d_getsbyname'
14216 d_getsbyport='$d_getsbyport'
14217 d_getsent='$d_getsent'
14218 d_getservprotos='$d_getservprotos'
14219 d_getspent='$d_getspent'
14220 d_getspnam='$d_getspnam'
14221 d_gettimeod='$d_gettimeod'
14222 d_gnulibc='$d_gnulibc'
14223 d_grpasswd='$d_grpasswd'
14224 d_hasmntopt='$d_hasmntopt'
14227 d_inetaton='$d_inetaton'
14228 d_int64t='$d_int64t'
14229 d_isascii='$d_isascii'
14230 d_killpg='$d_killpg'
14231 d_lchown='$d_lchown'
14232 d_ldbl_dig='$d_ldbl_dig'
14234 d_locconv='$d_locconv'
14236 d_longdbl='$d_longdbl'
14237 d_longlong='$d_longlong'
14240 d_mbstowcs='$d_mbstowcs'
14241 d_mbtowc='$d_mbtowc'
14242 d_memchr='$d_memchr'
14243 d_memcmp='$d_memcmp'
14244 d_memcpy='$d_memcpy'
14245 d_memmove='$d_memmove'
14246 d_memset='$d_memset'
14248 d_mkfifo='$d_mkfifo'
14249 d_mktime='$d_mktime'
14251 d_msg_ctrunc='$d_msg_ctrunc'
14252 d_msg_dontroute='$d_msg_dontroute'
14253 d_msg_oob='$d_msg_oob'
14254 d_msg_peek='$d_msg_peek'
14255 d_msg_proxy='$d_msg_proxy'
14256 d_msgctl='$d_msgctl'
14257 d_msgget='$d_msgget'
14258 d_msgrcv='$d_msgrcv'
14259 d_msgsnd='$d_msgsnd'
14260 d_mymalloc='$d_mymalloc'
14262 d_off64_t='$d_off64_t'
14263 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14264 d_oldpthreads='$d_oldpthreads'
14265 d_oldsock='$d_oldsock'
14267 d_pathconf='$d_pathconf'
14269 d_phostname='$d_phostname'
14272 d_portable='$d_portable'
14273 d_pthread_yield='$d_pthread_yield'
14275 d_pwchange='$d_pwchange'
14276 d_pwclass='$d_pwclass'
14277 d_pwcomment='$d_pwcomment'
14278 d_pwexpire='$d_pwexpire'
14279 d_pwgecos='$d_pwgecos'
14280 d_pwpasswd='$d_pwpasswd'
14281 d_pwquota='$d_pwquota'
14283 d_readdir='$d_readdir'
14284 d_readlink='$d_readlink'
14285 d_rename='$d_rename'
14286 d_rewinddir='$d_rewinddir'
14288 d_safebcpy='$d_safebcpy'
14289 d_safemcpy='$d_safemcpy'
14290 d_sanemcmp='$d_sanemcmp'
14291 d_sched_yield='$d_sched_yield'
14292 d_scm_rights='$d_scm_rights'
14293 d_seekdir='$d_seekdir'
14294 d_select='$d_select'
14296 d_semctl='$d_semctl'
14297 d_semctl_semid_ds='$d_semctl_semid_ds'
14298 d_semctl_semun='$d_semctl_semun'
14299 d_semget='$d_semget'
14301 d_setegid='$d_setegid'
14302 d_seteuid='$d_seteuid'
14303 d_setgrent='$d_setgrent'
14304 d_setgrps='$d_setgrps'
14305 d_sethent='$d_sethent'
14306 d_setlinebuf='$d_setlinebuf'
14307 d_setlocale='$d_setlocale'
14308 d_setnent='$d_setnent'
14309 d_setpent='$d_setpent'
14310 d_setpgid='$d_setpgid'
14311 d_setpgrp2='$d_setpgrp2'
14312 d_setpgrp='$d_setpgrp'
14313 d_setprior='$d_setprior'
14314 d_setpwent='$d_setpwent'
14315 d_setregid='$d_setregid'
14316 d_setresgid='$d_setresgid'
14317 d_setresuid='$d_setresuid'
14318 d_setreuid='$d_setreuid'
14319 d_setrgid='$d_setrgid'
14320 d_setruid='$d_setruid'
14321 d_setsent='$d_setsent'
14322 d_setsid='$d_setsid'
14323 d_setspent='$d_setspent'
14324 d_setvbuf='$d_setvbuf'
14328 d_shmatprototype='$d_shmatprototype'
14329 d_shmctl='$d_shmctl'
14331 d_shmget='$d_shmget'
14332 d_sigaction='$d_sigaction'
14333 d_sigsetjmp='$d_sigsetjmp'
14334 d_socket='$d_socket'
14335 d_sockpair='$d_sockpair'
14337 d_statblks='$d_statblks'
14338 d_statfs_f_flags='$d_statfs_f_flags'
14339 d_statfs_s='$d_statfs_s'
14340 d_statvfs='$d_statvfs'
14341 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14342 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14343 d_stdio_stream_array='$d_stdio_stream_array'
14344 d_stdiobase='$d_stdiobase'
14345 d_stdstdio='$d_stdstdio'
14346 d_strchr='$d_strchr'
14347 d_strcoll='$d_strcoll'
14348 d_strctcpy='$d_strctcpy'
14349 d_strerrm='$d_strerrm'
14350 d_strerror='$d_strerror'
14351 d_strtod='$d_strtod'
14352 d_strtol='$d_strtol'
14353 d_strtoul='$d_strtoul'
14354 d_strtoull='$d_strtoull'
14355 d_strxfrm='$d_strxfrm'
14356 d_suidsafe='$d_suidsafe'
14357 d_symlink='$d_symlink'
14358 d_syscall='$d_syscall'
14359 d_sysconf='$d_sysconf'
14360 d_sysernlst='$d_sysernlst'
14361 d_syserrlst='$d_syserrlst'
14362 d_system='$d_system'
14363 d_tcgetpgrp='$d_tcgetpgrp'
14364 d_tcsetpgrp='$d_tcsetpgrp'
14365 d_telldir='$d_telldir'
14366 d_telldirproto='$d_telldirproto'
14369 d_truncate='$d_truncate'
14370 d_tzname='$d_tzname'
14373 d_union_semun='$d_union_semun'
14375 d_vendorbin='$d_vendorbin'
14376 d_vendorlib='$d_vendorlib'
14378 d_void_closedir='$d_void_closedir'
14379 d_voidsig='$d_voidsig'
14380 d_voidtty='$d_voidtty'
14381 d_volatile='$d_volatile'
14382 d_vprintf='$d_vprintf'
14384 d_waitpid='$d_waitpid'
14385 d_wcstombs='$d_wcstombs'
14386 d_wctomb='$d_wctomb'
14389 db_hashtype='$db_hashtype'
14390 db_prefixtype='$db_prefixtype'
14391 defvoidused='$defvoidused'
14392 direntrytype='$direntrytype'
14395 doublesize='$doublesize'
14397 dynamic_ext='$dynamic_ext'
14403 eunicefix='$eunicefix'
14406 extensions='$extensions'
14407 fflushNULL='$fflushNULL'
14408 fflushall='$fflushall'
14410 firstmakefile='$firstmakefile'
14412 fpossize='$fpossize'
14413 fpostype='$fpostype'
14414 freetype='$freetype'
14416 full_csh='$full_csh'
14417 full_sed='$full_sed'
14418 gccversion='$gccversion'
14419 gidformat='$gidformat'
14425 groupcat='$groupcat'
14426 groupstype='$groupstype'
14429 h_sysfile='$h_sysfile'
14441 i_arpainet='$i_arpainet'
14442 i_bsdioctl='$i_bsdioctl'
14445 i_dirent='$i_dirent'
14452 i_inttypes='$i_inttypes'
14453 i_limits='$i_limits'
14454 i_locale='$i_locale'
14455 i_machcthr='$i_machcthr'
14456 i_malloc='$i_malloc'
14458 i_memory='$i_memory'
14459 i_mntent='$i_mntent'
14462 i_neterrno='$i_neterrno'
14463 i_netinettcp='$i_netinettcp'
14466 i_pthread='$i_pthread'
14468 i_rpcsvcdbm='$i_rpcsvcdbm'
14471 i_shadow='$i_shadow'
14473 i_stdarg='$i_stdarg'
14474 i_stddef='$i_stddef'
14475 i_stdlib='$i_stdlib'
14476 i_string='$i_string'
14477 i_sysaccess='$i_sysaccess'
14478 i_sysdir='$i_sysdir'
14479 i_sysfile='$i_sysfile'
14480 i_sysfilio='$i_sysfilio'
14482 i_sysioctl='$i_sysioctl'
14483 i_sysmount='$i_sysmount'
14484 i_sysndir='$i_sysndir'
14485 i_sysparam='$i_sysparam'
14486 i_sysresrc='$i_sysresrc'
14487 i_syssecrt='$i_syssecrt'
14488 i_sysselct='$i_sysselct'
14489 i_syssockio='$i_syssockio'
14490 i_sysstat='$i_sysstat'
14491 i_sysstatfs='$i_sysstatfs'
14492 i_sysstatvfs='$i_sysstatvfs'
14493 i_systime='$i_systime'
14494 i_systimek='$i_systimek'
14495 i_systimes='$i_systimes'
14496 i_systypes='$i_systypes'
14497 i_sysuio='$i_sysuio'
14499 i_sysvfs='$i_sysvfs'
14500 i_syswait='$i_syswait'
14501 i_termio='$i_termio'
14502 i_termios='$i_termios'
14504 i_unistd='$i_unistd'
14507 i_values='$i_values'
14508 i_varargs='$i_varargs'
14509 i_varhdr='$i_varhdr'
14511 ignore_versioned_solibs='$ignore_versioned_solibs'
14514 installarchlib='$installarchlib'
14515 installbin='$installbin'
14516 installman1dir='$installman1dir'
14517 installman3dir='$installman3dir'
14518 installprefix='$installprefix'
14519 installprefixexp='$installprefixexp'
14520 installprivlib='$installprivlib'
14521 installscript='$installscript'
14522 installsitearch='$installsitearch'
14523 installsitebin='$installsitebin'
14524 installsitelib='$installsitelib'
14525 installstyle='$installstyle'
14526 installusrbinperl='$installusrbinperl'
14527 installvendorbin='$installvendorbin'
14528 installvendorlib='$installvendorlib'
14530 ivdformat='$ivdformat'
14533 known_extensions='$known_extensions'
14537 lddlflags='$lddlflags'
14539 ldlibpthname='$ldlibpthname'
14546 libswanted='$libswanted'
14552 locincpth='$locincpth'
14553 loclibpth='$loclibpth'
14554 longdblsize='$longdblsize'
14555 longlongsize='$longlongsize'
14556 longsize='$longsize'
14560 lseeksize='$lseeksize'
14561 lseektype='$lseektype'
14565 make_set_make='$make_set_make'
14566 mallocobj='$mallocobj'
14567 mallocsrc='$mallocsrc'
14568 malloctype='$malloctype'
14570 man1direxp='$man1direxp'
14573 man3direxp='$man3direxp'
14576 mips_type='$mips_type'
14579 modetype='$modetype'
14581 multiarch='$multiarch'
14583 myarchname='$myarchname'
14584 mydomain='$mydomain'
14585 myhostname='$myhostname'
14588 netdb_hlen_type='$netdb_hlen_type'
14589 netdb_host_type='$netdb_host_type'
14590 netdb_name_type='$netdb_name_type'
14591 netdb_net_type='$netdb_net_type'
14594 nm_so_opt='$nm_so_opt'
14595 nonxs_ext='$nonxs_ext'
14599 o_nonblock='$o_nonblock'
14601 old_pthread_create_joinable='$old_pthread_create_joinable'
14602 optimize='$optimize'
14603 orderlib='$orderlib'
14609 patchlevel='$patchlevel'
14610 path_sep='$path_sep'
14612 perladmin='$perladmin'
14613 perlpath='$perlpath'
14615 phostname='$phostname'
14618 pm_apiversion='$pm_apiversion'
14622 prefixexp='$prefixexp'
14624 privlibexp='$privlibexp'
14625 prototype='$prototype'
14627 quadcase='$quadcase'
14628 quadtype='$quadtype'
14629 randbits='$randbits'
14630 randfunc='$randfunc'
14631 randseedtype='$randseedtype'
14633 rd_nodata='$rd_nodata'
14637 sPRIEldbl='$sPRIEldbl'
14638 sPRIFldbl='$sPRIFldbl'
14639 sPRIGldbl='$sPRIGldbl'
14642 sPRIeldbl='$sPRIeldbl'
14643 sPRIfldbl='$sPRIfldbl'
14644 sPRIgldbl='$sPRIgldbl'
14649 sched_yield='$sched_yield'
14650 scriptdir='$scriptdir'
14651 scriptdirexp='$scriptdirexp'
14653 seedfunc='$seedfunc'
14654 selectminbits='$selectminbits'
14655 selecttype='$selecttype'
14656 sendmail='$sendmail'
14659 sharpbang='$sharpbang'
14660 shmattype='$shmattype'
14661 shortsize='$shortsize'
14664 sig_count='$sig_count'
14665 sig_name='$sig_name'
14666 sig_name_init='$sig_name_init'
14668 sig_num_init='$sig_num_init'
14669 signal_t='$signal_t'
14670 sitearch='$sitearch'
14671 sitearchexp='$sitearchexp'
14673 sitebinexp='$sitebinexp'
14675 sitelibexp='$sitelibexp'
14676 siteprefix='$siteprefix'
14677 siteprefixexp='$siteprefixexp'
14678 sizetype='$sizetype'
14683 sockethdr='$sockethdr'
14684 socketlib='$socketlib'
14686 spackage='$spackage'
14687 spitshell='$spitshell'
14690 ssizetype='$ssizetype'
14691 startperl='$startperl'
14693 static_ext='$static_ext'
14695 stdio_base='$stdio_base'
14696 stdio_bufsiz='$stdio_bufsiz'
14697 stdio_cnt='$stdio_cnt'
14698 stdio_filbuf='$stdio_filbuf'
14699 stdio_ptr='$stdio_ptr'
14700 stdio_stream_array='$stdio_stream_array'
14703 subversion='$subversion'
14710 timeincl='$timeincl'
14711 timetype='$timetype'
14724 uidformat='$uidformat'
14730 uquadtype='$uquadtype'
14731 use64bits='$use64bits'
14733 uselargefiles='$uselargefiles'
14734 uselongdouble='$uselongdouble'
14735 uselonglong='$uselonglong'
14736 usemorebits='$usemorebits'
14737 usemultiplicity='$usemultiplicity'
14738 usemymalloc='$usemymalloc'
14740 useopcode='$useopcode'
14741 useperlio='$useperlio'
14742 useposix='$useposix'
14744 useshrplib='$useshrplib'
14745 usesocks='$usesocks'
14746 usethreads='$usethreads'
14747 usevendorprefix='$usevendorprefix'
14748 usevfork='$usevfork'
14751 uvoformat='$uvoformat'
14754 uvuformat='$uvuformat'
14755 uvxformat='$uvxformat'
14756 vendorbin='$vendorbin'
14757 vendorbinexp='$vendorbinexp'
14758 vendorlib='$vendorlib'
14759 vendorlibexp='$vendorlibexp'
14760 vendorprefix='$vendorprefix'
14761 vendorprefixexp='$vendorprefixexp'
14764 voidflags='$voidflags'
14766 xs_apiversion='$xs_apiversion'
14771 : Add in command line options if available
14772 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14774 : add special variables
14775 $test -f $src/patchlevel.h && \
14776 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14777 echo "CONFIGDOTSH=true" >>config.sh
14779 : propagate old symbols
14780 if $test -f UU/config.sh; then
14781 <UU/config.sh sort | uniq >UU/oldconfig.sh
14782 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14783 sort | uniq -u >UU/oldsyms
14784 set X `cat UU/oldsyms`
14790 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14792 echo "# Variables propagated from previous config.sh file." >>config.sh
14793 for sym in `cat UU/oldsyms`; do
14794 echo " Propagating $hint variable "'$'"$sym..."
14795 eval 'tmp="$'"${sym}"'"'
14797 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14803 : Finish up by extracting the .SH files
14817 If you'd like to make any changes to the config.sh file before I begin
14818 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14821 rp="Press return or use a shell escape to edit config.sh:"
14826 *) : in case they cannot read
14827 sh 1>&4 -c "$ans";;
14832 : if this fails, just run all the .SH files by hand
14839 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14846 Now you need to generate make dependencies by running "$make depend".
14847 You might prefer to run it in background: "$make depend > makedepend.out &"
14848 It can take a while, so you might not want to run it right now.
14853 rp="Run $make depend now?"
14857 $make depend && echo "Now you must run a $make."
14860 echo "You must run '$make depend' then '$make'."
14863 elif test -f [Mm]akefile; then
14865 echo "Now you must run a $make."
14870 if $test -f Policy.sh; then
14873 If you compile $package on a different machine or from a different object
14874 directory, copy the Policy.sh file from this object directory to the
14875 new one before you run Configure -- this will help you with most of
14876 the policy defaults.
14880 if $test -f config.msg; then
14881 echo "Hmm. I also noted the following information while running:"
14883 $cat config.msg >&4
14886 $rm -f kit*isdone ark*isdone