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 Thu Jan 20 00:42:19 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
674 inc_version_list_init=''
694 ignore_versioned_solibs=''
852 d_stdio_stream_array=''
853 stdio_stream_array=''
897 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
900 : We must find out about Eunice early
902 if test -f /etc/unixtovms; then
903 eunicefix=/etc/unixtovms
905 if test -f /etc/unixtovms.exe; then
906 eunicefix=/etc/unixtovms.exe
910 : list of known cpp symbols, sorted alphabetically
911 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
912 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
913 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
914 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
915 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
916 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
917 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
918 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
919 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
920 al="$al VMS Xenix286"
921 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
922 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
923 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
924 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
925 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
926 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
927 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
928 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
929 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
930 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
931 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
932 al="$al __SVR4_2__ __UMAXV__"
933 al="$al ____386BSD____ __alpha __alpha__ __amiga"
934 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
935 al="$al __host_mips__"
936 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
937 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
938 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
939 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
940 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
941 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
942 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
943 al="$al __mc88100 __mc88100__ __mips __mips__"
944 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
945 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
946 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
947 al="$al _host_mips _mips _unix"
948 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
949 al="$al apollo ardent att386 att3b"
950 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
951 al="$al cadmus clipper concurrent convex cray ctix"
952 al="$al dmert encore gcos gcx gimpel gould"
953 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
954 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
955 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
956 al="$al i186 i286 i386 i486 i8086"
957 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
958 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
959 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
960 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
961 al="$al mc88000 mc88100 merlin mert mips mvs n16"
962 al="$al ncl_el ncl_mr"
963 al="$al news1500 news1700 news1800 news1900 news3700"
964 al="$al news700 news800 news900 ns16000 ns32000"
965 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
966 al="$al parisc pc532 pdp11 plexus posix pyr"
967 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
968 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
969 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
970 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
971 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
972 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
975 : set useposix=false in your hint file to disable the POSIX extension.
977 : set useopcode=false in your hint file to disable the Opcode extension.
979 : Trailing extension. Override this in a hint file, if needed.
981 : Extra object files, if any, needed on this platform.
983 : Possible local include directories to search.
984 : Set locincpth to "" in a hint file to defeat local include searches.
985 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
986 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
988 : no include file wanted by default
992 : change the next line if compiling for Xenix/286 on Xenix/386
993 xlibpth='/usr/lib/386 /lib/386'
995 : Possible local library directories to search.
996 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
997 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
999 : general looking path for locating libraries
1000 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
1001 glibpth="$glibpth /lib /usr/lib $xlibpth"
1002 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
1003 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1005 : Private path used by Configure to find libraries. Its value
1006 : is prepended to libpth. This variable takes care of special
1007 : machines, like the mips. Usually, it should be empty.
1010 : default library list
1012 : some systems want to use only the non-versioned libso:s
1013 ignore_versioned_solibs=''
1014 : set usemultiplicity on the Configure command line to enable multiplicity.
1015 : set usesocks on the Configure command line to enable socks.
1016 : set usethreads on the Configure command line to enable threads.
1017 : full support for void wanted by default
1020 : List of libraries we want.
1021 : If anyone needs -lnet, put it in a hint file.
1022 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1023 libswanted="$libswanted dld ld sun m c cposix posix"
1024 libswanted="$libswanted ndir dir crypt sec"
1025 libswanted="$libswanted ucb bsd BSD PW x"
1026 : We probably want to search /usr/shlib before most other libraries.
1027 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1028 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1029 glibpth="/usr/shlib $glibpth"
1030 : Do not use vfork unless overridden by a hint file.
1033 : Find the basic shell for Bourne shell scripts
1037 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1040 if test -f "$xxx"; then
1043 : Build up a list and do a single loop so we can 'break' out.
1044 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1045 for xxx in sh bash ksh pdksh ash; do
1047 try="$try ${p}/${xxx}"
1051 if test -f "$xxx"; then
1054 elif test -f "$xxx.exe"; then
1065 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1067 Usually it's in /bin/sh. How did you even get this far?
1068 Please contact me (Perl Maintainers) at perlbug@perl.com and
1069 we'll try to straighten this all out.
1075 : see if sh knows # comments
1076 if `$sh -c '#' >/dev/null 2>&1`; then
1080 test -f $xcat || xcat=/usr/bin/cat
1085 if test -s today; then
1088 echo "#! $xcat" > try
1092 if test -s today; then
1100 echo "Your $sh doesn't grok # comments--I will strip them later on."
1103 echo "exec grep -v '^[ ]*#'" >spitshell
1105 $eunicefix spitshell
1106 spitshell=`pwd`/spitshell
1108 echo "I presume that if # doesn't work, #! won't work either!"
1113 : figure out how to guarantee sh startup
1115 '') startsh=${sharpbang}${sh} ;;
1127 : echo "Yup, it does."
1129 echo "Hmm... '$startsh' does not guarantee sh startup..."
1130 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1135 : Save command line options in file UU/cmdline.opt for later use in
1136 : generating config.sh.
1137 cat > cmdline.opt <<EOSH
1138 # Configure command line arguments.
1145 cat >>cmdline.opt <<EOSH
1146 config_arg$argn='$arg'
1148 argn=`expr $argn + 1`
1151 : produce awk script to parse command line options
1152 cat >options.awk <<'EOF'
1154 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1156 len = length(optstr);
1157 for (i = 1; i <= len; i++) {
1158 c = substr(optstr, i, 1);
1159 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1170 if (substr(str, 1, 1) != "-") {
1171 printf("'%s'\n", str);
1175 for (i = 2; i <= len; i++) {
1176 c = substr(str, i, 1);
1178 printf("-%s\n", substr(str, i));
1184 printf("'%s'\n", substr(str, i + 1));
1197 : process the command line options
1198 set X `for arg in "$@"; do echo "X$arg"; done |
1199 sed -e s/X// | awk -f options.awk`
1204 : set up default values
1214 rm -f optdef.sh posthint.sh
1215 cat >optdef.sh <<EOS
1221 while test $# -gt 0; do
1223 -d) shift; fastread=yes;;
1224 -e) shift; alldone=cont;;
1228 if test -r "$1"; then
1231 echo "$me: cannot read config file $1." >&2
1236 -h) shift; error=true;;
1237 -r) shift; reuseval=true;;
1238 -s) shift; silent=true; realsilent=true;;
1239 -E) shift; alldone=exit;;
1240 -K) shift; knowitall=true;;
1241 -O) shift; override=true;;
1242 -S) shift; silent=true; extractsh=true;;
1247 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1248 echo "$me: ignoring -D $1" >&2
1251 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1252 *) echo "$1='define'" >> optdef.sh;;
1259 *=) echo "$1" >> optdef.sh;;
1261 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1262 echo "$me: ignoring -U $1" >&2
1264 *) echo "$1='undef'" >> optdef.sh;;
1275 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1279 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1286 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1287 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1288 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1289 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1290 *) xxx=`echo $yyy|sed 's!:.*!!'`
1291 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1297 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=''" >> posthint.sh ;;
1304 echo "$yyy='$zzz'" >> posthint.sh ;;
1306 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1308 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1313 echo "$yyy=$zzz" >> posthint.sh ;;
1314 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1317 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1320 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1328 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1329 [-U symbol] [-U symbol=] [-A command:symbol...]
1330 -d : use defaults for all answers.
1331 -e : go on without questioning past the production of config.sh.
1332 -f : specify an alternate default configuration file.
1333 -h : print this help message and exit (with an error status).
1334 -r : reuse C symbols value if possible (skips costly nm extraction).
1335 -s : silent mode, only echoes questions and essential information.
1336 -D : define symbol to have some value:
1337 -D symbol symbol gets the value 'define'
1338 -D symbol=value symbol gets the value 'value'
1339 -E : stop at the end of questions, after having produced config.sh.
1340 -K : do not use unless you know what you are doing.
1341 -O : let -D and -U override definitions from loaded configuration file.
1342 -S : perform variable substitutions on all .SH files (can mix with -f)
1343 -U : undefine symbol:
1344 -U symbol symbol gets the value 'undef'
1345 -U symbol= symbol gets completely empty
1346 -A : manipulate symbol after the platform specific hints have been applied:
1347 -A symbol=value append " "value to symbol
1348 -A append:symbol=value append value to symbol
1349 -A define:symbol=value define symbol to have value
1350 -A clear:symbol define symbol to be ''
1351 -A define:symbol define symbol to be 'define'
1352 -A eval:symbol=value define symbol to be eval of value
1353 -A prepend:symbol=value prepend value to symbol
1354 -A undef:symbol define symbol to be 'undef'
1355 -A undef:symbol= define symbol to be ''
1356 -V : print version number and exit (with a zero status).
1363 case "$fastread$alldone" in
1366 if test ! -t 0; then
1367 echo "Say 'sh Configure', not 'sh <Configure'"
1375 true) exec 1>/dev/null;;
1378 : run the defines and the undefines, if any, but leave the file out there...
1381 : create the posthint manipulation script and leave the file out there...
1386 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1387 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1388 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1389 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1390 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1393 : Some greps do not return status, grrr.
1394 echo "grimblepritz" >grimble
1395 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1397 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1403 : the following should work in any shell
1407 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1408 cat >contains <<'EOSS'
1409 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1414 : Find the path to the source tree
1417 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1420 *) src=`cd ../$src && pwd` ;;
1433 if test -f $rsrc/Configure && \
1434 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1436 : found it, so we are ok.
1439 for src in . .. ../.. ../../.. ../../../..; do
1440 if test -f ../$src/Configure && \
1441 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1452 Sorry, I can't seem to locate the source dir for $package. Please start
1453 Configure with an explicit path -- i.e. /some/path/Configure.
1461 echo "Sources for $package found in \"$src\"." >&4
1465 : script used to extract .SH files with variable substitutions
1466 cat >extract <<'EOS'
1468 echo "Doing variable substitutions on .SH files..."
1469 if test -f $src/MANIFEST; then
1470 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1472 echo "(Looking for .SH files under the source directory.)"
1473 set x `(cd $src; find . -name "*.SH" -print)`
1477 0) set x `(cd $src; echo *.SH)`; shift;;
1479 if test ! -f $src/$1; then
1485 while test $name; do
1486 if test ! -d "$name"; then
1487 create="$name $create";
1488 name=`echo $name | sed -e "s|^[^/]*$||"`;
1489 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1494 for file in $create; do
1503 dir=`expr X$file : 'X\(.*\)/'`
1504 file=`expr X$file : 'X.*/\(.*\)'`
1505 (cd $dir && . ./$file)
1515 dir=`expr X$file : 'X\(.*\)/'`
1516 file=`expr X$file : 'X.*/\(.*\)'`
1517 (set x $dir; shift; eval $mkdir_p)
1527 if test -f $src/config_h.SH; then
1528 if test ! -f config.h; then
1529 : oops, they left it out of MANIFEST, probably, so do it anyway.
1535 : extract files and exit if asked to do so
1536 case "$extractsh" in
1538 case "$realsilent" in
1542 case "$config_sh" in
1543 '') config_sh='config.sh';;
1546 echo "Fetching answers from $config_sh..."
1549 test "$override" && . ./optdef.sh
1558 : Eunice requires " " instead of "", can you believe it
1561 echo "Beginning of configuration questions for $package."
1563 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1565 : first determine how to suppress newline on echo command
1567 echo "Checking echo to see how to suppress newlines..."
1568 (echo "hi there\c" ; echo " ") >.echotmp
1569 if $contains c .echotmp >/dev/null 2>&1 ; then
1580 echo $n "The star should be here-->$c"
1584 : Now test for existence of everything in MANIFEST
1586 if test -f $rsrc/MANIFEST; then
1587 echo "First let's make sure your kit is complete. Checking..." >&4
1588 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1591 for filelist in x??; do
1592 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1594 if test -s missing; then
1598 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1600 You have the option of continuing the configuration process, despite the
1601 distinct possibility that your kit is damaged, by typing 'y'es. If you
1602 do, don't blame me if something goes wrong. I advise you to type 'n'o
1603 and contact the author (perlbug@perl.com).
1606 echo $n "Continue? [n] $c" >&4
1610 echo "Continuing..." >&4
1614 echo "ABORTING..." >&4
1619 echo "Looks good..."
1622 echo "There is no MANIFEST file. I hope your kit is complete !"
1627 : Find the appropriate value for a newline for tr
1628 if test -n "$DJGPP"; then
1631 if test X"$trnl" = X; then
1632 case "`echo foo|tr '\n' x 2>/dev/null`" in
1636 if test X"$trnl" = X; then
1637 case "`echo foo|tr '\012' x 2>/dev/null`" in
1638 foox) trnl='\012' ;;
1641 if test X"$trnl" = X; then
1644 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1650 : compute the number of columns on the terminal for proper question formatting
1655 : set up the echo used in my read
1656 myecho="case \"\$xxxm\" in
1657 '') echo $n \"\$rp $c\" >&4;;
1659 '') echo $n \"[\$xxxm] $c\";;
1661 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1663 echo $n \"[\$xxxm] $c\" >&4
1665 echo $n \"\$rp [\$xxxm] $c\" >&4
1671 : now set up to do reads with possible shell escape and default assignment
1677 case "\$fastread" in
1678 yes) case "\$dflt" in
1681 case "\$silent-\$rp" in
1686 *) case "\$silent" in
1687 true) case "\$rp" in
1692 while expr "X\$ans" : "X!" >/dev/null; do
1696 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1704 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1713 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1718 echo "(OK, I'll run with -d after this question.)" >&4
1721 echo "*** Sorry, \$1 not supported yet." >&4
1731 echo "*** Substitution done -- please confirm."
1733 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1738 echo "*** Error -- try again."
1745 case "\$ans\$xxxm\$nostick" in
1757 : create .config dir to save info across Configure sessions
1758 test -d ../.config || mkdir ../.config
1759 cat >../.config/README <<EOF
1760 This directory created by Configure to save information that should
1761 persist across sessions for $package.
1763 You may safely delete it if you wish.
1766 : general instructions
1769 user=`(logname) 2>/dev/null`
1771 '') user=`whoami 2>&1`;;
1773 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1776 rp='Would you like to see the instructions?'
1787 This installation shell script will examine your system and ask you questions
1788 to determine how the perl5 package should be installed. If you get
1789 stuck on a question, you may use a ! shell escape to start a subshell or
1790 execute a command. Many of the questions will have default answers in square
1791 brackets; typing carriage return will give you the default.
1793 On some of the questions which ask for file or directory names you are allowed
1794 to use the ~name construct to specify the login directory belonging to "name",
1795 even if you don't have a shell which knows about that. Questions where this is
1796 allowed will be marked "(~name ok)".
1800 dflt='Type carriage return to continue'
1804 The prompter used in this script allows you to use shell variables and
1805 backticks in your answers. You may use $1, $2, etc... to refer to the words
1806 in the default answer, as if the default line was a set of arguments given to a
1807 script shell. This means you may also use $* to repeat the whole default line,
1808 so you do not have to re-type everything to add something to the default.
1810 Everytime there is a substitution, you will have to confirm. If there is an
1811 error (e.g. an unmatched backtick), the default answer will remain unchanged
1812 and you will be prompted again.
1814 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1815 the questions and use the computed defaults (or the previous answers if there
1816 was already a config.sh file). Type 'Configure -h' for a list of options.
1817 You may also start interactively and then answer '& -d' at any prompt to turn
1818 on the non-interactive behaviour for the remainder of the execution.
1824 Much effort has been expended to ensure that this shell script will run on any
1825 Unix system. If despite that it blows up on yours, your best bet is to edit
1826 Configure and run it again. If you can't run Configure for some reason,
1827 you'll have to generate a config.sh file by hand. Whatever problems you
1828 have, let me (perlbug@perl.com) know how I blew it.
1830 This installation script affects things in two ways:
1832 1) it may do direct variable substitutions on some of the files included
1834 2) it builds a config.h file for inclusion in C programs. You may edit
1835 any of these files as the need arises after running this script.
1837 If you make a mistake on a question, there is no easy way to back up to it
1838 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1839 files. Configure will offer to let you do this before it runs the SH files.
1842 dflt='Type carriage return to continue'
1844 case "$firsttime" in
1845 true) echo $user >>../.config/instruct;;
1849 : find out where common programs are
1851 echo "Locating common programs..." >&4
1864 if test -d \$dir/\$thing; then
1870 for thisthing in \$dir/\$thing; do
1871 : just loop through to pick last item
1873 if test -f \$thisthing; then
1876 elif test -f \$dir/\$thing.exe; then
1877 if test -n "$DJGPP"; then
1878 echo \$dir/\$thing.exe
1880 : on Eunice apparently
1931 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1932 pth="$pth /lib /usr/lib"
1933 for file in $loclist; do
1937 if test -f "$xxx"; then
1940 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1941 xxx=`./loc $file $file $pth`
1944 '') xxx=`./loc $file $file $pth`;;
1945 *) xxx=`./loc $xxx $xxx $pth`;;
1951 echo $file is in $xxx.
1954 echo $file is in $xxx.
1957 echo "I don't know where '$file' is, and my life depends on it." >&4
1958 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1964 echo "Don't worry if any of the following aren't found..."
1966 for file in $trylist; do
1970 if test -f "$xxx"; then
1973 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1974 xxx=`./loc $file $file $pth`
1977 '') xxx=`./loc $file $file $pth`;;
1978 *) xxx=`./loc $xxx $xxx $pth`;;
1984 echo $file is in $xxx.
1987 echo $file is in $xxx.
1990 echo "I don't see $file out there, $say."
1997 echo "Substituting grep for egrep."
2003 echo "Substituting cp for ln."
2009 echo "Hopefully test is built into your sh."
2012 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2013 echo "Using the test built into your sh."
2021 echo "Hopefully echo is built into your sh."
2026 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2027 $echo $n "hi there$c" >foo1
2028 echo $n "hi there$c" >foo2
2029 if cmp foo1 foo2 >/dev/null 2>&1; then
2030 echo "They are compatible. In fact, they may be identical."
2037 They are not compatible! You are probably running ksh on a non-USG system.
2038 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2039 have echo built in and we may have to run some Bourne shell scripts. That
2040 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2043 $echo $n "The star should be here-->$c"
2050 : determine whether symbolic links are supported
2053 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2054 echo "Symbolic links are supported." >&4
2057 echo "Symbolic links are NOT supported." >&4
2062 : see whether [:lower:] and [:upper:] are supported character classes
2064 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2066 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2070 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2071 # (0xc9 and 0xd1), therefore that is a nice testing point.
2072 if test "X$up" = X -o "X$low" = X; then
2073 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2079 if test "X$up" = X -o "X$low" = X; then
2080 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2086 if test "X$up" = X -o "X$low" = X; then
2087 case "`echo IJ | od -x 2>/dev/null`" in
2089 echo "Hey, this might be EBCDIC." >&4
2090 if test "X$up" = X -o "X$low" = X; then
2091 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2092 ij) up='[A-IJ-RS-Z]'
2097 if test "X$up" = X -o "X$low" = X; then
2098 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2108 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2110 echo "Using $up and $low to convert case." >&4
2113 echo "I don't know how to translate letters from upper to lower case." >&4
2114 echo "Your tr is not acting any way I know of." >&4
2118 : set up the translation script tr, must be called with ./tr of course
2122 '[A-Z][a-z]') exec $tr '$up' '$low';;
2123 '[a-z][A-Z]') exec $tr '$low' '$up';;
2130 : Try to determine whether config.sh was made on this system
2131 case "$config_sh" in
2133 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2134 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2135 # because the A-Z/a-z are not consecutive.
2136 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2137 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2138 newmyuname="$myuname"
2140 case "$knowitall" in
2142 if test -f ../config.sh; then
2143 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2144 eval "`grep myuname= ../config.sh`"
2146 if test "X$myuname" = "X$newmyuname"; then
2154 : Get old answers from old config file if Configure was run on the
2155 : same system, otherwise use the hints.
2158 if test -f config.sh; then
2160 rp="I see a config.sh file. Shall I use it to set the defaults?"
2163 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2164 *) echo "Fetching default answers from your old config.sh file..." >&4
2172 : Older versions did not always set $sh. Catch re-use of such
2181 if test ! -f config.sh; then
2184 First time through, eh? I have some defaults handy for some systems
2185 that need some extra help getting the Configure answers right:
2188 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2190 : Half the following guesses are probably wrong... If you have better
2191 : tests or hints, please send them to perlbug@perl.com
2192 : The metaconfig authors would also appreciate a copy...
2193 $test -f /irix && osname=irix
2194 $test -f /xenix && osname=sco_xenix
2195 $test -f /dynix && osname=dynix
2196 $test -f /dnix && osname=dnix
2197 $test -f /lynx.os && osname=lynxos
2198 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2199 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2200 $test -f /bin/mips && /bin/mips && osname=mips
2201 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2202 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2203 $test -d /usr/apollo/bin && osname=apollo
2204 $test -f /etc/saf/_sactab && osname=svr4
2205 $test -d /usr/include/minix && osname=minix
2206 if $test -d /MachTen -o -d /MachTen_Folder; then
2208 if $test -x /sbin/version; then
2209 osvers=`/sbin/version | $awk '{print $2}' |
2210 $sed -e 's/[A-Za-z]$//'`
2211 elif $test -x /usr/etc/version; then
2212 osvers=`/usr/etc/version | $awk '{print $2}' |
2213 $sed -e 's/[A-Za-z]$//'`
2219 $test -f /sys/posix.dll &&
2220 $test -f /usr/bin/what &&
2221 set X `/usr/bin/what /sys/posix.dll` &&
2222 $test "$3" = UWIN &&
2226 if $test -f $uname; then
2234 umips) osname=umips ;;
2237 [23]100) osname=mips ;;
2238 next*) osname=next ;;
2240 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2241 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2244 elif $test -f /etc/kconfig; then
2246 if test "$lns" = "$ln -s"; then
2248 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2250 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2257 if test -n "$DJGPP"; then
2266 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2268 'not found') osvers="$4"."$3" ;;
2269 '<3240'|'<>3240') osvers=3.2.0 ;;
2270 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2271 '=3250'|'>3250') osvers=3.2.5 ;;
2275 bsd386) osname=bsd386
2278 cygwin*) osname=cygwin
2281 *dc.osx) osname=dcosx
2287 domainos) osname=apollo
2293 dynixptx*) osname=dynixptx
2294 osvers=`echo "$4"|sed 's/^v//'`
2296 freebsd) osname=freebsd
2298 genix) osname=genix ;;
2300 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2316 netbsd*) osname=netbsd
2319 news-os) osvers="$3"
2321 4*) osname=newsos4 ;;
2325 next*) osname=next ;;
2326 POSIX-BC | posix-bc ) osname=posix-bc
2329 powerux | power_ux | powermax_os | powermaxos | \
2330 powerunix | power_unix) osname=powerux
2336 solaris) osname=solaris
2338 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2345 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2349 titanos) osname=titanos
2358 ultrix) osname=ultrix
2361 osf1|mls+) case "$5" in
2364 osvers=`echo "$3" | sed 's/^[xvt]//'`
2366 hp*) osname=hp_osf1 ;;
2367 mips) osname=mips_osf1 ;;
2370 unixware) osname=svr5
2376 $2) case "$osname" in
2380 : svr4.x or possibly later
2390 if test -f /stand/boot ; then
2391 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2392 if test -n "$INITPROG" -a -f "$INITPROG"; then
2393 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2394 if test -n "$isesix"; then
2402 *) if test -f /etc/systemid; then
2404 set `echo $3 | $sed 's/\./ /g'` $4
2405 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2407 elif $test -f $src/hints/sco_$1_$2.sh; then
2409 elif $test -f $src/hints/sco_$1.sh; then
2414 '') : Still unknown. Probably a generic Sys V.
2423 *) case "$osname" in
2424 '') : Still unknown. Probably a generic BSD.
2432 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2433 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2434 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2437 $rm -f UU/kernel.what
2438 elif test -d c:/.; then
2445 : Now look for a hint file osname_osvers, unless one has been
2446 : specified already.
2449 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2450 : Also try without trailing minor version numbers.
2451 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2452 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2453 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2454 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2457 *) case "$osvers" in
2460 *) if $test -f $src/hints/$file.sh ; then
2462 elif $test -f $src/hints/$xfile.sh ; then
2464 elif $test -f $src/hints/$xxfile.sh ; then
2466 elif $test -f $src/hints/$xxxfile.sh ; then
2468 elif $test -f $src/hints/$xxxxfile.sh ; then
2470 elif $test -f "$src/hints/${osname}.sh" ; then
2479 if $test -f Policy.sh ; then
2482 none) dflt="Policy" ;;
2483 *) dflt="Policy $dflt" ;;
2488 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2492 if $test -f Policy.sh ; then
2495 There's also a Policy hint file available, which should make the
2496 site-specific (policy) questions easier to answer.
2503 You may give one or more space-separated answers, or "none" if appropriate.
2504 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2505 is a good thing. DO NOT give a wrong version or a wrong OS.
2509 rp="Which of these apply, if any?"
2512 for file in $tans; do
2513 if $test X$file = XPolicy -a -f Policy.sh; then
2515 $cat Policy.sh >> UU/config.sh
2516 elif $test -f $src/hints/$file.sh; then
2517 . $src/hints/$file.sh
2518 $cat $src/hints/$file.sh >> UU/config.sh
2519 elif $test X$tans = X -o X$tans = Xnone ; then
2522 : Give one chance to correct a possible typo.
2523 echo "$file.sh does not exist"
2525 rp="hint to use instead?"
2527 for file in $ans; do
2528 if $test -f "$src/hints/$file.sh"; then
2529 . $src/hints/$file.sh
2530 $cat $src/hints/$file.sh >> UU/config.sh
2531 elif $test X$ans = X -o X$ans = Xnone ; then
2534 echo "$file.sh does not exist -- ignored."
2541 : Remember our hint file for later.
2542 if $test -f "$src/hints/$file.sh" ; then
2552 echo "Fetching default answers from $config_sh..." >&4
2556 cp $config_sh config.sh 2>/dev/null
2566 test "$override" && . ./optdef.sh
2567 myuname="$newmyuname"
2569 : Restore computed paths
2570 for file in $loclist $trylist; do
2571 eval $file="\$_$file"
2576 Configure uses the operating system name and version to set some defaults.
2577 The default value is probably right if the name rings a bell. Otherwise,
2578 since spelling matters for me, either accept the default or answer "none"
2585 ''|' '|none) dflt=none ;;
2586 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2589 *) dflt="$osname" ;;
2591 rp="Operating system name?"
2595 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2601 ''|' '|none) dflt=none ;;
2602 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2603 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2605 ''|' ') dflt=none ;;
2610 *) dflt="$osvers" ;;
2612 rp="Operating system version?"
2622 : who configured the system
2623 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2624 cf_by=`(logname) 2>/dev/null`
2627 cf_by=`(whoami) 2>/dev/null`
2629 "") cf_by=unknown ;;
2633 : set up the script used to warn in case of inconsistency
2640 echo "*** WHOA THERE!!! ***" >&4
2641 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2642 rp=" Keep the $hint value?"
2645 y) td=$was; tu=$was;;
2649 : function used to set $1 to $val
2650 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2652 $define$undef) . ./whoa; eval "$var=\$td";;
2653 $undef$define) . ./whoa; eval "$var=\$tu";;
2654 *) eval "$var=$val";;
2659 Perl can be built to take advantage of threads, on some systems.
2660 To do so, Configure must be run with -Dusethreads.
2662 Note that threading is a highly experimental feature, and
2663 some known race conditions still remain. If you choose to try
2664 it, be very sure to not actually deploy it for production
2665 purposes. README.threads has more details, and is required
2666 reading if you enable threads.
2668 case "$usethreads" in
2669 $define|true|[yY]*) dflt='y';;
2672 rp='Build a threading Perl?'
2675 y|Y) val="$define" ;;
2681 case "$usethreads" in
2685 As of 5.5.640, Perl has two different internal threading implementations,
2686 the 5.005 version (5005threads) and an interpreter-based version
2687 (ithreads) that has one interpreter per thread. Both are very
2688 experimental. This arrangement exists to help developers work out
2689 which one is better.
2691 : Default to ithreads unless overridden on command line or with
2694 case "$use5005threads" in
2695 $define|true|[yY]*) dflt='n';;
2697 case "$useithreads" in
2698 $undef|false|[nN]*) dflt='n';;
2700 rp='Use interpreter-based ithreads?'
2703 y|Y) val="$define" ;;
2708 : Now set use5005threads to the opposite value.
2709 case "$useithreads" in
2710 $define) val="$undef" ;;
2717 useithreads="$undef"
2718 use5005threads="$undef"
2722 case "$d_oldpthreads" in
2723 '') : Configure tests would be welcome here. For now, assume undef.
2725 *) val="$d_oldpthreads" ;;
2731 case "$usethreads" in
2732 "$define"|true|[yY]*)
2733 : Look for a hint-file generated 'call-back-unit'. If the
2734 : user has specified that a threading perl is to be built,
2735 : we may need to set or change some other defaults.
2736 if $test -f usethreads.cbu; then
2737 echo "Your platform has some specific hints for threaded builds, using them..."
2741 (Your platform doesn't have any specific hints for threaded builds.
2742 Assuming POSIX threads, then.)
2750 Perl can be built so that multiple Perl interpreters can coexist
2751 within the same Perl executable.
2754 case "$useithreads" in
2757 This multiple interpreter support is required for interpreter-based threads.
2762 echo 'Normally you do not need this and you should answer no.'
2763 case "$usemultiplicity" in
2764 $define|true|[yY]*) dflt='y';;
2767 rp='Build Perl for multiplicity?'
2770 y|Y) val="$define" ;;
2778 : determine where manual pages are on this system
2782 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2783 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2784 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2785 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2786 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2787 sysman=`./loc . /usr/man/man1 $syspath`
2790 if $test -d "$sysman"; then
2791 echo "System manual is in $sysman." >&4
2793 echo "Could not find manual pages in source form." >&4
2796 : see what memory models we can support
2799 $cat >pdp11.c <<'EOP'
2808 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2809 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2810 dflt='unsplit split'
2812 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2815 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2820 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2823 if $test -d /lib/large || $test -d /usr/lib/large; then
2826 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2835 Some systems have different model sizes. On most systems they are called
2836 small, medium, large, and huge. On the PDP11 they are called unsplit and
2837 split. If your system doesn't support different memory models, say "none".
2838 If you wish to force everything to one memory model, say "none" here and
2839 put the appropriate flags later when it asks you for other cc and ld flags.
2840 Venix systems may wish to put "none" and let the compiler figure things out.
2841 (In the following question multiple model names should be space separated.)
2843 The default for most systems is "none".
2846 rp="Which memory models are supported?"
2861 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2862 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2869 rp="What flag indicates separate I and D space?"
2877 *large*|*small*|*medium*|*huge*)
2884 rp="What flag indicates large model?"
2894 *huge*) case "$huge" in
2898 rp="What flag indicates huge model?"
2908 *medium*) case "$medium" in
2912 rp="What flag indicates medium model?"
2919 *) medium="$large";;
2922 *small*) case "$small" in
2926 rp="What flag indicates small model?"
2937 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2940 $rm -f pdp11.* pdp11
2942 : make some quick guesses about what we are up against
2944 $echo $n "Hmm... $c"
2954 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2955 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2957 echo "Looks kind of like an OSF/1 system, but we'll see..."
2959 elif test `echo abc | tr a-z A-Z` = Abc ; then
2960 xxx=`./loc addbib blurfl $pth`
2961 if $test -f $xxx; then
2962 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2966 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2967 echo "Looks kind of like an extended USG system, but we'll see..."
2969 echo "Looks kind of like a USG system, but we'll see..."
2973 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2974 echo "Looks kind of like a BSD system, but we'll see..."
2978 echo "Looks kind of like a Version 7 system, but we'll see..."
2981 case "$eunicefix" in
2984 There is, however, a strange, musty smell in the air that reminds me of
2985 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2989 : it so happens the Eunice I know will not run shell scripts in Unix format
2993 echo "Congratulations. You aren't running Eunice."
2997 : Detect OS2. The p_ variable is set above in the Head.U unit.
3002 I have the feeling something is not exactly right, however...don't tell me...
3003 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3008 if test -f /xenix; then
3009 echo "Actually, this looks more like a XENIX system..."
3014 echo "It's not Xenix..."
3019 if test -f /venix; then
3020 echo "Actually, this looks more like a VENIX system..."
3027 echo "Nor is it Venix..."
3030 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3031 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3034 : see if we need a special compiler
3042 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3043 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3057 On some older systems the default C compiler will not resolve multiple global
3058 references that happen to have the same name. On some such systems the "Mcc"
3059 command may be used to force these to be resolved. On other systems a "cc -M"
3060 command is required. (Note that the -M flag on other systems indicates a
3061 memory model to use!) If you have the Gnu C compiler, you might wish to use
3067 rp="Use which C compiler?"
3075 rp="Use which C compiler?"
3079 : Look for a hint-file generated 'call-back-unit'. Now that the
3080 : user has specified the compiler, we may need to set or change some
3082 if $test -f cc.cbu; then
3086 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3087 $cat >gccvers.c <<EOM
3092 printf("%s\n", __VERSION__);
3094 printf("%s\n", "1");
3100 if $cc -o gccvers gccvers.c; then
3101 gccversion=`./gccvers`
3102 case "$gccversion" in
3103 '') echo "You are not using GNU cc." ;;
3104 *) echo "You are using GNU cc $gccversion."
3109 echo "*** WHOA THERE!!! ***" >&4
3110 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3111 case "$knowitall" in
3113 echo " You'd better start hunting for one and let me know about it." >&4
3119 case "$gccversion" in
3120 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3123 : decide how portable to be. Allow command line overrides.
3124 case "$d_portable" in
3126 *) d_portable="$define" ;;
3129 : set up shell script to do ~ expansion
3135 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3138 if $test -f /bin/csh; then
3139 /bin/csh -f -c "glob \$1"
3144 name=\`$expr x\$1 : '..\([^/]*\)'\`
3145 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3146 if $test ! -d "\$dir"; then
3148 echo "\$me: can't locate home directory for: \$name" >&2
3153 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3169 : now set up to get a file name
3173 cat <<'EOSC' >>getfile
3189 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3190 fn=`echo $fn | sed 's/(.*)//'`
3196 loc_file=`expr $fn : '.*:\(.*\)'`
3197 fn=`expr $fn : '\(.*\):.*'`
3205 */*) fullpath=true;;
3214 *e*) exp_file=true;;
3217 *p*) nopath_ok=true;;
3222 *d*) type='Directory';;
3223 *l*) type='Locate';;
3228 Locate) what='File';;
3233 case "$d_portable" in
3241 while test "$type"; do
3246 true) rp="$rp (~name ok)";;
3249 if test -f UU/getfile.ok && \
3250 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3269 value=`UU/filexp $ans`
3272 if test "$ans" != "$value"; then
3273 echo "(That expands to $value on this system.)"
3287 /*) value="$ansexp" ;;
3292 echo "I shall only accept a full path name, as in /bin/ls." >&4
3293 echo "Use a ! shell escape if you wish to check pathnames." >&4
3296 echo "Please give a full path name, starting with slash." >&4
3299 echo "Note that using ~name is ok provided it expands well." >&4
3312 for fp in $gfpth; do
3313 if test "X$fp" = X.; then
3318 if test -f "$pf"; then
3320 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3322 echo "($value is not a plain file, but that's ok.)"
3325 if test X"$type" = X; then
3332 for fp in $gfpth; do
3333 if test "X$fp" = X.; then
3338 if test -d "$pf"; then
3346 if test -d "$ansexp"; then
3347 echo "(Looking for $loc_file in directory $value.)"
3348 value="$value/$loc_file"
3349 ansexp="$ansexp/$loc_file"
3351 if test -f "$ansexp"; then
3354 case "$nopath_ok" in
3355 true) case "$value" in
3357 *) echo "Assuming $value will be in people's path."
3373 if test "$fastread" = yes; then
3378 rp="$what $value doesn't exist. Use that name anyway?"
3397 test "X$gfpthkeep" != Xy && gfpth=""
3400 : What should the include directory be ?
3402 $echo $n "Hmm... $c"
3406 if $test -f /bin/mips && /bin/mips; then
3407 echo "Looks like a MIPS system..."
3408 $cat >usr.c <<'EOCP'
3409 #ifdef SYSTYPE_BSD43
3413 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3414 dflt='/bsd43/usr/include'
3418 mips_type='System V'
3420 $rm -f usr.c usr.out
3421 echo "and you're compiling with the $mips_type compiler and libraries."
3425 echo "Doesn't look like a MIPS system."
3435 case "$xxx_prompt" in
3438 rp='Where are the include files you want to use?'
3446 : see how we invoke the C preprocessor
3448 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3449 cat <<'EOT' >testcpp.c
3455 if test ! -f cppstdin; then
3456 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3457 # AIX cc -E doesn't show the absolute headerfile
3458 # locations but we'll cheat by using the -M flag.
3459 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
3461 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3464 echo "Keeping your $hint cppstdin wrapper."
3467 wrapper=`pwd`/cppstdin
3471 if $test "X$cppstdin" != "X" && \
3472 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3473 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3475 echo "You used to use $cppstdin $cppminus so we'll use that again."
3477 '') echo "But let's see if we can live without a wrapper..." ;;
3479 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3480 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3482 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3485 echo "(However, $cpprun $cpplast does not work, let's see...)"
3493 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3500 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3501 $cc -E <testcpp.c >testcpp.out 2>&1; \
3502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3503 echo "Yup, it does."
3506 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3507 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3509 echo "Yup, it does."
3512 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3513 $cc -P <testcpp.c >testcpp.out 2>&1; \
3514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3515 echo "Yipee, that works!"
3518 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3519 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3521 echo "At long last!"
3524 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3525 $cpp <testcpp.c >testcpp.out 2>&1; \
3526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3530 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3531 $cpp - <testcpp.c >testcpp.out 2>&1; \
3532 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3533 echo "Hooray, it works! I was beginning to wonder."
3536 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3537 $wrapper <testcpp.c >testcpp.out 2>&1; \
3538 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3544 rp="No dice. I can't find a C preprocessor. Name one:"
3548 $x_cpp <testcpp.c >testcpp.out 2>&1
3549 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3550 echo "OK, that will do." >&4
3552 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3567 echo "Perhaps can we force $cc -E using a wrapper..."
3568 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3569 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3575 echo "Nope, we'll have to live without it..."
3589 "$wrapper"|'cppstdin') ;;
3590 *) $rm -f $wrapper;;
3592 $rm -f testcpp.c testcpp.out
3594 : Set private lib path
3597 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3602 '') dlist="$loclibpth $plibpth $glibpth";;
3603 *) dlist="$libpth";;
3606 : Now check and see which directories actually exist, avoiding duplicates
3610 if $test -d $xxx; then
3613 *) libpth="$libpth $xxx";;
3619 Some systems have incompatible or broken versions of libraries. Among
3620 the directories listed in the question below, please remove any you
3621 know not to be holding relevant libraries, and add any that are needed.
3622 Say "none" for none.
3633 rp="Directories to use for library searches?"
3640 : compute shared library extension
3643 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3653 On some systems, shared libraries may be available. Answer 'none' if
3654 you want to suppress searching of shared libraries for the remainder
3655 of this configuration.
3658 rp='What is the file extension used for shared libraries?'
3662 : Define several unixisms.
3663 : Hints files or command line option can be used to override them.
3664 : The convoluted testing is in case hints files set either the old
3667 '') case "$exe_ext" in
3669 *) _exe="$exe_ext" ;;
3674 '') case "$lib_ext" in
3681 '') case "$obj_ext" in
3688 '') case "$path_sep" in
3699 : Which makefile gets called first. This is used by make depend.
3700 case "$firstmakefile" in
3701 '') firstmakefile='makefile';;
3706 Perl can be built to use the SOCKS proxy protocol library. To do so,
3707 Configure must be run with -Dusesocks.
3709 Normally you do not need this and you should answer no.
3713 $define|true|[yY]*) dflt='y';;
3716 rp='Build Perl for SOCKS?'
3719 y|Y) val="$define" ;;
3725 : Looking for optional libraries
3727 echo "Checking for optional libraries..." >&4
3732 case "$libswanted" in
3733 '') libswanted='c_s';;
3737 libswanted="$libswanted socks5 socks5_sh"
3740 for thislib in $libswanted; do
3742 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3743 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3744 echo "Found -l$thislib (shared)."
3747 *) dflt="$dflt -l$thislib";;
3749 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3750 echo "Found -l$thislib (shared)."
3753 *) dflt="$dflt -l$thislib";;
3755 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3756 echo "Found -l$thislib."
3759 *) dflt="$dflt -l$thislib";;
3761 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3762 echo "Found -l$thislib."
3765 *) dflt="$dflt -l$thislib";;
3767 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3768 echo "Found -l${thislib}_s."
3771 *) dflt="$dflt -l${thislib}_s";;
3773 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3774 echo "Found -l$thislib."
3777 *) dflt="$dflt -l$thislib";;
3780 echo "No -l$thislib."
3791 ' '|'') dflt='none';;
3796 In order to compile $package on your machine, a number of libraries
3797 are usually needed. Include any other special libraries here as well.
3798 Say "none" for none. The default list is almost always right.
3802 rp="What libraries to use?"
3809 : determine optimization, if desired, or use for debug flag also
3811 ' '|$undef) dflt='none';;
3813 *) dflt="$optimize";;
3817 By default, $package compiles with the -O flag to use the optimizer.
3818 Alternately, you might want to use the symbolic debugger, which uses
3819 the -g flag (on traditional Unix systems). Either flag can be
3820 specified here. To use neither flag, specify the word "none".
3823 rp="What optimizer/debugger flag should be used?"
3827 'none') optimize=" ";;
3831 : We will not override a previous value, but we might want to
3832 : augment a hint file
3834 default|recommended)
3835 case "$gccversion" in
3836 1*) dflt='-fpcc-struct-return' ;;
3839 *-g*) dflt="$dflt -DDEBUGGING";;
3841 case "$gccversion" in
3842 2*) if test -d /etc/conf/kconfig.d &&
3843 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3849 case "$gccversion" in
3853 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3854 echo 'int main(void) { return 0; }' > gcctest.c
3855 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3856 echo "Yes, it does." 2>&1
3859 echo "Leaving current flags $ccflags alone." 2>&1
3861 *) dflt="$dflt -fno-strict-aliasing" ;;
3864 echo "Nope, it doesn't, but that's ok." 2>&1
3871 case "$mips_type" in
3872 *BSD*|'') inclwanted="$locincpth $usrinc";;
3873 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3875 for thisincl in $inclwanted; do
3876 if $test -d $thisincl; then
3877 if $test x$thisincl != x$usrinc; then
3880 *) dflt="$dflt -I$thisincl";;
3886 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3888 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3896 *) dflt="$dflt -D$2";;
3900 set signal.h LANGUAGE_C; eval $inctest
3904 ccflags="$ccflags -DSOCKS"
3909 default|recommended) dflt="$ccflags $dflt" ;;
3910 *) dflt="$ccflags";;
3918 Your C compiler may want other flags. For this question you should include
3919 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3920 but you should NOT include libraries or ld flags like -lwhatever. If you
3921 want $package to honor its debug switch, you should include -DDEBUGGING here.
3922 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3924 To use no flags, specify the word "none".
3930 rp="Any additional cc flags?"
3937 : the following weeds options from ccflags that are of no interest to cpp
3939 case "$gccversion" in
3940 1*) cppflags="$cppflags -D__GNUC__"
3942 case "$mips_type" in
3944 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3950 echo "Let me guess what the preprocessor flags are..." >&4
3964 *) ftry="$previous $flag";;
3966 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3967 >cpp1.out 2>/dev/null && \
3968 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3969 >cpp2.out 2>/dev/null && \
3970 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3971 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3973 cppflags="$cppflags $ftry"
3983 *-*) echo "They appear to be: $cppflags";;
3985 $rm -f cpp.c cpp?.out
3989 : flags used in final linking phase
3991 '') if ./venix; then
3997 *-posix*) dflt="$dflt -posix" ;;
4000 *) dflt="$ldflags";;
4003 : Try to guess additional flags to pick up local libraries.
4004 for thislibdir in $libpth; do
4005 case " $loclibpth " in
4008 *"-L$thislibdir "*) ;;
4009 *) dflt="$dflt -L$thislibdir" ;;
4021 Your C linker may need flags. For this question you should
4022 include -L/whatever and any other flags used by the C linker, but you
4023 should NOT include libraries like -lwhatever.
4025 Make sure you include the appropriate -L/path flags if your C linker
4026 does not normally search all of the directories you specified above,
4029 To use no flags, specify the word "none".
4033 rp="Any additional ld flags (NOT including libraries)?"
4039 rmlist="$rmlist pdp11"
4043 echo "Checking your choice of C compiler and flags for coherency..." >&4
4044 $cat > try.c <<'EOF'
4046 int main() { printf("Ok\n"); exit(0); }
4048 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4050 $cat >try.msg <<'EOM'
4051 I've tried to compile and run the following simple program:
4054 $cat try.c >> try.msg
4056 $cat >> try.msg <<EOM
4063 and I got the following output:
4067 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4068 if sh -c './try' >>try.msg 2>&1; then
4072 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4075 cat >> try.msg <<'EOQS'
4076 If $libs contains -lsfio, and sfio is mis-configured, then it
4077 sometimes (apparently) runs and exits with a 0 status, but with no
4078 output! It may have to do with sfio's use of _exit vs. exit.
4081 rp="You have a big problem. Shall I abort Configure"
4088 echo "The program compiled OK, but exited with status $?." >>try.msg
4089 rp="You have a problem. Shall I abort Configure"
4093 echo "I can't compile the test program." >>try.msg
4094 rp="You have a BIG problem. Shall I abort Configure"
4100 case "$knowitall" in
4102 echo "(The supplied flags or libraries might be incorrect.)"
4110 *) echo "Ok. Stopping Configure." >&4
4115 n) echo "OK, that should do.";;
4117 $rm -f try try.* core
4119 : define an is-a-typedef? function
4120 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4122 "") inclist="sys/types.h";;
4124 eval "varval=\$$var";
4128 for inc in $inclist; do
4129 echo "#include <$inc>" >>temp.c;
4131 echo "#ifdef $type" >> temp.c;
4132 echo "printf(\"We have $type\");" >> temp.c;
4133 echo "#endif" >> temp.c;
4134 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4135 if $contains $type temp.E >/dev/null 2>&1; then
4141 *) eval "$var=\$varval";;
4144 : define an is-a-typedef? function that prompts if the type is not available.
4145 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4147 "") inclist="sys/types.h";;
4149 eval "varval=\$$var";
4153 for inc in $inclist; do
4154 echo "#include <$inc>" >>temp.c;
4156 echo "#ifdef $type" >> temp.c;
4157 echo "printf(\"We have $type\");" >> temp.c;
4158 echo "#endif" >> temp.c;
4159 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4161 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4162 if $contains $type temp.E >/dev/null 2>&1; then
4163 echo "$type found." >&4;
4166 echo "$type NOT found." >&4;
4172 *) eval "$var=\$varval";;
4175 : define a shorthand compile call
4179 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4180 : define a shorthand compile call for compilations that should be ok.
4184 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4186 : check for lengths of integral types
4190 echo "Checking to see how big your integers are..." >&4
4191 $cat >intsize.c <<'EOCP'
4195 printf("intsize=%d;\n", (int)sizeof(int));
4196 printf("longsize=%d;\n", (int)sizeof(long));
4197 printf("shortsize=%d;\n", (int)sizeof(short));
4202 if eval $compile_ok && ./intsize > /dev/null; then
4204 echo "Your integers are $intsize bytes long."
4205 echo "Your long integers are $longsize bytes long."
4206 echo "Your short integers are $shortsize bytes long."
4210 Help! I can't compile and run the intsize test program: please enlighten me!
4211 (This is probably a misconfiguration in your system or libraries, and
4212 you really ought to fix it. Still, I'll try anyway.)
4216 rp="What is the size of an integer (in bytes)?"
4220 rp="What is the size of a long integer (in bytes)?"
4224 rp="What is the size of a short integer (in bytes)?"
4230 $rm -f intsize intsize.*
4232 : see what type lseek is declared as in the kernel
4233 rp="What is the type used for lseek's offset on this system?"
4234 set off_t lseektype long stdio.h sys/types.h
4238 $echo $n "Checking to see how big your file offsets are...$c" >&4
4240 #include <sys/types.h>
4244 printf("%d\n", (int)sizeof($lseektype));
4249 if eval $compile_ok; then
4251 $echo " $lseeksize bytes." >&4
4255 echo "(I can't seem to compile the test program. Guessing...)"
4256 rp="What is the size of your file offsets (in bytes)?"
4262 : see what type file positions are declared as in the library
4263 rp="What is the type for file position used by fsetpos()?"
4264 set fpos_t fpostype long stdio.h sys/types.h
4269 *_t) zzz="$fpostype" ;;
4272 $echo $n "Checking the size of $zzz...$c" >&4
4274 #include <sys/types.h>
4277 printf("%d\n", (int)sizeof($fpostype));
4282 if eval $compile_ok; then
4287 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4290 echo " $fpossize bytes."
4296 echo "(I can't compile the test program. Guessing...)" >&4
4297 rp="What is the size of your file positions (in bytes)?"
4304 case "$lseeksize:$fpossize" in
4307 You can have files larger than 2 gigabytes.
4312 Perl can be built to understand large files (files larger than 2 gigabytes)
4313 on some systems. To do so, Configure must be run with -Duselargefiles.
4315 If this doesn't make any sense to you, just accept the default 'y'.
4317 case "$uselargefiles" in
4318 "$undef"|false|[nN]*) dflt='n' ;;
4321 rp='Try to understand large files, if available?'
4324 y|Y) val="$define" ;;
4331 case "$uselargefiles" in
4333 : Look for a hint-file generated 'call-back-unit'. If the
4334 : user has specified that a large files perl is to be built,
4335 : we may need to set or change some other defaults.
4336 if $test -f uselfs.cbu; then
4337 echo "Your platform has some specific hints for large file builds, using them..."
4340 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4342 #include <sys/types.h>
4346 printf("%d\n", (int)sizeof($lseektype));
4351 if eval $compile_ok; then
4353 $echo " $lseeksize bytes." >&4
4357 echo "(I can't seem to compile the test program. Guessing...)"
4358 rp="What is the size of your file offsets (in bytes)?"
4363 *_t) zzz="$fpostype" ;;
4366 $echo $n "Rechecking the size of $zzz...$c" >&4
4368 #include <sys/types.h>
4371 printf("%d\n", (int)sizeof($fpostype));
4376 if eval $compile_ok; then
4381 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4384 echo " $fpossize bytes."
4390 echo "(I can't compile the test program. Guessing...)" >&4
4391 rp="What is the size of your file positions (in bytes)?"
4401 case "$usemorebits" in
4402 "$define"|true|[yY]*)
4404 uselongdouble="$define"
4405 usemorebits="$define"
4407 *) usemorebits="$undef"
4412 case "$intsize:$longsize" in
4415 You have natively 64-bit integers.
4420 Perl can be built to take advantage of 64-bit integer types
4421 on some systems. To do so, Configure must be run with -Duse64bits.
4423 If this doesn't make any sense to you, just accept the default.
4425 case "$use64bits" in
4426 $define|true|[yY]*) dflt='y';;
4429 rp='Try to use 64-bit integers, if available?'
4432 y|Y) val="$define" ;;
4440 case "$archname64" in
4441 '') archname64='' ;; # not a typo
4444 case "$use64bits" in
4445 "$define"|true|[yY]*)
4446 : Look for a hint-file generated 'call-back-unit'. If the
4447 : user has specified that a 64-bit perl is to be built,
4448 : we may need to set or change some other defaults.
4449 if $test -f use64bits.cbu; then
4450 echo "Your platform has some specific hints for 64-bit builds, using them..."
4454 (Your platform doesn't have any specific hints for 64-bit builds.)
4456 case "$intsize:$longsize" in
4458 (This is probably okay, as your system is a natively 64-bit system.)
4462 case "$gccversion" in
4464 *) case "$ccflags" in
4465 *-DUSE_LONG_LONG*) ;;
4467 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4468 to the compilation flags.
4470 ccflags="$ccflags -DUSE_LONG_LONG"
4479 : determine the architecture name
4481 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4482 tarch=`arch`"-$osname"
4483 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4484 if uname -m > tmparch 2>&1 ; then
4485 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4486 -e 's/$/'"-$osname/" tmparch`
4494 case "$myarchname" in
4497 echo "(Your architecture name used to be $myarchname.)"
4504 *) dflt="$archname";;
4506 rp='What is your architecture name'
4509 case "$usethreads" in
4511 echo "Threads selected." >&4
4513 *-thread*) echo "...and architecture name already has -thread." >&4
4515 *) archname="$archname-thread"
4516 echo "...setting architecture name to $archname." >&4
4521 case "$usemultiplicity" in
4523 echo "Multiplicity selected." >&4
4525 *-multi*) echo "...and architecture name already has -multi." >&4
4527 *) archname="$archname-multi"
4528 echo "...setting architecture name to $archname." >&4
4533 case "$use64bits" in
4535 case "$archname64" in
4540 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4542 *) archname="$archname-$archname64"
4543 echo "...setting architecture name to $archname." >&4
4550 : determine root of directory hierarchy where package will be installed.
4553 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4561 By default, $package will be installed in $dflt/bin, manual pages
4562 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4563 installation directories. Typically this is something like /usr/local.
4564 If you wish to have binaries under /usr/bin but other parts of the
4565 installation under /usr/local, that's ok: you will be prompted
4566 separately for each of the installation directories, the prefix being
4567 only used to set the defaults.
4571 rp='Installation prefix to use?'
4579 *) oldprefix="$prefix";;
4589 $define|true) afs=true ;;
4590 $undef|false) afs=false ;;
4591 *) if test -d /afs; then
4599 echo "AFS may be running... I'll be extra cautious then..." >&4
4601 echo "AFS does not seem to be running..." >&4
4604 : determine installation prefix for where package is to be installed.
4608 Since you are running AFS, I need to distinguish the directory in which
4609 files will reside from the directory in which they are installed (and from
4610 which they are presumably copied to the former directory by occult means).
4613 case "$installprefix" in
4614 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4615 *) dflt="$installprefix";;
4620 In some special cases, particularly when building $package for distribution,
4621 it is convenient to distinguish between the directory in which files should
4622 be installed from the directory ($prefix) in which they
4623 will eventually reside. For most users, these two directories are the same.
4626 case "$installprefix" in
4628 *) dflt=$installprefix;;
4632 rp='What installation prefix should I use for installing files?'
4634 installprefix="$ans"
4635 installprefixexp="$ansexp"
4637 : set the prefixit variable, to compute a suitable default value
4638 prefixit='case "$3" in
4640 case "$oldprefix" in
4641 "") eval "$1=\"\$$2\"";;
4648 ""|" ") eval "$1=\"\$$2\"";;
4654 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4656 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4657 /*-$oldprefix/*|\~*-$oldprefix/*)
4658 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4659 *) eval "$1=\"\$$2\"";;
4663 : set the base revision
4667 : get the patchlevel
4669 echo "Getting the current patchlevel..." >&4
4670 if $test -r $rsrc/patchlevel.h;then
4671 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4672 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4673 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4674 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4675 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4683 $echo $n "(You have $package" $c
4686 *) $echo $n " $baserev" $c ;;
4688 $echo $n " patchlevel $patchlevel" $c
4689 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4692 dos|cygwin|vms|win32)
4693 : XXX Should be a Configure test for double-dots in filenames.
4694 version=`echo $baserev $patchlevel $subversion | \
4695 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4696 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4697 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4700 version=`echo $baserev $patchlevel $subversion | \
4701 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4702 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4703 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4706 : Special case the 5.005_xx maintenance series, which used 5.005
4707 : without any subversion label as a subdirectory in $sitelib
4708 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4709 api_versionstring='5.005'
4712 : determine installation style
4713 : For now, try to deduce it from prefix unless it is already set.
4714 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4715 case "$installstyle" in
4716 '') case "$prefix" in
4717 *perl*) dflt='lib';;
4718 *) dflt='lib/perl5' ;;
4721 *) dflt='lib/perl5' ;;
4723 : Probably not worth prompting for this since we prompt for all
4724 : the directories individually, and the prompt would be too long and
4728 : determine where private library files go
4729 : Usual default is /usr/local/lib/perl5/$version.
4730 : Also allow things like /opt/perl/lib/$version, since
4731 : /opt/perl/lib/perl5... would be redundant.
4732 : The default "style" setting is made in installstyle.U
4733 case "$installstyle" in
4734 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4735 *) set dflt privlib lib/$version ;;
4740 There are some auxiliary files for $package that need to be put into a
4741 private library directory that is accessible by everyone.
4745 rp='Pathname where the private library files will reside?'
4748 privlibexp="$ansexp"
4749 : Change installation prefix, if necessary.
4750 if $test X"$prefix" != X"$installprefix"; then
4751 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4753 installprivlib="$privlibexp"
4756 : set the prefixup variable, to restore leading tilda escape
4757 prefixup='case "$prefixexp" in
4759 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4762 : determine where public architecture dependent libraries go
4765 : privlib default is /usr/local/lib/$package/$version
4766 : archlib default is /usr/local/lib/$package/$version/$archname
4767 : privlib may have an optional trailing /share.
4768 tdflt=`echo $privlib | $sed 's,/share$,,'`
4769 tdflt=$tdflt/$archname
4778 $spackage contains architecture-dependent library files. If you are
4779 sharing libraries in a heterogeneous environment, you might store
4780 these files in a separate location. Otherwise, you can just include
4781 them with the rest of the public library files.
4785 rp='Where do you want to put the public architecture-dependent libraries?'
4788 archlibexp="$ansexp"
4789 if $test X"$archlib" = X"$privlib"; then
4794 : Change installation prefix, if necessary.
4795 if $test X"$prefix" != X"$installprefix"; then
4796 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4798 installarchlib="$archlibexp"
4802 : Binary compatibility with 5.005 is not possible for builds
4803 : with advanced features
4804 case "$usethreads$usemultiplicity" in
4806 bincompat5005="$undef"
4807 d_bincompat5005="$undef"
4811 Perl 5.006 can be compiled for binary compatibility with 5.005.
4812 If you decide to do so, you will be able to continue using most
4813 of the extensions that were compiled for Perl 5.005.
4816 case "$bincompat5005$d_bincompat5005" in
4817 *"$undef"*) dflt=n ;;
4820 rp='Binary compatibility with Perl 5.005?'
4823 y*) val="$define" ;;
4828 case "$d_bincompat5005" in
4830 bincompat5005="$define"
4832 *) bincompat5005="$undef"
4833 d_bincompat5005="$undef"
4840 : see if setuid scripts can be secure
4843 Some kernels have a bug that prevents setuid #! scripts from being
4844 secure. Some sites have disabled setuid #! scripts because of this.
4846 First let's decide if your kernel supports secure setuid #! scripts.
4847 (If setuid #! scripts would be secure but have been disabled anyway,
4848 don't say that they are secure if asked.)
4853 if $test -d /dev/fd; then
4854 echo "#!$ls" >reflect
4855 chmod +x,u+s reflect
4856 ./reflect >flect 2>&1
4857 if $contains "/dev/fd" flect >/dev/null; then
4858 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4862 If you are not sure if they are secure, I can check but I'll need a
4863 username and password different from the one you are using right now.
4864 If you don't have such a username or don't want me to test, simply
4868 rp='Other username to test security of setuid scripts with?'
4873 case "$d_suidsafe" in
4874 '') echo "I'll assume setuid scripts are *not* secure." >&4
4877 echo "Well, the $hint value is *not* secure." >&4
4879 *) echo "Well, the $hint value *is* secure." >&4
4884 $rm -f reflect flect
4885 echo "#!$ls" >reflect
4886 chmod +x,u+s reflect
4889 echo '"su" will (probably) prompt you for '"$ans's password."
4890 su $ans -c './reflect >flect'
4891 if $contains "/dev/fd" flect >/dev/null; then
4892 echo "Okay, it looks like setuid scripts are secure." >&4
4895 echo "I don't think setuid scripts are secure." >&4
4900 rp='Does your kernel have *secure* setuid scripts?'
4903 [yY]*) val="$define";;
4908 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4909 echo "(That's for file descriptors, not floppy disks.)"
4915 $rm -f reflect flect
4917 : now see if they want to do setuid emulation
4920 case "$d_suidsafe" in
4923 echo "No need to emulate SUID scripts since they are secure here." >& 4
4927 Some systems have disabled setuid scripts, especially systems where
4928 setuid scripts cannot be secure. On systems where setuid scripts have
4929 been disabled, the setuid/setgid bits on scripts are currently
4930 useless. It is possible for $package to detect those bits and emulate
4931 setuid/setgid in a secure fashion. This emulation will only work if
4932 setuid scripts have been disabled in your kernel.
4936 "$define") dflt=y ;;
4939 rp="Do you want to do setuid/setgid emulation?"
4942 [yY]*) val="$define";;
4950 : determine filename position in cpp output
4952 echo "Computing filename position in cpp output for #include directives..." >&4
4953 echo '#include <stdio.h>' > foo.c
4956 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4957 $grep '^[ ]*#.*stdio\.h' | \
4958 while read cline; do
4961 while $test \$# -gt 0; do
4962 if $test -r \`echo \$1 | $tr -d '"'\`; then
4967 pos=\`expr \$pos + 1\`
4979 *) pos="${fieldn}th";;
4981 echo "Your cpp writes the filename in the $pos field of the line."
4983 : locate header file
4988 for usrincdir in $usrinc
4990 if test -f \$usrincdir/\$wanted; then
4991 echo "\$usrincdir/\$wanted"
4995 awkprg='{ print \$$fieldn }'
4996 echo "#include <\$wanted>" > foo\$\$.c
4997 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4998 $grep "^[ ]*#.*\$wanted" | \
4999 while read cline; do
5000 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5002 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5003 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5008 # status = 0: grep returned 0 lines, case statement not executed
5009 # status = 1: headerfile found
5010 # status = 2: while loop executed, no headerfile found
5014 if test \$status -eq 1; then
5021 : define an alternate in-header-list? function
5022 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5023 cont=true; xxf="echo \"<\$1> found.\" >&4";
5024 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5025 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5027 case $# in 4) instead=instead;; *) instead="at last";; esac;
5028 while $test "$cont"; do
5030 var=$2; eval "was=\$$2";
5031 if $test "$xxx" && $test -r "$xxx";
5033 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5036 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5037 set $yyy; shift; shift; yyy=$@;
5038 case $# in 0) cont="";;
5039 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5040 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5041 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5042 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5046 do set $yyy; var=$2; eval "was=\$$2";
5047 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5048 set $yyy; shift; shift; yyy=$@;
5051 : see if this is a malloc.h system
5052 set malloc.h i_malloc
5055 : see if stdlib is available
5056 set stdlib.h i_stdlib
5059 : determine which malloc to compile in
5061 case "$usemymalloc" in
5062 ''|[yY]*|true|$define) dflt='y' ;;
5065 rp="Do you wish to attempt to use the malloc that comes with $package?"
5071 mallocsrc='malloc.c'
5072 mallocobj="malloc$_o"
5073 d_mymalloc="$define"
5076 : Remove malloc from list of libraries to use
5077 echo "Removing unneeded -lmalloc from library list" >&4
5078 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5081 echo "libs = $libs" >&4
5093 : compute the return types of malloc and free
5095 $cat >malloc.c <<END
5099 #include <sys/types.h>
5113 case "$malloctype" in
5115 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5122 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5126 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5133 echo "Your system uses $freetype free(), it would seem." >&4
5137 The installation process will also create a directory for
5138 vendor-supplied add-ons. Vendors who supply perl with their system
5139 may find it convenient to place all vendor-supplied files in this
5140 directory rather than in the main distribution directory. This will
5141 ease upgrades between binary-compatible maintenance versions of perl.
5143 Of course you may also use these directories in whatever way you see
5144 fit. For example, you might use them to access modules shared over a
5145 company-wide network.
5147 The default answer should be fine for most people.
5148 This causes further questions about vendor add-ons to be skipped
5149 and no vendor-specific directories will be configured for perl.
5152 rp='Do you want to configure vendor-specific add-on directories?'
5153 case "$usevendorprefix" in
5154 define|true|[yY]*) dflt=y ;;
5160 rp='Installation prefix to use for vendor-supplied add-ons?'
5161 case "$vendorprefix" in
5163 *) dflt=$vendorprefix ;;
5167 case "$vendorprefix" in
5171 *) oldvendorprefix="$prefix";;
5175 usevendorprefix="$define"
5177 vendorprefixexp="$ansexp"
5179 *) usevendorprefix="$undef"
5185 case "$vendorprefix" in
5186 '') d_vendorlib="$undef"
5190 *) d_vendorlib="$define"
5191 : determine where vendor-supplied modules go.
5192 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5193 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5194 case "$installstyle" in
5195 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5196 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5199 rp='Pathname for the vendor-supplied library files?'
5202 vendorlibexp="$ansexp"
5203 : Change installation prefix, if necessary.
5204 if $test X"$prefix" != X"$installprefix"; then
5205 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5207 installvendorlib="$vendorlibexp"
5212 : Cruising for prototypes
5214 echo "Checking out function prototypes..." >&4
5215 $cat >prototype.c <<'EOCP'
5216 int main(int argc, char *argv[]) {
5219 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5220 echo "Your C compiler appears to support function prototypes."
5223 echo "Your C compiler doesn't seem to understand function prototypes."
5230 case "$prototype" in
5232 *) ansi2knr='ansi2knr'
5237 This version of $package can only be compiled by a compiler that
5238 understands function prototypes. Unfortunately, your C compiler
5240 doesn't seem to understand them. Sorry about that.
5242 If GNU cc is available for your system, perhaps you could try that instead.
5244 Eventually, we hope to support building Perl with pre-ANSI compilers.
5245 If you would like to help in that effort, please contact <perlbug@perl.org>.
5247 Aborting Configure now.
5253 : determine where public executables go
5258 rp='Pathname where the public executables will reside?'
5260 if $test "X$ansexp" != "X$binexp"; then
5265 : Change installation prefix, if necessary.
5266 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5267 if $test X"$prefix" != X"$installprefix"; then
5268 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5270 installbin="$binexp"
5275 After $package is installed, you may wish to install various
5276 add-on modules and utilities. Typically, these add-ons will
5277 be installed under $prefix with the rest
5278 of this package. However, you may wish to install such add-ons
5279 elsewhere under a different prefix.
5281 If you do not wish to put everything under a single prefix, that's
5282 ok. You will be prompted for the individual locations; this siteprefix
5283 is only used to suggest the defaults.
5285 The default should be fine for most people.
5289 rp='Installation prefix to use for add-on modules and utilities?'
5290 : XXX Here might be another good place for an installstyle setting.
5291 case "$siteprefix" in
5293 *) dflt=$siteprefix ;;
5297 case "$siteprefix" in
5302 *) oldsiteprefix="$prefix";;
5307 siteprefixexp="$ansexp"
5309 : determine where site specific libraries go.
5310 : Usual default is /usr/local/lib/perl5/site_perl/$version
5311 : The default "style" setting is made in installstyle.U
5312 : XXX No longer works with Prefixit stuff.
5313 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5314 case "$installstyle" in
5315 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5316 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5320 The installation process will create a directory for
5321 site-specific extensions and modules. Most users find it convenient
5322 to place all site-specific files in this directory rather than in the
5323 main distribution directory.
5327 rp='Pathname for the site-specific library files?'
5330 sitelibexp="$ansexp"
5331 : Change installation prefix, if necessary.
5332 if $test X"$prefix" != X"$installprefix"; then
5333 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5335 installsitelib="$sitelibexp"
5338 : Determine list of previous versions to include in @INC
5339 $cat > getverlist <<EOPL
5342 \$api_versionstring = "$api_versionstring";
5343 \$version = "$version";
5344 \$sitelib = "$sitelib";
5345 \$archname = "$archname";
5347 $cat >> getverlist <<'EOPL'
5348 # Can't have leading @ because metaconfig interprets it as a command!
5349 ;@inc_version_list=();
5350 $stem=dirname($sitelib);
5351 # Redo to do opendir/readdir?
5354 ;@candidates = glob("5.*");
5360 # XXX ToDo: These comparisons must be reworked when two-digit
5361 # subversions come along, so that 5.7.10 compares as greater than
5362 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5363 # widespread that we can use the built-in version vectors rather
5364 # than reinventing them here. For 5.6.0, however, we must
5365 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5366 foreach $d (@candidates) {
5367 if ($d lt $version) {
5368 if ($d ge $api_versionstring) {
5369 unshift(@inc_version_list, "$d/$archname", $d);
5371 elsif ($d ge "5.005") {
5372 unshift(@inc_version_list, $d);
5376 # Skip newer version. I.e. don't look in
5377 # 5.7.0 if we're installing 5.6.1.
5381 if (@inc_version_list) {
5382 print join(' ', @inc_version_list);
5385 # Blank space to preserve value for next Configure run.
5390 case "$inc_version_list" in
5391 '') if test -x $perl; then
5392 dflt=`$perl getverlist`
5397 $undef) dflt='none' ;;
5398 *) dflt="$inc_version_list" ;;
5402 In order to ease the process of upgrading, this version of perl
5403 can be configured to use modules built and installed with earlier
5404 versions of perl that were installed under $prefix. Specify here
5405 the list of earlier versions that this version of perl should check.
5406 If Configure detected no earlier versions of perl installed under
5407 $prefix, then the list will be empty. Answer 'none' to tell perl
5408 to not search earlier versions.
5410 The default should almost always be sensible, so if you're not sure,
5411 just accept the default.
5414 rp='List of earlier versions to include in @INC?'
5417 [Nn]one) inc_version_list=' ' ;;
5418 *) inc_version_list="$ans" ;;
5420 case "$inc_version_list" in
5422 inc_version_list_init='""';;
5423 *) inc_version_list_init=`echo $inc_version_list |
5424 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/"/'`
5429 : determine whether to install perl also as /usr/bin/perl
5432 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5434 Many scripts expect to perl to be installed as /usr/bin/perl.
5435 I can install the perl you are about to compile also as /usr/bin/perl
5436 (in addition to $installbin/perl).
5438 case "$installusrbinperl" in
5439 "$undef"|[nN]*) dflt='n';;
5442 rp="Do you want to install perl as /usr/bin/perl?"
5445 [yY]*) val="$define";;
5451 set installusrbinperl
5455 echo "Checking for GNU C Library..." >&4
5456 cat >gnulibc.c <<EOM
5468 if eval $compile_ok && ./gnulibc; then
5470 echo "You are using the GNU C Library"
5473 echo "You are not using the GNU C Library"
5479 : see if nm is to be used to determine whether a symbol is defined or not
5483 case "$d_gnulibc" in
5486 echo "nm probably won't work on the GNU C Library." >&4
5492 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5494 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5495 echo "'nm' won't be sufficient on this sytem." >&4
5501 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5502 if $test $dflt -gt 20; then
5512 true|$define) dflt=y;;
5519 I can use $nm to extract the symbols from your C libraries. This
5520 is a time consuming task which may generate huge output on the disk (up
5521 to 3 megabytes) but that should make the symbols extraction faster. The
5522 alternative is to skip the 'nm' extraction part and to compile a small
5523 test program instead to determine whether each symbol is present. If
5524 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5525 this may be the best solution.
5527 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5530 rp="Shall I use $nm to extract C symbols from the libraries?"
5533 [Nn]*) usenm=false;;
5542 : nm options which may be necessary
5544 '') if $test -f /mach_boot; then
5546 elif $test -d /usr/ccs/lib; then
5547 nm_opt='-p' # Solaris (and SunOS?)
5548 elif $test -f /dgux; then
5550 elif $test -f /lib64/rld; then
5551 nm_opt='-p' # 64-bit Irix
5557 : nm options which may be necessary for shared libraries but illegal
5558 : for archive libraries. Thank you, Linux.
5559 case "$nm_so_opt" in
5560 '') case "$myuname" in
5562 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5563 nm_so_opt='--dynamic'
5572 : get list of predefined functions in a handy place
5577 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5584 *) for thislib in $libs; do
5587 : Handle C library specially below.
5590 thislib=`echo $thislib | $sed -e 's/^-l//'`
5591 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5593 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5595 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5597 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5599 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5601 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5603 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5608 libnames="$libnames $try"
5610 *) libnames="$libnames $thislib" ;;
5619 for xxx in $libpth; do
5620 $test -r $1 || set $xxx/libc.$so
5621 : The messy sed command sorts on library version numbers.
5623 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5624 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5626 s/[0-9][0-9]*/0000&/g
5627 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5630 sort | $sed -e 's/^.* //'`
5633 $test -r $1 || set /usr/ccs/lib/libc.$so
5634 $test -r $1 || set /lib/libsys_s$_a
5640 if $test -r "$1"; then
5641 echo "Your (shared) C library seems to be in $1."
5643 elif $test -r /lib/libc && $test -r /lib/clib; then
5644 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5646 libc='/lib/clib /lib/libc'
5647 if $test -r /lib/syslib; then
5648 echo "(Your math library is in /lib/syslib.)"
5649 libc="$libc /lib/syslib"
5651 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5652 echo "Your C library seems to be in $libc, as you said before."
5653 elif $test -r $incpath/usr/lib/libc$_a; then
5654 libc=$incpath/usr/lib/libc$_a;
5655 echo "Your C library seems to be in $libc. That's fine."
5656 elif $test -r /lib/libc$_a; then
5658 echo "Your C library seems to be in $libc. You're normal."
5660 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5662 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5663 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5664 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5666 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5668 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5671 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5673 if $test -r "$tans"; then
5674 echo "Your C library seems to be in $tans, of all places."
5680 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5684 If the guess above is wrong (which it might be if you're using a strange
5685 compiler, or your machine supports multiple models), you can override it here.
5690 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5692 I can't seem to find your C library. I've looked in the following places:
5695 $sed 's/^/ /' libpath
5698 None of these seems to contain your C library. I need to get its name...
5703 rp='Where is your C library?'
5708 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5709 set X `cat libnames`
5712 case $# in 1) xxx=file; esac
5713 echo "Extracting names from the following $xxx for later perusal:" >&4
5715 $sed 's/^/ /' libnames >&4
5717 $echo $n "This may take a while...$c" >&4
5721 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5722 *) $nm $nm_opt $file 2>/dev/null;;
5727 $grep fprintf libc.tmp > libc.ptf
5728 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5729 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5731 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5735 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5737 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5739 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5741 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5743 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5745 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5747 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5749 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5751 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5753 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5755 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5756 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5758 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5760 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5762 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5764 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5766 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5768 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5770 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5772 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5774 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5776 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5778 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5780 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5782 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5784 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5786 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5789 $nm -p $* 2>/dev/null >libc.tmp
5790 $grep fprintf libc.tmp > libc.ptf
5791 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5792 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5798 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5800 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5801 for thisname in $libnames $libc; do
5802 $ar t $thisname >>libc.tmp
5804 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5806 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5807 # Repeat libc to extract forwarders to DLL entries too
5808 for thisname in $libnames $libc; do
5809 $ar tv $thisname >>libc.tmp
5810 # Revision 50 of EMX has bug in $ar.
5811 # it will not extract forwarders to DLL entries
5812 # Use emximp which will extract exactly them.
5813 emximp -o tmp.imp $thisname \
5815 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5816 < tmp.imp >>libc.tmp
5819 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5822 echo "$ar didn't seem to work right." >&4
5823 echo "Maybe this is a Cray...trying bld instead..." >&4
5824 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5826 for thisname in $libnames; do
5828 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5829 $ar t $thisname >>libc.tmp
5833 echo "That didn't work either. Giving up." >&4
5840 if $test -f /lib/syscalls.exp; then
5842 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5843 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5847 $rm -f libnames libpath
5849 : see if dld is available
5853 : is a C symbol defined?
5856 -v) tf=libc.tmp; tc=""; tdc="";;
5857 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5858 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5861 case "$reuseval-$4" in
5863 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5869 if $contains $tlook $tf >/dev/null 2>&1;
5874 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5875 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5883 $define) tval=true;;
5889 : define an is-in-libc? function
5890 inlibc='echo " "; td=$define; tu=$undef;
5891 sym=$1; var=$2; eval "was=\$$2";
5893 case "$reuseval$was" in
5903 echo "$sym() found." >&4;
5904 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5906 echo "$sym() NOT found." >&4;
5907 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5911 $define) echo "$sym() found." >&4;;
5912 *) echo "$sym() NOT found." >&4;;
5916 : see if dlopen exists
5923 : determine which dynamic loading, if any, to compile in
5925 dldir="ext/DynaLoader"
5938 $define) dflt='y' ;;
5941 $define) dflt='y' ;;
5943 : Does a dl_xxx.xs file exist for this operating system
5944 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5947 rp="Do you wish to use dynamic loading?"
5954 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5955 dflt="$dldir/dl_${osname}.xs"
5956 elif $test "$d_dlopen" = "$define" ; then
5957 dflt="$dldir/dl_dlopen.xs"
5958 elif $test "$i_dld" = "$define" ; then
5959 dflt="$dldir/dl_dld.xs"
5964 *) dflt="$dldir/$dlsrc"
5967 echo "The following dynamic loading files are available:"
5968 : Can not go over to $dldir because getfile has path hard-coded in.
5969 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5970 rp="Source file to use for dynamic loading"
5976 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5980 Some systems may require passing special flags to $cc -c to
5981 compile modules that will be used to create a shared library.
5982 To use no flags, say "none".
5985 case "$cccdlflags" in
5986 '') case "$gccversion" in
5987 '') case "$osname" in
5989 next) dflt='none' ;;
5990 irix*) dflt='-KPIC' ;;
5991 svr4*|esix*|solaris) dflt='-KPIC' ;;
5992 sunos) dflt='-pic' ;;
5996 *) case "$osname" in
5997 svr4*|esix*|solaris) dflt='-fPIC' ;;
6002 *) dflt="$cccdlflags" ;;
6004 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6007 none) cccdlflags=' ' ;;
6008 *) cccdlflags="$ans" ;;
6013 Some systems use ld to create libraries that can be dynamically loaded,
6014 while other systems (such as those using ELF) use $cc.
6018 '') $cat >try.c <<'EOM'
6019 /* Test for whether ELF binaries are produced */
6024 int i = open("a.out",O_RDONLY);
6027 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6028 exit(0); /* succeed (yes, it's ELF) */
6033 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6035 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6039 echo "I'll use ld to build dynamic libraries."
6048 rp="What command should be used to create dynamic libraries?"
6054 Some systems may require passing special flags to $ld to create a
6055 library that can be dynamically loaded. If your ld flags include
6056 -L/other/path options to locate libraries outside your loader's normal
6057 search path, you may need to specify those -L options here as well. To
6058 use no flags, say "none".
6061 case "$lddlflags" in
6062 '') case "$osname" in
6063 beos) dflt='-nostart' ;;
6065 linux|irix*) dflt='-shared' ;;
6066 next) dflt='none' ;;
6067 solaris) dflt='-G' ;;
6068 sunos) dflt='-assert nodefinitions' ;;
6069 svr4*|esix*) dflt="-G $ldflags" ;;
6073 *) dflt="$lddlflags" ;;
6076 : Try to guess additional flags to pick up local libraries.
6077 : Be careful not to append to a plain 'none'
6081 for thisflag in $ldflags; do
6086 *) dflt="$dflt $thisflag" ;;
6093 ''|' ') dflt='none' ;;
6096 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6099 none) lddlflags=' ' ;;
6100 *) lddlflags="$ans" ;;
6105 Some systems may require passing special flags to $cc to indicate that
6106 the resulting executable will use dynamic linking. To use no flags,
6110 case "$ccdlflags" in
6111 '') case "$osname" in
6112 hpux) dflt='-Wl,-E' ;;
6113 linux) dflt='-rdynamic' ;;
6114 next) dflt='none' ;;
6115 sunos) dflt='none' ;;
6119 *) dflt="$ccdlflags" ;;
6121 rp="Any special flags to pass to $cc to use dynamic linking?"
6124 none) ccdlflags=' ' ;;
6125 *) ccdlflags="$ans" ;;
6139 # No dynamic loading being used, so don't bother even to prompt.
6142 *) case "$useshrplib" in
6143 '') case "$osname" in
6144 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6146 also='Building a shared libperl is required for dynamic loading to work on your system.'
6151 also='Building a shared libperl is needed for MAB support.'
6169 The perl executable is normally obtained by linking perlmain.c with
6170 libperl${_a}, any static extensions (usually just DynaLoader), and
6171 any other libraries needed on this system (such as -lm, etc.). Since
6172 your system supports dynamic loading, it is probably possible to build
6173 a shared libperl.$so. If you will have more than one executable linked
6174 to libperl.$so, this will significantly reduce the size of each
6175 executable, but it may have a noticeable affect on performance. The
6176 default is probably sensible for your system.
6180 rp="Build a shared libperl.$so (y/n)"
6184 useshrplib='true' ;;
6185 *) useshrplib='false' ;;
6190 case "$useshrplib" in
6194 # Figure out a good name for libperl.so. Since it gets stored in
6195 # a version-specific architecture-dependent library, the version
6196 # number isn't really that important, except for making cc/ld happy.
6198 # A name such as libperl.so.3.1
6199 majmin="libperl.$so.$patchlevel.$subversion"
6200 # A name such as libperl.so.301
6201 majonly=`echo $patchlevel $subversion |
6202 $awk '{printf "%d%02d", $1, $2}'`
6203 majonly=libperl.$so.$majonly
6204 # I'd prefer to keep the os-specific stuff here to a minimum, and
6205 # rely on figuring it out from the naming of libc.
6206 case "${osname}${osvers}" in
6209 # XXX How handle the --version stuff for MAB?
6211 linux*) # ld won't link with a bare -lperl otherwise.
6214 cygwin*) # include version
6215 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6217 *) # Try to guess based on whether libc has major.minor.
6219 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6220 *libc.$so.[0-9]*) dflt=$majonly ;;
6221 *) dflt=libperl.$so ;;
6231 I need to select a good name for the shared libperl. If your system uses
6232 library names with major and minor numbers, then you might want something
6233 like $majmin. Alternatively, if your system uses a single version
6234 number for shared libraries, then you might want to use $majonly.
6235 Or, your system might be quite happy with a simple libperl.$so.
6237 Since the shared libperl will get installed into a version-specific
6238 architecture-dependent directory, the version number of the shared perl
6239 library probably isn't important, so the default should be o.k.
6242 rp='What name do you want to give to the shared libperl?'
6245 echo "Ok, I'll use $libperl"
6248 libperl="libperl${_a}"
6252 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6256 WARNING: Use of the shrpdir variable for the installation location of
6257 the shared $libperl is not supported. It was never documented and
6258 will not work in this version. Let me (perlbug@perl.com)
6259 know of any problems this may cause.
6265 But your current setting of $shrpdir is
6266 the default anyway, so it's harmless.
6271 Further, your current attempted setting of $shrpdir
6272 conflicts with the value of $archlibexp/CORE
6273 that installperl will use.
6280 # How will the perl executable find the installed shared $libperl?
6281 # Add $xxx to ccdlflags.
6282 # If we can't figure out a command-line option, use $shrpenv to
6283 # set env LD_RUN_PATH. The main perl makefile uses this.
6284 shrpdir=$archlibexp/CORE
6287 if "$useshrplib"; then
6290 # We'll set it in Makefile.SH...
6296 xxx="-Wl,-R$shrpdir"
6298 linux|irix*|dec_osf)
6299 xxx="-Wl,-rpath,$shrpdir"
6302 # next doesn't like the default...
6305 # beos doesn't like the default, either.
6308 # hpux doesn't like the default, either.
6309 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6312 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6318 # Only add $xxx if it isn't already in ccdlflags.
6319 case " $ccdlflags " in
6321 *) ccdlflags="$ccdlflags $xxx"
6324 Adding $xxx to the flags
6325 passed to $ld so that the perl executable will find the
6326 installed shared $libperl.
6334 # Fix ccdlflags in AIX for building external extensions.
6335 # (For building Perl itself bare -bE:perl.exp is needed,
6336 # Makefile.SH takes care of this.)
6338 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6340 # Respect a hint or command-line value.
6342 '') shrpenv="$tmp_shrpenv" ;;
6344 case "$ldlibpthname" in
6345 '') ldlibpthname=LD_LIBRARY_PATH ;;
6346 none) ldlibpthname='' ;;
6349 : determine where manual pages go
6350 set man1dir man1dir none
6354 $spackage has manual pages available in source form.
6358 echo "However, you don't have nroff, so they're probably useless to you."
6360 '') man1dir="none";;
6363 echo "If you don't want the manual sources installed, answer 'none'."
6368 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6369 lookpath="$lookpath $prefixexp/man/p_man/man1"
6370 lookpath="$lookpath $prefixexp/man/u_man/man1"
6371 lookpath="$lookpath $prefixexp/man/man.1"
6373 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6374 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6384 rp="Where do the main $spackage manual pages (source) go?"
6386 if $test "X$man1direxp" != "X$ansexp"; then
6390 man1direxp="$ansexp"
6396 : Change installation prefix, if necessary.
6397 if $test X"$prefix" != X"$installprefix"; then
6398 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6400 installman1dir="$man1direxp"
6403 : What suffix to use on installed man pages
6410 rp="What suffix should be used for the main $spackage man pages?"
6412 '') case "$man1dir" in
6426 *) dflt="$man1ext";;
6433 : see if we can have long filenames
6435 rmlist="$rmlist /tmp/cf$$"
6436 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6437 first=123456789abcdef
6438 second=/tmp/cf$$/$first
6439 $rm -f $first $second
6440 if (echo hi >$first) 2>/dev/null; then
6441 if $test -f 123456789abcde; then
6442 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6445 if (echo hi >$second) 2>/dev/null; then
6446 if $test -f /tmp/cf$$/123456789abcde; then
6448 That's peculiar... You can have filenames longer than 14 characters, but only
6449 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6450 I shall consider your system cannot support long filenames at all.
6454 echo 'You can have filenames longer than 14 characters.' >&4
6459 How confusing! Some of your filesystems are sane enough to allow filenames
6460 longer than 14 characters but some others like /tmp can't even think about them.
6461 So, for now on, I shall assume your kernel does not allow them at all.
6468 You can't have filenames longer than 14 chars. You can't even think about them!
6474 $rm -rf /tmp/cf$$ 123456789abcde*
6476 : determine where library module manual pages go
6477 set man3dir man3dir none
6481 $spackage has manual pages for many of the library modules.
6487 However, you don't have nroff, so they're probably useless to you.
6490 '') man3dir="none";;
6494 case "$d_flexfnam" in
6497 However, your system can't handle the long file names like File::Basename.3.
6500 '') man3dir="none";;
6504 echo "If you don't want the manual sources installed, answer 'none'."
6505 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6507 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6508 if $test -d "$privlib/man/man3"; then
6511 WARNING: Previous versions of perl installed man3 pages into
6512 $privlib/man/man3. This version will suggest a
6513 new default of $dflt.
6517 rp='Do you wish to preserve the old behavior?(y/n)'
6520 y*) dflt="$privlib/man/man3" ;;
6526 *) dflt="$man3dir" ;;
6530 rp="Where do the $package library man pages (source) go?"
6533 man3direxp="$ansexp"
6539 : Change installation prefix, if necessary.
6540 if $test X"$prefix" != X"$installprefix"; then
6541 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6543 installman3dir="$man3direxp"
6546 : What suffix to use on installed man pages
6552 rp="What suffix should be used for the $package library man pages?"
6554 '') case "$man3dir" in
6568 *) dflt="$man3ext";;
6575 : see if we have to deal with yellow pages, now NIS.
6576 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6577 if $test -f /usr/etc/nibindd; then
6579 echo "I'm fairly confident you're on a NeXT."
6581 rp='Do you get the hosts file via NetInfo?'
6590 y*) hostcat='nidump hosts .';;
6591 *) case "$hostcat" in
6592 nidump*) hostcat='';;
6602 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6610 rp='Are you getting the hosts file via yellow pages?'
6613 y*) hostcat='ypcat hosts';;
6614 *) hostcat='cat /etc/hosts';;
6620 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6623 '') test -f /etc/group && groupcat='cat /etc/group';;
6626 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6629 : now get the host name
6631 echo "Figuring out host name..." >&4
6632 case "$myhostname" in
6634 echo 'Maybe "hostname" will work...'
6635 if tans=`sh -c hostname 2>&1` ; then
6643 if $test "$cont"; then
6645 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6646 if tans=`cat /etc/systemid 2>&1` ; then
6648 phostname='cat /etc/systemid'
6649 echo "Whadyaknow. Xenix always was a bit strange..."
6652 elif $test -r /etc/systemid; then
6653 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6656 if $test "$cont"; then
6657 echo 'No, maybe "uuname -l" will work...'
6658 if tans=`sh -c 'uuname -l' 2>&1` ; then
6660 phostname='uuname -l'
6662 echo 'Strange. Maybe "uname -n" will work...'
6663 if tans=`sh -c 'uname -n' 2>&1` ; then
6665 phostname='uname -n'
6667 echo 'Oh well, maybe I can mine it out of whoami.h...'
6668 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6669 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6670 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6672 case "$myhostname" in
6673 '') echo "Does this machine have an identity crisis or something?"
6676 echo "Well, you said $myhostname before..."
6677 phostname='echo $myhostname';;
6683 : you do not want to know about this
6688 if $test "$myhostname" ; then
6690 rp='Your host name appears to be "'$myhostname'".'" Right?"
6698 : bad guess or no guess
6699 while $test "X$myhostname" = X ; do
6701 rp="Please type the (one word) name of your host:"
6706 : translate upper to lower if necessary
6707 case "$myhostname" in
6709 echo "(Normalizing case in your host name)"
6710 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6714 case "$myhostname" in
6716 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6717 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6718 echo "(Trimming domain name from host name--host name is now $myhostname)"
6720 *) case "$mydomain" in
6723 test "X$hostcat" = "Xypcat hosts" &&
6724 ypmatch "$myhostname" hosts 2>/dev/null |\
6725 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6728 test "X$hostcat" != "X" &&
6729 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6730 /[ ]$myhostname[ . ]/p" > hosts
6733 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6734 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6735 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6736 hosts | $sort | $uniq | \
6737 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6738 case `$echo X$dflt` in
6739 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6742 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6747 tans=`./loc resolv.conf X /etc /usr/etc`
6748 if $test -f "$tans"; then
6749 echo "(Attempting domain name extraction from $tans)"
6750 dflt=.`$sed -n -e 's/ / /g' \
6751 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6752 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6754 .) dflt=.`$sed -n -e 's/ / /g' \
6755 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6756 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6763 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6764 dflt=.`sh -c domainname 2>/dev/null`
6767 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6772 .) echo "(Lost all hope -- silly guess then)"
6778 *) dflt="$mydomain";;
6782 rp="What is your domain name?"
6792 : translate upper to lower if necessary
6795 echo "(Normalizing case in your domain name)"
6796 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6800 : a little sanity check here
6801 case "$phostname" in
6804 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6805 $myhostname$mydomain|$myhostname) ;;
6807 case "$phostname" in
6809 echo "(That doesn't agree with your whoami.h file, by the way.)"
6812 echo "(That doesn't agree with your $phostname command, by the way.)"
6822 I need to get your e-mail address in Internet format if possible, i.e.
6823 something like user@host.domain. Please answer accurately since I have
6824 no easy means to double check it. The default value provided below
6825 is most probably close to reality but may not be valid from outside
6826 your organization...
6830 while test "$cont"; do
6832 '') dflt="$cf_by@$myhostname$mydomain";;
6833 *) dflt="$cf_email";;
6835 rp='What is your e-mail address?'
6841 rp='Address does not look like an Internet one. Use it anyway?'
6857 If you or somebody else will be maintaining perl at your site, please
6858 fill in the correct e-mail address here so that they may be contacted
6859 if necessary. Currently, the "perlbug" program included with perl
6860 will send mail to this address in addition to perlbug@perl.com. You may
6861 enter "none" for no administrator.
6864 case "$perladmin" in
6865 '') dflt="$cf_email";;
6866 *) dflt="$perladmin";;
6868 rp='Perl administrator e-mail address'
6872 : figure out how to guarantee perl startup
6873 case "$startperl" in
6875 case "$sharpbang" in
6879 I can use the #! construct to start perl on your system. This will
6880 make startup of perl scripts faster, but may cause problems if you
6881 want to share those scripts and perl is not in a standard place
6882 ($binexp/perl) on all your platforms. The alternative is to force
6883 a shell by starting the script with a single ':' character.
6887 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6890 none) startperl=": # use perl";;
6891 *) startperl="#!$ans"
6892 if $test 30 -lt `echo "$ans" | wc -c`; then
6895 WARNING: Some systems limit the #! command to 32 characters.
6896 If you experience difficulty running Perl scripts with #!, try
6897 installing Perl in a directory with a shorter pathname.
6903 *) startperl=": # use perl"
6908 echo "I'll use $startperl to start perl scripts."
6910 : figure best path for perl in scripts
6913 perlpath="$binexp/perl"
6914 case "$startperl" in
6919 I will use the "eval 'exec'" idiom to start Perl on your system.
6920 I can use the full path of your Perl binary for this purpose, but
6921 doing so may cause problems if you want to share those scripts and
6922 Perl is not always in a standard place ($binexp/perl).
6926 rp="What path shall I use in \"eval 'exec'\"?"
6933 case "$startperl" in
6935 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6938 : determine where public executable scripts go
6939 set scriptdir scriptdir
6941 case "$scriptdir" in
6944 : guess some guesses
6945 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6946 $test -d /usr/share/bin && dflt=/usr/share/bin
6947 $test -d /usr/local/script && dflt=/usr/local/script
6948 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6949 $test -d $prefixexp/script && dflt=$prefixexp/script
6953 *) dflt="$scriptdir"
6958 Some installations have a separate directory just for executable scripts so
6959 that they can mount it across multiple architectures but keep the scripts in
6960 one spot. You might, for example, have a subdirectory of /usr/share for this.
6961 Or you might just lump your scripts in with all your other executables.
6965 rp='Where do you keep publicly executable scripts?'
6967 if $test "X$ansexp" != "X$scriptdirexp"; then
6971 scriptdirexp="$ansexp"
6972 : Change installation prefix, if necessary.
6973 if $test X"$prefix" != X"$installprefix"; then
6974 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6976 installscript="$scriptdirexp"
6979 : determine where site specific architecture-dependent libraries go.
6980 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6981 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6982 : sitelib may have an optional trailing /share.
6983 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6984 tdflt="$tdflt/$archname"
6985 set sitearch sitearch none
6988 '') dflt="$tdflt" ;;
6989 *) dflt="$sitearch" ;;
6993 The installation process will also create a directory for
6994 architecture-dependent site-specific extensions and modules.
6998 rp='Pathname for the site-specific architecture-dependent library files?'
7001 sitearchexp="$ansexp"
7002 : Change installation prefix, if necessary.
7003 if $test X"$prefix" != X"$installprefix"; then
7004 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7006 installsitearch="$sitearchexp"
7009 : determine where add-on public executables go
7011 '') dflt=$siteprefix/bin ;;
7015 rp='Pathname where the add-on public executables should be installed?'
7018 sitebinexp="$ansexp"
7019 : Change installation prefix, if necessary.
7020 if $test X"$prefix" != X"$installprefix"; then
7021 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7023 installsitebin="$sitebinexp"
7028 Perl can be built to take advantage of long doubles which
7029 (if available) may give more accuracy and range for floating point numbers.
7031 If this doesn't make any sense to you, just accept the default 'n'.
7035 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7038 case "$uselongdouble" in
7039 $define|true|[yY]*) dflt='y';;
7042 rp='Try to use long doubles if available?'
7045 y|Y) val="$define" ;;
7051 case "$uselongdouble" in
7052 true|[yY]*) uselongdouble="$define" ;;
7055 case "$uselongdouble" in
7057 : Look for a hint-file generated 'call-back-unit'. If the
7058 : user has specified that long doubles should be used,
7059 : we may need to set or change some other defaults.
7060 if $test -f uselongdouble.cbu; then
7061 echo "Your platform has some specific hints for long doubles, using them..."
7062 . ./uselongdouble.cbu
7065 (Your platform doesn't have any specific hints for long doubles.)
7073 Perl can be built to take advantage of long longs which
7074 (if available) may give more range for integer numbers.
7076 If this doesn't make any sense to you, just accept the default 'n'.
7080 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7083 case "$uselonglong" in
7084 $define|true|[yY]*) dflt='y';;
7087 rp='Try to use long longs if available?'
7090 y|Y) val="$define" ;;
7096 case "$uselonglong" in
7097 true|[yY]*) uselonglong="$define" ;;
7100 case "$uselonglong" in
7102 : Look for a hint-file generated 'call-back-unit'. If the
7103 : user has specified that long longs should be used,
7104 : we may need to set or change some other defaults.
7105 if $test -f uselonglong.cbu; then
7106 echo "Your platform has some specific hints for long longs, using them..."
7110 (Your platform doesn't have any specific hints for long longs.)
7118 Previous version of $package used the standard IO mechanisms as defined
7119 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7120 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7121 the default. This abstraction layer can use AT&T's sfio (if you already
7122 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7123 problems with some extension modules. Using PerlIO with stdio is safe,
7124 but it is slower than plain stdio and therefore is not the default.
7126 If this doesn't make any sense to you, just accept the default 'n'.
7128 case "$useperlio" in
7129 $define|true|[yY]*) dflt='y';;
7132 rp='Use the experimental PerlIO abstraction layer?'
7139 echo "Ok, doing things the stdio way"
7146 case "$vendorprefix" in
7147 '') d_vendorbin="$undef"
7151 *) d_vendorbin="$define"
7152 : determine where vendor-supplied executables go.
7153 dflt=$vendorprefix/bin
7155 rp='Pathname for the vendor-supplied executables directory?'
7158 vendorbinexp="$ansexp"
7159 : Change installation prefix, if necessary.
7160 if $test X"$prefix" != X"$installprefix"; then
7161 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7163 installvendorbin="$vendorbinexp"
7168 : check for length of double
7170 case "$doublesize" in
7172 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7173 $cat >try.c <<'EOCP'
7177 printf("%d\n", (int)sizeof(double));
7182 if eval $compile_ok; then
7184 $echo " $doublesize bytes." >&4
7187 echo "(I can't seem to compile the test program. Guessing...)"
7188 rp="What is the size of a double precision number (in bytes)?"
7196 : check for long doubles
7198 $echo $n "Checking to see if your system supports long double..." $c >&4
7199 echo 'int main() { long double x = 7.0; }' > try.c
7201 if eval $compile; then
7203 echo " Yes, it does." >&4
7206 echo " No, it doesn't." >&4
7212 : check for length of long double
7213 case "${d_longdbl}${longdblsize}" in
7216 $echo $n "Checking to see how big your long doubles are..." $c >&4
7217 $cat >try.c <<'EOCP'
7221 printf("%d\n", sizeof(long double));
7226 if eval $compile; then
7227 longdblsize=`./try$exe_ext`
7228 $echo " $longdblsize bytes." >&4
7232 echo "(I can't seem to compile the test program. Guessing...)" >&4
7233 rp="What is the size of a long double (in bytes)?"
7237 if $test "X$doublesize" = "X$longdblsize"; then
7238 echo "(That isn't any different from an ordinary double.)"
7244 : Check how to convert floats to strings.
7245 if test "X$d_Gconvert" = X; then
7247 echo "Checking for an efficient way to convert floats to strings."
7250 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7251 char *myname = "gconvert";
7254 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7255 char *myname = "gcvt";
7258 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7259 char *myname = "qgcvt";
7260 #define DOUBLETYPE long double
7263 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7264 char *myname = "sprintf";
7268 #define DOUBLETYPE double
7278 checkit(expect, got)
7282 if (strcmp(expect, got)) {
7283 printf("%s oddity: Expected %s, got %s\n",
7284 myname, expect, got);
7294 /* This must be 1st test on (which?) platform */
7295 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7296 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7297 checkit("0.1", buf);
7299 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7302 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7305 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7308 /* Some Linux gcvt's give 1.e+5 here. */
7309 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7310 checkit("100000", buf);
7312 /* Some Linux gcvt's give -1.e+5 here. */
7313 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7314 checkit("-100000", buf);
7319 case "$d_Gconvert" in
7320 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7321 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7322 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7323 *) xxx_list='gconvert gcvt sprintf' ;;
7326 case "$d_longdbl$uselongdouble" in
7327 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7330 for xxx_convert in $xxx_list; do
7331 echo "Trying $xxx_convert..."
7333 set try -DTRY_$xxx_convert
7334 if eval $compile; then
7335 echo "$xxx_convert() found." >&4
7337 echo "I'll use $xxx_convert to convert floats into a string." >&4
7340 echo "...But $xxx_convert didn't work as I expected."
7343 echo "$xxx_convert NOT found." >&4
7347 case "$xxx_convert" in
7348 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7349 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7350 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7351 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7357 if $test X"$d_longdbl" = X"$define"; then
7359 echo "Checking how to print long doubles..." >&4
7361 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7362 $cat >try.c <<'EOCP'
7363 #include <sys/types.h>
7367 printf("%.3f\n", d);
7371 if eval $compile; then
7375 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7376 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7377 echo "We will use %f."
7383 if $test X"$sPRIfldbl" = X; then
7384 $cat >try.c <<'EOCP'
7385 #include <sys/types.h>
7388 long double d = 123.456;
7389 printf("%.3llf\n", d);
7393 if eval $compile; then
7397 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7398 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7399 echo "We will use %llf."
7405 if $test X"$sPRIfldbl" = X; then
7406 $cat >try.c <<'EOCP'
7407 #include <sys/types.h>
7410 long double d = 123.456;
7411 printf("%.3Lf\n", d);
7415 if eval $compile; then
7419 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7420 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7421 echo "We will use %Lf."
7427 if $test X"$sPRIfldbl" = X; then
7428 $cat >try.c <<'EOCP'
7429 #include <sys/types.h>
7432 long double d = 123.456;
7433 printf("%.3lf\n", d);
7437 if eval $compile; then
7441 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7442 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7443 echo "We will use %lf."
7449 if $test X"$sPRIfldbl" = X; then
7450 echo "Cannot figure out how to print long doubles." >&4
7457 case "$sPRIfldbl" in
7458 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7459 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7461 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7462 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7466 : Initialize h_fcntl
7469 : Initialize h_sysfile
7472 : access call always available on UNIX
7476 : locate the flags for 'access()'
7480 $cat >access.c <<'EOCP'
7481 #include <sys/types.h>
7486 #include <sys/file.h>
7495 : check sys/file.h first, no particular reason here
7496 if $test `./findhdr sys/file.h` && \
7497 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7499 echo "<sys/file.h> defines the *_OK access constants." >&4
7500 elif $test `./findhdr fcntl.h` && \
7501 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7503 echo "<fcntl.h> defines the *_OK access constants." >&4
7504 elif $test `./findhdr unistd.h` && \
7505 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7506 echo "<unistd.h> defines the *_OK access constants." >&4
7508 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7514 : see if accessx exists
7515 set accessx d_accessx
7518 : see if alarm exists
7522 : see if atolf exists
7526 : see if atoll exists
7530 : Look for GNU-cc style attribute checking
7532 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7533 $cat >attrib.c <<'EOCP'
7535 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7537 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7538 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7539 echo "Your C compiler doesn't fully support __attribute__."
7542 echo "Your C compiler supports __attribute__."
7546 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7553 : see if bcmp exists
7557 : see if bcopy exists
7561 : see if this is a unistd.h system
7562 set unistd.h i_unistd
7565 : see if getpgrp exists
7566 set getpgrp d_getpgrp
7569 case "$d_getpgrp" in
7572 echo "Checking to see which flavor of getpgrp is in use..."
7575 #include <sys/types.h>
7577 # include <unistd.h>
7581 if (getuid() == 0) {
7582 printf("(I see you are running Configure as super-user...)\n");
7586 if (getpgrp(1) == 0)
7595 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7596 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7598 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7599 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7602 echo "I can't seem to compile and run the test program."
7604 xxx="a USG one, i.e. you use getpgrp()."
7606 # SVR4 systems can appear rather BSD-ish.
7609 xxx="a BSD one, i.e. you use getpgrp(pid)."
7613 xxx="probably a USG one, i.e. you use getpgrp()."
7618 echo "Assuming your getpgrp is $xxx" >&4
7627 : see if setpgrp exists
7628 set setpgrp d_setpgrp
7631 case "$d_setpgrp" in
7634 echo "Checking to see which flavor of setpgrp is in use..."
7637 #include <sys/types.h>
7639 # include <unistd.h>
7643 if (getuid() == 0) {
7644 printf("(I see you are running Configure as super-user...)\n");
7648 if (-1 == setpgrp(1, 1))
7651 if (setpgrp() != -1)
7657 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7658 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7660 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7661 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7664 echo "(I can't seem to compile and run the test program.)"
7666 xxx="a USG one, i.e. you use setpgrp()."
7668 # SVR4 systems can appear rather BSD-ish.
7671 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7675 xxx="probably a USG one, i.e. you use setpgrp()."
7680 echo "Assuming your setpgrp is $xxx" >&4
7688 : see if bzero exists
7692 : see if signal is declared as pointer to function returning int or void
7694 xxx=`./findhdr signal.h`
7695 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7696 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7697 echo "You have int (*signal())() instead of void." >&4
7699 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7700 echo "You have void (*signal())()." >&4
7702 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7703 echo "You have int (*signal())() instead of void." >&4
7705 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7706 echo "You have void (*signal())()." >&4
7709 case "$d_voidsig" in
7711 echo "I can't determine whether signal handler returns void or int..." >&4
7713 rp="What type does your signal handler return?"
7720 echo "As you already told me, signal handler returns void." >&4
7723 *) echo "As you already told me, signal handler returns int." >&4
7730 case "$d_voidsig" in
7731 "$define") signal_t="void";;
7736 : check for ability to cast large floats to 32-bit ints.
7738 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7739 if $test "$intsize" -ge 4; then
7746 #include <sys/types.h>
7748 $signal_t blech(s) int s; { exit(3); }
7755 signal(SIGFPE, blech);
7757 /* Don't let compiler optimize the test away. Store the number
7758 in a writable string for gcc to pass to sscanf under HP/UX.
7760 sprintf(str, "2147483647");
7761 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7765 /* x86 processors will probably give 0x8000 0000, which is a
7766 sign change. We don't want that. We want to mimic SPARC
7767 behavior here, which is to preserve the sign and give
7770 if (i32 != ($xxx) f)
7776 if eval $compile_ok; then
7780 echo "(I can't seem to compile the test program--assuming it can't)"
7788 echo "Nope, it can't."
7795 : check for ability to cast negative floats to unsigned
7797 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7800 #include <sys/types.h>
7802 $signal_t blech(s) int s; { exit(7); }
7803 $signal_t blech_in_list(s) int s; { exit(4); }
7804 unsigned long dummy_long(p) unsigned long p; { return p; }
7805 unsigned int dummy_int(p) unsigned int p; { return p; }
7806 unsigned short dummy_short(p) unsigned short p; { return p; }
7810 unsigned long along;
7812 unsigned short ashort;
7816 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7817 a direct f = -123. assignment. gcc-2.8.0 reportedly
7818 optimized the whole file away
7820 /* Store the number in a writable string for gcc to pass to
7823 sprintf(str, "-123");
7824 sscanf(str, "%lf", &f); /* f = -123.; */
7826 signal(SIGFPE, blech);
7827 along = (unsigned long)f;
7828 aint = (unsigned int)f;
7829 ashort = (unsigned short)f;
7830 if (along != (unsigned long)-123)
7832 if (aint != (unsigned int)-123)
7834 if (ashort != (unsigned short)-123)
7836 sprintf(str, "1073741824.");
7837 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7840 along = (unsigned long)f;
7841 if (along != 0x80000000)
7845 along = (unsigned long)f;
7846 if (along != 0x7fffffff)
7850 along = (unsigned long)f;
7851 if (along != 0x80000001)
7855 signal(SIGFPE, blech_in_list);
7856 sprintf(str, "123.");
7857 sscanf(str, "%lf", &f); /* f = 123.; */
7858 along = dummy_long((unsigned long)f);
7859 aint = dummy_int((unsigned int)f);
7860 ashort = dummy_short((unsigned short)f);
7861 if (along != (unsigned long)123)
7863 if (aint != (unsigned int)123)
7865 if (ashort != (unsigned short)123)
7872 if eval $compile_ok; then
7876 echo "(I can't seem to compile the test program--assuming it can't)"
7879 case "$castflags" in
7884 echo "Nope, it can't."
7891 : see if vprintf exists
7893 if set vprintf val -f d_vprintf; eval $csym; $val; then
7894 echo 'vprintf() found.' >&4
7896 $cat >vprintf.c <<'EOF'
7897 #include <varargs.h>
7899 int main() { xxx("foo"); }
7908 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7912 if eval $compile && ./vprintf; then
7913 echo "Your vsprintf() returns (int)." >&4
7916 echo "Your vsprintf() returns (char*)." >&4
7920 echo 'vprintf() NOT found.' >&4
7930 : see if chown exists
7934 : see if chroot exists
7938 : see if chsize exists
7942 : check for const keyword
7944 echo 'Checking to see if your C compiler knows about "const"...' >&4
7945 $cat >const.c <<'EOCP'
7946 typedef struct spug { int drokk; } spug;
7953 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7955 echo "Yup, it does."
7958 echo "Nope, it doesn't."
7963 : see if crypt exists
7965 if set crypt val -f d_crypt; eval $csym; $val; then
7966 echo 'crypt() found.' >&4
7970 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7971 if $test -z "$cryptlib"; then
7972 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7976 if $test -z "$cryptlib"; then
7977 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7981 if $test -z "$cryptlib"; then
7982 cryptlib=`./loc libcrypt$_a "" $libpth`
7986 if $test -z "$cryptlib"; then
7987 echo 'crypt() NOT found.' >&4
7996 : get csh whereabouts
7998 'csh') val="$undef" ;;
8003 : Respect a hint or command line value for full_csh.
8005 '') full_csh=$csh ;;
8008 : see if cuserid exists
8009 set cuserid d_cuserid
8012 : see if this is a limits.h system
8013 set limits.h i_limits
8016 : see if this is a float.h system
8020 : See if number of significant digits in a double precision number is known
8022 $cat >dbl_dig.c <<EOM
8032 printf("Contains DBL_DIG");
8035 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8036 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8037 echo "DBL_DIG found." >&4
8040 echo "DBL_DIG NOT found." >&4
8047 : see if difftime exists
8048 set difftime d_difftime
8051 : see if this is a dirent system
8053 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8055 echo "<dirent.h> found." >&4
8058 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8059 echo "<sys/dir.h> found." >&4
8062 xinc=`./findhdr sys/ndir.h`
8064 echo "<dirent.h> NOT found." >&4
8069 : Look for type of directory structure.
8071 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8073 case "$direntrytype" in
8076 $define) guess1='struct dirent' ;;
8077 *) guess1='struct direct' ;;
8080 *) guess1="$direntrytype"
8085 'struct dirent') guess2='struct direct' ;;
8086 *) guess2='struct dirent' ;;
8089 if $contains "$guess1" try.c >/dev/null 2>&1; then
8090 direntrytype="$guess1"
8091 echo "Your directory entries are $direntrytype." >&4
8092 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8093 direntrytype="$guess2"
8094 echo "Your directory entries seem to be $direntrytype." >&4
8096 echo "I don't recognize your system's directory entries." >&4
8097 rp="What type is used for directory entries on this system?"
8105 : see if the directory entry stores field length
8107 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8108 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8109 echo "Good, your directory entry keeps length information in d_namlen." >&4
8112 echo "Your directory entry does not know about the d_namlen field." >&4
8119 : see if dlerror exists
8122 set dlerror d_dlerror
8126 : see if dlfcn is available
8134 On a few systems, the dynamically loaded modules that perl generates and uses
8135 will need a different extension than shared libs. The default will probably
8143 rp='What is the extension of dynamically loaded modules'
8152 : Check if dlsym need a leading underscore
8158 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8159 $cat >dyna.c <<'EOM'
8168 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8170 #include <sys/types.h>
8184 int mode = RTLD_LAZY ;
8186 handle = dlopen("./dyna.$dlext", mode) ;
8187 if (handle == NULL) {
8192 symbol = dlsym(handle, "fred") ;
8193 if (symbol == NULL) {
8194 /* try putting a leading underscore */
8195 symbol = dlsym(handle, "_fred") ;
8196 if (symbol == NULL) {
8209 : Call the object file tmp-dyna.o in case dlext=o.
8210 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8211 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8212 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8213 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8216 1) echo "Test program failed using dlopen." >&4
8217 echo "Perhaps you should not use dynamic loading." >&4;;
8218 2) echo "Test program failed using dlsym." >&4
8219 echo "Perhaps you should not use dynamic loading." >&4;;
8220 3) echo "dlsym needs a leading underscore" >&4
8222 4) echo "dlsym doesn't need a leading underscore." >&4;;
8225 echo "I can't compile and run the test program." >&4
8226 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8231 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8236 hasproto='varname=$1; func=$2; shift; shift;
8237 while $test $# -ge 2; do
8239 $define) echo "#include <$2>";;
8243 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8244 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8245 echo "$func() prototype found.";
8248 echo "$func() prototype NOT found.";
8253 $rm -f try.c tryout.c'
8255 : see if prototype for drand48 is available
8257 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8260 : see if dup2 exists
8264 : see if eaccess exists
8265 set eaccess d_eaccess
8268 : see if endgrent exists
8269 set endgrent d_endgrent
8272 : see if endhostent exists
8273 set endhostent d_endhent
8276 : see if endnetent exists
8277 set endnetent d_endnent
8280 : see if endprotoent exists
8281 set endprotoent d_endpent
8284 : see if endpwent exists
8285 set endpwent d_endpwent
8288 : see if endservent exists
8289 set endservent d_endsent
8292 : see if endspent exists
8293 set endspent d_endspent
8296 : Locate the flags for 'open()'
8298 $cat >open3.c <<'EOCP'
8299 #include <sys/types.h>
8304 #include <sys/file.h>
8315 : check sys/file.h first to get FREAD on Sun
8316 if $test `./findhdr sys/file.h` && \
8317 set open3 -DI_SYS_FILE && eval $compile; then
8319 echo "<sys/file.h> defines the O_* constants..." >&4
8321 echo "and you have the 3 argument form of open()." >&4
8324 echo "but not the 3 argument form of open(). Oh, well." >&4
8327 elif $test `./findhdr fcntl.h` && \
8328 set open3 -DI_FCNTL && eval $compile; then
8330 echo "<fcntl.h> defines the O_* constants..." >&4
8332 echo "and you have the 3 argument form of open()." >&4
8335 echo "but not the 3 argument form of open(). Oh, well." >&4
8340 echo "I can't find the O_* constant definitions! You got problems." >&4
8346 : see which of string.h or strings.h is needed
8348 strings=`./findhdr string.h`
8349 if $test "$strings" && $test -r "$strings"; then
8350 echo "Using <string.h> instead of <strings.h>." >&4
8354 strings=`./findhdr strings.h`
8355 if $test "$strings" && $test -r "$strings"; then
8356 echo "Using <strings.h> instead of <string.h>." >&4
8358 echo "No string header found -- You'll surely have problems." >&4
8364 "$undef") strings=`./findhdr strings.h`;;
8365 *) strings=`./findhdr string.h`;;
8368 : check for non-blocking I/O stuff
8369 case "$h_sysfile" in
8370 true) echo "#include <sys/file.h>" > head.c;;
8373 true) echo "#include <fcntl.h>" > head.c;;
8374 *) echo "#include <sys/fcntl.h>" > head.c;;
8379 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8380 case "$o_nonblock" in
8383 $cat >>try.c <<'EOCP'
8387 printf("O_NONBLOCK\n");
8391 printf("O_NDELAY\n");
8395 printf("FNDELAY\n");
8402 if eval $compile_ok; then
8404 case "$o_nonblock" in
8405 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8406 *) echo "Seems like we can use $o_nonblock.";;
8409 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8412 *) echo "Using $hint value $o_nonblock.";;
8414 $rm -f try try.* .out core
8417 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8423 #include <sys/types.h>
8426 #define MY_O_NONBLOCK $o_nonblock
8427 #ifndef errno /* XXX need better Configure test */
8437 #include <strings.h>
8439 $signal_t blech(x) int x; { exit(3); }
8441 $cat >> try.c <<'EOCP'
8449 pipe(pd); /* Down: child -> parent */
8450 pipe(pu); /* Up: parent -> child */
8453 close(pd[1]); /* Parent reads from pd[0] */
8454 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8455 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8457 signal(SIGALRM, blech);
8459 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8461 sprintf(string, "%d\n", ret);
8462 write(2, string, strlen(string));
8465 if (errno == EAGAIN) {
8471 if (errno == EWOULDBLOCK)
8472 printf("EWOULDBLOCK\n");
8475 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8476 sleep(2); /* Give it time to close our pipe */
8478 ret = read(pd[0], buf, 1); /* Should read EOF */
8480 sprintf(string, "%d\n", ret);
8481 write(3, string, strlen(string));
8485 close(pd[0]); /* We write to pd[1] */
8486 close(pu[1]); /* We read from pu[0] */
8487 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8488 close(pd[1]); /* Pipe pd is now fully closed! */
8489 exit(0); /* Bye bye, thank you for playing! */
8493 if eval $compile_ok; then
8494 echo "$startsh" >mtry
8495 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8497 ./mtry >/dev/null 2>&1
8499 0) eagain=`$cat try.out`;;
8500 1) echo "Could not perform non-blocking setting!";;
8501 2) echo "I did a successful read() for something that was not there!";;
8502 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8503 *) echo "Something terribly wrong happened during testing.";;
8505 rd_nodata=`$cat try.ret`
8506 echo "A read() system call with no data present returns $rd_nodata."
8507 case "$rd_nodata" in
8510 echo "(That's peculiar, fixing that to be -1.)"
8516 echo "Forcing errno EAGAIN on read() with no data available."
8520 echo "Your read() sets errno to $eagain when no data is available."
8523 status=`$cat try.err`
8525 0) echo "And it correctly returns 0 to signal EOF.";;
8526 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8527 *) echo "However, your read() returns '$status' on EOF??";;
8530 if test "$status" = "$rd_nodata"; then
8531 echo "WARNING: you can't distinguish between EOF and no data!"
8535 echo "I can't compile the test program--assuming errno EAGAIN will do."
8542 echo "Using $hint value $eagain."
8543 echo "Your read() returns $rd_nodata when no data is present."
8544 case "$d_eofnblk" in
8545 "$define") echo "And you can see EOF because read() returns 0.";;
8546 "$undef") echo "But you can't see EOF status from read() returned value.";;
8548 echo "(Assuming you can't see EOF status from read anyway.)"
8554 $rm -f try try.* .out core head.c mtry
8556 : see if fchmod exists
8560 : see if fchown exists
8564 : see if this is an fcntl system
8568 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8569 while $test $# -ge 2; do
8571 $define) echo "#include <$2>";;
8575 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8577 if eval $compile; then
8588 : see whether socket exists
8590 $echo $n "Hmm... $c" >&4
8591 if set socket val -f d_socket; eval $csym; $val; then
8592 echo "Looks like you have Berkeley networking support." >&4
8594 if set setsockopt val -f; eval $csym; $val; then
8597 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8601 if $contains socklib libc.list >/dev/null 2>&1; then
8602 echo "Looks like you have Berkeley networking support." >&4
8604 : we will have to assume that it supports the 4.2 BSD interface
8607 echo "You don't have Berkeley networking in libc$_a..." >&4
8608 if test "X$d_socket" = "X$define"; then
8609 echo "...but you seem to believe that you have sockets." >&4
8611 for net in net socket
8613 if test -f /usr/lib/lib$net$_a; then
8614 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8615 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8616 if $contains socket libc.list >/dev/null 2>&1; then
8621 echo "...but the Wollongong group seems to have hacked it in." >&4
8622 sockethdr="-I/usr/netinclude"
8625 echo "Found Berkeley sockets interface in lib$net." >& 4
8626 if $contains setsockopt libc.list >/dev/null 2>&1; then
8629 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8636 if test "X$d_socket" != "X$define"; then
8637 echo "or anywhere else I see." >&4
8645 : see if socketpair exists
8646 set socketpair d_sockpair
8651 echo "Checking the availability of certain socket constants..." >& 4
8652 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8653 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8655 #include <sys/types.h>
8656 #include <sys/socket.h>
8662 set try; if eval $compile; then
8665 set d_${enum}; eval $setvar
8669 : see if sys/select.h has to be included
8670 set sys/select.h i_sysselct
8673 : see if we should include time.h, sys/time.h, or both
8675 if test "X$timeincl" = X; then
8676 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8677 $echo $n "I'm now running the test program...$c"
8678 $cat >try.c <<'EOCP'
8679 #include <sys/types.h>
8684 #ifdef SYSTIMEKERNEL
8687 #include <sys/time.h>
8690 #include <sys/select.h>
8699 struct timezone tzp;
8701 if (foo.tm_sec == foo.tm_sec)
8704 if (bar.tv_sec == bar.tv_sec)
8711 for s_timezone in '-DS_TIMEZONE' ''; do
8713 for s_timeval in '-DS_TIMEVAL' ''; do
8714 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8715 for i_time in '' '-DI_TIME'; do
8716 for i_systime in '-DI_SYSTIME' ''; do
8719 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8720 if eval $compile; then
8721 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8725 $echo $n "Succeeded with $flags$c"
8737 *SYSTIMEKERNEL*) i_systimek="$define"
8738 timeincl=`./findhdr sys/time.h`
8739 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8740 *) i_systimek="$undef";;
8743 *I_TIME*) i_time="$define"
8744 timeincl=`./findhdr time.h`" $timeincl"
8745 echo "We'll include <time.h>." >&4;;
8746 *) i_time="$undef";;
8749 *I_SYSTIME*) i_systime="$define"
8750 timeincl=`./findhdr sys/time.h`" $timeincl"
8751 echo "We'll include <sys/time.h>." >&4;;
8752 *) i_systime="$undef";;
8757 : check for fd_set items
8760 Checking to see how well your C compiler handles fd_set and friends ...
8762 $cat >fd_set.c <<EOCP
8763 #$i_systime I_SYS_TIME
8764 #$i_sysselct I_SYS_SELECT
8765 #$d_socket HAS_SOCKET
8766 #include <sys/types.h>
8768 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8771 #include <sys/time.h>
8774 #include <sys/select.h>
8783 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8790 set fd_set -DTRYBITS
8791 if eval $compile; then
8792 d_fds_bits="$define"
8794 echo "Well, your system knows about the normal fd_set typedef..." >&4
8796 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8797 d_fd_macros="$define"
8800 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8802 d_fd_macros="$undef"
8806 Hmm, your compiler has some difficulty with fd_set. Checking further...
8809 if eval $compile; then
8812 echo "Well, your system has some sort of fd_set available..." >&4
8814 echo "and you have the normal fd_set macros." >&4
8815 d_fd_macros="$define"
8818 but not the normal fd_set macros! Gross! More work for me...
8820 d_fd_macros="$undef"
8823 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8826 d_fd_macros="$undef"
8831 : see if fgetpos exists
8832 set fgetpos d_fgetpos
8835 : see if flock exists
8839 : see if fork exists
8843 : see if pathconf exists
8844 set pathconf d_pathconf
8847 : see if fpathconf exists
8848 set fpathconf d_fpathconf
8854 echo "Checking to see if your system supports off64_t..." >&4
8856 #include <sys/types.h>
8858 int main() { off64_t x = 7; }'
8861 if eval $compile; then
8863 echo "Yes, it does."
8866 echo "No, it doesn't."
8867 case "$lseeksize" in
8868 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8875 : check for fpos64_t
8877 echo "Checking to see if your system supports fpos64_t..." >&4
8879 #include <sys/stdio.h>
8880 int main() { fpos64_t x x = 7; }'
8883 if eval $compile; then
8885 echo "Yes, it does."
8888 echo "No, it doesn't."
8890 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8897 hasstruct='varname=$1; struct=$2; shift; shift;
8898 while $test $# -ge 2; do
8900 $define) echo "#include <$2>";;
8904 echo "int main () { struct $struct foo; }" >> try.c;
8906 if eval $compile; then
8915 : see if this is a sys/param system
8916 set sys/param.h i_sysparam
8919 : see if this is a sys/mount.h system
8920 set sys/mount.h i_sysmount
8923 : see if sys/types.h has to be included
8924 set sys/types.h i_systypes
8929 echo "Checking to see if your system supports struct fs_data..." >&4
8930 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8932 case "$d_fs_data_s" in
8933 "$define") echo "Yes, it does." ;;
8934 *) echo "No, it doesn't." ;;
8937 : see if fseeko exists
8941 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8944 : see if fsetpos exists
8945 set fsetpos d_fsetpos
8949 : see if fstatfs exists
8950 set fstatfs d_fstatfs
8954 : see if statvfs exists
8955 set statvfs d_statvfs
8958 : see if fstatvfs exists
8959 set fstatvfs d_fstatvfs
8963 : see if ftello exists
8967 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8970 : see if getgrent exists
8971 set getgrent d_getgrent
8974 : see if gethostbyaddr exists
8975 set gethostbyaddr d_gethbyaddr
8978 : see if gethostbyname exists
8979 set gethostbyname d_gethbyname
8982 : see if gethostent exists
8983 set gethostent d_gethent
8986 : see how we will look up host name
8989 if set gethostname val -f d_gethname; eval $csym; $val; then
8990 echo 'gethostname() found.' >&4
8991 d_gethname="$define"
8994 if set uname val -f d_uname; eval $csym; $val; then
8997 uname() was found, but you're running xenix, and older versions of xenix
8998 have a broken uname(). If you don't really know whether your xenix is old
8999 enough to have a broken system call, use the default answer.
9006 rp='Is your uname() broken?'
9009 n*) d_uname="$define"; call=uname;;
9012 echo 'uname() found.' >&4
9019 case "$d_gethname" in
9020 '') d_gethname="$undef";;
9023 '') d_uname="$undef";;
9025 case "$d_uname$d_gethname" in
9030 Every now and then someone has a $call() that lies about the hostname
9031 but can't be fixed for political or economic reasons. If you wish, I can
9032 pretend $call() isn't there and maybe compute hostname at run-time
9033 thanks to the '$phostname' command.
9036 rp="Shall I ignore $call() from now on?"
9039 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9042 case "$phostname" in
9044 *) case "$aphostname" in
9050 file=`./loc $file $file $pth`
9051 aphostname=`echo $file $*`
9056 case "$d_uname$d_gethname" in
9059 case "$phostname" in
9061 echo "There will be no way for $package to get your hostname." >&4;;
9063 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9067 case "$d_phostname" in
9068 '') d_phostname="$undef";;
9071 : see if this is a netdb.h system
9075 : see if prototypes for various gethostxxx netdb.h functions are available
9077 set d_gethostprotos gethostent $i_netdb netdb.h
9080 : see if getlogin exists
9081 set getlogin d_getlogin
9084 : see if getmnt exists
9088 : see if getmntent exists
9089 set getmntent d_getmntent
9092 : see if getnetbyaddr exists
9093 set getnetbyaddr d_getnbyaddr
9096 : see if getnetbyname exists
9097 set getnetbyname d_getnbyname
9100 : see if getnetent exists
9101 set getnetent d_getnent
9104 : see if prototypes for various getnetxxx netdb.h functions are available
9106 set d_getnetprotos getnetent $i_netdb netdb.h
9110 : see if getprotobyname exists
9111 set getprotobyname d_getpbyname
9114 : see if getprotobynumber exists
9115 set getprotobynumber d_getpbynumber
9118 : see if getprotoent exists
9119 set getprotoent d_getpent
9122 : see if getpgid exists
9123 set getpgid d_getpgid
9126 : see if getpgrp2 exists
9127 set getpgrp2 d_getpgrp2
9130 : see if getppid exists
9131 set getppid d_getppid
9134 : see if getpriority exists
9135 set getpriority d_getprior
9138 : see if prototypes for various getprotoxxx netdb.h functions are available
9140 set d_getprotoprotos getprotoent $i_netdb netdb.h
9143 : see if getpwent exists
9144 set getpwent d_getpwent
9148 : see if getservbyname exists
9149 set getservbyname d_getsbyname
9152 : see if getservbyport exists
9153 set getservbyport d_getsbyport
9156 : see if getservent exists
9157 set getservent d_getsent
9160 : see if prototypes for various getservxxx netdb.h functions are available
9162 set d_getservprotos getservent $i_netdb netdb.h
9165 : see if getspent exists
9166 set getspent d_getspent
9169 : see if getspnam exists
9170 set getspnam d_getspnam
9173 : see if gettimeofday or ftime exists
9174 set gettimeofday d_gettimeod
9176 case "$d_gettimeod" in
9182 val="$undef"; set d_ftime; eval $setvar
9185 case "$d_gettimeod$d_ftime" in
9188 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9192 : see if this is an grp system
9198 xxx=`./findhdr grp.h`
9199 $cppstdin $cppflags $cppminus < $xxx >$$.h
9201 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9213 set d_grpasswd; eval $setvar
9217 : see if hasmntopt exists
9218 set hasmntopt d_hasmntopt
9221 : see if this is a netinet/in.h or sys/in.h system
9222 set netinet/in.h i_niin sys/in.h i_sysin
9225 : see if arpa/inet.h has to be included
9226 set arpa/inet.h i_arpainet
9229 : see if htonl --and friends-- exists
9234 : Maybe they are macros.
9239 #include <sys/types.h>
9240 #$i_niin I_NETINET_IN
9242 #$i_arpainet I_ARPA_INET
9244 #include <netinet/in.h>
9250 #include <arpa/inet.h>
9253 printf("Defined as a macro.");
9256 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9257 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9259 echo "But it seems to be defined as a macro." >&4
9269 if set index val -f; eval $csym; $val; then
9270 if set strchr val -f d_strchr; eval $csym; $val; then
9271 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9274 echo "strchr() found." >&4
9278 echo "index() found." >&4
9283 echo "index() found." >&4
9286 if set strchr val -f d_strchr; eval $csym; $val; then
9289 echo "strchr() found." >&4
9291 echo "No index() or strchr() found!" >&4
9296 set d_strchr; eval $setvar
9298 set d_index; eval $setvar
9300 : check whether inet_aton exists
9301 set inet_aton d_inetaton
9306 $cat >isascii.c <<'EOCP'
9318 if eval $compile; then
9319 echo "isascii() found." >&4
9322 echo "isascii() NOT found." >&4
9329 : see if killpg exists
9333 : see if lchown exists
9335 $cat > try.c <<'EOCP'
9336 /* System header to define __stub macros and hopefully few prototypes,
9337 which can conflict with char lchown(); below. */
9339 /* Override any gcc2 internal prototype to avoid an error. */
9340 /* We use char because int might match the return type of a gcc2
9341 builtin and then its argument prototype would still apply. */
9344 /* The GNU C library defines this for functions which it implements
9345 to always fail with ENOSYS. Some functions are actually named
9346 something starting with __ and the normal name is an alias. */
9347 #if defined (__stub_lchown) || defined (__stub___lchown)
9355 if eval $compile; then
9356 $echo "lchown() found." >&4
9359 $echo "lchown() NOT found." >&4
9365 : See if number of significant digits in a double precision number is known
9367 $cat >ldbl_dig.c <<EOM
9377 printf("Contains LDBL_DIG");
9380 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9381 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9382 echo "LDBL_DIG found." >&4
9385 echo "LDBL_DIG NOT found." >&4
9392 : see if link exists
9396 : see if localeconv exists
9397 set localeconv d_locconv
9400 : see if lockf exists
9404 : check for long long
9406 $echo $n "Checking to see if your system supports long long..." $c >&4
9407 echo 'int main() { long long x = 7; return 0; }' > try.c
9409 if eval $compile; then
9411 echo " Yes, it does." >&4
9414 echo " No, it doesn't." >&4
9420 : check for length of long long
9421 case "${d_longlong}${longlongsize}" in
9424 $echo $n "Checking to see how big your long longs are..." $c >&4
9425 $cat >try.c <<'EOCP'
9429 printf("%d\n", (int)sizeof(long long));
9434 if eval $compile_ok; then
9435 longlongsize=`./try$exe_ext`
9436 $echo " $longlongsize bytes." >&4
9440 echo "(I can't seem to compile the test program. Guessing...)"
9441 rp="What is the size of a long long (in bytes)?"
9445 if $test "X$longsize" = "X$longlongsize"; then
9446 echo "(That isn't any different from an ordinary long.)"
9452 : see if lstat exists
9456 : see if mblen exists
9460 : see if mbstowcs exists
9461 set mbstowcs d_mbstowcs
9464 : see if mbtowc exists
9468 : see if memchr exists
9472 : see if memcmp exists
9476 : see if memcpy exists
9480 : see if memmove exists
9481 set memmove d_memmove
9484 : see if memset exists
9488 : see if mkdir exists
9492 : see if mkfifo exists
9496 : see if mktime exists
9500 : see if msgctl exists
9504 : see if msgget exists
9508 : see if msgsnd exists
9512 : see if msgrcv exists
9516 : see how much of the 'msg*(2)' library is present.
9519 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9520 *"$undef"*) h_msg=false;;
9524 case "`ipcs 2>&1`" in
9525 "SVID messages"*"not configured"*)
9526 echo "Your $osname does not have the msg*(2) configured." >&4
9541 : we could also check for sys/ipc.h ...
9542 if $h_msg && $test `./findhdr sys/msg.h`; then
9543 echo "You have the full msg*(2) library." >&4
9546 echo "You don't have the full msg*(2) library." >&4
9552 : see if nice exists
9556 : see if inttypes.h is available
9557 : we want a real compile instead of Inhdr because some systems
9558 : have an inttypes.h which includes non-existent headers
9561 #include <inttypes.h>
9563 static int32_t foo32 = 0x12345678;
9567 if eval $compile; then
9568 echo "<inttypes.h> found." >&4
9571 echo "<inttypes.h> NOT found." >&4
9580 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9582 #include <sys/types.h>
9583 #$i_inttypes I_INTTYPES
9585 #include <inttypes.h>
9587 int main() { int64_t x = 7; }
9590 if eval $compile; then
9592 echo " Yes, it does." >&4
9595 echo " No, it doesn't." >&4
9603 echo "Checking which 64-bit integer type we could use..." >&4
9609 val='"unsigned int"'
9614 *) case "$longsize" in
9618 val='"unsigned long"'
9623 *) case "$uselonglong:$d_longlong:$longlongsize" in
9628 val='"unsigned long long"'
9633 *) case "$d_int64t" in
9652 '') case "$uselonglong:$d_longlong:$longlongsize" in
9654 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9655 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9659 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9664 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9669 : check for length of character
9673 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9674 $cat >try.c <<'EOCP'
9678 printf("%d\n", (int)sizeof(char));
9683 if eval $compile_ok; then
9687 echo "(I can't seem to compile the test program. Guessing...)"
9694 rp="What is the size of a character (in bytes)?"
9701 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9703 case "$use64bits:$d_quad:$quadtype" in
9711 uvtype="unsigned long"
9717 case "$uselongdouble:$d_longdbl" in
9719 nvtype="long double"
9727 $echo "(IV will be "$ivtype", $ivsize bytes)"
9728 $echo "(UV will be "$uvtype", $uvsize bytes)"
9729 $echo "(NV will be "$nvtype", $nvsize bytes)"
9732 #$i_inttypes I_INTTYPES
9734 #include <inttypes.h>
9739 int8_t i = INT8_MAX;
9740 uint8_t u = UINT8_MAX;
9744 int16_t i = INT16_MAX;
9745 uint16_t i = UINT16_MAX;
9746 printf("int16_t\n");
9749 int32_t i = INT32_MAX;
9750 uint32_t u = UINT32_MAX;
9751 printf("int32_t\n");
9757 '') case "$charsize" in
9759 u8type="unsigned char"
9768 if eval $compile; then
9769 case "`./try$exe_ext`" in
9770 int8_t) i8type=int8_t
9780 '') if $test $charsize -ge 1; then
9782 u8type="unsigned char"
9790 '') case "$shortsize" in
9792 u16type="unsigned short"
9801 if eval $compile; then
9802 case "`./try$exe_ext`" in
9814 '') if $test $shortsize -ge 2; then
9816 u16type="unsigned short"
9824 '') case "$longsize" in
9826 u32type="unsigned long"
9830 *) case "$intsize" in
9832 u32type="unsigned int"
9843 if eval $compile; then
9844 case "`./try$exe_ext`" in
9856 '') if $test $intsize -ge 4; then
9858 u32type="unsigned int"
9866 '') case "$d_quad:$quadtype" in
9869 u64type="$uquadtype"
9877 $echo "Checking whether your NVs can preserve your UVs..." >&4
9881 $uvtype k = ($uvtype)~0, l;
9887 printf("preserve\n");
9892 if eval $compile; then
9893 case "`./try$exe_ext`" in
9894 preserve) d_nvpresuv="$define" ;;
9897 case "$d_nvpresuv" in
9898 $define) $echo "Yes, they can." 2>&1 ;;
9899 *) $echo "No, they can't." 2>&1
9906 : see if POSIX threads are available
9907 set pthread.h i_pthread
9913 : how to create joinable pthreads
9914 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9916 echo "Checking what constant to use for creating joinable pthreads..." >&4
9917 $cat >try.c <<'EOCP'
9918 #include <pthread.h>
9920 int detachstate = JOINABLE;
9923 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9924 if eval $compile; then
9925 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9926 val="$undef" # Yes, undef.
9927 set d_old_pthread_create_joinable
9930 set old_pthread_create_joinable
9933 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9934 if eval $compile; then
9935 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9937 set d_old_pthread_create_joinable
9939 val=PTHREAD_CREATE_UNDETACHED
9940 set old_pthread_create_joinable
9943 set try -DJOINABLE=__UNDETACHED
9944 if eval $compile; then
9945 echo "You seem to use __UNDETACHED." >&4
9947 set d_old_pthread_create_joinable
9950 set old_pthread_create_joinable
9953 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9955 set d_old_pthread_create_joinable
9958 set old_pthread_create_joinable
9965 d_old_pthread_create_joinable="$undef"
9966 old_pthread_create_joinable=""
9969 : see if pause exists
9973 : see if pipe exists
9977 : see if poll exists
9982 : see whether the various POSIXish _yields exist
9984 #include <pthread.h>
9990 #ifdef PTHREAD_YIELD
9993 #ifdef PTHREAD_YIELD_NULL
9994 pthread_yield(NULL);
10000 : see if sched_yield exists
10001 set try -DSCHED_YIELD
10002 if eval $compile; then
10004 sched_yield='sched_yield()'
10008 case "$usethreads" in
10011 $define) echo 'sched_yield() found.' >&4 ;;
10012 *) echo 'sched_yield() NOT found.' >&4 ;;
10018 : see if pthread_yield exists
10019 set try -DPTHREAD_YIELD
10020 if eval $compile; then
10022 case "$sched_yield" in
10023 '') sched_yield='pthread_yield()' ;;
10026 set try -DPTHREAD_YIELD_NULL
10027 if eval $compile; then
10029 case "$sched_yield" in
10030 '') sched_yield='pthread_yield(NULL)' ;;
10036 case "$usethreads" in
10039 $define) echo 'pthread_yield() found.' >&4 ;;
10040 *) echo 'pthread_yield() NOT found.' >&4 ;;
10044 set d_pthread_yield
10047 case "$sched_yield" in
10048 '') sched_yield=undef ;;
10053 : see if this is a pwd.h system
10059 xxx=`./findhdr pwd.h`
10060 $cppstdin $cppflags $cppminus < $xxx >$$.h
10062 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10070 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10078 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10086 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10094 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10102 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10110 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10118 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10130 set d_pwquota; eval $setvar
10131 set d_pwage; eval $setvar
10132 set d_pwchange; eval $setvar
10133 set d_pwclass; eval $setvar
10134 set d_pwexpire; eval $setvar
10135 set d_pwcomment; eval $setvar
10136 set d_pwgecos; eval $setvar
10137 set d_pwpasswd; eval $setvar
10141 : see if readdir and friends exist
10142 set readdir d_readdir
10144 set seekdir d_seekdir
10146 set telldir d_telldir
10148 set rewinddir d_rewinddir
10151 : see if readlink exists
10152 set readlink d_readlink
10155 : see if rename exists
10156 set rename d_rename
10159 : see if rmdir exists
10163 : see if memory.h is available.
10168 : See if it conflicts with string.h
10174 $cppstdin $cppflags $cppminus < $strings > mem.h
10175 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10177 echo "We won't be including <memory.h>."
10187 : can bcopy handle overlapping blocks?
10192 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10194 #$i_memory I_MEMORY
10195 #$i_stdlib I_STDLIB
10196 #$i_string I_STRING
10197 #$i_unistd I_UNISTD
10199 $cat >>try.c <<'EOCP'
10202 # include <memory.h>
10205 # include <stdlib.h>
10208 # include <string.h>
10210 # include <strings.h>
10213 # include <unistd.h> /* Needed for NetBSD */
10217 char buf[128], abc[128];
10223 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10225 for (align = 7; align >= 0; align--) {
10226 for (len = 36; len; len--) {
10228 bcopy(abc, b, len);
10229 for (off = 1; off <= len; off++) {
10230 bcopy(b, b+off, len);
10231 bcopy(b+off, b, len);
10232 if (bcmp(b, abc, len))
10241 if eval $compile_ok; then
10242 if ./try 2>/dev/null; then
10243 echo "Yes, it can."
10246 echo "It can't, sorry."
10247 case "$d_memmove" in
10248 "$define") echo "But that's Ok since you have memmove()." ;;
10252 echo "(I can't compile the test program, so we'll assume not...)"
10253 case "$d_memmove" in
10254 "$define") echo "But that's Ok since you have memmove()." ;;
10259 $rm -f try.* try core
10263 : can memcpy handle overlapping blocks?
10265 case "$d_memcpy" in
10268 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10270 #$i_memory I_MEMORY
10271 #$i_stdlib I_STDLIB
10272 #$i_string I_STRING
10273 #$i_unistd I_UNISTD
10275 $cat >>try.c <<'EOCP'
10278 # include <memory.h>
10281 # include <stdlib.h>
10284 # include <string.h>
10286 # include <strings.h>
10289 # include <unistd.h> /* Needed for NetBSD */
10293 char buf[128], abc[128];
10299 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10300 try to store the string in read-only memory. */
10301 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10303 for (align = 7; align >= 0; align--) {
10304 for (len = 36; len; len--) {
10306 memcpy(b, abc, len);
10307 for (off = 1; off <= len; off++) {
10308 memcpy(b+off, b, len);
10309 memcpy(b, b+off, len);
10310 if (memcmp(b, abc, len))
10319 if eval $compile_ok; then
10320 if ./try 2>/dev/null; then
10321 echo "Yes, it can."
10324 echo "It can't, sorry."
10325 case "$d_memmove" in
10326 "$define") echo "But that's Ok since you have memmove()." ;;
10330 echo "(I can't compile the test program, so we'll assume not...)"
10331 case "$d_memmove" in
10332 "$define") echo "But that's Ok since you have memmove()." ;;
10337 $rm -f try.* try core
10341 : can memcmp be trusted to compare relative magnitude?
10343 case "$d_memcmp" in
10346 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10348 #$i_memory I_MEMORY
10349 #$i_stdlib I_STDLIB
10350 #$i_string I_STRING
10351 #$i_unistd I_UNISTD
10353 $cat >>try.c <<'EOCP'
10356 # include <memory.h>
10359 # include <stdlib.h>
10362 # include <string.h>
10364 # include <strings.h>
10367 # include <unistd.h> /* Needed for NetBSD */
10373 if ((a < b) && memcmp(&a, &b, 1) < 0)
10379 if eval $compile_ok; then
10380 if ./try 2>/dev/null; then
10381 echo "Yes, it can."
10384 echo "No, it can't (it uses signed chars)."
10387 echo "(I can't compile the test program, so we'll assume not...)"
10391 $rm -f try.* try core
10395 : see if select exists
10396 set select d_select
10399 : see if semctl exists
10400 set semctl d_semctl
10403 : see if semget exists
10404 set semget d_semget
10407 : see if semop exists
10411 : see how much of the 'sem*(2)' library is present.
10414 case "$d_semctl$d_semget$d_semop" in
10415 *"$undef"*) h_sem=false;;
10419 case "`ipcs 2>&1`" in
10420 "SVID messages"*"not configured"*)
10421 echo "Your $osname does not have the sem*(2) configured." >&4
10424 set semctl d_semctl
10426 set semget d_semget
10434 : we could also check for sys/ipc.h ...
10435 if $h_sem && $test `./findhdr sys/sem.h`; then
10436 echo "You have the full sem*(2) library." >&4
10439 echo "You don't have the full sem*(2) library." >&4
10445 : see whether sys/sem.h defines union semun
10447 $cat > try.c <<'END'
10448 #include <sys/types.h>
10449 #include <sys/ipc.h>
10450 #include <sys/sem.h>
10451 int main () { union semun semun; semun.buf = 0; }
10454 if eval $compile; then
10455 echo "You have union semun in <sys/sem.h>." >&4
10458 echo "You do not have union semun in <sys/sem.h>." >&4
10461 $rm -f try try.c try.h
10465 : see how to do semctl IPC_STAT
10468 : see whether semctl IPC_STAT can use union semun
10473 # define S_IRUSR S_IREAD
10474 # define S_IWUSR S_IWRITE
10475 # define S_IXUSR S_IEXEC
10477 # define S_IRUSR 0400
10478 # define S_IWUSR 0200
10479 # define S_IXUSR 0100
10481 # define S_IRGRP (S_IRUSR>>3)
10482 # define S_IWGRP (S_IWUSR>>3)
10483 # define S_IXGRP (S_IXUSR>>3)
10484 # define S_IROTH (S_IRUSR>>6)
10485 # define S_IWOTH (S_IWUSR>>6)
10486 # define S_IXOTH (S_IXUSR>>6)
10489 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10490 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10491 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10496 #include <sys/types.h>
10497 #include <sys/ipc.h>
10498 #include <sys/sem.h>
10499 #include <sys/stat.h>
10506 #$d_union_semun HAS_UNION_SEMUN
10509 #ifndef HAS_UNION_SEMUN
10512 struct semid_ds *buf;
10513 unsigned short *array;
10519 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10520 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10522 struct semid_ds argbuf;
10525 st = semctl(sem, 0, IPC_STAT, arg);
10529 # endif /* IPC_STAT */
10530 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10532 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10533 # endif /* IPC_RMID */
10534 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10536 #endif /* IPC_PRIVATE && ... */
10537 printf("semget failed: errno = %d\n", errno);
10543 if eval $compile; then
10546 semun) val="$define" ;;
10552 case "$d_semctl_semun" in
10554 echo "You can use union semun for semctl IPC_STAT." >&4
10557 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10562 : see whether semctl IPC_STAT can use struct semid_ds pointer
10563 $cat > try.c <<'END'
10564 #include <sys/types.h>
10565 #include <sys/ipc.h>
10566 #include <sys/sem.h>
10567 #include <sys/stat.h>
10575 struct semid_ds arg;
10578 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10579 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10582 st = semctl(sem, 0, IPC_STAT, &arg);
10584 printf("semid_ds\n");
10586 # endif /* IPC_STAT */
10587 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10589 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10590 # endif /* IPC_RMID */
10591 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10593 #endif /* IPC_PRIVATE && ... */
10594 printf("semget failed: errno = %d\n", errno);
10601 if eval $compile; then
10604 semid_ds) val="$define" ;;
10608 set d_semctl_semid_ds
10610 case "$d_semctl_semid_ds" in
10612 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10614 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10621 # We do not have the full sem*(2) library, so assume we can not
10627 set d_semctl_semid_ds
10632 : see if setegid exists
10633 set setegid d_setegid
10636 : see if seteuid exists
10637 set seteuid d_seteuid
10640 : see if setgrent exists
10641 set setgrent d_setgrent
10644 : see if sethostent exists
10645 set sethostent d_sethent
10648 : see if setlinebuf exists
10649 set setlinebuf d_setlinebuf
10652 : see if setlocale exists
10653 set setlocale d_setlocale
10656 : see if setnetent exists
10657 set setnetent d_setnent
10660 : see if setprotoent exists
10661 set setprotoent d_setpent
10664 : see if setpgid exists
10665 set setpgid d_setpgid
10668 : see if setpgrp2 exists
10669 set setpgrp2 d_setpgrp2
10672 : see if setpriority exists
10673 set setpriority d_setprior
10676 : see if setpwent exists
10677 set setpwent d_setpwent
10680 : see if setregid exists
10681 set setregid d_setregid
10683 set setresgid d_setresgid
10686 : see if setreuid exists
10687 set setreuid d_setreuid
10689 set setresuid d_setresuid
10692 : see if setrgid exists
10693 set setrgid d_setrgid
10696 : see if setruid exists
10697 set setruid d_setruid
10700 : see if setservent exists
10701 set setservent d_setsent
10704 : see if setsid exists
10705 set setsid d_setsid
10708 : see if setspent exists
10709 set setspent d_setspent
10712 : see if setvbuf exists
10713 set setvbuf d_setvbuf
10716 : see if sfio.h is available
10721 : see if sfio library is available
10732 : Ok, but do we want to use it.
10736 true|$define|[yY]*) dflt='y';;
10739 echo "$package can use the sfio library, but it is experimental."
10740 rp="You seem to have sfio available, do you want to try using it?"
10744 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10746 : Remove sfio from list of libraries to use
10747 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10750 echo "libs = $libs" >&4
10754 *) case "$usesfio" in
10755 true|$define|[yY]*)
10756 echo "Sorry, cannot find sfio on this machine" >&4
10757 echo "Ignoring your setting of usesfio=$usesfio" >&4
10765 $define) usesfio='true';;
10766 *) usesfio='false';;
10769 : see if shmctl exists
10770 set shmctl d_shmctl
10773 : see if shmget exists
10774 set shmget d_shmget
10777 : see if shmat exists
10780 : see what shmat returns
10783 $cat >shmat.c <<'END'
10784 #include <sys/shm.h>
10787 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10792 echo "and it returns ($shmattype)." >&4
10793 : see if a prototype for shmat is available
10794 xxx=`./findhdr sys/shm.h`
10795 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10796 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10807 set d_shmatprototype
10810 : see if shmdt exists
10814 : see how much of the 'shm*(2)' library is present.
10817 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10818 *"$undef"*) h_shm=false;;
10822 case "`ipcs 2>&1`" in
10823 "SVID shared memory"*"not configured"*)
10824 echo "Your $osname does not have the shm*(2) configured." >&4
10827 set shmctl d_shmctl
10829 set shmget d_shmget
10839 : we could also check for sys/ipc.h ...
10840 if $h_shm && $test `./findhdr sys/shm.h`; then
10841 echo "You have the full shm*(2) library." >&4
10844 echo "You don't have the full shm*(2) library." >&4
10851 : see if we have sigaction
10852 if set sigaction val -f d_sigaction; eval $csym; $val; then
10853 echo 'sigaction() found.' >&4
10854 $cat > try.c <<'EOP'
10856 #include <sys/types.h>
10857 #include <signal.h>
10860 struct sigaction act, oact;
10862 oact.sa_handler = 0;
10863 /* so that act and oact are used */
10864 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10868 if eval $compile_ok; then
10871 echo "But you don't seem to have a useable struct sigaction." >&4
10875 echo 'sigaction NOT found.' >&4
10878 set d_sigaction; eval $setvar
10879 $rm -f try try$_o try.c
10881 : see if sigsetjmp exists
10883 case "$d_sigsetjmp" in
10885 $cat >try.c <<'EOP'
10886 #include <setjmp.h>
10891 if (sigsetjmp(env,1))
10894 siglongjmp(env, 1);
10899 if eval $compile; then
10900 if ./try >/dev/null 2>&1; then
10901 echo "POSIX sigsetjmp found." >&4
10905 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10911 echo "sigsetjmp not found." >&4
10915 *) val="$d_sigsetjmp"
10916 case "$d_sigsetjmp" in
10917 $define) echo "POSIX sigsetjmp found." >&4;;
10918 $undef) echo "sigsetjmp not found." >&4;;
10926 : see if sqrtl exists
10930 : see if sys/stat.h is available
10931 set sys/stat.h i_sysstat
10935 : see if stat knows about block sizes
10937 echo "Checking to see if your struct stat has st_blocks field..." >&4
10938 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10942 : see if this is a sys/vfs.h system
10943 set sys/vfs.h i_sysvfs
10947 : see if this is a sys/statfs.h system
10948 set sys/statfs.h i_sysstatfs
10953 echo "Checking to see if your system supports struct statfs..." >&4
10954 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
10956 case "$d_statfs_s" in
10957 "$define") echo "Yes, it does." ;;
10958 *) echo "No, it doesn't." ;;
10963 : see if struct statfs knows about f_flags
10964 case "$d_statfs_s" in
10967 echo "Checking to see if your struct statfs has f_flags field..." >&4
10968 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
10972 set d_statfs_f_flags
10976 case "$d_statfs_f_flags" in
10977 "$define") echo "Yes, it does." ;;
10978 *) echo "No, it doesn't." ;;
10981 : see if _ptr and _cnt from stdio act std
10983 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10984 echo "(Looks like you have stdio.h from Linux.)"
10985 case "$stdio_ptr" in
10986 '') stdio_ptr='((fp)->_IO_read_ptr)'
10989 *) ptr_lval=$d_stdio_ptr_lval;;
10991 case "$stdio_cnt" in
10992 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10995 *) cnt_lval=$d_stdio_cnt_lval;;
10997 case "$stdio_base" in
10998 '') stdio_base='((fp)->_IO_read_base)';;
11000 case "$stdio_bufsiz" in
11001 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11004 case "$stdio_ptr" in
11005 '') stdio_ptr='((fp)->_ptr)'
11008 *) ptr_lval=$d_stdio_ptr_lval;;
11010 case "$stdio_cnt" in
11011 '') stdio_cnt='((fp)->_cnt)'
11014 *) cnt_lval=$d_stdio_cnt_lval;;
11016 case "$stdio_base" in
11017 '') stdio_base='((fp)->_base)';;
11019 case "$stdio_bufsiz" in
11020 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11023 : test whether _ptr and _cnt really work
11024 echo "Checking how std your stdio is..." >&4
11027 #define FILE_ptr(fp) $stdio_ptr
11028 #define FILE_cnt(fp) $stdio_cnt
11030 FILE *fp = fopen("try.c", "r");
11033 18 <= FILE_cnt(fp) &&
11034 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11042 if eval $compile; then
11044 echo "Your stdio acts pretty std."
11047 echo "Your stdio isn't very std."
11050 echo "Your stdio doesn't appear very std."
11056 : Can _ptr be used as an lvalue?
11057 case "$d_stdstdio$ptr_lval" in
11058 $define$define) val=$define ;;
11061 set d_stdio_ptr_lval
11064 : Can _cnt be used as an lvalue?
11065 case "$d_stdstdio$cnt_lval" in
11066 $define$define) val=$define ;;
11069 set d_stdio_cnt_lval
11072 : see if _base is also standard
11074 case "$d_stdstdio" in
11078 #define FILE_base(fp) $stdio_base
11079 #define FILE_bufsiz(fp) $stdio_bufsiz
11081 FILE *fp = fopen("try.c", "r");
11084 19 <= FILE_bufsiz(fp) &&
11085 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11092 if eval $compile; then
11094 echo "And its _base field acts std."
11097 echo "But its _base field isn't std."
11100 echo "However, it seems to be lacking the _base field."
11109 Checking how to access stdio streams by file descriptor number...
11111 case "$stdio_stream_array" in
11112 '') $cat >try.c <<EOCP
11115 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11119 for s in _iob __iob __sF
11121 set try -DSTDIO_STREAM_ARRAY=$s
11122 if eval $compile; then
11123 case "`./try$exe_ext`" in
11124 yes) stdio_stream_array=$s; break ;;
11128 $rm -f try.* try$exe_ext
11130 case "$stdio_stream_array" in
11132 I can't figure out how to access stdio streams by file descriptor number.
11134 d_stdio_stream_array="$undef"
11137 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11139 d_stdio_stream_array="$define"
11143 : see if strcoll exists
11144 set strcoll d_strcoll
11147 : check for structure copying
11149 echo "Checking to see if your C compiler can copy structs..." >&4
11150 $cat >try.c <<'EOCP'
11160 if $cc -c try.c >/dev/null 2>&1 ; then
11162 echo "Yup, it can."
11165 echo "Nope, it can't."
11171 : see if strerror and/or sys_errlist[] exist
11173 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11174 if set strerror val -f d_strerror; eval $csym; $val; then
11175 echo 'strerror() found.' >&4
11176 d_strerror="$define"
11177 d_strerrm='strerror(e)'
11178 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11179 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11180 d_syserrlst="$define"
11182 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11183 d_syserrlst="$undef"
11185 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11186 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11187 echo 'strerror() found in string header.' >&4
11188 d_strerror="$define"
11189 d_strerrm='strerror(e)'
11190 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11191 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11192 d_syserrlst="$define"
11194 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11195 d_syserrlst="$undef"
11197 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11198 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11199 d_strerror="$undef"
11200 d_syserrlst="$define"
11201 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11203 echo 'strerror() and sys_errlist[] NOT found.' >&4
11204 d_strerror="$undef"
11205 d_syserrlst="$undef"
11206 d_strerrm='"unknown"'
11210 : see if strtod exists
11211 set strtod d_strtod
11214 : see if strtol exists
11215 set strtol d_strtol
11218 : see if strtold exists
11219 set strtold d_strtold
11222 : see if strtoll exists
11223 set strtoll d_strtoll
11226 : see if strtoul exists
11227 set strtoul d_strtoul
11230 : see if strtoull exists
11231 set strtoull d_strtoull
11234 : see if strtouq exists
11235 set strtouq d_strtouq
11238 : see if strxfrm exists
11239 set strxfrm d_strxfrm
11242 : see if symlink exists
11243 set symlink d_symlink
11246 : see if syscall exists
11247 set syscall d_syscall
11250 : see if sysconf exists
11251 set sysconf d_sysconf
11254 : see if system exists
11255 set system d_system
11258 : see if tcgetpgrp exists
11259 set tcgetpgrp d_tcgetpgrp
11262 : see if tcsetpgrp exists
11263 set tcsetpgrp d_tcsetpgrp
11266 : see if prototype for telldir is available
11268 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11271 : see if this is a sys/times.h system
11272 set sys/times.h i_systimes
11275 : see if times exists
11277 if set times val -f d_times; eval $csym; $val; then
11278 echo 'times() found.' >&4
11281 case "$i_systimes" in
11282 "$define") inc='sys/times.h';;
11284 rp="What is the type returned by times() on this system?"
11285 set clock_t clocktype long stdio.h sys/types.h $inc
11288 echo 'times() NOT found, hope that will do.' >&4
11293 : see if truncate exists
11294 set truncate d_truncate
11297 : see if tzname[] exists
11299 if set tzname val -a d_tzname; eval $csym; $val; then
11301 echo 'tzname[] found.' >&4
11304 echo 'tzname[] NOT found.' >&4
11309 : see if umask exists
11313 : see if ustat exists
11317 : backward compatibility for d_hvfork
11318 if test X$d_hvfork != X; then
11319 d_vfork="$d_hvfork"
11322 : see if there is a vfork
11327 : Ok, but do we want to use it. vfork is reportedly unreliable in
11328 : perl on Solaris 2.x, and probably elsewhere.
11332 case "$usevfork" in
11338 Perl can only use a vfork() that doesn't suffer from strict
11339 restrictions on calling functions or modifying global data in
11340 the child. For example, glibc-2.1 contains such a vfork()
11341 that is unsuitable. If your system provides a proper fork()
11342 call, chances are that you do NOT want perl to use vfork().
11345 rp="Do you still want to use vfork()?"
11350 echo "Ok, we won't use vfork()."
11359 $define) usevfork='true';;
11360 *) usevfork='false';;
11363 : see if this is an sysdir system
11364 set sys/dir.h i_sysdir
11367 : see if this is an sysndir system
11368 set sys/ndir.h i_sysndir
11371 : see if closedir exists
11372 set closedir d_closedir
11375 case "$d_closedir" in
11378 echo "Checking whether closedir() returns a status..." >&4
11379 cat > closedir.c <<EOM
11380 #$i_dirent I_DIRENT /**/
11381 #$i_sysdir I_SYS_DIR /**/
11382 #$i_sysndir I_SYS_NDIR /**/
11383 #$i_systypes I_SYS_TYPES /**/
11385 #if defined(I_SYS_TYPES)
11386 #include <sys/types.h>
11388 #if defined(I_DIRENT)
11389 #include <dirent.h>
11390 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11391 #include <sys/dir.h>
11395 #include <sys/ndir.h>
11399 #include <ndir.h> /* may be wrong in the future */
11401 #include <sys/dir.h>
11406 int main() { return closedir(opendir(".")); }
11409 if eval $compile_ok; then
11410 if ./closedir > /dev/null 2>&1 ; then
11411 echo "Yes, it does."
11414 echo "No, it doesn't."
11418 echo "(I can't seem to compile the test program--assuming it doesn't)"
11426 set d_void_closedir
11429 : check for volatile keyword
11431 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11432 $cat >try.c <<'EOCP'
11435 typedef struct _goo_struct goo_struct;
11436 goo_struct * volatile goo = ((goo_struct *)0);
11437 struct _goo_struct {
11442 typedef unsigned short foo_t;
11443 char *volatile foo;
11445 volatile foo_t blech;
11449 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11451 echo "Yup, it does."
11454 echo "Nope, it doesn't."
11460 : see if there is a wait4
11464 : see if waitpid exists
11465 set waitpid d_waitpid
11468 : see if wcstombs exists
11469 set wcstombs d_wcstombs
11472 : see if wctomb exists
11473 set wctomb d_wctomb
11476 : preserve RCS keywords in files with variable substitution, grrr
11481 Revision='$Revision'
11483 case "$crosscompile" in
11484 ''|[nN]*) crosscompile="$undef" ;;
11488 next|rhapsody) multiarch="$define" ;;
11490 case "$multiarch" in
11491 ''|[nN]*) multiarch="$undef" ;;
11494 : check for alignment requirements
11496 case "$crosscompile$multiarch" in
11499 You seem to be either cross-compiling or doing a multiarchitecture build,
11500 skipping the memory alignment check.
11503 case "$alignbytes" in
11504 '') alignbytes=8 ;;
11508 case "$alignbytes" in
11509 '') echo "Checking alignment constraints..." >&4
11510 $cat >try.c <<'EOCP'
11518 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11523 if eval $compile_ok; then
11527 echo "(I can't seem to compile the test program...)"
11530 *) dflt="$alignbytes"
11533 rp="Doubles must be aligned on a how-many-byte boundary?"
11541 : check for ordering of bytes in a long
11543 case "$crosscompile$multiarch" in
11546 You seem to be either cross-compiling or doing a multiarchitecture build,
11547 skipping the byteorder check.
11553 case "$byteorder" in
11556 In the following, larger digits indicate more significance. A big-endian
11557 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11558 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11559 machines may have weird orders like 3412. A Cray will report 87654321,
11560 an Alpha will report 12345678. If the test program works the default is
11562 I'm now running the test program...
11564 $cat >try.c <<'EOCP'
11571 char c[sizeof(long)];
11574 if (sizeof(long) > 4)
11575 u.l = (0x08070605L << 32) | 0x04030201L;
11578 for (i = 0; i < sizeof(long); i++)
11579 printf("%c", u.c[i]+'0');
11586 if eval $compile && ./try > /dev/null; then
11589 [1-4][1-4][1-4][1-4]|12345678|87654321)
11590 echo "(The test program ran ok.)"
11591 echo "byteorder=$dflt"
11594 ????|????????) echo "(The test program ran ok.)" ;;
11595 *) echo "(The test program didn't run right for some reason.)" ;;
11600 (I can't seem to compile the test program. Guessing big-endian...)
11603 case "$xxx_prompt" in
11605 rp="What is the order of bytes in a long?"
11619 : how do we catenate cpp tokens here?
11621 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11622 $cat >cpp_stuff.c <<'EOCP'
11623 #define RCAT(a,b)a/**/b
11624 #define ACAT(a,b)a ## b
11628 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11629 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11630 echo "Oh! Smells like ANSI's been here." >&4
11631 echo "We can catify or stringify, separately or together!"
11633 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11634 echo "Ah, yes! The good old days!" >&4
11635 echo "However, in the good old days we don't know how to stringify and"
11636 echo "catify at the same time."
11640 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11641 to have to edit the values of CAT[2-5] in config.h...
11643 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11647 : see if this is a db.h system
11653 : Check db version.
11655 echo "Checking Berkeley DB version ..." >&4
11661 #include <sys/types.h>
11666 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11667 int Major, Minor, Patch ;
11668 unsigned long Version ;
11669 (void)db_version(&Major, &Minor, &Patch) ;
11670 printf("You have Berkeley DB Version 2 or greater\n");
11672 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11673 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11674 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11675 Major, Minor, Patch) ;
11677 /* check that db.h & libdb are compatible */
11678 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11679 printf("db.h and libdb are incompatible\n") ;
11683 printf("db.h and libdb are compatible\n") ;
11685 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11686 + DB_VERSION_PATCH ;
11688 /* needs to be >= 2.3.4 */
11689 if (Version < 2003004) {
11690 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11691 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11697 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11698 printf("You have Berkeley DB Version 1\n");
11699 exit(0); /* DB version < 2: the coast is clear. */
11701 exit(1); /* <db.h> not Berkeley DB? */
11707 if eval $compile_ok && ./try; then
11708 echo 'Looks OK.' >&4
11710 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11714 : Remove db from list of libraries to use
11715 echo "Removing unusable -ldb from library list" >&4
11716 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11719 echo "libs = $libs" >&4
11729 : Check the return type needed for hash
11731 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11737 #include <sys/types.h>
11740 #ifndef DB_VERSION_MAJOR
11741 u_int32_t hash_cb (ptr, size)
11749 info.hash = hash_cb;
11753 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11754 if $contains warning try.out >>/dev/null 2>&1 ; then
11757 db_hashtype='u_int32_t'
11760 : XXX Maybe we should just give up here.
11761 db_hashtype=u_int32_t
11763 echo "Help: I can't seem to compile the db test program." >&4
11764 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11767 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11769 *) db_hashtype=u_int32_t
11774 : Check the return type needed for prefix
11776 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11782 #include <sys/types.h>
11785 #ifndef DB_VERSION_MAJOR
11786 size_t prefix_cb (key1, key2)
11794 info.prefix = prefix_cb;
11798 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11799 if $contains warning try.out >>/dev/null 2>&1 ; then
11800 db_prefixtype='int'
11802 db_prefixtype='size_t'
11805 db_prefixtype='size_t'
11806 : XXX Maybe we should just give up here.
11808 echo "Help: I can't seem to compile the db test program." >&4
11809 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11812 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11814 *) db_prefixtype='size_t'
11818 : check for void type
11820 echo "Checking to see how well your C compiler groks the void type..." >&4
11821 case "$voidflags" in
11823 $cat >try.c <<'EOCP'
11829 extern void moo(); /* function returning void */
11830 void (*goo)(); /* ptr to func returning void */
11832 void *hue; /* generic ptr */
11845 int main() { sub(); }
11847 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11848 voidflags=$defvoidused
11849 echo "Good. It appears to support void to the level $package wants.">&4
11850 if $contains warning .out >/dev/null 2>&1; then
11851 echo "However, you might get some warnings that look like this:"
11855 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11856 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11857 echo "It supports 1..."
11858 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11859 echo "It also supports 2..."
11860 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11862 echo "And it supports 4 but not 8 definitely."
11864 echo "It doesn't support 4..."
11865 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11867 echo "But it supports 8."
11870 echo "Neither does it support 8."
11874 echo "It does not support 2..."
11875 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11877 echo "But it supports 4 and 8."
11879 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11881 echo "And it supports 4 but has not heard about 8."
11883 echo "However it supports 8 but not 4."
11888 echo "There is no support at all for void."
11893 case "$voidflags" in
11895 *) $cat >&4 <<'EOM'
11896 Support flag bits are:
11897 1: basic void declarations.
11898 2: arrays of pointers to functions returning void.
11899 4: operations between pointers to and addresses of void functions.
11900 8: generic void pointers.
11903 rp="Your void support flags add up to what?"
11911 : How can we generate normalized random numbers ?
11913 echo "Looking for a random number function..." >&4
11914 case "$randfunc" in
11916 if set drand48 val -f; eval $csym; $val; then
11918 echo "Good, found drand48()." >&4
11919 elif set random val -f; eval $csym; $val; then
11921 echo "OK, found random()." >&4
11924 echo "Yick, looks like I have to use rand()." >&4
11935 *-Dmy_rand=*|*-Dmy_srand=*)
11936 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11937 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11938 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11939 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11943 while $test "$cont"; do
11944 rp="Use which function to generate random numbers?"
11946 if $test "$ans" = "$dflt"; then
11952 if set $ans val -f; eval $csym; $val; then
11956 rp="I cannot find function $ans. Use that name anyway?"
11965 case "$randfunc" in
11967 drand01="drand48()"
11973 case "$randbits" in
11975 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11977 #$i_unistd I_UNISTD
11978 #$i_stdlib I_STDLIB
11981 # include <unistd.h>
11984 # include <stdlib.h>
11989 register unsigned long tmp;
11990 register unsigned long max = 0L;
11992 for (i = 1000; i; i--) {
11993 tmp = (unsigned long) $randfunc();
11994 if (tmp > max) max = tmp;
11996 for (i = 0; max; i++)
12002 if eval $compile_ok; then
12006 echo "(I can't seem to compile the test program...)"
12013 rp="How many bits does your $randfunc() function produce?"
12017 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12018 seedfunc="s$randfunc"
12019 randseedtype=unsigned
12023 rp="How many bits does your $randfunc() function produce?"
12026 seedfunc="s$randfunc"
12027 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12028 if set $seedfunc val -f; eval $csym; $val; then
12029 echo "(Using $seedfunc() to seed random generator)"
12031 echo "(Warning: no $seedfunc() to seed random generator)"
12034 randseedtype=unsigned
12042 echo "Determining whether or not we are on an EBCDIC system..." >&4
12043 $cat >tebcdic.c <<'EOM'
12046 if ('M'==0xd4) return 0;
12053 if eval $compile_ok; then
12055 echo "You have EBCDIC." >&4
12058 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12061 echo "I'm unable to compile the test program." >&4
12062 echo "I'll assume ASCII or some ISO Latin." >&4
12064 $rm -f tebcdic.c tebcdic
12070 Checking how to flush all pending stdio output...
12072 # I only know how to find the first 32 possibly open files on SunOS.
12073 # See also hints/sunos_4_1.sh and util.c --AD
12075 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12077 $cat >>try.c <<EOCP
12079 #$i_unistd I_UNISTD
12081 # include <unistd.h>
12083 #$d_sysconf HAS_SYSCONF
12084 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12085 #ifdef HAS_STDIO_STREAM_ARRAY
12086 # define STDIO_STREAM_ARRAY $stdio_stream_array
12089 FILE* p = fopen("try.out", "w");
12093 # ifdef TRY_FPRINTF
12097 #ifdef TRY_FFLUSH_NULL
12100 #ifdef TRY_FFLUSH_ALL
12102 long open_max = -1;
12103 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12104 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12106 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12107 open_max = sysconf(_SC_OPEN_MAX);
12110 open_max = FOPEN_MAX;
12113 open_max = OPEN_MAX;
12122 # ifdef HAS_STDIO_STREAM_ARRAY
12123 if (open_max > 0) {
12125 for (i = 0; i < open_max; i++)
12126 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12127 STDIO_STREAM_ARRAY[i]._file < open_max &&
12128 STDIO_STREAM_ARRAY[i]._flag)
12129 fflush(&STDIO_STREAM_ARRAY[i]);
12137 : first we have to find out how _not_ to flush
12138 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12140 set try -DTRY_FPUTC
12141 if eval $compile; then
12143 ./try$exe_ext 2>/dev/null
12144 if $test ! -s try.out -a "X$?" = X42; then
12150 set try -DTRY_FPRINTF
12152 if eval $compile; then
12154 ./try$exe_ext 2>/dev/null
12155 if $test ! -s try.out -a "X$?" = X42; then
12156 output=-DTRY_FPRINTF
12162 : check for fflush NULL behaviour
12163 case "$fflushNULL" in
12164 '') set try -DTRY_FFLUSH_NULL $output
12165 if eval $compile; then
12167 ./try$exe_ext 2>/dev/null
12169 if $test -s try.out -a "X$code" = X42; then
12170 fflushNULL="`$cat try.out`"
12172 if $test "X$code" != X42; then
12174 (If this test failed, don't worry, we'll try another method shortly.)
12179 $rm -f core try.core core.try.*
12180 case "$fflushNULL" in
12182 Your fflush(NULL) works okay.
12184 fflushNULL="$define"
12187 Your fflush(NULL) isn't working (contrary to ANSI C).
12189 fflushNULL="$undef"
12192 Cannot figure out whether your fflush(NULL) works or not.
12193 I'm assuming it doesn't (contrary to ANSI C).
12195 fflushNULL="$undef"
12199 $define|true|[yY]*)
12200 fflushNULL="$define"
12203 fflushNULL="$undef"
12206 : check explicit looping only if NULL did not work
12207 case "$fflushNULL" in
12209 : check for fflush all behaviour
12210 case "$fflushall" in
12211 '') set try -DTRY_FFLUSH_ALL $output
12212 if eval $compile; then
12214 (Now testing the other method--but note that also this may fail.)
12217 ./try$exe_ext 2>/dev/null
12218 if $test -s try.out -a "X$?" = X42; then
12219 fflushall="`$cat try.out`"
12222 $rm -f core try.core core.try.*
12223 case "$fflushall" in
12225 Whew. Flushing explicitly all the stdio streams works.
12227 fflushall="$define"
12230 Sigh. Flushing explicitly all the stdio streams doesn't work.
12235 Cannot figure out whether flushing stdio streams explicitly works or not.
12236 I'm assuming it doesn't.
12242 "$define"|true|[yY]*)
12243 fflushall="$define"
12250 *) fflushall="$undef"
12253 case "$fflushNULL$fflushall" in
12256 I cannot figure out how to flush pending stdio output.
12260 $rm -f try.* try$exe_ext
12262 : Store the full pathname to the ar program for use in the C program
12263 : Respect a hint or command line value for full_ar.
12268 : Store the full pathname to the sed program for use in the C program
12271 : see what type gids are declared as in the kernel
12273 echo "Looking for the type for group ids returned by getgid()."
12274 set gid_t gidtype xxx stdio.h sys/types.h
12278 xxx=`./findhdr sys/user.h`
12279 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12281 unsigned) dflt="$1 $2" ;;
12285 *) dflt="$gidtype";;
12288 gid_t) echo "gid_t found." ;;
12289 *) rp="What is the type for group ids returned by getgid()?"
12297 *_t) zzz="$gidtype" ;;
12300 echo "Checking the size of $zzz..." >&4
12302 #include <sys/types.h>
12305 printf("%d\n", (int)sizeof($gidtype));
12310 if eval $compile_ok; then
12314 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12317 echo "Your $zzz size is $gidsize bytes."
12322 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12328 *_t) zzz="$gidtype" ;;
12331 echo "Checking the sign of $zzz..." >&4
12333 #include <sys/types.h>
12344 if eval $compile; then
12348 echo "(I can't execute the test program--guessing unsigned.)" >&4
12352 1) echo "Your $zzz is unsigned." ;;
12353 -1) echo "Your $zzz is signed." ;;
12359 echo "(I can't compile the test program--guessing unsigned.)" >&4
12365 if $test X"$quadtype" != X; then
12367 echo "Checking how to print 64-bit integers..." >&4
12369 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12370 $cat >try.c <<'EOCP'
12371 #include <sys/types.h>
12374 int q = 12345678901;
12375 printf("%ld\n", q);
12379 if eval $compile; then
12380 yyy=`./try$exe_ext`
12383 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12384 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12385 echo "We will use %d."
12391 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12392 $cat >try.c <<'EOCP'
12393 #include <sys/types.h>
12396 long q = 12345678901;
12397 printf("%ld\n", q);
12401 if eval $compile; then
12402 yyy=`./try$exe_ext`
12405 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12406 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12407 echo "We will use %ld."
12413 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12414 $cat >try.c <<'EOCP'
12415 #include <sys/types.h>
12416 #include <inttypes.h>
12419 int64_t q = 12345678901;
12420 printf("%" PRId64 "\n", q);
12424 if eval $compile; then
12425 yyy=`./try$exe_ext`
12428 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12429 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12430 echo "We will use the C9X style."
12436 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12437 $cat >try.c <<'EOCP'
12438 #include <sys/types.h>
12441 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12442 printf("%lld\n", q);
12446 if eval $compile; then
12447 yyy=`./try$exe_ext`
12450 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12451 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12452 echo "We will use the %lld style."
12458 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12460 #include <sys/types.h>
12463 $quadtype q = 12345678901;
12464 printf("%Ld\n", q);
12468 if eval $compile; then
12469 yyy=`./try$exe_ext`
12472 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12473 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12474 echo "We will use %Ld."
12480 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12482 #include <sys/types.h>
12485 $quadtype q = 12345678901;
12486 printf("%qd\n", q);
12490 if eval $compile; then
12491 yyy=`./try$exe_ext`
12494 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12495 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12496 echo "We will use %qd."
12502 if $test X"$sPRId64" = X; then
12503 echo "Cannot figure out how to print 64-bit integers." >&4
12511 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12512 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12514 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12515 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12521 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12523 if $test X"$ivsize" = X8; then
12524 ivdformat="$sPRId64"
12525 uvuformat="$sPRIu64"
12526 uvoformat="$sPRIo64"
12527 uvxformat="$sPRIx64"
12529 if $test X"$ivsize" = X"$longsize"; then
12535 if $test X"$ivsize" = X"$intsize"; then
12542 if $test X"$ivsize" = X"$shortsize"; then
12552 case "$ivdformat" in
12553 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12560 $echo "Checking the format string to be used for gids..." >&4
12563 -1) if $test X"$gidsize" = X"$ivsize"; then
12564 gidformat="$ivdformat"
12566 if $test X"$gidsize" = X"$longsize"; then
12569 if $test X"$gidsize" = X"$intsize"; then
12572 if $test X"$gidsize" = X"$shortsize"; then
12579 *) if $test X"$gidsize" = X"$uvsize"; then
12580 gidformat="$uvuformat"
12582 if $test X"$gidsize" = X"$longsize"; then
12585 if $test X"$gidsize" = X"$intsize"; then
12588 if $test X"$gidsize" = X"$shortsize"; then
12597 : see if getgroups exists
12598 set getgroups d_getgrps
12601 : see if setgroups exists
12602 set setgroups d_setgrps
12606 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12608 case "$d_getgrps$d_setgrps" in
12610 case "$groupstype" in
12611 '') dflt="$gidtype" ;;
12612 *) dflt="$groupstype" ;;
12615 What type of pointer is the second argument to getgroups() and setgroups()?
12616 Usually this is the same as group ids, $gidtype, but not always.
12619 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12623 *) groupstype="$gidtype";;
12627 echo "Checking if your $make program sets \$(MAKE)..." >&4
12628 case "$make_set_make" in
12630 $sed 's/^X //' > testmake.mak << 'EOF'
12632 X @echo 'maketemp="$(MAKE)"'
12634 case "`$make -f testmake.mak 2>/dev/null`" in
12635 *maketemp=*) make_set_make='#' ;;
12636 *) make_set_make="MAKE=$make" ;;
12638 $rm -f testmake.mak
12641 case "$make_set_make" in
12642 '#') echo "Yup, it does.";;
12643 *) echo "Nope, it doesn't.";;
12646 : see what type is used for mode_t
12647 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12648 set mode_t modetype int stdio.h sys/types.h
12651 : define a fucntion to check prototypes
12652 $cat > protochk <<EOSH
12655 optimize="$optimize"
12657 prototype="$prototype"
12662 $cat >> protochk <<'EOSH'
12667 while test $# -ge 2; do
12669 $define) echo "#include <$2>" >> try.c ;;
12670 literal) echo "$2" >> try.c ;;
12674 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12675 cat >> try.c <<'EOCP'
12676 #ifdef CAN_PROTOTYPE
12677 #define _(args) args
12682 echo "$foo" >> try.c
12683 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12684 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12690 $eunicefix protochk
12692 : see what type is used for size_t
12693 rp="What is the type used for the length parameter for string functions?"
12694 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12697 : check for type of arguments to gethostbyaddr.
12698 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12699 case "$d_gethbyaddr" in
12703 Checking to see what type of arguments are accepted by gethostbyaddr().
12705 hdrs="$define sys/types.h
12706 $d_socket sys/socket.h
12707 $i_niin netinet/in.h
12709 $i_unistd unistd.h"
12710 : The first arg can 'char *' or 'void *'
12711 : The second arg is some of integral type
12712 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12713 for yyy in size_t long int; do
12714 case "$netdb_host_type" in
12715 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12716 if ./protochk "$try" $hdrs; then
12717 echo "Your system accepts $xxx for the first arg."
12718 echo "...and $yyy for the second arg."
12719 netdb_host_type="$xxx"
12720 netdb_hlen_type="$yyy"
12726 : In case none of those worked, prompt the user.
12727 case "$netdb_host_type" in
12728 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12731 netdb_host_type=$ans
12732 rp='What is the type for the 2nd argument to gethostbyaddr?'
12735 netdb_hlen_type=$ans
12739 *) : no gethostbyaddr, so pick harmless defaults
12740 netdb_host_type='char *'
12741 netdb_hlen_type="$sizetype"
12744 # Remove the "const" if needed. -- but then we'll have a
12746 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12749 : check for type of argument to gethostbyname.
12750 if test "X$netdb_name_type" = X ; then
12751 case "$d_gethbyname" in
12755 Checking to see what type of argument is accepted by gethostbyname().
12757 hdrs="$define sys/types.h
12758 $d_socket sys/socket.h
12759 $i_niin netinet/in.h
12761 $i_unistd unistd.h"
12762 for xxx in "const char *" "char *"; do
12763 case "$netdb_name_type" in
12764 '') try="extern struct hostent *gethostbyname($xxx);"
12765 if ./protochk "$try" $hdrs; then
12766 echo "Your system accepts $xxx."
12767 netdb_name_type="$xxx"
12772 : In case none of those worked, prompt the user.
12773 case "$netdb_name_type" in
12774 '') rp='What is the type for the 1st argument to gethostbyname?'
12777 netdb_name_type=$ans
12781 *) : no gethostbyname, so pick harmless default
12782 netdb_name_type='char *'
12787 : check for type of 1st argument to getnetbyaddr.
12788 if test "X$netdb_net_type" = X ; then
12789 case "$d_getnbyaddr" in
12793 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12795 hdrs="$define sys/types.h
12796 $d_socket sys/socket.h
12797 $i_niin netinet/in.h
12799 $i_unistd unistd.h"
12800 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12801 case "$netdb_net_type" in
12802 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12803 if ./protochk "$try" $hdrs; then
12804 echo "Your system accepts $xxx."
12805 netdb_net_type="$xxx"
12810 : In case none of those worked, prompt the user.
12811 case "$netdb_net_type" in
12812 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12815 netdb_net_type=$ans
12819 *) : no getnetbyaddr, so pick harmless default
12820 netdb_net_type='long'
12824 : locate the preferred pager for this system
12838 '') dflt=/usr/ucb/more;;
12845 rp='What pager is used on your system?'
12849 : see what type pids are declared as in the kernel
12850 rp="What is the type of process ids on this system?"
12851 set pid_t pidtype int stdio.h sys/types.h
12854 : check for length of pointer
12858 $echo $n "Checking to see how big your pointers are...$c" >&4
12859 if test "$voidflags" -gt 7; then
12860 echo '#define VOID_PTR char *' > try.c
12862 echo '#define VOID_PTR void *' > try.c
12864 $cat >>try.c <<'EOCP'
12868 printf("%d\n", (int)sizeof(VOID_PTR));
12873 if eval $compile_ok; then
12875 $echo " $ptrsize bytes." >&4
12878 echo "(I can't seem to compile the test program. Guessing...)" >&4
12879 rp="What is the size of a pointer (in bytes)?"
12887 : see if ar generates random libraries by itself
12889 echo "Checking how to generate random libraries on your machine..." >&4
12890 echo 'int bar1() { return bar2(); }' > bar1.c
12891 echo 'int bar2() { return 2; }' > bar2.c
12892 $cat > foo.c <<'EOP'
12893 int main() { printf("%d\n", bar1()); exit(0); }
12895 $cc $ccflags -c bar1.c >/dev/null 2>&1
12896 $cc $ccflags -c bar2.c >/dev/null 2>&1
12897 $cc $ccflags -c foo.c >/dev/null 2>&1
12898 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12899 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12900 ./foobar >/dev/null 2>&1; then
12901 echo "$ar appears to generate random libraries itself."
12904 elif $ar ts bar$_a >/dev/null 2>&1 &&
12905 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12906 ./foobar >/dev/null 2>&1; then
12907 echo "a table of contents needs to be added with '$ar ts'."
12914 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12915 $test -f $ranlib || ranlib=''
12918 if $test -n "$ranlib"; then
12919 echo "your system has '$ranlib'; we'll use that."
12922 echo "your system doesn't seem to support random libraries"
12923 echo "so we'll use lorder and tsort to order the libraries."
12930 : check for type of arguments to select.
12931 case "$selecttype" in
12932 '') case "$d_select" in
12936 Checking to see what type of arguments are accepted by select().
12938 hdrs="$define sys/types.h
12939 $i_systime sys/time.h
12940 $i_sysselct sys/select.h
12941 $d_socket sys/socket.h"
12942 : The first arg can be int, unsigned, or size_t
12943 : The last arg may or may not be 'const'
12945 : void pointer has been seen but using that
12946 : breaks the selectminbits test
12947 for xxx in 'fd_set *' 'int *'; do
12948 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12949 for tmo in 'struct timeval *' 'const struct timeval *'; do
12951 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12952 if ./protochk "$try" $hdrs; then
12953 echo "Your system accepts $xxx."
12962 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12963 case "$d_fd_set" in
12964 $define) dflt="fd_set *" ;;
12973 *) : no select, so pick a harmless default
12980 : check for the select 'width'
12981 case "$selectminbits" in
12982 '') case "$d_select" in
12986 Checking to see on how many bits at a time your select() operates...
12989 #include <sys/types.h>
12991 #$i_systime I_SYS_TIME
12992 #$i_systimek I_SYS_TIME_KERNEL
12997 # ifdef I_SYS_TIME_KERNEL
13000 # include <sys/time.h>
13001 # ifdef I_SYS_TIME_KERNEL
13005 #$i_sysselct I_SYS_SELECT
13006 #ifdef I_SYS_SELECT
13007 #include <sys/select.h>
13009 #$d_socket HAS_SOCKET
13011 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13015 #define S sizeof(*(b))
13017 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13018 #define NBITS (NBYTES * 8)
13027 fp = fopen("try.c", "r");
13033 b = ($selecttype)s;
13034 for (i = 0; i < NBITS; i++)
13038 select(fd + 1, b, 0, 0, &t);
13039 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13040 printf("%d\n", i + 1);
13045 if eval $compile_ok; then
13046 selectminbits=`./try`
13047 case "$selectminbits" in
13049 Cannot figure out on how many bits at a time your select() operates.
13050 I'll play safe and guess it is 32 bits.
13056 *) bits="$selectminbits bits" ;;
13058 echo "Your select() operates on $bits at a time." >&4
13060 rp='What is the minimum number of bits your select() operates on?'
13061 case "$byteorder" in
13062 1234|12345678) dflt=32 ;;
13067 selectminbits="$val"
13071 *) : no select, so pick a harmless default
13078 : Trace out the files included by signal.h, then look for SIGxxx names.
13079 : Remove SIGARRAYSIZE used by HPUX.
13080 : Remove SIGSTKSIZE used by Linux.
13081 : Remove SIGSTKSZ used by Posix.
13082 : Remove SIGTYP void lines used by OS2.
13083 : Some cpps, like os390, dont give the file name anywhere
13084 if [ "X$fieldn" = X ]; then
13085 : Just make some guesses. We check them later.
13086 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13088 xxx=`echo '#include <signal.h>' |
13089 $cppstdin $cppminus $cppflags 2>/dev/null |
13090 $grep '^[ ]*#.*include' |
13091 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13093 : Check this list of files to be sure we have parsed the cpp output ok.
13094 : This will also avoid potentially non-existent files, such
13097 for xx in $xxx /dev/null ; do
13098 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13100 : If we have found no files, at least try signal.h
13101 case "$xxxfiles" in
13102 '') xxxfiles=`./findhdr signal.h` ;;
13105 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13106 print substr($2, 4, 20)
13108 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13109 print substr($3, 4, 20)
13111 : Append some common names just in case the awk scan failed.
13112 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13113 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13114 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13115 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13116 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13118 : generate a few handy files for later
13119 $cat > signal.c <<'EOCP'
13120 #include <sys/types.h>
13121 #include <signal.h>
13125 /* Strange style to avoid deeply-nested #if/#else/#endif */
13128 # define NSIG (_NSIG)
13134 # define NSIG (SIGMAX+1)
13140 # define NSIG (SIG_MAX+1)
13146 # define NSIG (MAXSIG+1)
13152 # define NSIG (MAX_SIG+1)
13157 # ifdef SIGARRAYSIZE
13158 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13164 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13168 /* Default to some arbitrary number that's big enough to get most
13169 of the common signals.
13175 printf("NSIG %d\n", NSIG);
13181 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13183 printf "#ifdef SIG"; printf $1; printf "\n"
13184 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13185 printf $1; printf ");\n"
13189 printf "#endif /* JUST_NSIG */\n";
13190 printf "exit(0);\n}\n";
13193 $cat >signal.awk <<'EOP'
13194 BEGIN { ndups = 0 }
13195 $1 ~ /^NSIG$/ { nsig = $2 }
13196 ($1 !~ /^NSIG$/) && (NF == 2) {
13197 if ($2 > maxsig) { maxsig = $2 }
13198 if (sig_name[$2]) {
13199 dup_name[ndups] = $1
13200 dup_num[ndups] = $2
13212 printf("NSIG %d\n", nsig);
13213 for (n = 1; n < nsig; n++) {
13215 printf("%s %d\n", sig_name[n], sig_num[n])
13218 printf("NUM%d %d\n", n, n)
13221 for (n = 0; n < ndups; n++) {
13222 printf("%s %d\n", dup_name[n], dup_num[n])
13226 $cat >signal_cmd <<EOS
13228 if $test -s signal.lst; then
13229 echo "Using your existing signal.lst file"
13234 $cat >>signal_cmd <<'EOS'
13237 if eval $compile_ok; then
13238 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13240 echo "(I can't seem be able to compile the whole test program)" >&4
13241 echo "(I'll try it in little pieces.)" >&4
13242 set signal -DJUST_NSIG
13243 if eval $compile_ok; then
13244 ./signal$_exe > signal.nsg
13247 echo "I can't seem to figure out how many signals you have." >&4
13248 echo "Guessing 50." >&4
13249 echo 'NSIG 50' > signal.nsg
13251 : Now look at all the signal names, one at a time.
13252 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13253 $cat > signal.c <<EOCP
13254 #include <sys/types.h>
13255 #include <signal.h>
13258 printf("$xx %d\n", SIG${xx});
13263 if eval $compile; then
13264 echo "SIG${xx} found."
13265 ./signal$_exe >> signal.ls1
13267 echo "SIG${xx} NOT found."
13270 if $test -s signal.ls1; then
13271 $cat signal.nsg signal.ls1 |
13272 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13276 if $test -s signal.lst; then
13279 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13280 echo 'kill -l' >signal
13281 set X `csh -f <signal`
13285 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13287 echo $@ | $tr ' ' $trnl | \
13288 $awk '{ printf "%s %d\n", $1, ++s; }
13289 END { printf "NSIG %d\n", ++s }' >signal.lst
13291 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13293 chmod a+x signal_cmd
13294 $eunicefix signal_cmd
13296 : generate list of signal names
13298 case "$sig_name_init" in
13300 *) case "$sig_num_init" in
13301 ''|*,*) doinit=yes ;;
13306 echo "Generating a list of signal names and numbers..." >&4
13308 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13309 sig_name=`$awk 'BEGIN { printf "ZERO " }
13310 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13311 sig_num=`$awk 'BEGIN { printf "0 " }
13312 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13313 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13314 !/^NSIG/ { printf "\"%s\", ", $1 }
13315 END { printf "0\n" }' signal.lst`
13316 sig_num_init=`$awk 'BEGIN { printf "0, " }
13317 !/^NSIG/ { printf "%d, ", $2}
13318 END { printf "0\n"}' signal.lst`
13321 echo "The following $sig_count signals are available:"
13323 echo $sig_name | $awk \
13324 'BEGIN { linelen = 0 }
13326 for (i = 1; i <= NF; i++) {
13327 name = "SIG" $i " "
13328 linelen = linelen + length(name)
13329 if (linelen > 70) {
13331 linelen = length(name)
13337 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13339 : see what type is used for signed size_t
13340 set ssize_t ssizetype int stdio.h sys/types.h
13343 $cat > ssize.c <<EOM
13345 #include <sys/types.h>
13346 #define Size_t $sizetype
13347 #define SSize_t $dflt
13350 if (sizeof(Size_t) == sizeof(SSize_t))
13352 else if (sizeof(Size_t) == sizeof(int))
13361 if eval $compile_ok && ./ssize > /dev/null; then
13362 ssizetype=`./ssize`
13363 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13366 Help! I can't compile and run the ssize_t test program: please enlighten me!
13367 (This is probably a misconfiguration in your system or libraries, and
13368 you really ought to fix it. Still, I'll try anyway.)
13370 I need a type that is the same size as $sizetype, but is guaranteed to
13371 be signed. Common values are ssize_t, int and long.
13374 rp="What signed type is the same size as $sizetype?"
13378 $rm -f ssize ssize.*
13380 : see what type of char stdio uses.
13382 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13383 echo "Your stdio uses unsigned chars." >&4
13384 stdchar="unsigned char"
13386 echo "Your stdio uses signed chars." >&4
13390 : see if time exists
13392 if test "X$d_time" = X -o X"$timetype" = X; then
13393 if set time val -f d_time; eval $csym; $val; then
13394 echo 'time() found.' >&4
13396 rp="What is the type returned by time() on this system?"
13397 set time_t timetype long stdio.h sys/types.h
13400 echo 'time() not found, hope that will do.' >&4
13408 : see what type uids are declared as in the kernel
13410 echo "Looking for the type for user ids returned by getuid()."
13411 set uid_t uidtype xxx stdio.h sys/types.h
13415 xxx=`./findhdr sys/user.h`
13416 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13418 unsigned) dflt="$1 $2" ;;
13422 *) dflt="$uidtype";;
13425 uid_t) echo "uid_t found." ;;
13426 *) rp="What is the type for user ids returned by getuid()?"
13434 *_t) zzz="$uidtype" ;;
13437 echo "Checking the size of $zzz..." >&4
13439 #include <sys/types.h>
13442 printf("%d\n", (int)sizeof($uidtype));
13447 if eval $compile_ok; then
13451 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13454 echo "Your $zzz size is $uidsize bytes."
13459 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13464 *_t) zzz="$uidtype" ;;
13467 echo "Checking the sign of $zzz..." >&4
13469 #include <sys/types.h>
13480 if eval $compile; then
13484 echo "(I can't execute the test program--guessing unsigned.)" >&4
13488 1) echo "Your $zzz is unsigned." ;;
13489 -1) echo "Your $zzz is signed." ;;
13495 echo "(I can't compile the test program--guessing unsigned.)" >&4
13501 $echo "Checking the format string to be used for uids..." >&4
13504 -1) if $test X"$uidsize" = X"$ivsize"; then
13505 uidformat="$ivdformat"
13507 if $test X"$uidsize" = X"$longsize"; then
13510 if $test X"$uidsize" = X"$intsize"; then
13513 if $test X"$uidsize" = X"$shortsize"; then
13520 *) if $test X"$uidsize" = X"$uvsize"; then
13521 uidformat="$uvuformat"
13523 if $test X"$uidsize" = X"$longsize"; then
13526 if $test X"$uidsize" = X"$intsize"; then
13529 if $test X"$uidsize" = X"$shortsize"; then
13538 : see if dbm.h is available
13539 : see if dbmclose exists
13540 set dbmclose d_dbmclose
13543 case "$d_dbmclose" in
13553 *) set rpcsvc/dbm.h i_rpcsvcdbm
13558 *) echo "We won't be including <dbm.h>"
13568 : see if this is a sys/file.h system
13573 : do we need to include sys/file.h ?
13577 if $h_sysfile; then
13579 echo "We'll be including <sys/file.h>." >&4
13582 echo "We won't be including <sys/file.h>." >&4
13592 : see if fcntl.h is there
13597 : see if we can include fcntl.h
13603 echo "We'll be including <fcntl.h>." >&4
13606 if $h_sysfile; then
13607 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13609 echo "We won't be including <fcntl.h>." >&4
13621 : see if locale.h is available
13622 set locale.h i_locale
13625 : see if mach cthreads are available
13626 if test "X$usethreads" = "X$define"; then
13627 set mach/cthreads.h i_machcthr
13630 i_machcthr="$undef"
13635 : see if this is a math.h system
13639 : see if this is a mntent.h system
13640 set mntent.h i_mntent
13643 : see if ndbm.h is available
13648 : see if dbm_open exists
13649 set dbm_open d_dbm_open
13651 case "$d_dbm_open" in
13654 echo "We won't be including <ndbm.h>"
13663 : see if net/errno.h is available
13665 set net/errno.h val
13668 : Unfortunately, it causes problems on some systems. Arrgh.
13671 cat > try.c <<'EOM'
13674 #include <net/errno.h>
13680 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13681 echo "We'll be including <net/errno.h>." >&4
13683 echo "We won't be including <net/errno.h>." >&4
13692 : see if netinet/tcp.h is available
13693 set netinet/tcp.h i_netinettcp
13696 : see if this is a poll.h system
13700 : get C preprocessor symbols handy
13702 $echo $n "Hmm... $c"
13703 echo $al | $tr ' ' $trnl >Cppsym.know
13704 $cat <<EOSS >Cppsym
13712 case "\$list\$#" in
13715 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13717 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13720 unknown="\$unknown \$sym"
13730 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13732 exit 0; _ _ _ _\1\\ \1\\
13735 echo "exit 1; _ _ _" >>Cppsym\$\$
13736 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13738 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13744 $rm -f Cppsym\$\$ Cppsym2\$\$
13749 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13751 : now check the C compiler for additional symbols
13752 postprocess_cc_v=''
13754 aix) postprocess_cc_v="|$tr , ' '" ;;
13761 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13764 -D*) echo "\$i" | $sed 's/^-D//';;
13765 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13770 postprocess_cc_v=''
13773 ./ccsym > ccsym1.raw
13774 if $test -s ccsym1.raw; then
13775 $sort ccsym1.raw | $uniq >ccsym.raw
13777 mv ccsym1.raw ccsym.raw
13780 $awk '/\=/ { print $0; next }
13781 { print $0"=1" }' ccsym.raw >ccsym.list
13782 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13783 $comm -13 ccsym.true ccsym.list >ccsym.own
13784 $comm -12 ccsym.true ccsym.list >ccsym.com
13785 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13787 if $test -z ccsym.raw; then
13788 echo "Your C compiler doesn't seem to define any symbols!" >&4
13790 echo "However, your C preprocessor defines the following symbols:"
13793 cppsymbols=`$cat Cppsym.true`
13794 cppsymbols=`echo $cppsymbols`
13795 cppccsymbols="$cppsymbols"
13797 if $test -s ccsym.com; then
13798 echo "Your C compiler and pre-processor define these symbols:"
13799 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13802 cppccsymbols=`$cat ccsym.com`
13803 cppccsymbols=`echo $cppccsymbols`
13804 $test "$silent" || sleep 1
13806 if $test -s ccsym.cpp; then
13807 $test "$also" && echo " "
13808 echo "Your C pre-processor ${also}defines the following symbols:"
13809 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13811 cppsymbols=`$cat ccsym.cpp`
13812 cppsymbols=`echo $cppsymbols`
13813 $test "$silent" || sleep 1
13815 if $test -s ccsym.own; then
13816 $test "$also" && echo " "
13817 echo "Your C compiler ${also}defines the following cpp symbols:"
13818 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13819 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13820 ccsymbols=`$cat ccsym.own`
13821 ccsymbols=`echo $ccsymbols`
13822 $test "$silent" || sleep 1
13827 : see if this is a termio system
13831 if $test `./findhdr termios.h`; then
13832 set tcsetattr i_termios
13838 "$define") echo "You have POSIX termios.h... good!" >&4;;
13839 *) if ./Cppsym pyr; then
13840 case "`/bin/universe`" in
13841 ucb) if $test `./findhdr sgtty.h`; then
13843 echo "<sgtty.h> found." >&4
13845 echo "System is pyramid with BSD universe."
13846 echo "<sgtty.h> not found--you could have problems." >&4
13848 *) if $test `./findhdr termio.h`; then
13850 echo "<termio.h> found." >&4
13852 echo "System is pyramid with USG universe."
13853 echo "<termio.h> not found--you could have problems." >&4
13857 if $test `./findhdr termio.h`; then
13858 echo "<termio.h> found." >&4
13860 elif $test `./findhdr sgtty.h`; then
13861 echo "<sgtty.h> found." >&4
13864 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13867 if $test `./findhdr sgtty.h`; then
13868 echo "<sgtty.h> found." >&4
13870 elif $test `./findhdr termio.h`; then
13871 echo "<termio.h> found." >&4
13874 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13878 set i_termio; eval $setvar
13879 val=$val2; set i_sgtty; eval $setvar
13880 val=$val3; set i_termios; eval $setvar
13882 : see if this is a shadow.h system
13883 set shadow.h i_shadow
13886 : see if this is a socks.h system
13887 set socks.h i_socks
13890 : see if stdarg is available
13892 if $test `./findhdr stdarg.h`; then
13893 echo "<stdarg.h> found." >&4
13896 echo "<stdarg.h> NOT found." >&4
13900 : see if varags is available
13902 if $test `./findhdr varargs.h`; then
13903 echo "<varargs.h> found." >&4
13905 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13908 : set up the varargs testing programs
13909 $cat > varargs.c <<EOP
13911 #include <stdarg.h>
13914 #include <varargs.h>
13918 int f(char *p, ...)
13932 p = va_arg(ap, char *);
13937 $cat > varargs <<EOP
13939 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13948 : now check which varargs header should be included
13953 if `./varargs I_STDARG`; then
13955 elif `./varargs I_VARARGS`; then
13960 if `./varargs I_VARARGS`; then
13967 echo "I could not find the definition for va_dcl... You have problems..." >&4
13968 val="$undef"; set i_stdarg; eval $setvar
13969 val="$undef"; set i_varargs; eval $setvar
13974 case "$i_varhdr" in
13976 val="$define"; set i_stdarg; eval $setvar
13977 val="$undef"; set i_varargs; eval $setvar
13980 val="$undef"; set i_stdarg; eval $setvar
13981 val="$define"; set i_varargs; eval $setvar
13984 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13988 : see if stddef is available
13989 set stddef.h i_stddef
13992 : see if sys/access.h is available
13993 set sys/access.h i_sysaccess
13996 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13997 set sys/filio.h i_sysfilio
14000 if $test `./findhdr sys/ioctl.h`; then
14002 echo '<sys/ioctl.h> found.' >&4
14005 if $test $i_sysfilio = "$define"; then
14006 echo '<sys/ioctl.h> NOT found.' >&4
14008 $test $i_sgtty = "$define" && xxx="sgtty.h"
14009 $test $i_termio = "$define" && xxx="termio.h"
14010 $test $i_termios = "$define" && xxx="termios.h"
14011 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14017 : see if sys/resource.h has to be included
14018 set sys/resource.h i_sysresrc
14021 : see if sys/security.h is available
14022 set sys/security.h i_syssecrt
14025 : see if this is a sys/statvfs.h system
14026 set sys/statvfs.h i_sysstatvfs
14029 : see if this is a sys/uio.h system
14030 set sys/uio.h i_sysuio
14033 : see if this is a sys/un.h system
14034 set sys/un.h i_sysun
14037 : see if this is a syswait system
14038 set sys/wait.h i_syswait
14041 : see if this is a ustat.h system
14042 set ustat.h i_ustat
14045 : see if this is an utime system
14046 set utime.h i_utime
14049 : see if this is a values.h system
14050 set values.h i_values
14053 : see if this is a vfork system
14056 set vfork.h i_vfork
14064 : see if gdbm.h is available
14069 : see if gdbm_open exists
14070 set gdbm_open d_gdbm_open
14072 case "$d_gdbm_open" in
14075 echo "We won't be including <gdbm.h>"
14085 echo "Looking for extensions..." >&4
14086 : If we are using the old config.sh, known_extensions may contain
14087 : old or inaccurate or duplicate values.
14088 known_extensions=''
14089 nonxs_extensions=''
14090 : We do not use find because it might not be available.
14091 : We do not just use MANIFEST because the user may have dropped
14092 : some additional extensions into the source tree and expect them
14095 : Function to recursively find available extensions, ignoring DynaLoader
14096 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14100 DynaLoader|dynaload) ;;
14102 if $test -f $xxx/$xxx.xs; then
14103 known_extensions="$known_extensions $1$xxx";
14104 elif $test -f $xxx/Makefile.PL; then
14105 nonxs_extensions="$nonxs_extensions $1$xxx";
14107 if $test -d $xxx -a $# -lt 10; then
14110 eval $find_extensions;
14122 eval $find_extensions
14123 set X $nonxs_extensions
14125 nonxs_extensions="$*"
14126 set X $known_extensions
14128 known_extensions="$*"
14131 : Now see which are supported on this system.
14133 for xxx in $known_extensions ; do
14137 $define) avail_ext="$avail_ext $xxx" ;;
14140 GDBM_File|gdbm_fil)
14142 $define) avail_ext="$avail_ext $xxx" ;;
14145 NDBM_File|ndbm_fil)
14147 $define) avail_ext="$avail_ext $xxx" ;;
14150 ODBM_File|odbm_fil)
14151 case "${i_dbm}${i_rpcsvcdbm}" in
14152 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14156 case "$useposix" in
14157 true|define|y) avail_ext="$avail_ext $xxx" ;;
14161 case "$useopcode" in
14162 true|define|y) avail_ext="$avail_ext $xxx" ;;
14166 case "$d_socket" in
14167 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14171 case "$usethreads" in
14172 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14176 : XXX Do we need a useipcsysv variable here
14177 case "${d_msg}${d_sem}${d_shm}" in
14178 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14181 *) avail_ext="$avail_ext $xxx"
14190 : Now see which nonxs extensions are supported on this system.
14191 : For now assume all are.
14193 for xxx in $nonxs_extensions ; do
14195 *) nonxs_ext="$nonxs_ext $xxx"
14207 A number of extensions are supplied with $package. You may choose to
14208 compile these extensions for dynamic loading (the default), compile
14209 them into the $package executable (static loading), or not include
14210 them at all. Answer "none" to include no extensions.
14211 Note that DynaLoader is always built and need not be mentioned here.
14214 case "$dynamic_ext" in
14215 '') dflt="$avail_ext" ;;
14216 *) dflt="$dynamic_ext"
14217 # Perhaps we are reusing an old out-of-date config.sh.
14220 if test X"$dynamic_ext" != X"$avail_ext"; then
14222 NOTICE: Your previous config.sh list may be incorrect.
14223 The extensions now available to you are
14225 but the default list from your previous config.sh is
14237 rp="What extensions do you wish to load dynamically?"
14240 none) dynamic_ext=' ' ;;
14241 *) dynamic_ext="$ans" ;;
14244 case "$static_ext" in
14246 : Exclude those already listed in dynamic linking
14248 for xxx in $avail_ext; do
14249 case " $dynamic_ext " in
14251 *) dflt="$dflt $xxx" ;;
14258 *) dflt="$static_ext"
14265 rp="What extensions do you wish to load statically?"
14268 none) static_ext=' ' ;;
14269 *) static_ext="$ans" ;;
14274 A number of extensions are supplied with $package. Answer "none"
14275 to include no extensions.
14276 Note that DynaLoader is always built and need not be mentioned here.
14279 case "$static_ext" in
14280 '') dflt="$avail_ext" ;;
14281 *) dflt="$static_ext"
14282 # Perhaps we are reusing an old out-of-date config.sh.
14285 if test X"$static_ext" != X"$avail_ext"; then
14287 NOTICE: Your previous config.sh list may be incorrect.
14288 The extensions now available to you are
14290 but the default list from your previous config.sh is
14299 : Exclude those that are not xs extensions
14303 rp="What extensions do you wish to include?"
14306 none) static_ext=' ' ;;
14307 *) static_ext="$ans" ;;
14312 set X $dynamic_ext $static_ext $nonxs_ext
14316 : Remove build directory name from cppstdin so it can be used from
14317 : either the present location or the final installed location.
14319 : Get out of the UU directory to get correct path name.
14321 case "$cppstdin" in
14323 echo "Stripping down cppstdin path name"
14329 : end of configuration questions
14331 echo "End of configuration questions."
14334 : back to where it started
14335 if test -d ../UU; then
14339 : configuration may be patched via a 'config.over' file
14340 if $test -f config.over; then
14343 rp='I see a config.over file. Do you wish to load it?'
14346 n*) echo "OK, I'll ignore it.";;
14348 echo "Configuration override changes have been loaded."
14353 : in case they want portability, strip down executable paths
14354 case "$d_portable" in
14357 echo "Stripping down executable paths..." >&4
14358 for file in $loclist $trylist; do
14360 eval $file=`basename $temp`
14365 : create config.sh file
14367 echo "Creating config.sh..." >&4
14368 $spitshell <<EOT >config.sh
14371 # This file was produced by running the Configure script. It holds all the
14372 # definitions figured out by Configure. Should you modify one of these values,
14373 # do not forget to propagate your changes by running "Configure -der". You may
14374 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14377 # Package name : $package
14378 # Source directory : $src
14379 # Configuration time: $cf_time
14380 # Configured by : $cf_by
14381 # Target system : $myuname
14391 Revision='$Revision'
14398 alignbytes='$alignbytes'
14399 ansi2knr='$ansi2knr'
14400 aphostname='$aphostname'
14401 api_revision='$api_revision'
14402 api_subversion='$api_subversion'
14403 api_version='$api_version'
14404 api_versionstring='$api_versionstring'
14407 archlibexp='$archlibexp'
14408 archname64='$archname64'
14409 archname='$archname'
14410 archobjs='$archobjs'
14415 bincompat5005='$bincompat5005'
14419 byteorder='$byteorder'
14421 castflags='$castflags'
14424 cccdlflags='$cccdlflags'
14425 ccdlflags='$ccdlflags'
14427 ccsymbols='$ccsymbols'
14429 cf_email='$cf_email'
14431 charsize='$charsize'
14435 clocktype='$clocktype'
14437 compress='$compress'
14438 contains='$contains'
14442 cpp_stuff='$cpp_stuff'
14443 cppccsymbols='$cppccsymbols'
14444 cppflags='$cppflags'
14446 cppminus='$cppminus'
14448 cppstdin='$cppstdin'
14449 cppsymbols='$cppsymbols'
14450 crosscompile='$crosscompile'
14451 cryptlib='$cryptlib'
14453 d_Gconvert='$d_Gconvert'
14454 d_PRIEldbl='$d_PRIEldbl'
14455 d_PRIFldbl='$d_PRIFldbl'
14456 d_PRIGldbl='$d_PRIGldbl'
14457 d_PRIX64='$d_PRIX64'
14458 d_PRId64='$d_PRId64'
14459 d_PRIeldbl='$d_PRIeldbl'
14460 d_PRIfldbl='$d_PRIfldbl'
14461 d_PRIgldbl='$d_PRIgldbl'
14462 d_PRIi64='$d_PRIi64'
14463 d_PRIo64='$d_PRIo64'
14464 d_PRIu64='$d_PRIu64'
14465 d_PRIx64='$d_PRIx64'
14466 d_access='$d_access'
14467 d_accessx='$d_accessx'
14469 d_archlib='$d_archlib'
14472 d_attribut='$d_attribut'
14475 d_bincompat5005='$d_bincompat5005'
14477 d_bsdgetpgrp='$d_bsdgetpgrp'
14478 d_bsdsetpgrp='$d_bsdsetpgrp'
14480 d_casti32='$d_casti32'
14481 d_castneg='$d_castneg'
14482 d_charvspr='$d_charvspr'
14484 d_chroot='$d_chroot'
14485 d_chsize='$d_chsize'
14486 d_closedir='$d_closedir'
14490 d_cuserid='$d_cuserid'
14491 d_dbl_dig='$d_dbl_dig'
14492 d_difftime='$d_difftime'
14493 d_dirnamlen='$d_dirnamlen'
14494 d_dlerror='$d_dlerror'
14495 d_dlopen='$d_dlopen'
14496 d_dlsymun='$d_dlsymun'
14497 d_dosuid='$d_dosuid'
14498 d_drand48proto='$d_drand48proto'
14500 d_eaccess='$d_eaccess'
14501 d_endgrent='$d_endgrent'
14502 d_endhent='$d_endhent'
14503 d_endnent='$d_endnent'
14504 d_endpent='$d_endpent'
14505 d_endpwent='$d_endpwent'
14506 d_endsent='$d_endsent'
14507 d_endspent='$d_endspent'
14508 d_eofnblk='$d_eofnblk'
14509 d_eunice='$d_eunice'
14510 d_fchmod='$d_fchmod'
14511 d_fchown='$d_fchown'
14513 d_fd_macros='$d_fd_macros'
14514 d_fd_set='$d_fd_set'
14515 d_fds_bits='$d_fds_bits'
14516 d_fgetpos='$d_fgetpos'
14517 d_flexfnam='$d_flexfnam'
14520 d_fpathconf='$d_fpathconf'
14521 d_fpos64_t='$d_fpos64_t'
14522 d_fs_data_s='$d_fs_data_s'
14523 d_fseeko='$d_fseeko'
14524 d_fsetpos='$d_fsetpos'
14525 d_fstatfs='$d_fstatfs'
14526 d_fstatvfs='$d_fstatvfs'
14527 d_ftello='$d_ftello'
14529 d_getgrent='$d_getgrent'
14530 d_getgrps='$d_getgrps'
14531 d_gethbyaddr='$d_gethbyaddr'
14532 d_gethbyname='$d_gethbyname'
14533 d_gethent='$d_gethent'
14534 d_gethname='$d_gethname'
14535 d_gethostprotos='$d_gethostprotos'
14536 d_getlogin='$d_getlogin'
14537 d_getmnt='$d_getmnt'
14538 d_getmntent='$d_getmntent'
14539 d_getnbyaddr='$d_getnbyaddr'
14540 d_getnbyname='$d_getnbyname'
14541 d_getnent='$d_getnent'
14542 d_getnetprotos='$d_getnetprotos'
14543 d_getpbyname='$d_getpbyname'
14544 d_getpbynumber='$d_getpbynumber'
14545 d_getpent='$d_getpent'
14546 d_getpgid='$d_getpgid'
14547 d_getpgrp2='$d_getpgrp2'
14548 d_getpgrp='$d_getpgrp'
14549 d_getppid='$d_getppid'
14550 d_getprior='$d_getprior'
14551 d_getprotoprotos='$d_getprotoprotos'
14552 d_getpwent='$d_getpwent'
14553 d_getsbyname='$d_getsbyname'
14554 d_getsbyport='$d_getsbyport'
14555 d_getsent='$d_getsent'
14556 d_getservprotos='$d_getservprotos'
14557 d_getspent='$d_getspent'
14558 d_getspnam='$d_getspnam'
14559 d_gettimeod='$d_gettimeod'
14560 d_gnulibc='$d_gnulibc'
14561 d_grpasswd='$d_grpasswd'
14562 d_hasmntopt='$d_hasmntopt'
14565 d_inetaton='$d_inetaton'
14566 d_int64t='$d_int64t'
14567 d_isascii='$d_isascii'
14568 d_killpg='$d_killpg'
14569 d_lchown='$d_lchown'
14570 d_ldbl_dig='$d_ldbl_dig'
14572 d_locconv='$d_locconv'
14574 d_longdbl='$d_longdbl'
14575 d_longlong='$d_longlong'
14578 d_mbstowcs='$d_mbstowcs'
14579 d_mbtowc='$d_mbtowc'
14580 d_memchr='$d_memchr'
14581 d_memcmp='$d_memcmp'
14582 d_memcpy='$d_memcpy'
14583 d_memmove='$d_memmove'
14584 d_memset='$d_memset'
14586 d_mkfifo='$d_mkfifo'
14587 d_mktime='$d_mktime'
14589 d_msg_ctrunc='$d_msg_ctrunc'
14590 d_msg_dontroute='$d_msg_dontroute'
14591 d_msg_oob='$d_msg_oob'
14592 d_msg_peek='$d_msg_peek'
14593 d_msg_proxy='$d_msg_proxy'
14594 d_msgctl='$d_msgctl'
14595 d_msgget='$d_msgget'
14596 d_msgrcv='$d_msgrcv'
14597 d_msgsnd='$d_msgsnd'
14598 d_mymalloc='$d_mymalloc'
14600 d_nvpresuv='$d_nvpresuv'
14601 d_off64_t='$d_off64_t'
14602 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14603 d_oldpthreads='$d_oldpthreads'
14604 d_oldsock='$d_oldsock'
14606 d_pathconf='$d_pathconf'
14608 d_phostname='$d_phostname'
14611 d_portable='$d_portable'
14612 d_pthread_yield='$d_pthread_yield'
14614 d_pwchange='$d_pwchange'
14615 d_pwclass='$d_pwclass'
14616 d_pwcomment='$d_pwcomment'
14617 d_pwexpire='$d_pwexpire'
14618 d_pwgecos='$d_pwgecos'
14619 d_pwpasswd='$d_pwpasswd'
14620 d_pwquota='$d_pwquota'
14622 d_readdir='$d_readdir'
14623 d_readlink='$d_readlink'
14624 d_rename='$d_rename'
14625 d_rewinddir='$d_rewinddir'
14627 d_safebcpy='$d_safebcpy'
14628 d_safemcpy='$d_safemcpy'
14629 d_sanemcmp='$d_sanemcmp'
14630 d_sched_yield='$d_sched_yield'
14631 d_scm_rights='$d_scm_rights'
14632 d_seekdir='$d_seekdir'
14633 d_select='$d_select'
14635 d_semctl='$d_semctl'
14636 d_semctl_semid_ds='$d_semctl_semid_ds'
14637 d_semctl_semun='$d_semctl_semun'
14638 d_semget='$d_semget'
14640 d_setegid='$d_setegid'
14641 d_seteuid='$d_seteuid'
14642 d_setgrent='$d_setgrent'
14643 d_setgrps='$d_setgrps'
14644 d_sethent='$d_sethent'
14645 d_setlinebuf='$d_setlinebuf'
14646 d_setlocale='$d_setlocale'
14647 d_setnent='$d_setnent'
14648 d_setpent='$d_setpent'
14649 d_setpgid='$d_setpgid'
14650 d_setpgrp2='$d_setpgrp2'
14651 d_setpgrp='$d_setpgrp'
14652 d_setprior='$d_setprior'
14653 d_setpwent='$d_setpwent'
14654 d_setregid='$d_setregid'
14655 d_setresgid='$d_setresgid'
14656 d_setresuid='$d_setresuid'
14657 d_setreuid='$d_setreuid'
14658 d_setrgid='$d_setrgid'
14659 d_setruid='$d_setruid'
14660 d_setsent='$d_setsent'
14661 d_setsid='$d_setsid'
14662 d_setspent='$d_setspent'
14663 d_setvbuf='$d_setvbuf'
14667 d_shmatprototype='$d_shmatprototype'
14668 d_shmctl='$d_shmctl'
14670 d_shmget='$d_shmget'
14671 d_sigaction='$d_sigaction'
14672 d_sigsetjmp='$d_sigsetjmp'
14673 d_socket='$d_socket'
14674 d_sockpair='$d_sockpair'
14676 d_statblks='$d_statblks'
14677 d_statfs_f_flags='$d_statfs_f_flags'
14678 d_statfs_s='$d_statfs_s'
14679 d_statvfs='$d_statvfs'
14680 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14681 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14682 d_stdio_stream_array='$d_stdio_stream_array'
14683 d_stdiobase='$d_stdiobase'
14684 d_stdstdio='$d_stdstdio'
14685 d_strchr='$d_strchr'
14686 d_strcoll='$d_strcoll'
14687 d_strctcpy='$d_strctcpy'
14688 d_strerrm='$d_strerrm'
14689 d_strerror='$d_strerror'
14690 d_strtod='$d_strtod'
14691 d_strtol='$d_strtol'
14692 d_strtold='$d_strtold'
14693 d_strtoll='$d_strtoll'
14694 d_strtoul='$d_strtoul'
14695 d_strtoull='$d_strtoull'
14696 d_strtouq='$d_strtouq'
14697 d_strxfrm='$d_strxfrm'
14698 d_suidsafe='$d_suidsafe'
14699 d_symlink='$d_symlink'
14700 d_syscall='$d_syscall'
14701 d_sysconf='$d_sysconf'
14702 d_sysernlst='$d_sysernlst'
14703 d_syserrlst='$d_syserrlst'
14704 d_system='$d_system'
14705 d_tcgetpgrp='$d_tcgetpgrp'
14706 d_tcsetpgrp='$d_tcsetpgrp'
14707 d_telldir='$d_telldir'
14708 d_telldirproto='$d_telldirproto'
14711 d_truncate='$d_truncate'
14712 d_tzname='$d_tzname'
14715 d_union_semun='$d_union_semun'
14717 d_vendorbin='$d_vendorbin'
14718 d_vendorlib='$d_vendorlib'
14720 d_void_closedir='$d_void_closedir'
14721 d_voidsig='$d_voidsig'
14722 d_voidtty='$d_voidtty'
14723 d_volatile='$d_volatile'
14724 d_vprintf='$d_vprintf'
14726 d_waitpid='$d_waitpid'
14727 d_wcstombs='$d_wcstombs'
14728 d_wctomb='$d_wctomb'
14731 db_hashtype='$db_hashtype'
14732 db_prefixtype='$db_prefixtype'
14733 defvoidused='$defvoidused'
14734 direntrytype='$direntrytype'
14737 doublesize='$doublesize'
14739 dynamic_ext='$dynamic_ext'
14745 eunicefix='$eunicefix'
14748 extensions='$extensions'
14749 fflushNULL='$fflushNULL'
14750 fflushall='$fflushall'
14752 firstmakefile='$firstmakefile'
14754 fpossize='$fpossize'
14755 fpostype='$fpostype'
14756 freetype='$freetype'
14758 full_csh='$full_csh'
14759 full_sed='$full_sed'
14760 gccversion='$gccversion'
14761 gidformat='$gidformat'
14767 groupcat='$groupcat'
14768 groupstype='$groupstype'
14771 h_sysfile='$h_sysfile'
14783 i_arpainet='$i_arpainet'
14784 i_bsdioctl='$i_bsdioctl'
14787 i_dirent='$i_dirent'
14794 i_inttypes='$i_inttypes'
14795 i_limits='$i_limits'
14796 i_locale='$i_locale'
14797 i_machcthr='$i_machcthr'
14798 i_malloc='$i_malloc'
14800 i_memory='$i_memory'
14801 i_mntent='$i_mntent'
14804 i_neterrno='$i_neterrno'
14805 i_netinettcp='$i_netinettcp'
14808 i_pthread='$i_pthread'
14810 i_rpcsvcdbm='$i_rpcsvcdbm'
14813 i_shadow='$i_shadow'
14815 i_stdarg='$i_stdarg'
14816 i_stddef='$i_stddef'
14817 i_stdlib='$i_stdlib'
14818 i_string='$i_string'
14819 i_sysaccess='$i_sysaccess'
14820 i_sysdir='$i_sysdir'
14821 i_sysfile='$i_sysfile'
14822 i_sysfilio='$i_sysfilio'
14824 i_sysioctl='$i_sysioctl'
14825 i_sysmount='$i_sysmount'
14826 i_sysndir='$i_sysndir'
14827 i_sysparam='$i_sysparam'
14828 i_sysresrc='$i_sysresrc'
14829 i_syssecrt='$i_syssecrt'
14830 i_sysselct='$i_sysselct'
14831 i_syssockio='$i_syssockio'
14832 i_sysstat='$i_sysstat'
14833 i_sysstatfs='$i_sysstatfs'
14834 i_sysstatvfs='$i_sysstatvfs'
14835 i_systime='$i_systime'
14836 i_systimek='$i_systimek'
14837 i_systimes='$i_systimes'
14838 i_systypes='$i_systypes'
14839 i_sysuio='$i_sysuio'
14841 i_sysvfs='$i_sysvfs'
14842 i_syswait='$i_syswait'
14843 i_termio='$i_termio'
14844 i_termios='$i_termios'
14846 i_unistd='$i_unistd'
14849 i_values='$i_values'
14850 i_varargs='$i_varargs'
14851 i_varhdr='$i_varhdr'
14853 ignore_versioned_solibs='$ignore_versioned_solibs'
14854 inc_version_list='$inc_version_list'
14855 inc_version_list_init='$inc_version_list_init'
14858 installarchlib='$installarchlib'
14859 installbin='$installbin'
14860 installman1dir='$installman1dir'
14861 installman3dir='$installman3dir'
14862 installprefix='$installprefix'
14863 installprefixexp='$installprefixexp'
14864 installprivlib='$installprivlib'
14865 installscript='$installscript'
14866 installsitearch='$installsitearch'
14867 installsitebin='$installsitebin'
14868 installsitelib='$installsitelib'
14869 installstyle='$installstyle'
14870 installusrbinperl='$installusrbinperl'
14871 installvendorbin='$installvendorbin'
14872 installvendorlib='$installvendorlib'
14874 ivdformat='$ivdformat'
14877 known_extensions='$known_extensions'
14881 lddlflags='$lddlflags'
14883 ldlibpthname='$ldlibpthname'
14890 libswanted='$libswanted'
14896 locincpth='$locincpth'
14897 loclibpth='$loclibpth'
14898 longdblsize='$longdblsize'
14899 longlongsize='$longlongsize'
14900 longsize='$longsize'
14904 lseeksize='$lseeksize'
14905 lseektype='$lseektype'
14909 make_set_make='$make_set_make'
14910 mallocobj='$mallocobj'
14911 mallocsrc='$mallocsrc'
14912 malloctype='$malloctype'
14914 man1direxp='$man1direxp'
14917 man3direxp='$man3direxp'
14920 mips_type='$mips_type'
14923 modetype='$modetype'
14925 multiarch='$multiarch'
14927 myarchname='$myarchname'
14928 mydomain='$mydomain'
14929 myhostname='$myhostname'
14932 netdb_hlen_type='$netdb_hlen_type'
14933 netdb_host_type='$netdb_host_type'
14934 netdb_name_type='$netdb_name_type'
14935 netdb_net_type='$netdb_net_type'
14938 nm_so_opt='$nm_so_opt'
14939 nonxs_ext='$nonxs_ext'
14943 o_nonblock='$o_nonblock'
14945 old_pthread_create_joinable='$old_pthread_create_joinable'
14946 optimize='$optimize'
14947 orderlib='$orderlib'
14953 patchlevel='$patchlevel'
14954 path_sep='$path_sep'
14956 perladmin='$perladmin'
14957 perlpath='$perlpath'
14959 phostname='$phostname'
14965 prefixexp='$prefixexp'
14967 privlibexp='$privlibexp'
14968 prototype='$prototype'
14970 quadkind='$quadkind'
14971 quadtype='$quadtype'
14972 randbits='$randbits'
14973 randfunc='$randfunc'
14974 randseedtype='$randseedtype'
14976 rd_nodata='$rd_nodata'
14980 sPRIEldbl='$sPRIEldbl'
14981 sPRIFldbl='$sPRIFldbl'
14982 sPRIGldbl='$sPRIGldbl'
14985 sPRIeldbl='$sPRIeldbl'
14986 sPRIfldbl='$sPRIfldbl'
14987 sPRIgldbl='$sPRIgldbl'
14992 sched_yield='$sched_yield'
14993 scriptdir='$scriptdir'
14994 scriptdirexp='$scriptdirexp'
14996 seedfunc='$seedfunc'
14997 selectminbits='$selectminbits'
14998 selecttype='$selecttype'
14999 sendmail='$sendmail'
15002 sharpbang='$sharpbang'
15003 shmattype='$shmattype'
15004 shortsize='$shortsize'
15007 sig_count='$sig_count'
15008 sig_name='$sig_name'
15009 sig_name_init='$sig_name_init'
15011 sig_num_init='$sig_num_init'
15012 signal_t='$signal_t'
15013 sitearch='$sitearch'
15014 sitearchexp='$sitearchexp'
15016 sitebinexp='$sitebinexp'
15018 sitelibexp='$sitelibexp'
15019 siteprefix='$siteprefix'
15020 siteprefixexp='$siteprefixexp'
15021 sizetype='$sizetype'
15026 sockethdr='$sockethdr'
15027 socketlib='$socketlib'
15029 spackage='$spackage'
15030 spitshell='$spitshell'
15033 ssizetype='$ssizetype'
15034 startperl='$startperl'
15036 static_ext='$static_ext'
15038 stdio_base='$stdio_base'
15039 stdio_bufsiz='$stdio_bufsiz'
15040 stdio_cnt='$stdio_cnt'
15041 stdio_filbuf='$stdio_filbuf'
15042 stdio_ptr='$stdio_ptr'
15043 stdio_stream_array='$stdio_stream_array'
15046 subversion='$subversion'
15053 timeincl='$timeincl'
15054 timetype='$timetype'
15067 uidformat='$uidformat'
15073 uquadtype='$uquadtype'
15074 use5005threads='$use5005threads'
15075 use64bits='$use64bits'
15077 useithreads='$useithreads'
15078 uselargefiles='$uselargefiles'
15079 uselongdouble='$uselongdouble'
15080 uselonglong='$uselonglong'
15081 usemorebits='$usemorebits'
15082 usemultiplicity='$usemultiplicity'
15083 usemymalloc='$usemymalloc'
15085 useopcode='$useopcode'
15086 useperlio='$useperlio'
15087 useposix='$useposix'
15089 useshrplib='$useshrplib'
15090 usesocks='$usesocks'
15091 usethreads='$usethreads'
15092 usevendorprefix='$usevendorprefix'
15093 usevfork='$usevfork'
15096 uvoformat='$uvoformat'
15099 uvuformat='$uvuformat'
15100 uvxformat='$uvxformat'
15101 vendorbin='$vendorbin'
15102 vendorbinexp='$vendorbinexp'
15103 vendorlib='$vendorlib'
15104 vendorlibexp='$vendorlibexp'
15105 vendorprefix='$vendorprefix'
15106 vendorprefixexp='$vendorprefixexp'
15109 voidflags='$voidflags'
15115 : Add in command line options if available
15116 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15118 : add special variables
15119 $test -f $src/patchlevel.h && \
15120 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15121 echo "CONFIGDOTSH=true" >>config.sh
15123 : propagate old symbols
15124 if $test -f UU/config.sh; then
15125 <UU/config.sh sort | uniq >UU/oldconfig.sh
15126 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15127 sort | uniq -u >UU/oldsyms
15128 set X `cat UU/oldsyms`
15134 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15136 echo "# Variables propagated from previous config.sh file." >>config.sh
15137 for sym in `cat UU/oldsyms`; do
15138 echo " Propagating $hint variable "'$'"$sym..."
15139 eval 'tmp="$'"${sym}"'"'
15141 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15147 : Finish up by extracting the .SH files
15161 If you'd like to make any changes to the config.sh file before I begin
15162 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15165 rp="Press return or use a shell escape to edit config.sh:"
15170 *) : in case they cannot read
15171 sh 1>&4 -c "$ans";;
15176 : if this fails, just run all the .SH files by hand
15183 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15190 Now you need to generate make dependencies by running "$make depend".
15191 You might prefer to run it in background: "$make depend > makedepend.out &"
15192 It can take a while, so you might not want to run it right now.
15197 rp="Run $make depend now?"
15201 $make depend && echo "Now you must run a $make."
15204 echo "You must run '$make depend' then '$make'."
15207 elif test -f [Mm]akefile; then
15209 echo "Now you must run a $make."
15214 if $test -f Policy.sh; then
15217 If you compile $package on a different machine or from a different object
15218 directory, copy the Policy.sh file from this object directory to the
15219 new one before you run Configure -- this will help you with most of
15220 the policy defaults.
15224 if $test -f config.msg; then
15225 echo "Hmm. I also noted the following information while running:"
15227 $cat config.msg >&4
15230 $rm -f kit*isdone ark*isdone