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 Wed Jan 19 19:38:29 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=''
693 ignore_versioned_solibs=''
851 d_stdio_stream_array=''
852 stdio_stream_array=''
896 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
899 : We must find out about Eunice early
901 if test -f /etc/unixtovms; then
902 eunicefix=/etc/unixtovms
904 if test -f /etc/unixtovms.exe; then
905 eunicefix=/etc/unixtovms.exe
909 : list of known cpp symbols, sorted alphabetically
910 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
911 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
912 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
913 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
914 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
915 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
916 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
917 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
918 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
919 al="$al VMS Xenix286"
920 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
921 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
922 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
923 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
924 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
925 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
926 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
927 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
928 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
929 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
930 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
931 al="$al __SVR4_2__ __UMAXV__"
932 al="$al ____386BSD____ __alpha __alpha__ __amiga"
933 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
934 al="$al __host_mips__"
935 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
936 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
937 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
938 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
939 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
940 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
941 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
942 al="$al __mc88100 __mc88100__ __mips __mips__"
943 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
944 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
945 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
946 al="$al _host_mips _mips _unix"
947 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
948 al="$al apollo ardent att386 att3b"
949 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
950 al="$al cadmus clipper concurrent convex cray ctix"
951 al="$al dmert encore gcos gcx gimpel gould"
952 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
953 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
954 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
955 al="$al i186 i286 i386 i486 i8086"
956 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
957 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
958 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
959 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
960 al="$al mc88000 mc88100 merlin mert mips mvs n16"
961 al="$al ncl_el ncl_mr"
962 al="$al news1500 news1700 news1800 news1900 news3700"
963 al="$al news700 news800 news900 ns16000 ns32000"
964 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
965 al="$al parisc pc532 pdp11 plexus posix pyr"
966 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
967 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
968 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
969 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
970 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
971 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
974 : set useposix=false in your hint file to disable the POSIX extension.
976 : set useopcode=false in your hint file to disable the Opcode extension.
978 : Trailing extension. Override this in a hint file, if needed.
980 : Extra object files, if any, needed on this platform.
982 : Possible local include directories to search.
983 : Set locincpth to "" in a hint file to defeat local include searches.
984 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
985 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
987 : no include file wanted by default
991 : change the next line if compiling for Xenix/286 on Xenix/386
992 xlibpth='/usr/lib/386 /lib/386'
994 : Possible local library directories to search.
995 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
996 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
998 : general looking path for locating libraries
999 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
1000 glibpth="$glibpth /lib /usr/lib $xlibpth"
1001 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
1002 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1004 : Private path used by Configure to find libraries. Its value
1005 : is prepended to libpth. This variable takes care of special
1006 : machines, like the mips. Usually, it should be empty.
1009 : default library list
1011 : some systems want to use only the non-versioned libso:s
1012 ignore_versioned_solibs=''
1013 : set usemultiplicity on the Configure command line to enable multiplicity.
1014 : set usesocks on the Configure command line to enable socks.
1015 : set usethreads on the Configure command line to enable threads.
1016 : full support for void wanted by default
1019 : List of libraries we want.
1020 : If anyone needs -lnet, put it in a hint file.
1021 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1022 libswanted="$libswanted dld ld sun m c cposix posix"
1023 libswanted="$libswanted ndir dir crypt sec"
1024 libswanted="$libswanted ucb bsd BSD PW x"
1025 : We probably want to search /usr/shlib before most other libraries.
1026 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1027 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1028 glibpth="/usr/shlib $glibpth"
1029 : Do not use vfork unless overridden by a hint file.
1032 : Find the basic shell for Bourne shell scripts
1036 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1039 if test -f "$xxx"; then
1042 : Build up a list and do a single loop so we can 'break' out.
1043 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1044 for xxx in sh bash ksh pdksh ash; do
1046 try="$try ${p}/${xxx}"
1050 if test -f "$xxx"; then
1053 elif test -f "$xxx.exe"; then
1064 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1066 Usually it's in /bin/sh. How did you even get this far?
1067 Please contact me (Perl Maintainers) at perlbug@perl.com and
1068 we'll try to straighten this all out.
1074 : see if sh knows # comments
1075 if `$sh -c '#' >/dev/null 2>&1`; then
1079 test -f $xcat || xcat=/usr/bin/cat
1084 if test -s today; then
1087 echo "#! $xcat" > try
1091 if test -s today; then
1099 echo "Your $sh doesn't grok # comments--I will strip them later on."
1102 echo "exec grep -v '^[ ]*#'" >spitshell
1104 $eunicefix spitshell
1105 spitshell=`pwd`/spitshell
1107 echo "I presume that if # doesn't work, #! won't work either!"
1112 : figure out how to guarantee sh startup
1114 '') startsh=${sharpbang}${sh} ;;
1126 : echo "Yup, it does."
1128 echo "Hmm... '$startsh' does not guarantee sh startup..."
1129 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1134 : Save command line options in file UU/cmdline.opt for later use in
1135 : generating config.sh.
1136 cat > cmdline.opt <<EOSH
1137 # Configure command line arguments.
1144 cat >>cmdline.opt <<EOSH
1145 config_arg$argn='$arg'
1147 argn=`expr $argn + 1`
1150 : produce awk script to parse command line options
1151 cat >options.awk <<'EOF'
1153 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1155 len = length(optstr);
1156 for (i = 1; i <= len; i++) {
1157 c = substr(optstr, i, 1);
1158 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1169 if (substr(str, 1, 1) != "-") {
1170 printf("'%s'\n", str);
1174 for (i = 2; i <= len; i++) {
1175 c = substr(str, i, 1);
1177 printf("-%s\n", substr(str, i));
1183 printf("'%s'\n", substr(str, i + 1));
1196 : process the command line options
1197 set X `for arg in "$@"; do echo "X$arg"; done |
1198 sed -e s/X// | awk -f options.awk`
1203 : set up default values
1213 rm -f optdef.sh posthint.sh
1214 cat >optdef.sh <<EOS
1220 while test $# -gt 0; do
1222 -d) shift; fastread=yes;;
1223 -e) shift; alldone=cont;;
1227 if test -r "$1"; then
1230 echo "$me: cannot read config file $1." >&2
1235 -h) shift; error=true;;
1236 -r) shift; reuseval=true;;
1237 -s) shift; silent=true; realsilent=true;;
1238 -E) shift; alldone=exit;;
1239 -K) shift; knowitall=true;;
1240 -O) shift; override=true;;
1241 -S) shift; silent=true; extractsh=true;;
1246 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1247 echo "$me: ignoring -D $1" >&2
1250 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1251 *) echo "$1='define'" >> optdef.sh;;
1258 *=) echo "$1" >> optdef.sh;;
1260 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1261 echo "$me: ignoring -U $1" >&2
1263 *) echo "$1='undef'" >> optdef.sh;;
1274 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1278 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1279 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1285 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1286 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1287 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1288 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1289 *) xxx=`echo $yyy|sed 's!:.*!!'`
1290 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1296 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1298 echo "$yyy=''" >> posthint.sh ;;
1303 echo "$yyy='$zzz'" >> posthint.sh ;;
1305 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1307 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1312 echo "$yyy=$zzz" >> posthint.sh ;;
1313 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1316 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1319 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1327 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1328 [-U symbol] [-U symbol=] [-A command:symbol...]
1329 -d : use defaults for all answers.
1330 -e : go on without questioning past the production of config.sh.
1331 -f : specify an alternate default configuration file.
1332 -h : print this help message and exit (with an error status).
1333 -r : reuse C symbols value if possible (skips costly nm extraction).
1334 -s : silent mode, only echoes questions and essential information.
1335 -D : define symbol to have some value:
1336 -D symbol symbol gets the value 'define'
1337 -D symbol=value symbol gets the value 'value'
1338 -E : stop at the end of questions, after having produced config.sh.
1339 -K : do not use unless you know what you are doing.
1340 -O : let -D and -U override definitions from loaded configuration file.
1341 -S : perform variable substitutions on all .SH files (can mix with -f)
1342 -U : undefine symbol:
1343 -U symbol symbol gets the value 'undef'
1344 -U symbol= symbol gets completely empty
1345 -A : manipulate symbol after the platform specific hints have been applied:
1346 -A symbol=value append " "value to symbol
1347 -A append:symbol=value append value to symbol
1348 -A define:symbol=value define symbol to have value
1349 -A clear:symbol define symbol to be ''
1350 -A define:symbol define symbol to be 'define'
1351 -A eval:symbol=value define symbol to be eval of value
1352 -A prepend:symbol=value prepend value to symbol
1353 -A undef:symbol define symbol to be 'undef'
1354 -A undef:symbol= define symbol to be ''
1355 -V : print version number and exit (with a zero status).
1362 case "$fastread$alldone" in
1365 if test ! -t 0; then
1366 echo "Say 'sh Configure', not 'sh <Configure'"
1374 true) exec 1>/dev/null;;
1377 : run the defines and the undefines, if any, but leave the file out there...
1380 : create the posthint manipulation script and leave the file out there...
1385 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1386 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1387 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1388 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1389 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1392 : Some greps do not return status, grrr.
1393 echo "grimblepritz" >grimble
1394 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1396 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1402 : the following should work in any shell
1406 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1407 cat >contains <<'EOSS'
1408 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1413 : Find the path to the source tree
1416 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1419 *) src=`cd ../$src && pwd` ;;
1432 if test -f $rsrc/Configure && \
1433 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1435 : found it, so we are ok.
1438 for src in . .. ../.. ../../.. ../../../..; do
1439 if test -f ../$src/Configure && \
1440 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1451 Sorry, I can't seem to locate the source dir for $package. Please start
1452 Configure with an explicit path -- i.e. /some/path/Configure.
1460 echo "Sources for $package found in \"$src\"." >&4
1464 : script used to extract .SH files with variable substitutions
1465 cat >extract <<'EOS'
1467 echo "Doing variable substitutions on .SH files..."
1468 if test -f $src/MANIFEST; then
1469 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1471 echo "(Looking for .SH files under the source directory.)"
1472 set x `(cd $src; find . -name "*.SH" -print)`
1476 0) set x `(cd $src; echo *.SH)`; shift;;
1478 if test ! -f $src/$1; then
1484 while test $name; do
1485 if test ! -d "$name"; then
1486 create="$name $create";
1487 name=`echo $name | sed -e "s|^[^/]*$||"`;
1488 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1493 for file in $create; do
1502 dir=`expr X$file : 'X\(.*\)/'`
1503 file=`expr X$file : 'X.*/\(.*\)'`
1504 (cd $dir && . ./$file)
1514 dir=`expr X$file : 'X\(.*\)/'`
1515 file=`expr X$file : 'X.*/\(.*\)'`
1516 (set x $dir; shift; eval $mkdir_p)
1526 if test -f $src/config_h.SH; then
1527 if test ! -f config.h; then
1528 : oops, they left it out of MANIFEST, probably, so do it anyway.
1534 : extract files and exit if asked to do so
1535 case "$extractsh" in
1537 case "$realsilent" in
1541 case "$config_sh" in
1542 '') config_sh='config.sh';;
1545 echo "Fetching answers from $config_sh..."
1548 test "$override" && . ./optdef.sh
1557 : Eunice requires " " instead of "", can you believe it
1560 echo "Beginning of configuration questions for $package."
1562 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1564 : first determine how to suppress newline on echo command
1566 echo "Checking echo to see how to suppress newlines..."
1567 (echo "hi there\c" ; echo " ") >.echotmp
1568 if $contains c .echotmp >/dev/null 2>&1 ; then
1579 echo $n "The star should be here-->$c"
1583 : Now test for existence of everything in MANIFEST
1585 if test -f $rsrc/MANIFEST; then
1586 echo "First let's make sure your kit is complete. Checking..." >&4
1587 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1590 for filelist in x??; do
1591 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1593 if test -s missing; then
1597 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1599 You have the option of continuing the configuration process, despite the
1600 distinct possibility that your kit is damaged, by typing 'y'es. If you
1601 do, don't blame me if something goes wrong. I advise you to type 'n'o
1602 and contact the author (perlbug@perl.com).
1605 echo $n "Continue? [n] $c" >&4
1609 echo "Continuing..." >&4
1613 echo "ABORTING..." >&4
1618 echo "Looks good..."
1621 echo "There is no MANIFEST file. I hope your kit is complete !"
1626 : Find the appropriate value for a newline for tr
1627 if test -n "$DJGPP"; then
1630 if test X"$trnl" = X; then
1631 case "`echo foo|tr '\n' x 2>/dev/null`" in
1635 if test X"$trnl" = X; then
1636 case "`echo foo|tr '\012' x 2>/dev/null`" in
1637 foox) trnl='\012' ;;
1640 if test X"$trnl" = X; then
1643 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1649 : compute the number of columns on the terminal for proper question formatting
1654 : set up the echo used in my read
1655 myecho="case \"\$xxxm\" in
1656 '') echo $n \"\$rp $c\" >&4;;
1658 '') echo $n \"[\$xxxm] $c\";;
1660 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1662 echo $n \"[\$xxxm] $c\" >&4
1664 echo $n \"\$rp [\$xxxm] $c\" >&4
1670 : now set up to do reads with possible shell escape and default assignment
1676 case "\$fastread" in
1677 yes) case "\$dflt" in
1680 case "\$silent-\$rp" in
1685 *) case "\$silent" in
1686 true) case "\$rp" in
1691 while expr "X\$ans" : "X!" >/dev/null; do
1695 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1703 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1712 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1717 echo "(OK, I'll run with -d after this question.)" >&4
1720 echo "*** Sorry, \$1 not supported yet." >&4
1730 echo "*** Substitution done -- please confirm."
1732 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1737 echo "*** Error -- try again."
1744 case "\$ans\$xxxm\$nostick" in
1756 : create .config dir to save info across Configure sessions
1757 test -d ../.config || mkdir ../.config
1758 cat >../.config/README <<EOF
1759 This directory created by Configure to save information that should
1760 persist across sessions for $package.
1762 You may safely delete it if you wish.
1765 : general instructions
1768 user=`(logname) 2>/dev/null`
1770 '') user=`whoami 2>&1`;;
1772 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1775 rp='Would you like to see the instructions?'
1786 This installation shell script will examine your system and ask you questions
1787 to determine how the perl5 package should be installed. If you get
1788 stuck on a question, you may use a ! shell escape to start a subshell or
1789 execute a command. Many of the questions will have default answers in square
1790 brackets; typing carriage return will give you the default.
1792 On some of the questions which ask for file or directory names you are allowed
1793 to use the ~name construct to specify the login directory belonging to "name",
1794 even if you don't have a shell which knows about that. Questions where this is
1795 allowed will be marked "(~name ok)".
1799 dflt='Type carriage return to continue'
1803 The prompter used in this script allows you to use shell variables and
1804 backticks in your answers. You may use $1, $2, etc... to refer to the words
1805 in the default answer, as if the default line was a set of arguments given to a
1806 script shell. This means you may also use $* to repeat the whole default line,
1807 so you do not have to re-type everything to add something to the default.
1809 Everytime there is a substitution, you will have to confirm. If there is an
1810 error (e.g. an unmatched backtick), the default answer will remain unchanged
1811 and you will be prompted again.
1813 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1814 the questions and use the computed defaults (or the previous answers if there
1815 was already a config.sh file). Type 'Configure -h' for a list of options.
1816 You may also start interactively and then answer '& -d' at any prompt to turn
1817 on the non-interactive behaviour for the remainder of the execution.
1823 Much effort has been expended to ensure that this shell script will run on any
1824 Unix system. If despite that it blows up on yours, your best bet is to edit
1825 Configure and run it again. If you can't run Configure for some reason,
1826 you'll have to generate a config.sh file by hand. Whatever problems you
1827 have, let me (perlbug@perl.com) know how I blew it.
1829 This installation script affects things in two ways:
1831 1) it may do direct variable substitutions on some of the files included
1833 2) it builds a config.h file for inclusion in C programs. You may edit
1834 any of these files as the need arises after running this script.
1836 If you make a mistake on a question, there is no easy way to back up to it
1837 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1838 files. Configure will offer to let you do this before it runs the SH files.
1841 dflt='Type carriage return to continue'
1843 case "$firsttime" in
1844 true) echo $user >>../.config/instruct;;
1848 : find out where common programs are
1850 echo "Locating common programs..." >&4
1863 if test -d \$dir/\$thing; then
1869 for thisthing in \$dir/\$thing; do
1870 : just loop through to pick last item
1872 if test -f \$thisthing; then
1875 elif test -f \$dir/\$thing.exe; then
1876 if test -n "$DJGPP"; then
1877 echo \$dir/\$thing.exe
1879 : on Eunice apparently
1930 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1931 pth="$pth /lib /usr/lib"
1932 for file in $loclist; do
1936 if test -f "$xxx"; then
1939 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1940 xxx=`./loc $file $file $pth`
1943 '') xxx=`./loc $file $file $pth`;;
1944 *) xxx=`./loc $xxx $xxx $pth`;;
1950 echo $file is in $xxx.
1953 echo $file is in $xxx.
1956 echo "I don't know where '$file' is, and my life depends on it." >&4
1957 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1963 echo "Don't worry if any of the following aren't found..."
1965 for file in $trylist; do
1969 if test -f "$xxx"; then
1972 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1973 xxx=`./loc $file $file $pth`
1976 '') xxx=`./loc $file $file $pth`;;
1977 *) xxx=`./loc $xxx $xxx $pth`;;
1983 echo $file is in $xxx.
1986 echo $file is in $xxx.
1989 echo "I don't see $file out there, $say."
1996 echo "Substituting grep for egrep."
2002 echo "Substituting cp for ln."
2008 echo "Hopefully test is built into your sh."
2011 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2012 echo "Using the test built into your sh."
2020 echo "Hopefully echo is built into your sh."
2025 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2026 $echo $n "hi there$c" >foo1
2027 echo $n "hi there$c" >foo2
2028 if cmp foo1 foo2 >/dev/null 2>&1; then
2029 echo "They are compatible. In fact, they may be identical."
2036 They are not compatible! You are probably running ksh on a non-USG system.
2037 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2038 have echo built in and we may have to run some Bourne shell scripts. That
2039 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2042 $echo $n "The star should be here-->$c"
2049 : determine whether symbolic links are supported
2052 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2053 echo "Symbolic links are supported." >&4
2056 echo "Symbolic links are NOT supported." >&4
2061 : see whether [:lower:] and [:upper:] are supported character classes
2063 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2065 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2069 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2070 # (0xc9 and 0xd1), therefore that is a nice testing point.
2071 if test "X$up" = X -o "X$low" = X; then
2072 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2078 if test "X$up" = X -o "X$low" = X; then
2079 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2085 if test "X$up" = X -o "X$low" = X; then
2086 case "`echo IJ | od -x 2>/dev/null`" in
2088 echo "Hey, this might be EBCDIC." >&4
2089 if test "X$up" = X -o "X$low" = X; then
2090 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2091 ij) up='[A-IJ-RS-Z]'
2096 if test "X$up" = X -o "X$low" = X; then
2097 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2107 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2109 echo "Using $up and $low to convert case." >&4
2112 echo "I don't know how to translate letters from upper to lower case." >&4
2113 echo "Your tr is not acting any way I know of." >&4
2117 : set up the translation script tr, must be called with ./tr of course
2121 '[A-Z][a-z]') exec $tr '$up' '$low';;
2122 '[a-z][A-Z]') exec $tr '$low' '$up';;
2129 : Try to determine whether config.sh was made on this system
2130 case "$config_sh" in
2132 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2133 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2134 # because the A-Z/a-z are not consecutive.
2135 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2136 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2137 newmyuname="$myuname"
2139 case "$knowitall" in
2141 if test -f ../config.sh; then
2142 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2143 eval "`grep myuname= ../config.sh`"
2145 if test "X$myuname" = "X$newmyuname"; then
2153 : Get old answers from old config file if Configure was run on the
2154 : same system, otherwise use the hints.
2157 if test -f config.sh; then
2159 rp="I see a config.sh file. Shall I use it to set the defaults?"
2162 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2163 *) echo "Fetching default answers from your old config.sh file..." >&4
2171 : Older versions did not always set $sh. Catch re-use of such
2180 if test ! -f config.sh; then
2183 First time through, eh? I have some defaults handy for some systems
2184 that need some extra help getting the Configure answers right:
2187 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2189 : Half the following guesses are probably wrong... If you have better
2190 : tests or hints, please send them to perlbug@perl.com
2191 : The metaconfig authors would also appreciate a copy...
2192 $test -f /irix && osname=irix
2193 $test -f /xenix && osname=sco_xenix
2194 $test -f /dynix && osname=dynix
2195 $test -f /dnix && osname=dnix
2196 $test -f /lynx.os && osname=lynxos
2197 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2198 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2199 $test -f /bin/mips && /bin/mips && osname=mips
2200 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2201 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2202 $test -d /usr/apollo/bin && osname=apollo
2203 $test -f /etc/saf/_sactab && osname=svr4
2204 $test -d /usr/include/minix && osname=minix
2205 if $test -d /MachTen -o -d /MachTen_Folder; then
2207 if $test -x /sbin/version; then
2208 osvers=`/sbin/version | $awk '{print $2}' |
2209 $sed -e 's/[A-Za-z]$//'`
2210 elif $test -x /usr/etc/version; then
2211 osvers=`/usr/etc/version | $awk '{print $2}' |
2212 $sed -e 's/[A-Za-z]$//'`
2218 $test -f /sys/posix.dll &&
2219 $test -f /usr/bin/what &&
2220 set X `/usr/bin/what /sys/posix.dll` &&
2221 $test "$3" = UWIN &&
2225 if $test -f $uname; then
2233 umips) osname=umips ;;
2236 [23]100) osname=mips ;;
2237 next*) osname=next ;;
2239 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2240 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2243 elif $test -f /etc/kconfig; then
2245 if test "$lns" = "$ln -s"; then
2247 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2249 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2256 if test -n "$DJGPP"; then
2265 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2267 'not found') osvers="$4"."$3" ;;
2268 '<3240'|'<>3240') osvers=3.2.0 ;;
2269 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2270 '=3250'|'>3250') osvers=3.2.5 ;;
2274 bsd386) osname=bsd386
2277 cygwin*) osname=cygwin
2280 *dc.osx) osname=dcosx
2286 domainos) osname=apollo
2292 dynixptx*) osname=dynixptx
2293 osvers=`echo "$4"|sed 's/^v//'`
2295 freebsd) osname=freebsd
2297 genix) osname=genix ;;
2299 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2315 netbsd*) osname=netbsd
2318 news-os) osvers="$3"
2320 4*) osname=newsos4 ;;
2324 next*) osname=next ;;
2325 POSIX-BC | posix-bc ) osname=posix-bc
2328 powerux | power_ux | powermax_os | powermaxos | \
2329 powerunix | power_unix) osname=powerux
2335 solaris) osname=solaris
2337 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2344 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2348 titanos) osname=titanos
2357 ultrix) osname=ultrix
2360 osf1|mls+) case "$5" in
2363 osvers=`echo "$3" | sed 's/^[xvt]//'`
2365 hp*) osname=hp_osf1 ;;
2366 mips) osname=mips_osf1 ;;
2369 unixware) osname=svr5
2375 $2) case "$osname" in
2379 : svr4.x or possibly later
2389 if test -f /stand/boot ; then
2390 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2391 if test -n "$INITPROG" -a -f "$INITPROG"; then
2392 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2393 if test -n "$isesix"; then
2401 *) if test -f /etc/systemid; then
2403 set `echo $3 | $sed 's/\./ /g'` $4
2404 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2406 elif $test -f $src/hints/sco_$1_$2.sh; then
2408 elif $test -f $src/hints/sco_$1.sh; then
2413 '') : Still unknown. Probably a generic Sys V.
2422 *) case "$osname" in
2423 '') : Still unknown. Probably a generic BSD.
2431 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2432 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2433 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2436 $rm -f UU/kernel.what
2437 elif test -d c:/.; then
2444 : Now look for a hint file osname_osvers, unless one has been
2445 : specified already.
2448 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2449 : Also try without trailing minor version numbers.
2450 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2451 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2452 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2453 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2456 *) case "$osvers" in
2459 *) if $test -f $src/hints/$file.sh ; then
2461 elif $test -f $src/hints/$xfile.sh ; then
2463 elif $test -f $src/hints/$xxfile.sh ; then
2465 elif $test -f $src/hints/$xxxfile.sh ; then
2467 elif $test -f $src/hints/$xxxxfile.sh ; then
2469 elif $test -f "$src/hints/${osname}.sh" ; then
2478 if $test -f Policy.sh ; then
2481 none) dflt="Policy" ;;
2482 *) dflt="Policy $dflt" ;;
2487 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2491 if $test -f Policy.sh ; then
2494 There's also a Policy hint file available, which should make the
2495 site-specific (policy) questions easier to answer.
2502 You may give one or more space-separated answers, or "none" if appropriate.
2503 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2504 is a good thing. DO NOT give a wrong version or a wrong OS.
2508 rp="Which of these apply, if any?"
2511 for file in $tans; do
2512 if $test X$file = XPolicy -a -f Policy.sh; then
2514 $cat Policy.sh >> UU/config.sh
2515 elif $test -f $src/hints/$file.sh; then
2516 . $src/hints/$file.sh
2517 $cat $src/hints/$file.sh >> UU/config.sh
2518 elif $test X$tans = X -o X$tans = Xnone ; then
2521 : Give one chance to correct a possible typo.
2522 echo "$file.sh does not exist"
2524 rp="hint to use instead?"
2526 for file in $ans; do
2527 if $test -f "$src/hints/$file.sh"; then
2528 . $src/hints/$file.sh
2529 $cat $src/hints/$file.sh >> UU/config.sh
2530 elif $test X$ans = X -o X$ans = Xnone ; then
2533 echo "$file.sh does not exist -- ignored."
2540 : Remember our hint file for later.
2541 if $test -f "$src/hints/$file.sh" ; then
2551 echo "Fetching default answers from $config_sh..." >&4
2555 cp $config_sh config.sh 2>/dev/null
2565 test "$override" && . ./optdef.sh
2566 myuname="$newmyuname"
2568 : Restore computed paths
2569 for file in $loclist $trylist; do
2570 eval $file="\$_$file"
2575 Configure uses the operating system name and version to set some defaults.
2576 The default value is probably right if the name rings a bell. Otherwise,
2577 since spelling matters for me, either accept the default or answer "none"
2584 ''|' '|none) dflt=none ;;
2585 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2588 *) dflt="$osname" ;;
2590 rp="Operating system name?"
2594 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2600 ''|' '|none) dflt=none ;;
2601 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2602 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2604 ''|' ') dflt=none ;;
2609 *) dflt="$osvers" ;;
2611 rp="Operating system version?"
2621 : who configured the system
2622 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2623 cf_by=`(logname) 2>/dev/null`
2626 cf_by=`(whoami) 2>/dev/null`
2628 "") cf_by=unknown ;;
2632 : set up the script used to warn in case of inconsistency
2639 echo "*** WHOA THERE!!! ***" >&4
2640 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2641 rp=" Keep the $hint value?"
2644 y) td=$was; tu=$was;;
2648 : function used to set $1 to $val
2649 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2651 $define$undef) . ./whoa; eval "$var=\$td";;
2652 $undef$define) . ./whoa; eval "$var=\$tu";;
2653 *) eval "$var=$val";;
2658 Perl can be built to take advantage of threads, on some systems.
2659 To do so, Configure must be run with -Dusethreads.
2661 Note that threading is a highly experimental feature, and
2662 some known race conditions still remain. If you choose to try
2663 it, be very sure to not actually deploy it for production
2664 purposes. README.threads has more details, and is required
2665 reading if you enable threads.
2667 case "$usethreads" in
2668 $define|true|[yY]*) dflt='y';;
2671 rp='Build a threading Perl?'
2674 y|Y) val="$define" ;;
2680 case "$usethreads" in
2684 As of 5.5.640, Perl has two different internal threading implementations,
2685 the 5.005 version (5005threads) and an interpreter-based version
2686 (ithreads) that has one interpreter per thread. Both are very
2687 experimental. This arrangement exists to help developers work out
2688 which one is better.
2690 : Default to ithreads unless overridden on command line or with
2693 case "$use5005threads" in
2694 $define|true|[yY]*) dflt='n';;
2696 case "$useithreads" in
2697 $undef|false|[nN]*) dflt='n';;
2699 rp='Use interpreter-based ithreads?'
2702 y|Y) val="$define" ;;
2707 : Now set use5005threads to the opposite value.
2708 case "$useithreads" in
2709 $define) val="$undef" ;;
2716 useithreads="$undef"
2717 use5005threads="$undef"
2721 case "$d_oldpthreads" in
2722 '') : Configure tests would be welcome here. For now, assume undef.
2724 *) val="$d_oldpthreads" ;;
2730 case "$usethreads" in
2731 "$define"|true|[yY]*)
2732 : Look for a hint-file generated 'call-back-unit'. If the
2733 : user has specified that a threading perl is to be built,
2734 : we may need to set or change some other defaults.
2735 if $test -f usethreads.cbu; then
2736 echo "Your platform has some specific hints for threaded builds, using them..."
2740 (Your platform doesn't have any specific hints for threaded builds.
2741 Assuming POSIX threads, then.)
2749 Perl can be built so that multiple Perl interpreters can coexist
2750 within the same Perl executable.
2753 case "$useithreads" in
2756 This multiple interpreter support is required for interpreter-based threads.
2761 echo 'Normally you do not need this and you should answer no.'
2762 case "$usemultiplicity" in
2763 $define|true|[yY]*) dflt='y';;
2766 rp='Build Perl for multiplicity?'
2769 y|Y) val="$define" ;;
2777 : determine where manual pages are on this system
2781 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2782 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2783 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2784 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2785 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2786 sysman=`./loc . /usr/man/man1 $syspath`
2789 if $test -d "$sysman"; then
2790 echo "System manual is in $sysman." >&4
2792 echo "Could not find manual pages in source form." >&4
2795 : see what memory models we can support
2798 $cat >pdp11.c <<'EOP'
2807 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2808 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2809 dflt='unsplit split'
2811 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2814 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2819 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2822 if $test -d /lib/large || $test -d /usr/lib/large; then
2825 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2834 Some systems have different model sizes. On most systems they are called
2835 small, medium, large, and huge. On the PDP11 they are called unsplit and
2836 split. If your system doesn't support different memory models, say "none".
2837 If you wish to force everything to one memory model, say "none" here and
2838 put the appropriate flags later when it asks you for other cc and ld flags.
2839 Venix systems may wish to put "none" and let the compiler figure things out.
2840 (In the following question multiple model names should be space separated.)
2842 The default for most systems is "none".
2845 rp="Which memory models are supported?"
2860 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2861 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2868 rp="What flag indicates separate I and D space?"
2876 *large*|*small*|*medium*|*huge*)
2883 rp="What flag indicates large model?"
2893 *huge*) case "$huge" in
2897 rp="What flag indicates huge model?"
2907 *medium*) case "$medium" in
2911 rp="What flag indicates medium model?"
2918 *) medium="$large";;
2921 *small*) case "$small" in
2925 rp="What flag indicates small model?"
2936 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2939 $rm -f pdp11.* pdp11
2941 : make some quick guesses about what we are up against
2943 $echo $n "Hmm... $c"
2953 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2954 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2956 echo "Looks kind of like an OSF/1 system, but we'll see..."
2958 elif test `echo abc | tr a-z A-Z` = Abc ; then
2959 xxx=`./loc addbib blurfl $pth`
2960 if $test -f $xxx; then
2961 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2965 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2966 echo "Looks kind of like an extended USG system, but we'll see..."
2968 echo "Looks kind of like a USG system, but we'll see..."
2972 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2973 echo "Looks kind of like a BSD system, but we'll see..."
2977 echo "Looks kind of like a Version 7 system, but we'll see..."
2980 case "$eunicefix" in
2983 There is, however, a strange, musty smell in the air that reminds me of
2984 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2988 : it so happens the Eunice I know will not run shell scripts in Unix format
2992 echo "Congratulations. You aren't running Eunice."
2996 : Detect OS2. The p_ variable is set above in the Head.U unit.
3001 I have the feeling something is not exactly right, however...don't tell me...
3002 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3007 if test -f /xenix; then
3008 echo "Actually, this looks more like a XENIX system..."
3013 echo "It's not Xenix..."
3018 if test -f /venix; then
3019 echo "Actually, this looks more like a VENIX system..."
3026 echo "Nor is it Venix..."
3029 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3030 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3033 : see if we need a special compiler
3041 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3042 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3056 On some older systems the default C compiler will not resolve multiple global
3057 references that happen to have the same name. On some such systems the "Mcc"
3058 command may be used to force these to be resolved. On other systems a "cc -M"
3059 command is required. (Note that the -M flag on other systems indicates a
3060 memory model to use!) If you have the Gnu C compiler, you might wish to use
3066 rp="Use which C compiler?"
3074 rp="Use which C compiler?"
3078 : Look for a hint-file generated 'call-back-unit'. Now that the
3079 : user has specified the compiler, we may need to set or change some
3081 if $test -f cc.cbu; then
3085 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3086 $cat >gccvers.c <<EOM
3091 printf("%s\n", __VERSION__);
3093 printf("%s\n", "1");
3099 if $cc -o gccvers gccvers.c; then
3100 gccversion=`./gccvers`
3101 case "$gccversion" in
3102 '') echo "You are not using GNU cc." ;;
3103 *) echo "You are using GNU cc $gccversion."
3108 echo "*** WHOA THERE!!! ***" >&4
3109 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3110 case "$knowitall" in
3112 echo " You'd better start hunting for one and let me know about it." >&4
3118 case "$gccversion" in
3119 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3122 : decide how portable to be. Allow command line overrides.
3123 case "$d_portable" in
3125 *) d_portable="$define" ;;
3128 : set up shell script to do ~ expansion
3134 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3137 if $test -f /bin/csh; then
3138 /bin/csh -f -c "glob \$1"
3143 name=\`$expr x\$1 : '..\([^/]*\)'\`
3144 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3145 if $test ! -d "\$dir"; then
3147 echo "\$me: can't locate home directory for: \$name" >&2
3152 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3168 : now set up to get a file name
3172 cat <<'EOSC' >>getfile
3188 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3189 fn=`echo $fn | sed 's/(.*)//'`
3195 loc_file=`expr $fn : '.*:\(.*\)'`
3196 fn=`expr $fn : '\(.*\):.*'`
3204 */*) fullpath=true;;
3213 *e*) exp_file=true;;
3216 *p*) nopath_ok=true;;
3221 *d*) type='Directory';;
3222 *l*) type='Locate';;
3227 Locate) what='File';;
3232 case "$d_portable" in
3240 while test "$type"; do
3245 true) rp="$rp (~name ok)";;
3248 if test -f UU/getfile.ok && \
3249 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3268 value=`UU/filexp $ans`
3271 if test "$ans" != "$value"; then
3272 echo "(That expands to $value on this system.)"
3286 /*) value="$ansexp" ;;
3291 echo "I shall only accept a full path name, as in /bin/ls." >&4
3292 echo "Use a ! shell escape if you wish to check pathnames." >&4
3295 echo "Please give a full path name, starting with slash." >&4
3298 echo "Note that using ~name is ok provided it expands well." >&4
3311 for fp in $gfpth; do
3312 if test "X$fp" = X.; then
3317 if test -f "$pf"; then
3319 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3321 echo "($value is not a plain file, but that's ok.)"
3324 if test X"$type" = X; then
3331 for fp in $gfpth; do
3332 if test "X$fp" = X.; then
3337 if test -d "$pf"; then
3345 if test -d "$ansexp"; then
3346 echo "(Looking for $loc_file in directory $value.)"
3347 value="$value/$loc_file"
3348 ansexp="$ansexp/$loc_file"
3350 if test -f "$ansexp"; then
3353 case "$nopath_ok" in
3354 true) case "$value" in
3356 *) echo "Assuming $value will be in people's path."
3372 if test "$fastread" = yes; then
3377 rp="$what $value doesn't exist. Use that name anyway?"
3396 test "X$gfpthkeep" != Xy && gfpth=""
3399 : What should the include directory be ?
3401 $echo $n "Hmm... $c"
3405 if $test -f /bin/mips && /bin/mips; then
3406 echo "Looks like a MIPS system..."
3407 $cat >usr.c <<'EOCP'
3408 #ifdef SYSTYPE_BSD43
3412 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3413 dflt='/bsd43/usr/include'
3417 mips_type='System V'
3419 $rm -f usr.c usr.out
3420 echo "and you're compiling with the $mips_type compiler and libraries."
3424 echo "Doesn't look like a MIPS system."
3434 case "$xxx_prompt" in
3437 rp='Where are the include files you want to use?'
3445 : see how we invoke the C preprocessor
3447 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3448 cat <<'EOT' >testcpp.c
3454 if test ! -f cppstdin; then
3455 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3456 # AIX cc -E doesn't show the absolute headerfile
3457 # locations but we'll cheat by using the -M flag.
3458 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
3460 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3463 echo "Keeping your $hint cppstdin wrapper."
3466 wrapper=`pwd`/cppstdin
3470 if $test "X$cppstdin" != "X" && \
3471 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3472 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3474 echo "You used to use $cppstdin $cppminus so we'll use that again."
3476 '') echo "But let's see if we can live without a wrapper..." ;;
3478 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3479 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3481 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3484 echo "(However, $cpprun $cpplast does not work, let's see...)"
3492 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3499 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3500 $cc -E <testcpp.c >testcpp.out 2>&1; \
3501 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3502 echo "Yup, it does."
3505 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3506 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3507 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3508 echo "Yup, it does."
3511 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3512 $cc -P <testcpp.c >testcpp.out 2>&1; \
3513 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3514 echo "Yipee, that works!"
3517 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3518 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3519 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3520 echo "At long last!"
3523 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3524 $cpp <testcpp.c >testcpp.out 2>&1; \
3525 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3529 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3530 $cpp - <testcpp.c >testcpp.out 2>&1; \
3531 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3532 echo "Hooray, it works! I was beginning to wonder."
3535 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3536 $wrapper <testcpp.c >testcpp.out 2>&1; \
3537 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3543 rp="No dice. I can't find a C preprocessor. Name one:"
3547 $x_cpp <testcpp.c >testcpp.out 2>&1
3548 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3549 echo "OK, that will do." >&4
3551 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3566 echo "Perhaps can we force $cc -E using a wrapper..."
3567 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3568 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3574 echo "Nope, we'll have to live without it..."
3588 "$wrapper"|'cppstdin') ;;
3589 *) $rm -f $wrapper;;
3591 $rm -f testcpp.c testcpp.out
3593 : Set private lib path
3596 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3601 '') dlist="$loclibpth $plibpth $glibpth";;
3602 *) dlist="$libpth";;
3605 : Now check and see which directories actually exist, avoiding duplicates
3609 if $test -d $xxx; then
3612 *) libpth="$libpth $xxx";;
3618 Some systems have incompatible or broken versions of libraries. Among
3619 the directories listed in the question below, please remove any you
3620 know not to be holding relevant libraries, and add any that are needed.
3621 Say "none" for none.
3632 rp="Directories to use for library searches?"
3639 : compute shared library extension
3642 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3652 On some systems, shared libraries may be available. Answer 'none' if
3653 you want to suppress searching of shared libraries for the remaining
3654 of this configuration.
3657 rp='What is the file extension used for shared libraries?'
3661 : Define several unixisms.
3662 : Hints files or command line option can be used to override them.
3663 : The convoluted testing is in case hints files set either the old
3666 '') case "$exe_ext" in
3668 *) _exe="$exe_ext" ;;
3673 '') case "$lib_ext" in
3680 '') case "$obj_ext" in
3687 '') case "$path_sep" in
3698 : Which makefile gets called first. This is used by make depend.
3699 case "$firstmakefile" in
3700 '') firstmakefile='makefile';;
3705 Perl can be built to use the SOCKS proxy protocol library. To do so,
3706 Configure must be run with -Dusesocks.
3708 Normally you do not need this and you should answer no.
3712 $define|true|[yY]*) dflt='y';;
3715 rp='Build Perl for SOCKS?'
3718 y|Y) val="$define" ;;
3724 : Looking for optional libraries
3726 echo "Checking for optional libraries..." >&4
3731 case "$libswanted" in
3732 '') libswanted='c_s';;
3736 libswanted="$libswanted socks5 socks5_sh"
3739 for thislib in $libswanted; do
3741 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3742 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3743 echo "Found -l$thislib (shared)."
3746 *) dflt="$dflt -l$thislib";;
3748 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3749 echo "Found -l$thislib (shared)."
3752 *) dflt="$dflt -l$thislib";;
3754 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3755 echo "Found -l$thislib."
3758 *) dflt="$dflt -l$thislib";;
3760 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3761 echo "Found -l$thislib."
3764 *) dflt="$dflt -l$thislib";;
3766 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3767 echo "Found -l${thislib}_s."
3770 *) dflt="$dflt -l${thislib}_s";;
3772 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3773 echo "Found -l$thislib."
3776 *) dflt="$dflt -l$thislib";;
3779 echo "No -l$thislib."
3790 ' '|'') dflt='none';;
3795 In order to compile $package on your machine, a number of libraries
3796 are usually needed. Include any other special libraries here as well.
3797 Say "none" for none. The default list is almost always right.
3801 rp="What libraries to use?"
3808 : determine optimization, if desired, or use for debug flag also
3810 ' '|$undef) dflt='none';;
3812 *) dflt="$optimize";;
3816 By default, $package compiles with the -O flag to use the optimizer.
3817 Alternately, you might want to use the symbolic debugger, which uses
3818 the -g flag (on traditional Unix systems). Either flag can be
3819 specified here. To use neither flag, specify the word "none".
3822 rp="What optimizer/debugger flag should be used?"
3826 'none') optimize=" ";;
3830 : We will not override a previous value, but we might want to
3831 : augment a hint file
3833 default|recommended)
3834 case "$gccversion" in
3835 1*) dflt='-fpcc-struct-return' ;;
3838 *-g*) dflt="$dflt -DDEBUGGING";;
3840 case "$gccversion" in
3841 2*) if test -d /etc/conf/kconfig.d &&
3842 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3848 case "$gccversion" in
3852 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3853 echo 'int main(void) { return 0; }' > gcctest.c
3854 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3855 echo "Yes, it does." 2>&1
3858 echo "Leaving current flags $ccflags alone." 2>&1
3860 *) dflt="$dflt -fno-strict-aliasing" ;;
3863 echo "Nope, it doesn't, but that's ok." 2>&1
3870 case "$mips_type" in
3871 *BSD*|'') inclwanted="$locincpth $usrinc";;
3872 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3874 for thisincl in $inclwanted; do
3875 if $test -d $thisincl; then
3876 if $test x$thisincl != x$usrinc; then
3879 *) dflt="$dflt -I$thisincl";;
3885 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3887 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3895 *) dflt="$dflt -D$2";;
3899 set signal.h LANGUAGE_C; eval $inctest
3903 ccflags="$ccflags -DSOCKS"
3908 default|recommended) dflt="$ccflags $dflt" ;;
3909 *) dflt="$ccflags";;
3917 Your C compiler may want other flags. For this question you should include
3918 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3919 but you should NOT include libraries or ld flags like -lwhatever. If you
3920 want $package to honor its debug switch, you should include -DDEBUGGING here.
3921 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3923 To use no flags, specify the word "none".
3929 rp="Any additional cc flags?"
3936 : the following weeds options from ccflags that are of no interest to cpp
3938 case "$gccversion" in
3939 1*) cppflags="$cppflags -D__GNUC__"
3941 case "$mips_type" in
3943 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3949 echo "Let me guess what the preprocessor flags are..." >&4
3963 *) ftry="$previous $flag";;
3965 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3966 >cpp1.out 2>/dev/null && \
3967 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3968 >cpp2.out 2>/dev/null && \
3969 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3970 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3972 cppflags="$cppflags $ftry"
3982 *-*) echo "They appear to be: $cppflags";;
3984 $rm -f cpp.c cpp?.out
3988 : flags used in final linking phase
3990 '') if ./venix; then
3996 *-posix*) dflt="$dflt -posix" ;;
3999 *) dflt="$ldflags";;
4002 : Try to guess additional flags to pick up local libraries.
4003 for thislibdir in $libpth; do
4004 case " $loclibpth " in
4007 *"-L$thislibdir "*) ;;
4008 *) dflt="$dflt -L$thislibdir" ;;
4020 Your C linker may need flags. For this question you should
4021 include -L/whatever and any other flags used by the C linker, but you
4022 should NOT include libraries like -lwhatever.
4024 Make sure you include the appropriate -L/path flags if your C linker
4025 does not normally search all of the directories you specified above,
4028 To use no flags, specify the word "none".
4032 rp="Any additional ld flags (NOT including libraries)?"
4038 rmlist="$rmlist pdp11"
4042 echo "Checking your choice of C compiler and flags for coherency..." >&4
4043 $cat > try.c <<'EOF'
4045 int main() { printf("Ok\n"); exit(0); }
4047 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4049 $cat >try.msg <<'EOM'
4050 I've tried to compile and run the following simple program:
4053 $cat try.c >> try.msg
4055 $cat >> try.msg <<EOM
4062 and I got the following output:
4066 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4067 if sh -c './try' >>try.msg 2>&1; then
4071 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4074 cat >> try.msg <<'EOQS'
4075 If $libs contains -lsfio, and sfio is mis-configured, then it
4076 sometimes (apparently) runs and exits with a 0 status, but with no
4077 output! It may have to do with sfio's use of _exit vs. exit.
4080 rp="You have a big problem. Shall I abort Configure"
4087 echo "The program compiled OK, but exited with status $?." >>try.msg
4088 rp="You have a problem. Shall I abort Configure"
4092 echo "I can't compile the test program." >>try.msg
4093 rp="You have a BIG problem. Shall I abort Configure"
4099 case "$knowitall" in
4101 echo "(The supplied flags or libraries might be incorrect.)"
4109 *) echo "Ok. Stopping Configure." >&4
4114 n) echo "OK, that should do.";;
4116 $rm -f try try.* core
4118 : define an is-a-typedef? function
4119 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4121 "") inclist="sys/types.h";;
4123 eval "varval=\$$var";
4127 for inc in $inclist; do
4128 echo "#include <$inc>" >>temp.c;
4130 echo "#ifdef $type" >> temp.c;
4131 echo "printf(\"We have $type\");" >> temp.c;
4132 echo "#endif" >> temp.c;
4133 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4134 if $contains $type temp.E >/dev/null 2>&1; then
4140 *) eval "$var=\$varval";;
4143 : define an is-a-typedef? function that prompts if the type is not available.
4144 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4146 "") inclist="sys/types.h";;
4148 eval "varval=\$$var";
4152 for inc in $inclist; do
4153 echo "#include <$inc>" >>temp.c;
4155 echo "#ifdef $type" >> temp.c;
4156 echo "printf(\"We have $type\");" >> temp.c;
4157 echo "#endif" >> temp.c;
4158 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4160 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4161 if $contains $type temp.E >/dev/null 2>&1; then
4162 echo "$type found." >&4;
4165 echo "$type NOT found." >&4;
4171 *) eval "$var=\$varval";;
4174 : define a shorthand compile call
4178 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4179 : define a shorthand compile call for compilations that should be ok.
4183 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4185 : check for lengths of integral types
4189 echo "Checking to see how big your integers are..." >&4
4190 $cat >intsize.c <<'EOCP'
4194 printf("intsize=%d;\n", (int)sizeof(int));
4195 printf("longsize=%d;\n", (int)sizeof(long));
4196 printf("shortsize=%d;\n", (int)sizeof(short));
4201 if eval $compile_ok && ./intsize > /dev/null; then
4203 echo "Your integers are $intsize bytes long."
4204 echo "Your long integers are $longsize bytes long."
4205 echo "Your short integers are $shortsize bytes long."
4209 Help! I can't compile and run the intsize test program: please enlighten me!
4210 (This is probably a misconfiguration in your system or libraries, and
4211 you really ought to fix it. Still, I'll try anyway.)
4215 rp="What is the size of an integer (in bytes)?"
4219 rp="What is the size of a long integer (in bytes)?"
4223 rp="What is the size of a short integer (in bytes)?"
4229 $rm -f intsize intsize.*
4231 : see what type lseek is declared as in the kernel
4232 rp="What is the type used for lseek's offset on this system?"
4233 set off_t lseektype long stdio.h sys/types.h
4237 $echo $n "Checking to see how big your file offsets are...$c" >&4
4239 #include <sys/types.h>
4243 printf("%d\n", (int)sizeof($lseektype));
4248 if eval $compile_ok; then
4250 $echo " $lseeksize bytes." >&4
4254 echo "(I can't seem to compile the test program. Guessing...)"
4255 rp="What is the size of your file offsets (in bytes)?"
4261 : see what type file positions are declared as in the library
4262 rp="What is the type for file position used by fsetpos()?"
4263 set fpos_t fpostype long stdio.h sys/types.h
4268 *_t) zzz="$fpostype" ;;
4271 $echo $n "Checking the size of $zzz...$c" >&4
4273 #include <sys/types.h>
4276 printf("%d\n", (int)sizeof($fpostype));
4281 if eval $compile_ok; then
4286 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4289 echo " $fpossize bytes."
4295 echo "(I can't compile the test program. Guessing...)" >&4
4296 rp="What is the size of your file positions (in bytes)?"
4303 case "$lseeksize:$fpossize" in
4306 You can have files larger than 2 gigabytes.
4311 Perl can be built to understand large files (files larger than 2 gigabytes)
4312 on some systems. To do so, Configure must be run with -Duselargefiles.
4314 If this doesn't make any sense to you, just accept the default 'y'.
4316 case "$uselargefiles" in
4317 "$undef"|false|[nN]*) dflt='n' ;;
4320 rp='Try to understand large files, if available?'
4323 y|Y) val="$define" ;;
4330 case "$uselargefiles" in
4332 : Look for a hint-file generated 'call-back-unit'. If the
4333 : user has specified that a large files perl is to be built,
4334 : we may need to set or change some other defaults.
4335 if $test -f uselfs.cbu; then
4336 echo "Your platform has some specific hints for large file builds, using them..."
4339 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4341 #include <sys/types.h>
4345 printf("%d\n", (int)sizeof($lseektype));
4350 if eval $compile_ok; then
4352 $echo " $lseeksize bytes." >&4
4356 echo "(I can't seem to compile the test program. Guessing...)"
4357 rp="What is the size of your file offsets (in bytes)?"
4362 *_t) zzz="$fpostype" ;;
4365 $echo $n "Rechecking the size of $zzz...$c" >&4
4367 #include <sys/types.h>
4370 printf("%d\n", (int)sizeof($fpostype));
4375 if eval $compile_ok; then
4380 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4383 echo " $fpossize bytes."
4389 echo "(I can't compile the test program. Guessing...)" >&4
4390 rp="What is the size of your file positions (in bytes)?"
4400 case "$usemorebits" in
4401 "$define"|true|[yY]*)
4403 uselongdouble="$define"
4404 usemorebits="$define"
4406 *) usemorebits="$undef"
4411 case "$intsize:$longsize" in
4414 You have natively 64-bit integers.
4419 Perl can be built to take advantage of 64-bit integer types
4420 on some systems. To do so, Configure must be run with -Duse64bits.
4422 If this doesn't make any sense to you, just accept the default.
4424 case "$use64bits" in
4425 $define|true|[yY]*) dflt='y';;
4428 rp='Try to use 64-bit integers, if available?'
4431 y|Y) val="$define" ;;
4439 case "$archname64" in
4440 '') archname64='' ;; # not a typo
4443 case "$use64bits" in
4444 "$define"|true|[yY]*)
4445 : Look for a hint-file generated 'call-back-unit'. If the
4446 : user has specified that a 64-bit perl is to be built,
4447 : we may need to set or change some other defaults.
4448 if $test -f use64bits.cbu; then
4449 echo "Your platform has some specific hints for 64-bit builds, using them..."
4453 (Your platform doesn't have any specific hints for 64-bit builds.)
4455 case "$intsize:$longsize" in
4457 (This is probably okay, as your system is a natively 64-bit system.)
4461 case "$gccversion" in
4463 *) case "$ccflags" in
4464 *-DUSE_LONG_LONG*) ;;
4466 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4467 to the compilation flags.
4469 ccflags="$ccflags -DUSE_LONG_LONG"
4478 : determine the architecture name
4480 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4481 tarch=`arch`"-$osname"
4482 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4483 if uname -m > tmparch 2>&1 ; then
4484 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4485 -e 's/$/'"-$osname/" tmparch`
4493 case "$myarchname" in
4496 echo "(Your architecture name used to be $myarchname.)"
4503 *) dflt="$archname";;
4505 rp='What is your architecture name'
4508 case "$usethreads" in
4510 echo "Threads selected." >&4
4512 *-thread*) echo "...and architecture name already has -thread." >&4
4514 *) archname="$archname-thread"
4515 echo "...setting architecture name to $archname." >&4
4520 case "$usemultiplicity" in
4522 echo "Multiplicity selected." >&4
4524 *-multi*) echo "...and architecture name already has -multi." >&4
4526 *) archname="$archname-multi"
4527 echo "...setting architecture name to $archname." >&4
4532 case "$use64bits" in
4534 case "$archname64" in
4539 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4541 *) archname="$archname-$archname64"
4542 echo "...setting architecture name to $archname." >&4
4549 : determine root of directory hierarchy where package will be installed.
4552 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4560 By default, $package will be installed in $dflt/bin, manual pages
4561 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4562 installation directories. Typically this is something like /usr/local.
4563 If you wish to have binaries under /usr/bin but other parts of the
4564 installation under /usr/local, that's ok: you will be prompted
4565 separately for each of the installation directories, the prefix being
4566 only used to set the defaults.
4570 rp='Installation prefix to use?'
4578 *) oldprefix="$prefix";;
4588 $define|true) afs=true ;;
4589 $undef|false) afs=false ;;
4590 *) if test -d /afs; then
4598 echo "AFS may be running... I'll be extra cautious then..." >&4
4600 echo "AFS does not seem to be running..." >&4
4603 : determine installation prefix for where package is to be installed.
4607 Since you are running AFS, I need to distinguish the directory in which
4608 files will reside from the directory in which they are installed (and from
4609 which they are presumably copied to the former directory by occult means).
4612 case "$installprefix" in
4613 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4614 *) dflt="$installprefix";;
4619 In some special cases, particularly when building $package for distribution,
4620 it is convenient to distinguish between the directory in which files should
4621 be installed from the directory ($prefix) in which they
4622 will eventually reside. For most users, these two directories are the same.
4625 case "$installprefix" in
4627 *) dflt=$installprefix;;
4631 rp='What installation prefix should I use for installing files?'
4633 installprefix="$ans"
4634 installprefixexp="$ansexp"
4636 : set the prefixit variable, to compute a suitable default value
4637 prefixit='case "$3" in
4639 case "$oldprefix" in
4640 "") eval "$1=\"\$$2\"";;
4647 ""|" ") eval "$1=\"\$$2\"";;
4653 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4655 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4656 /*-$oldprefix/*|\~*-$oldprefix/*)
4657 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4658 *) eval "$1=\"\$$2\"";;
4662 : set the base revision
4666 : get the patchlevel
4668 echo "Getting the current patchlevel..." >&4
4669 if $test -r $rsrc/patchlevel.h;then
4670 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4671 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4672 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4673 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4674 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4682 $echo $n "(You have $package" $c
4685 *) $echo $n " $baserev" $c ;;
4687 $echo $n " patchlevel $patchlevel" $c
4688 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4691 dos|cygwin|vms|win32)
4692 : XXX Should be a Configure test for double-dots in filenames.
4693 version=`echo $baserev $patchlevel $subversion | \
4694 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4695 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4696 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4699 version=`echo $baserev $patchlevel $subversion | \
4700 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4701 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4702 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4705 : Special case the 5.005_xx maintenance series, which used 5.005
4706 : without any subversion label as a subdirectory in $sitelib
4707 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4708 api_versionstring='5.005'
4711 : determine installation style
4712 : For now, try to deduce it from prefix unless it is already set.
4713 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4714 case "$installstyle" in
4715 '') case "$prefix" in
4716 *perl*) dflt='lib';;
4717 *) dflt='lib/perl5' ;;
4720 *) dflt='lib/perl5' ;;
4722 : Probably not worth prompting for this since we prompt for all
4723 : the directories individually, and the prompt would be too long and
4727 : determine where private library files go
4728 : Usual default is /usr/local/lib/perl5/$version.
4729 : Also allow things like /opt/perl/lib/$version, since
4730 : /opt/perl/lib/perl5... would be redundant.
4731 : The default "style" setting is made in installstyle.U
4732 case "$installstyle" in
4733 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4734 *) set dflt privlib lib/$version ;;
4739 There are some auxiliary files for $package that need to be put into a
4740 private library directory that is accessible by everyone.
4744 rp='Pathname where the private library files will reside?'
4747 privlibexp="$ansexp"
4748 : Change installation prefix, if necessary.
4749 if $test X"$prefix" != X"$installprefix"; then
4750 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4752 installprivlib="$privlibexp"
4755 : set the prefixup variable, to restore leading tilda escape
4756 prefixup='case "$prefixexp" in
4758 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4761 : determine where public architecture dependent libraries go
4764 : privlib default is /usr/local/lib/$package/$version
4765 : archlib default is /usr/local/lib/$package/$version/$archname
4766 : privlib may have an optional trailing /share.
4767 tdflt=`echo $privlib | $sed 's,/share$,,'`
4768 tdflt=$tdflt/$archname
4777 $spackage contains architecture-dependent library files. If you are
4778 sharing libraries in a heterogeneous environment, you might store
4779 these files in a separate location. Otherwise, you can just include
4780 them with the rest of the public library files.
4784 rp='Where do you want to put the public architecture-dependent libraries?'
4787 archlibexp="$ansexp"
4788 if $test X"$archlib" = X"$privlib"; then
4793 : Change installation prefix, if necessary.
4794 if $test X"$prefix" != X"$installprefix"; then
4795 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4797 installarchlib="$archlibexp"
4801 : Binary compatibility with 5.005 is not possible for builds
4802 : with advanced features
4803 case "$usethreads$usemultiplicity" in
4805 bincompat5005="$undef"
4806 d_bincompat5005="$undef"
4810 Perl 5.006 can be compiled for binary compatibility with 5.005.
4811 If you decide to do so, you will be able to continue using most
4812 of the extensions that were compiled for Perl 5.005.
4815 case "$bincompat5005$d_bincompat5005" in
4816 *"$undef"*) dflt=n ;;
4819 rp='Binary compatibility with Perl 5.005?'
4822 y*) val="$define" ;;
4827 case "$d_bincompat5005" in
4829 bincompat5005="$define"
4831 *) bincompat5005="$undef"
4832 d_bincompat5005="$undef"
4839 : see if setuid scripts can be secure
4842 Some kernels have a bug that prevents setuid #! scripts from being
4843 secure. Some sites have disabled setuid #! scripts because of this.
4845 First let's decide if your kernel supports secure setuid #! scripts.
4846 (If setuid #! scripts would be secure but have been disabled anyway,
4847 don't say that they are secure if asked.)
4852 if $test -d /dev/fd; then
4853 echo "#!$ls" >reflect
4854 chmod +x,u+s reflect
4855 ./reflect >flect 2>&1
4856 if $contains "/dev/fd" flect >/dev/null; then
4857 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4861 If you are not sure if they are secure, I can check but I'll need a
4862 username and password different from the one you are using right now.
4863 If you don't have such a username or don't want me to test, simply
4867 rp='Other username to test security of setuid scripts with?'
4872 case "$d_suidsafe" in
4873 '') echo "I'll assume setuid scripts are *not* secure." >&4
4876 echo "Well, the $hint value is *not* secure." >&4
4878 *) echo "Well, the $hint value *is* secure." >&4
4883 $rm -f reflect flect
4884 echo "#!$ls" >reflect
4885 chmod +x,u+s reflect
4888 echo '"su" will (probably) prompt you for '"$ans's password."
4889 su $ans -c './reflect >flect'
4890 if $contains "/dev/fd" flect >/dev/null; then
4891 echo "Okay, it looks like setuid scripts are secure." >&4
4894 echo "I don't think setuid scripts are secure." >&4
4899 rp='Does your kernel have *secure* setuid scripts?'
4902 [yY]*) val="$define";;
4907 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4908 echo "(That's for file descriptors, not floppy disks.)"
4914 $rm -f reflect flect
4916 : now see if they want to do setuid emulation
4919 case "$d_suidsafe" in
4922 echo "No need to emulate SUID scripts since they are secure here." >& 4
4926 Some systems have disabled setuid scripts, especially systems where
4927 setuid scripts cannot be secure. On systems where setuid scripts have
4928 been disabled, the setuid/setgid bits on scripts are currently
4929 useless. It is possible for $package to detect those bits and emulate
4930 setuid/setgid in a secure fashion. This emulation will only work if
4931 setuid scripts have been disabled in your kernel.
4935 "$define") dflt=y ;;
4938 rp="Do you want to do setuid/setgid emulation?"
4941 [yY]*) val="$define";;
4949 : determine filename position in cpp output
4951 echo "Computing filename position in cpp output for #include directives..." >&4
4952 echo '#include <stdio.h>' > foo.c
4955 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4956 $grep '^[ ]*#.*stdio\.h' | \
4957 while read cline; do
4960 while $test \$# -gt 0; do
4961 if $test -r \`echo \$1 | $tr -d '"'\`; then
4966 pos=\`expr \$pos + 1\`
4978 *) pos="${fieldn}th";;
4980 echo "Your cpp writes the filename in the $pos field of the line."
4982 : locate header file
4987 for usrincdir in $usrinc
4989 if test -f \$usrincdir/\$wanted; then
4990 echo "\$usrincdir/\$wanted"
4994 awkprg='{ print \$$fieldn }'
4995 echo "#include <\$wanted>" > foo\$\$.c
4996 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4997 $grep "^[ ]*#.*\$wanted" | \
4998 while read cline; do
4999 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5001 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5002 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5007 # status = 0: grep returned 0 lines, case statement not executed
5008 # status = 1: headerfile found
5009 # status = 2: while loop executed, no headerfile found
5013 if test \$status -eq 1; then
5020 : define an alternate in-header-list? function
5021 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5022 cont=true; xxf="echo \"<\$1> found.\" >&4";
5023 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5024 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5026 case $# in 4) instead=instead;; *) instead="at last";; esac;
5027 while $test "$cont"; do
5029 var=$2; eval "was=\$$2";
5030 if $test "$xxx" && $test -r "$xxx";
5032 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5035 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5036 set $yyy; shift; shift; yyy=$@;
5037 case $# in 0) cont="";;
5038 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5039 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5040 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5041 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5045 do set $yyy; var=$2; eval "was=\$$2";
5046 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5047 set $yyy; shift; shift; yyy=$@;
5050 : see if this is a malloc.h system
5051 set malloc.h i_malloc
5054 : see if stdlib is available
5055 set stdlib.h i_stdlib
5058 : determine which malloc to compile in
5060 case "$usemymalloc" in
5061 ''|[yY]*|true|$define) dflt='y' ;;
5064 rp="Do you wish to attempt to use the malloc that comes with $package?"
5070 mallocsrc='malloc.c'
5071 mallocobj="malloc$_o"
5072 d_mymalloc="$define"
5075 : Remove malloc from list of libraries to use
5076 echo "Removing unneeded -lmalloc from library list" >&4
5077 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5080 echo "libs = $libs" >&4
5092 : compute the return types of malloc and free
5094 $cat >malloc.c <<END
5098 #include <sys/types.h>
5112 case "$malloctype" in
5114 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5121 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5125 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5132 echo "Your system uses $freetype free(), it would seem." >&4
5136 The installation process will also create a directory for
5137 vendor-supplied add-ons. Vendors who supply perl with their system
5138 may find it convenient to place all vendor-supplied files in this
5139 directory rather than in the main distribution directory. This will
5140 ease upgrades between binary-compatible maintenance versions of perl.
5142 Of course you may also use these directories in whatever way you see
5143 fit. For example, you might use them to access modules shared over a
5144 company-wide network.
5146 The default answer should be fine for most people.
5147 This causes further questions about vendor add-ons to be skipped
5148 and no vendor-specific directories will be configured for perl.
5151 rp='Do you want to configure vendor-specific add-on directories?'
5152 case "$usevendorprefix" in
5153 define|true|[yY]*) dflt=y ;;
5159 rp='Installation prefix to use for vendor-supplied add-ons?'
5160 case "$vendorprefix" in
5162 *) dflt=$vendorprefix ;;
5166 case "$vendorprefix" in
5170 *) oldvendorprefix="$prefix";;
5174 usevendorprefix="$define"
5176 vendorprefixexp="$ansexp"
5178 *) usevendorprefix="$undef"
5184 case "$vendorprefix" in
5185 '') d_vendorlib="$undef"
5189 *) d_vendorlib="$define"
5190 : determine where vendor-supplied modules go.
5191 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5192 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5193 case "$installstyle" in
5194 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5195 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5198 rp='Pathname for the vendor-supplied library files?'
5201 vendorlibexp="$ansexp"
5202 : Change installation prefix, if necessary.
5203 if $test X"$prefix" != X"$installprefix"; then
5204 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5206 installvendorlib="$vendorlibexp"
5211 : Cruising for prototypes
5213 echo "Checking out function prototypes..." >&4
5214 $cat >prototype.c <<'EOCP'
5215 int main(int argc, char *argv[]) {
5218 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5219 echo "Your C compiler appears to support function prototypes."
5222 echo "Your C compiler doesn't seem to understand function prototypes."
5229 case "$prototype" in
5231 *) ansi2knr='ansi2knr'
5236 This version of $package can only be compiled by a compiler that
5237 understands function prototypes. Unfortunately, your C compiler
5239 doesn't seem to understand them. Sorry about that.
5241 If GNU cc is available for your system, perhaps you could try that instead.
5243 Eventually, we hope to support building Perl with pre-ANSI compilers.
5244 If you would like to help in that effort, please contact <perlbug@perl.org>.
5246 Aborting Configure now.
5252 : determine where public executables go
5257 rp='Pathname where the public executables will reside?'
5259 if $test "X$ansexp" != "X$binexp"; then
5264 : Change installation prefix, if necessary.
5265 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5266 if $test X"$prefix" != X"$installprefix"; then
5267 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5269 installbin="$binexp"
5274 After $package is installed, you may wish to install various
5275 add-on modules and utilities. Typically, these add-ons will
5276 be installed under $prefix with the rest
5277 of this package. However, you may wish to install such add-ons
5278 elsewhere under a different prefix.
5280 If you do not wish to put everything under a single prefix, that's
5281 ok. You will be prompted for the individual locations; this siteprefix
5282 is only used to suggest the defaults.
5284 The default should be fine for most people.
5288 rp='Installation prefix to use for add-on modules and utilities?'
5289 : XXX Here might be another good place for an installstyle setting.
5290 case "$siteprefix" in
5292 *) dflt=$siteprefix ;;
5296 case "$siteprefix" in
5301 *) oldsiteprefix="$prefix";;
5306 siteprefixexp="$ansexp"
5308 : determine where site specific libraries go.
5309 : Usual default is /usr/local/lib/perl5/site_perl/$version
5310 : The default "style" setting is made in installstyle.U
5311 : XXX No longer works with Prefixit stuff.
5312 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5313 case "$installstyle" in
5314 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5315 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5319 The installation process will create a directory for
5320 site-specific extensions and modules. Most users find it convenient
5321 to place all site-specific files in this directory rather than in the
5322 main distribution directory.
5326 rp='Pathname for the site-specific library files?'
5329 sitelibexp="$ansexp"
5330 : Change installation prefix, if necessary.
5331 if $test X"$prefix" != X"$installprefix"; then
5332 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5334 installsitelib="$sitelibexp"
5337 : Determine list of previous versions to include in @INC
5338 $cat > getverlist <<EOPL
5341 \$api_versionstring = "$api_versionstring";
5342 \$version = "$version";
5343 \$sitelib = "$sitelib";
5344 \$archname = "$archname";
5346 $cat >> getverlist <<'EOPL'
5347 # Can't have leading @ because metaconfig interprets it as a command!
5348 ;@inc_version_list=();
5349 $stem=dirname($sitelib);
5350 # Redo to do opendir/readdir?
5353 ;@candidates = glob("5.*");
5359 # XXX ToDo: These comparisons must be reworked when two-digit
5360 # subversions come along, so that 5.7.10 compares as greater than
5361 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5362 # widespread that we can use the built-in version vectors rather
5363 # than reinventing them here. For 5.6.0, however, we must
5364 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5365 foreach $d (@candidates) {
5366 if ($d lt $version) {
5367 if ($d ge $api_versionstring) {
5368 unshift(@inc_version_list, "$d/$archname", $d);
5370 elsif ($d ge "5.005") {
5371 unshift(@inc_version_list, $d);
5375 # Skip newer version. I.e. don't look in
5376 # 5.7.0 if we're installing 5.6.1.
5380 if (@inc_version_list) {
5382 print join('", "', @inc_version_list);
5386 # Blank space to preserve value for next Configure run.
5391 case "$inc_version_list" in
5392 '') if test -x $perl; then
5393 dflt=`$perl getverlist`
5398 *) 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.
5409 The default should almost always be sensible, so if you're not sure,
5410 just accept the default.
5413 rp='list of earlier versions to include in @INC?'
5415 inc_version_list="$ans"
5418 : determine whether to install perl also as /usr/bin/perl
5421 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5423 Many scripts expect to perl to be installed as /usr/bin/perl.
5424 I can install the perl you are about to compile also as /usr/bin/perl
5425 (in addition to $installbin/perl).
5427 case "$installusrbinperl" in
5428 "$undef"|[nN]*) dflt='n';;
5431 rp="Do you want to install perl as /usr/bin/perl?"
5434 [yY]*) val="$define";;
5440 set installusrbinperl
5444 echo "Checking for GNU C Library..." >&4
5445 cat >gnulibc.c <<EOM
5457 if eval $compile_ok && ./gnulibc; then
5459 echo "You are using the GNU C Library"
5462 echo "You are not using the GNU C Library"
5468 : see if nm is to be used to determine whether a symbol is defined or not
5472 case "$d_gnulibc" in
5475 echo "nm probably won't work on the GNU C Library." >&4
5481 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5483 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5484 echo "'nm' won't be sufficient on this sytem." >&4
5490 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5491 if $test $dflt -gt 20; then
5501 true|$define) dflt=y;;
5508 I can use $nm to extract the symbols from your C libraries. This
5509 is a time consuming task which may generate huge output on the disk (up
5510 to 3 megabytes) but that should make the symbols extraction faster. The
5511 alternative is to skip the 'nm' extraction part and to compile a small
5512 test program instead to determine whether each symbol is present. If
5513 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5514 this may be the best solution.
5516 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5519 rp="Shall I use $nm to extract C symbols from the libraries?"
5522 [Nn]*) usenm=false;;
5531 : nm options which may be necessary
5533 '') if $test -f /mach_boot; then
5535 elif $test -d /usr/ccs/lib; then
5536 nm_opt='-p' # Solaris (and SunOS?)
5537 elif $test -f /dgux; then
5539 elif $test -f /lib64/rld; then
5540 nm_opt='-p' # 64-bit Irix
5546 : nm options which may be necessary for shared libraries but illegal
5547 : for archive libraries. Thank you, Linux.
5548 case "$nm_so_opt" in
5549 '') case "$myuname" in
5551 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5552 nm_so_opt='--dynamic'
5561 : get list of predefined functions in a handy place
5566 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5573 *) for thislib in $libs; do
5576 : Handle C library specially below.
5579 thislib=`echo $thislib | $sed -e 's/^-l//'`
5580 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5582 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5584 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5586 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5588 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5590 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5592 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5597 libnames="$libnames $try"
5599 *) libnames="$libnames $thislib" ;;
5608 for xxx in $libpth; do
5609 $test -r $1 || set $xxx/libc.$so
5610 : The messy sed command sorts on library version numbers.
5612 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5613 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5615 s/[0-9][0-9]*/0000&/g
5616 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5619 sort | $sed -e 's/^.* //'`
5622 $test -r $1 || set /usr/ccs/lib/libc.$so
5623 $test -r $1 || set /lib/libsys_s$_a
5629 if $test -r "$1"; then
5630 echo "Your (shared) C library seems to be in $1."
5632 elif $test -r /lib/libc && $test -r /lib/clib; then
5633 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5635 libc='/lib/clib /lib/libc'
5636 if $test -r /lib/syslib; then
5637 echo "(Your math library is in /lib/syslib.)"
5638 libc="$libc /lib/syslib"
5640 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5641 echo "Your C library seems to be in $libc, as you said before."
5642 elif $test -r $incpath/usr/lib/libc$_a; then
5643 libc=$incpath/usr/lib/libc$_a;
5644 echo "Your C library seems to be in $libc. That's fine."
5645 elif $test -r /lib/libc$_a; then
5647 echo "Your C library seems to be in $libc. You're normal."
5649 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5651 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5652 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5653 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5655 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5657 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5660 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5662 if $test -r "$tans"; then
5663 echo "Your C library seems to be in $tans, of all places."
5669 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5673 If the guess above is wrong (which it might be if you're using a strange
5674 compiler, or your machine supports multiple models), you can override it here.
5679 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5681 I can't seem to find your C library. I've looked in the following places:
5684 $sed 's/^/ /' libpath
5687 None of these seems to contain your C library. I need to get its name...
5692 rp='Where is your C library?'
5697 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5698 set X `cat libnames`
5701 case $# in 1) xxx=file; esac
5702 echo "Extracting names from the following $xxx for later perusal:" >&4
5704 $sed 's/^/ /' libnames >&4
5706 $echo $n "This may take a while...$c" >&4
5710 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5711 *) $nm $nm_opt $file 2>/dev/null;;
5716 $grep fprintf libc.tmp > libc.ptf
5717 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5718 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5720 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5722 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5724 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5728 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5732 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5738 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5740 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5742 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5744 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5745 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5747 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5749 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5751 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5753 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5755 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5757 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5759 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5761 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5763 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5765 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5767 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5769 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5771 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5773 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5775 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5778 $nm -p $* 2>/dev/null >libc.tmp
5779 $grep fprintf libc.tmp > libc.ptf
5780 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5781 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5787 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5789 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5790 for thisname in $libnames $libc; do
5791 $ar t $thisname >>libc.tmp
5793 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5795 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5796 # Repeat libc to extract forwarders to DLL entries too
5797 for thisname in $libnames $libc; do
5798 $ar tv $thisname >>libc.tmp
5799 # Revision 50 of EMX has bug in $ar.
5800 # it will not extract forwarders to DLL entries
5801 # Use emximp which will extract exactly them.
5802 emximp -o tmp.imp $thisname \
5804 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5805 < tmp.imp >>libc.tmp
5808 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5811 echo "$ar didn't seem to work right." >&4
5812 echo "Maybe this is a Cray...trying bld instead..." >&4
5813 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5815 for thisname in $libnames; do
5817 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5818 $ar t $thisname >>libc.tmp
5822 echo "That didn't work either. Giving up." >&4
5829 if $test -f /lib/syscalls.exp; then
5831 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5832 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5836 $rm -f libnames libpath
5838 : see if dld is available
5842 : is a C symbol defined?
5845 -v) tf=libc.tmp; tc=""; tdc="";;
5846 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5847 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5850 case "$reuseval-$4" in
5852 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5858 if $contains $tlook $tf >/dev/null 2>&1;
5863 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5864 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5872 $define) tval=true;;
5878 : define an is-in-libc? function
5879 inlibc='echo " "; td=$define; tu=$undef;
5880 sym=$1; var=$2; eval "was=\$$2";
5882 case "$reuseval$was" in
5892 echo "$sym() found." >&4;
5893 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5895 echo "$sym() NOT found." >&4;
5896 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5900 $define) echo "$sym() found." >&4;;
5901 *) echo "$sym() NOT found." >&4;;
5905 : see if dlopen exists
5912 : determine which dynamic loading, if any, to compile in
5914 dldir="ext/DynaLoader"
5927 $define) dflt='y' ;;
5930 $define) dflt='y' ;;
5932 : Does a dl_xxx.xs file exist for this operating system
5933 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5936 rp="Do you wish to use dynamic loading?"
5943 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5944 dflt="$dldir/dl_${osname}.xs"
5945 elif $test "$d_dlopen" = "$define" ; then
5946 dflt="$dldir/dl_dlopen.xs"
5947 elif $test "$i_dld" = "$define" ; then
5948 dflt="$dldir/dl_dld.xs"
5953 *) dflt="$dldir/$dlsrc"
5956 echo "The following dynamic loading files are available:"
5957 : Can not go over to $dldir because getfile has path hard-coded in.
5958 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5959 rp="Source file to use for dynamic loading"
5965 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5969 Some systems may require passing special flags to $cc -c to
5970 compile modules that will be used to create a shared library.
5971 To use no flags, say "none".
5974 case "$cccdlflags" in
5975 '') case "$gccversion" in
5976 '') case "$osname" in
5978 next) dflt='none' ;;
5979 irix*) dflt='-KPIC' ;;
5980 svr4*|esix*|solaris) dflt='-KPIC' ;;
5981 sunos) dflt='-pic' ;;
5985 *) case "$osname" in
5986 svr4*|esix*|solaris) dflt='-fPIC' ;;
5991 *) dflt="$cccdlflags" ;;
5993 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5996 none) cccdlflags=' ' ;;
5997 *) cccdlflags="$ans" ;;
6002 Some systems use ld to create libraries that can be dynamically loaded,
6003 while other systems (such as those using ELF) use $cc.
6007 '') $cat >try.c <<'EOM'
6008 /* Test for whether ELF binaries are produced */
6013 int i = open("a.out",O_RDONLY);
6016 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6017 exit(0); /* succeed (yes, it's ELF) */
6022 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6024 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6028 echo "I'll use ld to build dynamic libraries."
6037 rp="What command should be used to create dynamic libraries?"
6043 Some systems may require passing special flags to $ld to create a
6044 library that can be dynamically loaded. If your ld flags include
6045 -L/other/path options to locate libraries outside your loader's normal
6046 search path, you may need to specify those -L options here as well. To
6047 use no flags, say "none".
6050 case "$lddlflags" in
6051 '') case "$osname" in
6052 beos) dflt='-nostart' ;;
6054 linux|irix*) dflt='-shared' ;;
6055 next) dflt='none' ;;
6056 solaris) dflt='-G' ;;
6057 sunos) dflt='-assert nodefinitions' ;;
6058 svr4*|esix*) dflt="-G $ldflags" ;;
6062 *) dflt="$lddlflags" ;;
6065 : Try to guess additional flags to pick up local libraries.
6066 : Be careful not to append to a plain 'none'
6070 for thisflag in $ldflags; do
6075 *) dflt="$dflt $thisflag" ;;
6082 ''|' ') dflt='none' ;;
6085 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6088 none) lddlflags=' ' ;;
6089 *) lddlflags="$ans" ;;
6094 Some systems may require passing special flags to $cc to indicate that
6095 the resulting executable will use dynamic linking. To use no flags,
6099 case "$ccdlflags" in
6100 '') case "$osname" in
6101 hpux) dflt='-Wl,-E' ;;
6102 linux) dflt='-rdynamic' ;;
6103 next) dflt='none' ;;
6104 sunos) dflt='none' ;;
6108 *) dflt="$ccdlflags" ;;
6110 rp="Any special flags to pass to $cc to use dynamic loading?"
6113 none) ccdlflags=' ' ;;
6114 *) ccdlflags="$ans" ;;
6128 # No dynamic loading being used, so don't bother even to prompt.
6131 *) case "$useshrplib" in
6132 '') case "$osname" in
6133 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6135 also='Building a shared libperl is required for dynamic loading to work on your system.'
6140 also='Building a shared libperl is needed for MAB support.'
6158 The perl executable is normally obtained by linking perlmain.c with
6159 libperl${_a}, any static extensions (usually just DynaLoader), and
6160 any other libraries needed on this system (such as -lm, etc.). Since
6161 your system supports dynamic loading, it is probably possible to build
6162 a shared libperl.$so. If you will have more than one executable linked
6163 to libperl.$so, this will significantly reduce the size of each
6164 executable, but it may have a noticeable affect on performance. The
6165 default is probably sensible for your system.
6169 rp="Build a shared libperl.$so (y/n)"
6173 useshrplib='true' ;;
6174 *) useshrplib='false' ;;
6179 case "$useshrplib" in
6183 # Figure out a good name for libperl.so. Since it gets stored in
6184 # a version-specific architecture-dependent library, the version
6185 # number isn't really that important, except for making cc/ld happy.
6187 # A name such as libperl.so.3.1
6188 majmin="libperl.$so.$patchlevel.$subversion"
6189 # A name such as libperl.so.301
6190 majonly=`echo $patchlevel $subversion |
6191 $awk '{printf "%d%02d", $1, $2}'`
6192 majonly=libperl.$so.$majonly
6193 # I'd prefer to keep the os-specific stuff here to a minimum, and
6194 # rely on figuring it out from the naming of libc.
6195 case "${osname}${osvers}" in
6198 # XXX How handle the --version stuff for MAB?
6200 linux*) # ld won't link with a bare -lperl otherwise.
6203 cygwin*) # include version
6204 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6206 *) # Try to guess based on whether libc has major.minor.
6208 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6209 *libc.$so.[0-9]*) dflt=$majonly ;;
6210 *) dflt=libperl.$so ;;
6220 I need to select a good name for the shared libperl. If your system uses
6221 library names with major and minor numbers, then you might want something
6222 like $majmin. Alternatively, if your system uses a single version
6223 number for shared libraries, then you might want to use $majonly.
6224 Or, your system might be quite happy with a simple libperl.$so.
6226 Since the shared libperl will get installed into a version-specific
6227 architecture-dependent directory, the version number of the shared perl
6228 library probably isn't important, so the default should be o.k.
6231 rp='What name do you want to give to the shared libperl?'
6234 echo "Ok, I'll use $libperl"
6237 libperl="libperl${_a}"
6241 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6245 WARNING: Use of the shrpdir variable for the installation location of
6246 the shared $libperl is not supported. It was never documented and
6247 will not work in this version. Let me (perlbug@perl.com)
6248 know of any problems this may cause.
6254 But your current setting of $shrpdir is
6255 the default anyway, so it's harmless.
6260 Further, your current attempted setting of $shrpdir
6261 conflicts with the value of $archlibexp/CORE
6262 that installperl will use.
6269 # How will the perl executable find the installed shared $libperl?
6270 # Add $xxx to ccdlflags.
6271 # If we can't figure out a command-line option, use $shrpenv to
6272 # set env LD_RUN_PATH. The main perl makefile uses this.
6273 shrpdir=$archlibexp/CORE
6276 if "$useshrplib"; then
6279 # We'll set it in Makefile.SH...
6285 xxx="-Wl,-R$shrpdir"
6287 linux|irix*|dec_osf)
6288 xxx="-Wl,-rpath,$shrpdir"
6291 # next doesn't like the default...
6294 # beos doesn't like the default, either.
6297 # hpux doesn't like the default, either.
6298 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6301 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6307 # Only add $xxx if it isn't already in ccdlflags.
6308 case " $ccdlflags " in
6310 *) ccdlflags="$ccdlflags $xxx"
6313 Adding $xxx to the flags
6314 passed to $ld so that the perl executable will find the
6315 installed shared $libperl.
6323 # Fix ccdlflags in AIX for building external extensions.
6324 # (For building Perl itself bare -bE:perl.exp is needed,
6325 # Makefile.SH takes care of this.)
6327 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6329 # Respect a hint or command-line value.
6331 '') shrpenv="$tmp_shrpenv" ;;
6333 case "$ldlibpthname" in
6334 '') ldlibpthname=LD_LIBRARY_PATH ;;
6335 none) ldlibpthname='' ;;
6338 : determine where manual pages go
6339 set man1dir man1dir none
6343 $spackage has manual pages available in source form.
6347 echo "However, you don't have nroff, so they're probably useless to you."
6349 '') man1dir="none";;
6352 echo "If you don't want the manual sources installed, answer 'none'."
6357 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6358 lookpath="$lookpath $prefixexp/man/p_man/man1"
6359 lookpath="$lookpath $prefixexp/man/u_man/man1"
6360 lookpath="$lookpath $prefixexp/man/man.1"
6362 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6363 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6373 rp="Where do the main $spackage manual pages (source) go?"
6375 if $test "X$man1direxp" != "X$ansexp"; then
6379 man1direxp="$ansexp"
6385 : Change installation prefix, if necessary.
6386 if $test X"$prefix" != X"$installprefix"; then
6387 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6389 installman1dir="$man1direxp"
6392 : What suffix to use on installed man pages
6399 rp="What suffix should be used for the main $spackage man pages?"
6401 '') case "$man1dir" in
6415 *) dflt="$man1ext";;
6422 : see if we can have long filenames
6424 rmlist="$rmlist /tmp/cf$$"
6425 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6426 first=123456789abcdef
6427 second=/tmp/cf$$/$first
6428 $rm -f $first $second
6429 if (echo hi >$first) 2>/dev/null; then
6430 if $test -f 123456789abcde; then
6431 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6434 if (echo hi >$second) 2>/dev/null; then
6435 if $test -f /tmp/cf$$/123456789abcde; then
6437 That's peculiar... You can have filenames longer than 14 characters, but only
6438 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6439 I shall consider your system cannot support long filenames at all.
6443 echo 'You can have filenames longer than 14 characters.' >&4
6448 How confusing! Some of your filesystems are sane enough to allow filenames
6449 longer than 14 characters but some others like /tmp can't even think about them.
6450 So, for now on, I shall assume your kernel does not allow them at all.
6457 You can't have filenames longer than 14 chars. You can't even think about them!
6463 $rm -rf /tmp/cf$$ 123456789abcde*
6465 : determine where library module manual pages go
6466 set man3dir man3dir none
6470 $spackage has manual pages for many of the library modules.
6476 However, you don't have nroff, so they're probably useless to you.
6479 '') man3dir="none";;
6483 case "$d_flexfnam" in
6486 However, your system can't handle the long file names like File::Basename.3.
6489 '') man3dir="none";;
6493 echo "If you don't want the manual sources installed, answer 'none'."
6494 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6496 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6497 if $test -d "$privlib/man/man3"; then
6500 WARNING: Previous versions of perl installed man3 pages into
6501 $privlib/man/man3. This version will suggest a
6502 new default of $dflt.
6506 rp='Do you wish to preserve the old behavior?(y/n)'
6509 y*) dflt="$privlib/man/man3" ;;
6515 *) dflt="$man3dir" ;;
6519 rp="Where do the $package library man pages (source) go?"
6522 man3direxp="$ansexp"
6528 : Change installation prefix, if necessary.
6529 if $test X"$prefix" != X"$installprefix"; then
6530 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6532 installman3dir="$man3direxp"
6535 : What suffix to use on installed man pages
6541 rp="What suffix should be used for the $package library man pages?"
6543 '') case "$man3dir" in
6557 *) dflt="$man3ext";;
6564 : see if we have to deal with yellow pages, now NIS.
6565 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6566 if $test -f /usr/etc/nibindd; then
6568 echo "I'm fairly confident you're on a NeXT."
6570 rp='Do you get the hosts file via NetInfo?'
6579 y*) hostcat='nidump hosts .';;
6580 *) case "$hostcat" in
6581 nidump*) hostcat='';;
6591 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6599 rp='Are you getting the hosts file via yellow pages?'
6602 y*) hostcat='ypcat hosts';;
6603 *) hostcat='cat /etc/hosts';;
6609 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6612 '') test -f /etc/group && groupcat='cat /etc/group';;
6615 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6618 : now get the host name
6620 echo "Figuring out host name..." >&4
6621 case "$myhostname" in
6623 echo 'Maybe "hostname" will work...'
6624 if tans=`sh -c hostname 2>&1` ; then
6632 if $test "$cont"; then
6634 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6635 if tans=`cat /etc/systemid 2>&1` ; then
6637 phostname='cat /etc/systemid'
6638 echo "Whadyaknow. Xenix always was a bit strange..."
6641 elif $test -r /etc/systemid; then
6642 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6645 if $test "$cont"; then
6646 echo 'No, maybe "uuname -l" will work...'
6647 if tans=`sh -c 'uuname -l' 2>&1` ; then
6649 phostname='uuname -l'
6651 echo 'Strange. Maybe "uname -n" will work...'
6652 if tans=`sh -c 'uname -n' 2>&1` ; then
6654 phostname='uname -n'
6656 echo 'Oh well, maybe I can mine it out of whoami.h...'
6657 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6658 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6659 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6661 case "$myhostname" in
6662 '') echo "Does this machine have an identity crisis or something?"
6665 echo "Well, you said $myhostname before..."
6666 phostname='echo $myhostname';;
6672 : you do not want to know about this
6677 if $test "$myhostname" ; then
6679 rp='Your host name appears to be "'$myhostname'".'" Right?"
6687 : bad guess or no guess
6688 while $test "X$myhostname" = X ; do
6690 rp="Please type the (one word) name of your host:"
6695 : translate upper to lower if necessary
6696 case "$myhostname" in
6698 echo "(Normalizing case in your host name)"
6699 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6703 case "$myhostname" in
6705 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6706 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6707 echo "(Trimming domain name from host name--host name is now $myhostname)"
6709 *) case "$mydomain" in
6712 test "X$hostcat" = "Xypcat hosts" &&
6713 ypmatch "$myhostname" hosts 2>/dev/null |\
6714 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6717 test "X$hostcat" != "X" &&
6718 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6719 /[ ]$myhostname[ . ]/p" > hosts
6722 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6723 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6724 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6725 hosts | $sort | $uniq | \
6726 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6727 case `$echo X$dflt` in
6728 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6731 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6736 tans=`./loc resolv.conf X /etc /usr/etc`
6737 if $test -f "$tans"; then
6738 echo "(Attempting domain name extraction from $tans)"
6739 dflt=.`$sed -n -e 's/ / /g' \
6740 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6741 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6743 .) dflt=.`$sed -n -e 's/ / /g' \
6744 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6745 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6752 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6753 dflt=.`sh -c domainname 2>/dev/null`
6756 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6761 .) echo "(Lost all hope -- silly guess then)"
6767 *) dflt="$mydomain";;
6771 rp="What is your domain name?"
6781 : translate upper to lower if necessary
6784 echo "(Normalizing case in your domain name)"
6785 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6789 : a little sanity check here
6790 case "$phostname" in
6793 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6794 $myhostname$mydomain|$myhostname) ;;
6796 case "$phostname" in
6798 echo "(That doesn't agree with your whoami.h file, by the way.)"
6801 echo "(That doesn't agree with your $phostname command, by the way.)"
6811 I need to get your e-mail address in Internet format if possible, i.e.
6812 something like user@host.domain. Please answer accurately since I have
6813 no easy means to double check it. The default value provided below
6814 is most probably close to the reality but may not be valid from outside
6815 your organization...
6819 while test "$cont"; do
6821 '') dflt="$cf_by@$myhostname$mydomain";;
6822 *) dflt="$cf_email";;
6824 rp='What is your e-mail address?'
6830 rp='Address does not look like an Internet one. Use it anyway?'
6846 If you or somebody else will be maintaining perl at your site, please
6847 fill in the correct e-mail address here so that they may be contacted
6848 if necessary. Currently, the "perlbug" program included with perl
6849 will send mail to this address in addition to perlbug@perl.com. You may
6850 enter "none" for no administrator.
6853 case "$perladmin" in
6854 '') dflt="$cf_email";;
6855 *) dflt="$perladmin";;
6857 rp='Perl administrator e-mail address'
6861 : figure out how to guarantee perl startup
6862 case "$startperl" in
6864 case "$sharpbang" in
6868 I can use the #! construct to start perl on your system. This will
6869 make startup of perl scripts faster, but may cause problems if you
6870 want to share those scripts and perl is not in a standard place
6871 ($binexp/perl) on all your platforms. The alternative is to force
6872 a shell by starting the script with a single ':' character.
6876 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6879 none) startperl=": # use perl";;
6880 *) startperl="#!$ans"
6881 if $test 30 -lt `echo "$ans" | wc -c`; then
6884 WARNING: Some systems limit the #! command to 32 characters.
6885 If you experience difficulty running Perl scripts with #!, try
6886 installing Perl in a directory with a shorter pathname.
6892 *) startperl=": # use perl"
6897 echo "I'll use $startperl to start perl scripts."
6899 : figure best path for perl in scripts
6902 perlpath="$binexp/perl"
6903 case "$startperl" in
6908 I will use the "eval 'exec'" idiom to start Perl on your system.
6909 I can use the full path of your Perl binary for this purpose, but
6910 doing so may cause problems if you want to share those scripts and
6911 Perl is not always in a standard place ($binexp/perl).
6915 rp="What path shall I use in \"eval 'exec'\"?"
6922 case "$startperl" in
6924 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6927 : determine where public executable scripts go
6928 set scriptdir scriptdir
6930 case "$scriptdir" in
6933 : guess some guesses
6934 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6935 $test -d /usr/share/bin && dflt=/usr/share/bin
6936 $test -d /usr/local/script && dflt=/usr/local/script
6937 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6938 $test -d $prefixexp/script && dflt=$prefixexp/script
6942 *) dflt="$scriptdir"
6947 Some installations have a separate directory just for executable scripts so
6948 that they can mount it across multiple architectures but keep the scripts in
6949 one spot. You might, for example, have a subdirectory of /usr/share for this.
6950 Or you might just lump your scripts in with all your other executables.
6954 rp='Where do you keep publicly executable scripts?'
6956 if $test "X$ansexp" != "X$scriptdirexp"; then
6960 scriptdirexp="$ansexp"
6961 : Change installation prefix, if necessary.
6962 if $test X"$prefix" != X"$installprefix"; then
6963 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6965 installscript="$scriptdirexp"
6968 : determine where site specific architecture-dependent libraries go.
6969 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6970 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6971 : sitelib may have an optional trailing /share.
6972 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6973 tdflt="$tdflt/$archname"
6974 set sitearch sitearch none
6977 '') dflt="$tdflt" ;;
6978 *) dflt="$sitearch" ;;
6982 The installation process will also create a directory for
6983 architecture-dependent site-specific extensions and modules.
6987 rp='Pathname for the site-specific architecture-dependent library files?'
6990 sitearchexp="$ansexp"
6991 : Change installation prefix, if necessary.
6992 if $test X"$prefix" != X"$installprefix"; then
6993 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6995 installsitearch="$sitearchexp"
6998 : determine where add-on public executables go
7000 '') dflt=$siteprefix/bin ;;
7004 rp='Pathname where the add-on public executables should be installed?'
7007 sitebinexp="$ansexp"
7008 : Change installation prefix, if necessary.
7009 if $test X"$prefix" != X"$installprefix"; then
7010 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7012 installsitebin="$sitebinexp"
7017 Perl can be built to take advantage of long doubles which
7018 (if available) may give more accuracy and range for floating point numbers.
7020 If this doesn't make any sense to you, just accept the default 'n'.
7024 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7027 case "$uselongdouble" in
7028 $define|true|[yY]*) dflt='y';;
7031 rp='Try to use long doubles if available?'
7034 y|Y) val="$define" ;;
7040 case "$uselongdouble" in
7041 true|[yY]*) uselongdouble="$define" ;;
7044 case "$uselongdouble" in
7046 : Look for a hint-file generated 'call-back-unit'. If the
7047 : user has specified that long doubles should be used,
7048 : we may need to set or change some other defaults.
7049 if $test -f uselongdouble.cbu; then
7050 echo "Your platform has some specific hints for long doubles, using them..."
7051 . ./uselongdouble.cbu
7054 (Your platform doesn't have any specific hints for long doubles.)
7062 Perl can be built to take advantage of long longs which
7063 (if available) may give more range for integer numbers.
7065 If this doesn't make any sense to you, just accept the default 'n'.
7069 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7072 case "$uselonglong" in
7073 $define|true|[yY]*) dflt='y';;
7076 rp='Try to use long longs if available?'
7079 y|Y) val="$define" ;;
7085 case "$uselonglong" in
7086 true|[yY]*) uselonglong="$define" ;;
7089 case "$uselonglong" in
7091 : Look for a hint-file generated 'call-back-unit'. If the
7092 : user has specified that long longs should be used,
7093 : we may need to set or change some other defaults.
7094 if $test -f uselonglong.cbu; then
7095 echo "Your platform has some specific hints for long longs, using them..."
7099 (Your platform doesn't have any specific hints for long longs.)
7107 Previous version of $package used the standard IO mechanisms as defined
7108 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7109 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7110 the default. This abstraction layer can use AT&T's sfio (if you already
7111 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7112 problems with some extension modules. Using PerlIO with stdio is safe,
7113 but it is slower than plain stdio and therefore is not the default.
7115 If this doesn't make any sense to you, just accept the default 'n'.
7117 case "$useperlio" in
7118 $define|true|[yY]*) dflt='y';;
7121 rp='Use the experimental PerlIO abstraction layer?'
7128 echo "Ok, doing things the stdio way"
7135 case "$vendorprefix" in
7136 '') d_vendorbin="$undef"
7140 *) d_vendorbin="$define"
7141 : determine where vendor-supplied executables go.
7142 dflt=$vendorprefix/bin
7144 rp='Pathname for the vendor-supplied executables directory?'
7147 vendorbinexp="$ansexp"
7148 : Change installation prefix, if necessary.
7149 if $test X"$prefix" != X"$installprefix"; then
7150 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7152 installvendorbin="$vendorbinexp"
7157 : check for length of double
7159 case "$doublesize" in
7161 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7162 $cat >try.c <<'EOCP'
7166 printf("%d\n", (int)sizeof(double));
7171 if eval $compile_ok; then
7173 $echo " $doublesize bytes." >&4
7176 echo "(I can't seem to compile the test program. Guessing...)"
7177 rp="What is the size of a double precision number (in bytes)?"
7185 : check for long doubles
7187 $echo $n "Checking to see if your system supports long double..." $c >&4
7188 echo 'int main() { long double x = 7.0; }' > try.c
7190 if eval $compile; then
7192 echo " Yes, it does." >&4
7195 echo " No, it doesn't." >&4
7201 : check for length of long double
7202 case "${d_longdbl}${longdblsize}" in
7205 $echo $n "Checking to see how big your long doubles are..." $c >&4
7206 $cat >try.c <<'EOCP'
7210 printf("%d\n", sizeof(long double));
7215 if eval $compile; then
7216 longdblsize=`./try$exe_ext`
7217 $echo " $longdblsize bytes." >&4
7221 echo "(I can't seem to compile the test program. Guessing...)" >&4
7222 rp="What is the size of a long double (in bytes)?"
7226 if $test "X$doublesize" = "X$longdblsize"; then
7227 echo "(That isn't any different from an ordinary double.)"
7233 : Check how to convert floats to strings.
7234 if test "X$d_Gconvert" = X; then
7236 echo "Checking for an efficient way to convert floats to strings."
7239 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7240 char *myname = "gconvert";
7243 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7244 char *myname = "gcvt";
7247 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7248 char *myname = "qgcvt";
7249 #define DOUBLETYPE long double
7252 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7253 char *myname = "sprintf";
7257 #define DOUBLETYPE double
7267 checkit(expect, got)
7271 if (strcmp(expect, got)) {
7272 printf("%s oddity: Expected %s, got %s\n",
7273 myname, expect, got);
7283 /* This must be 1st test on (which?) platform */
7284 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7285 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7286 checkit("0.1", buf);
7288 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7291 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7294 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7297 /* Some Linux gcvt's give 1.e+5 here. */
7298 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7299 checkit("100000", buf);
7301 /* Some Linux gcvt's give -1.e+5 here. */
7302 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7303 checkit("-100000", buf);
7308 case "$d_Gconvert" in
7309 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7310 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7311 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7312 *) xxx_list='gconvert gcvt sprintf' ;;
7315 case "$d_longdbl$uselongdouble" in
7316 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7319 for xxx_convert in $xxx_list; do
7320 echo "Trying $xxx_convert..."
7322 set try -DTRY_$xxx_convert
7323 if eval $compile; then
7324 echo "$xxx_convert() found." >&4
7326 echo "I'll use $xxx_convert to convert floats into a string." >&4
7329 echo "...But $xxx_convert didn't work as I expected."
7332 echo "$xxx_convert NOT found." >&4
7336 case "$xxx_convert" in
7337 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7338 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7339 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7340 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7346 if $test X"$d_longdbl" = X"$define"; then
7348 echo "Checking how to print long doubles..." >&4
7350 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7351 $cat >try.c <<'EOCP'
7352 #include <sys/types.h>
7356 printf("%.3f\n", d);
7360 if eval $compile; then
7364 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7365 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7366 echo "We will use %f."
7372 if $test X"$sPRIfldbl" = X; then
7373 $cat >try.c <<'EOCP'
7374 #include <sys/types.h>
7377 long double d = 123.456;
7378 printf("%.3llf\n", d);
7382 if eval $compile; then
7386 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7387 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7388 echo "We will use %llf."
7394 if $test X"$sPRIfldbl" = X; then
7395 $cat >try.c <<'EOCP'
7396 #include <sys/types.h>
7399 long double d = 123.456;
7400 printf("%.3Lf\n", d);
7404 if eval $compile; then
7408 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7409 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7410 echo "We will use %Lf."
7416 if $test X"$sPRIfldbl" = X; then
7417 $cat >try.c <<'EOCP'
7418 #include <sys/types.h>
7421 long double d = 123.456;
7422 printf("%.3lf\n", d);
7426 if eval $compile; then
7430 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7431 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7432 echo "We will use %lf."
7438 if $test X"$sPRIfldbl" = X; then
7439 echo "Cannot figure out how to print long doubles." >&4
7446 case "$sPRIfldbl" in
7447 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7448 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7450 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7451 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7455 : Initialize h_fcntl
7458 : Initialize h_sysfile
7461 : access call always available on UNIX
7465 : locate the flags for 'access()'
7469 $cat >access.c <<'EOCP'
7470 #include <sys/types.h>
7475 #include <sys/file.h>
7484 : check sys/file.h first, no particular reason here
7485 if $test `./findhdr sys/file.h` && \
7486 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7488 echo "<sys/file.h> defines the *_OK access constants." >&4
7489 elif $test `./findhdr fcntl.h` && \
7490 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7492 echo "<fcntl.h> defines the *_OK access constants." >&4
7493 elif $test `./findhdr unistd.h` && \
7494 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7495 echo "<unistd.h> defines the *_OK access constants." >&4
7497 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7503 : see if accessx exists
7504 set accessx d_accessx
7507 : see if alarm exists
7511 : see if atolf exists
7515 : see if atoll exists
7519 : Look for GNU-cc style attribute checking
7521 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7522 $cat >attrib.c <<'EOCP'
7524 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7526 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7527 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7528 echo "Your C compiler doesn't fully support __attribute__."
7531 echo "Your C compiler supports __attribute__."
7535 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7542 : see if bcmp exists
7546 : see if bcopy exists
7550 : see if this is a unistd.h system
7551 set unistd.h i_unistd
7554 : see if getpgrp exists
7555 set getpgrp d_getpgrp
7558 case "$d_getpgrp" in
7561 echo "Checking to see which flavor of getpgrp is in use..."
7564 #include <sys/types.h>
7566 # include <unistd.h>
7570 if (getuid() == 0) {
7571 printf("(I see you are running Configure as super-user...)\n");
7575 if (getpgrp(1) == 0)
7584 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7585 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7587 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7588 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7591 echo "I can't seem to compile and run the test program."
7593 xxx="a USG one, i.e. you use getpgrp()."
7595 # SVR4 systems can appear rather BSD-ish.
7598 xxx="a BSD one, i.e. you use getpgrp(pid)."
7602 xxx="probably a USG one, i.e. you use getpgrp()."
7607 echo "Assuming your getpgrp is $xxx" >&4
7616 : see if setpgrp exists
7617 set setpgrp d_setpgrp
7620 case "$d_setpgrp" in
7623 echo "Checking to see which flavor of setpgrp is in use..."
7626 #include <sys/types.h>
7628 # include <unistd.h>
7632 if (getuid() == 0) {
7633 printf("(I see you are running Configure as super-user...)\n");
7637 if (-1 == setpgrp(1, 1))
7640 if (setpgrp() != -1)
7646 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7647 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7649 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7650 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7653 echo "(I can't seem to compile and run the test program.)"
7655 xxx="a USG one, i.e. you use setpgrp()."
7657 # SVR4 systems can appear rather BSD-ish.
7660 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7664 xxx="probably a USG one, i.e. you use setpgrp()."
7669 echo "Assuming your setpgrp is $xxx" >&4
7677 : see if bzero exists
7681 : see if signal is declared as pointer to function returning int or void
7683 xxx=`./findhdr signal.h`
7684 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7685 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7686 echo "You have int (*signal())() instead of void." >&4
7688 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7689 echo "You have void (*signal())()." >&4
7691 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7692 echo "You have int (*signal())() instead of void." >&4
7694 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7695 echo "You have void (*signal())()." >&4
7698 case "$d_voidsig" in
7700 echo "I can't determine whether signal handler returns void or int..." >&4
7702 rp="What type does your signal handler return?"
7709 echo "As you already told me, signal handler returns void." >&4
7712 *) echo "As you already told me, signal handler returns int." >&4
7719 case "$d_voidsig" in
7720 "$define") signal_t="void";;
7725 : check for ability to cast large floats to 32-bit ints.
7727 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7728 if $test "$intsize" -ge 4; then
7735 #include <sys/types.h>
7737 $signal_t blech(s) int s; { exit(3); }
7744 signal(SIGFPE, blech);
7746 /* Don't let compiler optimize the test away. Store the number
7747 in a writable string for gcc to pass to sscanf under HP/UX.
7749 sprintf(str, "2147483647");
7750 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7754 /* x86 processors will probably give 0x8000 0000, which is a
7755 sign change. We don't want that. We want to mimic SPARC
7756 behavior here, which is to preserve the sign and give
7759 if (i32 != ($xxx) f)
7765 if eval $compile_ok; then
7769 echo "(I can't seem to compile the test program--assuming it can't)"
7777 echo "Nope, it can't."
7784 : check for ability to cast negative floats to unsigned
7786 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7789 #include <sys/types.h>
7791 $signal_t blech(s) int s; { exit(7); }
7792 $signal_t blech_in_list(s) int s; { exit(4); }
7793 unsigned long dummy_long(p) unsigned long p; { return p; }
7794 unsigned int dummy_int(p) unsigned int p; { return p; }
7795 unsigned short dummy_short(p) unsigned short p; { return p; }
7799 unsigned long along;
7801 unsigned short ashort;
7805 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7806 a direct f = -123. assignment. gcc-2.8.0 reportedly
7807 optimized the whole file away
7809 /* Store the number in a writable string for gcc to pass to
7812 sprintf(str, "-123");
7813 sscanf(str, "%lf", &f); /* f = -123.; */
7815 signal(SIGFPE, blech);
7816 along = (unsigned long)f;
7817 aint = (unsigned int)f;
7818 ashort = (unsigned short)f;
7819 if (along != (unsigned long)-123)
7821 if (aint != (unsigned int)-123)
7823 if (ashort != (unsigned short)-123)
7825 sprintf(str, "1073741824.");
7826 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7829 along = (unsigned long)f;
7830 if (along != 0x80000000)
7834 along = (unsigned long)f;
7835 if (along != 0x7fffffff)
7839 along = (unsigned long)f;
7840 if (along != 0x80000001)
7844 signal(SIGFPE, blech_in_list);
7845 sprintf(str, "123.");
7846 sscanf(str, "%lf", &f); /* f = 123.; */
7847 along = dummy_long((unsigned long)f);
7848 aint = dummy_int((unsigned int)f);
7849 ashort = dummy_short((unsigned short)f);
7850 if (along != (unsigned long)123)
7852 if (aint != (unsigned int)123)
7854 if (ashort != (unsigned short)123)
7861 if eval $compile_ok; then
7865 echo "(I can't seem to compile the test program--assuming it can't)"
7868 case "$castflags" in
7873 echo "Nope, it can't."
7880 : see if vprintf exists
7882 if set vprintf val -f d_vprintf; eval $csym; $val; then
7883 echo 'vprintf() found.' >&4
7885 $cat >vprintf.c <<'EOF'
7886 #include <varargs.h>
7888 int main() { xxx("foo"); }
7897 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7901 if eval $compile && ./vprintf; then
7902 echo "Your vsprintf() returns (int)." >&4
7905 echo "Your vsprintf() returns (char*)." >&4
7909 echo 'vprintf() NOT found.' >&4
7919 : see if chown exists
7923 : see if chroot exists
7927 : see if chsize exists
7931 : check for const keyword
7933 echo 'Checking to see if your C compiler knows about "const"...' >&4
7934 $cat >const.c <<'EOCP'
7935 typedef struct spug { int drokk; } spug;
7942 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7944 echo "Yup, it does."
7947 echo "Nope, it doesn't."
7952 : see if crypt exists
7954 if set crypt val -f d_crypt; eval $csym; $val; then
7955 echo 'crypt() found.' >&4
7959 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7960 if $test -z "$cryptlib"; then
7961 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7965 if $test -z "$cryptlib"; then
7966 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7970 if $test -z "$cryptlib"; then
7971 cryptlib=`./loc libcrypt$_a "" $libpth`
7975 if $test -z "$cryptlib"; then
7976 echo 'crypt() NOT found.' >&4
7985 : get csh whereabouts
7987 'csh') val="$undef" ;;
7992 : Respect a hint or command line value for full_csh.
7994 '') full_csh=$csh ;;
7997 : see if cuserid exists
7998 set cuserid d_cuserid
8001 : see if this is a limits.h system
8002 set limits.h i_limits
8005 : see if this is a float.h system
8009 : See if number of significant digits in a double precision number is known
8011 $cat >dbl_dig.c <<EOM
8021 printf("Contains DBL_DIG");
8024 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8025 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8026 echo "DBL_DIG found." >&4
8029 echo "DBL_DIG NOT found." >&4
8036 : see if difftime exists
8037 set difftime d_difftime
8040 : see if this is a dirent system
8042 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8044 echo "<dirent.h> found." >&4
8047 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8048 echo "<sys/dir.h> found." >&4
8051 xinc=`./findhdr sys/ndir.h`
8053 echo "<dirent.h> NOT found." >&4
8058 : Look for type of directory structure.
8060 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8062 case "$direntrytype" in
8065 $define) guess1='struct dirent' ;;
8066 *) guess1='struct direct' ;;
8069 *) guess1="$direntrytype"
8074 'struct dirent') guess2='struct direct' ;;
8075 *) guess2='struct dirent' ;;
8078 if $contains "$guess1" try.c >/dev/null 2>&1; then
8079 direntrytype="$guess1"
8080 echo "Your directory entries are $direntrytype." >&4
8081 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8082 direntrytype="$guess2"
8083 echo "Your directory entries seem to be $direntrytype." >&4
8085 echo "I don't recognize your system's directory entries." >&4
8086 rp="What type is used for directory entries on this system?"
8094 : see if the directory entry stores field length
8096 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8097 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8098 echo "Good, your directory entry keeps length information in d_namlen." >&4
8101 echo "Your directory entry does not know about the d_namlen field." >&4
8108 : see if dlerror exists
8111 set dlerror d_dlerror
8115 : see if dlfcn is available
8123 On a few systems, the dynamically loaded modules that perl generates and uses
8124 will need a different extension than shared libs. The default will probably
8132 rp='What is the extension of dynamically loaded modules'
8141 : Check if dlsym need a leading underscore
8147 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8148 $cat >dyna.c <<'EOM'
8157 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8159 #include <sys/types.h>
8173 int mode = RTLD_LAZY ;
8175 handle = dlopen("./dyna.$dlext", mode) ;
8176 if (handle == NULL) {
8181 symbol = dlsym(handle, "fred") ;
8182 if (symbol == NULL) {
8183 /* try putting a leading underscore */
8184 symbol = dlsym(handle, "_fred") ;
8185 if (symbol == NULL) {
8198 : Call the object file tmp-dyna.o in case dlext=o.
8199 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8200 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8201 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8202 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8205 1) echo "Test program failed using dlopen." >&4
8206 echo "Perhaps you should not use dynamic loading." >&4;;
8207 2) echo "Test program failed using dlsym." >&4
8208 echo "Perhaps you should not use dynamic loading." >&4;;
8209 3) echo "dlsym needs a leading underscore" >&4
8211 4) echo "dlsym doesn't need a leading underscore." >&4;;
8214 echo "I can't compile and run the test program." >&4
8215 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8220 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8225 hasproto='varname=$1; func=$2; shift; shift;
8226 while $test $# -ge 2; do
8228 $define) echo "#include <$2>";;
8232 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8233 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8234 echo "$func() prototype found.";
8237 echo "$func() prototype NOT found.";
8242 $rm -f try.c tryout.c'
8244 : see if prototype for drand48 is available
8246 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8249 : see if dup2 exists
8253 : see if eaccess exists
8254 set eaccess d_eaccess
8257 : see if endgrent exists
8258 set endgrent d_endgrent
8261 : see if endhostent exists
8262 set endhostent d_endhent
8265 : see if endnetent exists
8266 set endnetent d_endnent
8269 : see if endprotoent exists
8270 set endprotoent d_endpent
8273 : see if endpwent exists
8274 set endpwent d_endpwent
8277 : see if endservent exists
8278 set endservent d_endsent
8281 : see if endspent exists
8282 set endspent d_endspent
8285 : Locate the flags for 'open()'
8287 $cat >open3.c <<'EOCP'
8288 #include <sys/types.h>
8293 #include <sys/file.h>
8304 : check sys/file.h first to get FREAD on Sun
8305 if $test `./findhdr sys/file.h` && \
8306 set open3 -DI_SYS_FILE && eval $compile; then
8308 echo "<sys/file.h> defines the O_* constants..." >&4
8310 echo "and you have the 3 argument form of open()." >&4
8313 echo "but not the 3 argument form of open(). Oh, well." >&4
8316 elif $test `./findhdr fcntl.h` && \
8317 set open3 -DI_FCNTL && eval $compile; then
8319 echo "<fcntl.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
8329 echo "I can't find the O_* constant definitions! You got problems." >&4
8335 : see which of string.h or strings.h is needed
8337 strings=`./findhdr string.h`
8338 if $test "$strings" && $test -r "$strings"; then
8339 echo "Using <string.h> instead of <strings.h>." >&4
8343 strings=`./findhdr strings.h`
8344 if $test "$strings" && $test -r "$strings"; then
8345 echo "Using <strings.h> instead of <string.h>." >&4
8347 echo "No string header found -- You'll surely have problems." >&4
8353 "$undef") strings=`./findhdr strings.h`;;
8354 *) strings=`./findhdr string.h`;;
8357 : check for non-blocking I/O stuff
8358 case "$h_sysfile" in
8359 true) echo "#include <sys/file.h>" > head.c;;
8362 true) echo "#include <fcntl.h>" > head.c;;
8363 *) echo "#include <sys/fcntl.h>" > head.c;;
8368 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8369 case "$o_nonblock" in
8372 $cat >>try.c <<'EOCP'
8376 printf("O_NONBLOCK\n");
8380 printf("O_NDELAY\n");
8384 printf("FNDELAY\n");
8391 if eval $compile_ok; then
8393 case "$o_nonblock" in
8394 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8395 *) echo "Seems like we can use $o_nonblock.";;
8398 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8401 *) echo "Using $hint value $o_nonblock.";;
8403 $rm -f try try.* .out core
8406 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8412 #include <sys/types.h>
8415 #define MY_O_NONBLOCK $o_nonblock
8416 #ifndef errno /* XXX need better Configure test */
8426 #include <strings.h>
8428 $signal_t blech(x) int x; { exit(3); }
8430 $cat >> try.c <<'EOCP'
8438 pipe(pd); /* Down: child -> parent */
8439 pipe(pu); /* Up: parent -> child */
8442 close(pd[1]); /* Parent reads from pd[0] */
8443 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8444 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8446 signal(SIGALRM, blech);
8448 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8450 sprintf(string, "%d\n", ret);
8451 write(2, string, strlen(string));
8454 if (errno == EAGAIN) {
8460 if (errno == EWOULDBLOCK)
8461 printf("EWOULDBLOCK\n");
8464 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8465 sleep(2); /* Give it time to close our pipe */
8467 ret = read(pd[0], buf, 1); /* Should read EOF */
8469 sprintf(string, "%d\n", ret);
8470 write(3, string, strlen(string));
8474 close(pd[0]); /* We write to pd[1] */
8475 close(pu[1]); /* We read from pu[0] */
8476 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8477 close(pd[1]); /* Pipe pd is now fully closed! */
8478 exit(0); /* Bye bye, thank you for playing! */
8482 if eval $compile_ok; then
8483 echo "$startsh" >mtry
8484 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8486 ./mtry >/dev/null 2>&1
8488 0) eagain=`$cat try.out`;;
8489 1) echo "Could not perform non-blocking setting!";;
8490 2) echo "I did a successful read() for something that was not there!";;
8491 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8492 *) echo "Something terribly wrong happened during testing.";;
8494 rd_nodata=`$cat try.ret`
8495 echo "A read() system call with no data present returns $rd_nodata."
8496 case "$rd_nodata" in
8499 echo "(That's peculiar, fixing that to be -1.)"
8505 echo "Forcing errno EAGAIN on read() with no data available."
8509 echo "Your read() sets errno to $eagain when no data is available."
8512 status=`$cat try.err`
8514 0) echo "And it correctly returns 0 to signal EOF.";;
8515 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8516 *) echo "However, your read() returns '$status' on EOF??";;
8519 if test "$status" = "$rd_nodata"; then
8520 echo "WARNING: you can't distinguish between EOF and no data!"
8524 echo "I can't compile the test program--assuming errno EAGAIN will do."
8531 echo "Using $hint value $eagain."
8532 echo "Your read() returns $rd_nodata when no data is present."
8533 case "$d_eofnblk" in
8534 "$define") echo "And you can see EOF because read() returns 0.";;
8535 "$undef") echo "But you can't see EOF status from read() returned value.";;
8537 echo "(Assuming you can't see EOF status from read anyway.)"
8543 $rm -f try try.* .out core head.c mtry
8545 : see if fchmod exists
8549 : see if fchown exists
8553 : see if this is an fcntl system
8557 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8558 while $test $# -ge 2; do
8560 $define) echo "#include <$2>";;
8564 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8566 if eval $compile; then
8577 : see whether socket exists
8579 $echo $n "Hmm... $c" >&4
8580 if set socket val -f d_socket; eval $csym; $val; then
8581 echo "Looks like you have Berkeley networking support." >&4
8583 if set setsockopt val -f; eval $csym; $val; then
8586 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8590 if $contains socklib libc.list >/dev/null 2>&1; then
8591 echo "Looks like you have Berkeley networking support." >&4
8593 : we will have to assume that it supports the 4.2 BSD interface
8596 echo "You don't have Berkeley networking in libc$_a..." >&4
8597 if test "X$d_socket" = "X$define"; then
8598 echo "...but you seem to believe that you have sockets." >&4
8600 for net in net socket
8602 if test -f /usr/lib/lib$net$_a; then
8603 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8604 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8605 if $contains socket libc.list >/dev/null 2>&1; then
8610 echo "...but the Wollongong group seems to have hacked it in." >&4
8611 sockethdr="-I/usr/netinclude"
8614 echo "Found Berkeley sockets interface in lib$net." >& 4
8615 if $contains setsockopt libc.list >/dev/null 2>&1; then
8618 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8625 if test "X$d_socket" != "X$define"; then
8626 echo "or anywhere else I see." >&4
8634 : see if socketpair exists
8635 set socketpair d_sockpair
8640 echo "Checking the availability of certain socket constants..." >& 4
8641 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8642 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8644 #include <sys/types.h>
8645 #include <sys/socket.h>
8651 set try; if eval $compile; then
8654 set d_${enum}; eval $setvar
8658 : see if sys/select.h has to be included
8659 set sys/select.h i_sysselct
8662 : see if we should include time.h, sys/time.h, or both
8664 if test "X$timeincl" = X; then
8665 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8666 $echo $n "I'm now running the test program...$c"
8667 $cat >try.c <<'EOCP'
8668 #include <sys/types.h>
8673 #ifdef SYSTIMEKERNEL
8676 #include <sys/time.h>
8679 #include <sys/select.h>
8688 struct timezone tzp;
8690 if (foo.tm_sec == foo.tm_sec)
8693 if (bar.tv_sec == bar.tv_sec)
8700 for s_timezone in '-DS_TIMEZONE' ''; do
8702 for s_timeval in '-DS_TIMEVAL' ''; do
8703 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8704 for i_time in '' '-DI_TIME'; do
8705 for i_systime in '-DI_SYSTIME' ''; do
8708 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8709 if eval $compile; then
8710 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8714 $echo $n "Succeeded with $flags$c"
8726 *SYSTIMEKERNEL*) i_systimek="$define"
8727 timeincl=`./findhdr sys/time.h`
8728 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8729 *) i_systimek="$undef";;
8732 *I_TIME*) i_time="$define"
8733 timeincl=`./findhdr time.h`" $timeincl"
8734 echo "We'll include <time.h>." >&4;;
8735 *) i_time="$undef";;
8738 *I_SYSTIME*) i_systime="$define"
8739 timeincl=`./findhdr sys/time.h`" $timeincl"
8740 echo "We'll include <sys/time.h>." >&4;;
8741 *) i_systime="$undef";;
8746 : check for fd_set items
8749 Checking to see how well your C compiler handles fd_set and friends ...
8751 $cat >fd_set.c <<EOCP
8752 #$i_systime I_SYS_TIME
8753 #$i_sysselct I_SYS_SELECT
8754 #$d_socket HAS_SOCKET
8755 #include <sys/types.h>
8757 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8760 #include <sys/time.h>
8763 #include <sys/select.h>
8772 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8779 set fd_set -DTRYBITS
8780 if eval $compile; then
8781 d_fds_bits="$define"
8783 echo "Well, your system knows about the normal fd_set typedef..." >&4
8785 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8786 d_fd_macros="$define"
8789 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8791 d_fd_macros="$undef"
8795 Hmm, your compiler has some difficulty with fd_set. Checking further...
8798 if eval $compile; then
8801 echo "Well, your system has some sort of fd_set available..." >&4
8803 echo "and you have the normal fd_set macros." >&4
8804 d_fd_macros="$define"
8807 but not the normal fd_set macros! Gross! More work for me...
8809 d_fd_macros="$undef"
8812 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8815 d_fd_macros="$undef"
8820 : see if fgetpos exists
8821 set fgetpos d_fgetpos
8824 : see if flock exists
8828 : see if fork exists
8832 : see if pathconf exists
8833 set pathconf d_pathconf
8836 : see if fpathconf exists
8837 set fpathconf d_fpathconf
8843 echo "Checking to see if your system supports off64_t..." >&4
8845 #include <sys/types.h>
8847 int main() { off64_t x = 7; }'
8850 if eval $compile; then
8852 echo "Yes, it does."
8855 echo "No, it doesn't."
8856 case "$lseeksize" in
8857 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8864 : check for fpos64_t
8866 echo "Checking to see if your system supports fpos64_t..." >&4
8868 #include <sys/stdio.h>
8869 int main() { fpos64_t x x = 7; }'
8872 if eval $compile; then
8874 echo "Yes, it does."
8877 echo "No, it doesn't."
8879 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8886 hasstruct='varname=$1; struct=$2; shift; shift;
8887 while $test $# -ge 2; do
8889 $define) echo "#include <$2>";;
8893 echo "int main () { struct $struct foo; }" >> try.c;
8895 if eval $compile; then
8904 : see if this is a sys/param system
8905 set sys/param.h i_sysparam
8908 : see if this is a sys/mount.h system
8909 set sys/mount.h i_sysmount
8912 : see if sys/types.h has to be included
8913 set sys/types.h i_systypes
8918 echo "Checking to see if your system supports struct fs_data..." >&4
8919 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8921 case "$d_fs_data_s" in
8922 "$define") echo "Yes, it does." ;;
8923 *) echo "No, it doesn't." ;;
8926 : see if fseeko exists
8930 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8933 : see if fsetpos exists
8934 set fsetpos d_fsetpos
8938 : see if fstatfs exists
8939 set fstatfs d_fstatfs
8943 : see if statvfs exists
8944 set statvfs d_statvfs
8947 : see if fstatvfs exists
8948 set fstatvfs d_fstatvfs
8952 : see if ftello exists
8956 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8959 : see if getgrent exists
8960 set getgrent d_getgrent
8963 : see if gethostbyaddr exists
8964 set gethostbyaddr d_gethbyaddr
8967 : see if gethostbyname exists
8968 set gethostbyname d_gethbyname
8971 : see if gethostent exists
8972 set gethostent d_gethent
8975 : see how we will look up host name
8978 if set gethostname val -f d_gethname; eval $csym; $val; then
8979 echo 'gethostname() found.' >&4
8980 d_gethname="$define"
8983 if set uname val -f d_uname; eval $csym; $val; then
8986 uname() was found, but you're running xenix, and older versions of xenix
8987 have a broken uname(). If you don't really know whether your xenix is old
8988 enough to have a broken system call, use the default answer.
8995 rp='Is your uname() broken?'
8998 n*) d_uname="$define"; call=uname;;
9001 echo 'uname() found.' >&4
9008 case "$d_gethname" in
9009 '') d_gethname="$undef";;
9012 '') d_uname="$undef";;
9014 case "$d_uname$d_gethname" in
9019 Every now and then someone has a $call() that lies about the hostname
9020 but can't be fixed for political or economic reasons. If you wish, I can
9021 pretend $call() isn't there and maybe compute hostname at run-time
9022 thanks to the '$phostname' command.
9025 rp="Shall I ignore $call() from now on?"
9028 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9031 case "$phostname" in
9033 *) case "$aphostname" in
9039 file=`./loc $file $file $pth`
9040 aphostname=`echo $file $*`
9045 case "$d_uname$d_gethname" in
9048 case "$phostname" in
9050 echo "There will be no way for $package to get your hostname." >&4;;
9052 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9056 case "$d_phostname" in
9057 '') d_phostname="$undef";;
9060 : see if this is a netdb.h system
9064 : see if prototypes for various gethostxxx netdb.h functions are available
9066 set d_gethostprotos gethostent $i_netdb netdb.h
9069 : see if getlogin exists
9070 set getlogin d_getlogin
9073 : see if getmnt exists
9077 : see if getmntent exists
9078 set getmntent d_getmntent
9081 : see if getnetbyaddr exists
9082 set getnetbyaddr d_getnbyaddr
9085 : see if getnetbyname exists
9086 set getnetbyname d_getnbyname
9089 : see if getnetent exists
9090 set getnetent d_getnent
9093 : see if prototypes for various getnetxxx netdb.h functions are available
9095 set d_getnetprotos getnetent $i_netdb netdb.h
9099 : see if getprotobyname exists
9100 set getprotobyname d_getpbyname
9103 : see if getprotobynumber exists
9104 set getprotobynumber d_getpbynumber
9107 : see if getprotoent exists
9108 set getprotoent d_getpent
9111 : see if getpgid exists
9112 set getpgid d_getpgid
9115 : see if getpgrp2 exists
9116 set getpgrp2 d_getpgrp2
9119 : see if getppid exists
9120 set getppid d_getppid
9123 : see if getpriority exists
9124 set getpriority d_getprior
9127 : see if prototypes for various getprotoxxx netdb.h functions are available
9129 set d_getprotoprotos getprotoent $i_netdb netdb.h
9132 : see if getpwent exists
9133 set getpwent d_getpwent
9137 : see if getservbyname exists
9138 set getservbyname d_getsbyname
9141 : see if getservbyport exists
9142 set getservbyport d_getsbyport
9145 : see if getservent exists
9146 set getservent d_getsent
9149 : see if prototypes for various getservxxx netdb.h functions are available
9151 set d_getservprotos getservent $i_netdb netdb.h
9154 : see if getspent exists
9155 set getspent d_getspent
9158 : see if getspnam exists
9159 set getspnam d_getspnam
9162 : see if gettimeofday or ftime exists
9163 set gettimeofday d_gettimeod
9165 case "$d_gettimeod" in
9171 val="$undef"; set d_ftime; eval $setvar
9174 case "$d_gettimeod$d_ftime" in
9177 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9181 : see if this is an grp system
9187 xxx=`./findhdr grp.h`
9188 $cppstdin $cppflags $cppminus < $xxx >$$.h
9190 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9202 set d_grpasswd; eval $setvar
9206 : see if hasmntopt exists
9207 set hasmntopt d_hasmntopt
9210 : see if this is a netinet/in.h or sys/in.h system
9211 set netinet/in.h i_niin sys/in.h i_sysin
9214 : see if arpa/inet.h has to be included
9215 set arpa/inet.h i_arpainet
9218 : see if htonl --and friends-- exists
9223 : Maybe they are macros.
9228 #include <sys/types.h>
9229 #$i_niin I_NETINET_IN
9231 #$i_arpainet I_ARPA_INET
9233 #include <netinet/in.h>
9239 #include <arpa/inet.h>
9242 printf("Defined as a macro.");
9245 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9246 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9248 echo "But it seems to be defined as a macro." >&4
9258 if set index val -f; eval $csym; $val; then
9259 if set strchr val -f d_strchr; eval $csym; $val; then
9260 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9263 echo "strchr() found." >&4
9267 echo "index() found." >&4
9272 echo "index() found." >&4
9275 if set strchr val -f d_strchr; eval $csym; $val; then
9278 echo "strchr() found." >&4
9280 echo "No index() or strchr() found!" >&4
9285 set d_strchr; eval $setvar
9287 set d_index; eval $setvar
9289 : check whether inet_aton exists
9290 set inet_aton d_inetaton
9295 $cat >isascii.c <<'EOCP'
9307 if eval $compile; then
9308 echo "isascii() found." >&4
9311 echo "isascii() NOT found." >&4
9318 : see if killpg exists
9322 : see if lchown exists
9324 $cat > try.c <<'EOCP'
9325 /* System header to define __stub macros and hopefully few prototypes,
9326 which can conflict with char lchown(); below. */
9328 /* Override any gcc2 internal prototype to avoid an error. */
9329 /* We use char because int might match the return type of a gcc2
9330 builtin and then its argument prototype would still apply. */
9333 /* The GNU C library defines this for functions which it implements
9334 to always fail with ENOSYS. Some functions are actually named
9335 something starting with __ and the normal name is an alias. */
9336 #if defined (__stub_lchown) || defined (__stub___lchown)
9344 if eval $compile; then
9345 $echo "lchown() found." >&4
9348 $echo "lchown() NOT found." >&4
9354 : See if number of significant digits in a double precision number is known
9356 $cat >ldbl_dig.c <<EOM
9366 printf("Contains LDBL_DIG");
9369 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9370 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9371 echo "LDBL_DIG found." >&4
9374 echo "LDBL_DIG NOT found." >&4
9381 : see if link exists
9385 : see if localeconv exists
9386 set localeconv d_locconv
9389 : see if lockf exists
9393 : check for long long
9395 $echo $n "Checking to see if your system supports long long..." $c >&4
9396 echo 'int main() { long long x = 7; return 0; }' > try.c
9398 if eval $compile; then
9400 echo " Yes, it does." >&4
9403 echo " No, it doesn't." >&4
9409 : check for length of long long
9410 case "${d_longlong}${longlongsize}" in
9413 $echo $n "Checking to see how big your long longs are..." $c >&4
9414 $cat >try.c <<'EOCP'
9418 printf("%d\n", (int)sizeof(long long));
9423 if eval $compile_ok; then
9424 longlongsize=`./try$exe_ext`
9425 $echo " $longlongsize bytes." >&4
9429 echo "(I can't seem to compile the test program. Guessing...)"
9430 rp="What is the size of a long long (in bytes)?"
9434 if $test "X$longsize" = "X$longlongsize"; then
9435 echo "(That isn't any different from an ordinary long.)"
9441 : see if lstat exists
9445 : see if mblen exists
9449 : see if mbstowcs exists
9450 set mbstowcs d_mbstowcs
9453 : see if mbtowc exists
9457 : see if memchr exists
9461 : see if memcmp exists
9465 : see if memcpy exists
9469 : see if memmove exists
9470 set memmove d_memmove
9473 : see if memset exists
9477 : see if mkdir exists
9481 : see if mkfifo exists
9485 : see if mktime exists
9489 : see if msgctl exists
9493 : see if msgget exists
9497 : see if msgsnd exists
9501 : see if msgrcv exists
9505 : see how much of the 'msg*(2)' library is present.
9508 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9509 *"$undef"*) h_msg=false;;
9513 case "`ipcs 2>&1`" in
9514 "SVID messages"*"not configured"*)
9515 echo "Your $osname does not have the msg*(2) configured." >&4
9530 : we could also check for sys/ipc.h ...
9531 if $h_msg && $test `./findhdr sys/msg.h`; then
9532 echo "You have the full msg*(2) library." >&4
9535 echo "You don't have the full msg*(2) library." >&4
9541 : see if nice exists
9545 : see if inttypes.h is available
9546 : we want a real compile instead of Inhdr because some systems
9547 : have an inttypes.h which includes non-existent headers
9550 #include <inttypes.h>
9552 static int32_t foo32 = 0x12345678;
9556 if eval $compile; then
9557 echo "<inttypes.h> found." >&4
9560 echo "<inttypes.h> NOT found." >&4
9569 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9571 #include <sys/types.h>
9572 #$i_inttypes I_INTTYPES
9574 #include <inttypes.h>
9576 int main() { int64_t x = 7; }
9579 if eval $compile; then
9581 echo " Yes, it does." >&4
9584 echo " No, it doesn't." >&4
9592 echo "Checking which 64-bit integer type we could use..." >&4
9598 val='"unsigned int"'
9603 *) case "$longsize" in
9607 val='"unsigned long"'
9612 *) case "$uselonglong:$d_longlong:$longlongsize" in
9617 val='"unsigned long long"'
9622 *) case "$d_int64t" in
9641 '') case "$uselonglong:$d_longlong:$longlongsize" in
9643 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9644 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9648 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9653 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9658 : check for length of character
9662 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9663 $cat >try.c <<'EOCP'
9667 printf("%d\n", (int)sizeof(char));
9672 if eval $compile_ok; then
9676 echo "(I can't seem to compile the test program. Guessing...)"
9683 rp="What is the size of a character (in bytes)?"
9690 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9692 case "$use64bits:$d_quad:$quadtype" in
9700 uvtype="unsigned long"
9706 case "$uselongdouble:$d_longdbl" in
9708 nvtype="long double"
9716 $echo "(IV will be "$ivtype", $ivsize bytes)"
9717 $echo "(UV will be "$uvtype", $uvsize bytes)"
9718 $echo "(NV will be "$nvtype", $nvsize bytes)"
9721 #$i_inttypes I_INTTYPES
9723 #include <inttypes.h>
9728 int8_t i = INT8_MAX;
9729 uint8_t u = UINT8_MAX;
9733 int16_t i = INT16_MAX;
9734 uint16_t i = UINT16_MAX;
9735 printf("int16_t\n");
9738 int32_t i = INT32_MAX;
9739 uint32_t u = UINT32_MAX;
9740 printf("int32_t\n");
9746 '') case "$charsize" in
9748 u8type="unsigned char"
9757 if eval $compile; then
9758 case "`./try$exe_ext`" in
9759 int8_t) i8type=int8_t
9769 '') if $test $charsize -ge 1; then
9771 u8type="unsigned char"
9779 '') case "$shortsize" in
9781 u16type="unsigned short"
9790 if eval $compile; then
9791 case "`./try$exe_ext`" in
9803 '') if $test $shortsize -ge 2; then
9805 u16type="unsigned short"
9813 '') case "$longsize" in
9815 u32type="unsigned long"
9819 *) case "$intsize" in
9821 u32type="unsigned int"
9832 if eval $compile; then
9833 case "`./try$exe_ext`" in
9845 '') if $test $intsize -ge 4; then
9847 u32type="unsigned int"
9855 '') case "$d_quad:$quadtype" in
9858 u64type="$uquadtype"
9866 $echo "Checking whether your NVs can preserve your UVs..." >&4
9870 $uvtype k = ($uvtype)~0, l;
9876 printf("preserve\n");
9881 if eval $compile; then
9882 case "`./try$exe_ext`" in
9883 preserve) d_nvpresuv="$define" ;;
9886 case "$d_nvpresuv" in
9887 $define) $echo "Yes, they can." 2>&1 ;;
9888 *) $echo "No, they can't." 2>&1
9895 : see if POSIX threads are available
9896 set pthread.h i_pthread
9902 : how to create joinable pthreads
9903 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9905 echo "Checking what constant to use for creating joinable pthreads..." >&4
9906 $cat >try.c <<'EOCP'
9907 #include <pthread.h>
9909 int detachstate = JOINABLE;
9912 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9913 if eval $compile; then
9914 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9915 val="$undef" # Yes, undef.
9916 set d_old_pthread_create_joinable
9919 set old_pthread_create_joinable
9922 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9923 if eval $compile; then
9924 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9926 set d_old_pthread_create_joinable
9928 val=PTHREAD_CREATE_UNDETACHED
9929 set old_pthread_create_joinable
9932 set try -DJOINABLE=__UNDETACHED
9933 if eval $compile; then
9934 echo "You seem to use __UNDETACHED." >&4
9936 set d_old_pthread_create_joinable
9939 set old_pthread_create_joinable
9942 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9944 set d_old_pthread_create_joinable
9947 set old_pthread_create_joinable
9954 d_old_pthread_create_joinable="$undef"
9955 old_pthread_create_joinable=""
9958 : see if pause exists
9962 : see if pipe exists
9966 : see if poll exists
9971 : see whether the various POSIXish _yields exist
9973 #include <pthread.h>
9979 #ifdef PTHREAD_YIELD
9982 #ifdef PTHREAD_YIELD_NULL
9983 pthread_yield(NULL);
9989 : see if sched_yield exists
9990 set try -DSCHED_YIELD
9991 if eval $compile; then
9993 sched_yield='sched_yield()'
9997 case "$usethreads" in
10000 $define) echo 'sched_yield() found.' >&4 ;;
10001 *) echo 'sched_yield() NOT found.' >&4 ;;
10007 : see if pthread_yield exists
10008 set try -DPTHREAD_YIELD
10009 if eval $compile; then
10011 case "$sched_yield" in
10012 '') sched_yield='pthread_yield()' ;;
10015 set try -DPTHREAD_YIELD_NULL
10016 if eval $compile; then
10018 case "$sched_yield" in
10019 '') sched_yield='pthread_yield(NULL)' ;;
10025 case "$usethreads" in
10028 $define) echo 'pthread_yield() found.' >&4 ;;
10029 *) echo 'pthread_yield() NOT found.' >&4 ;;
10033 set d_pthread_yield
10036 case "$sched_yield" in
10037 '') sched_yield=undef ;;
10042 : see if this is a pwd.h system
10048 xxx=`./findhdr pwd.h`
10049 $cppstdin $cppflags $cppminus < $xxx >$$.h
10051 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10059 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10067 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10075 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10083 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10091 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10099 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10107 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10119 set d_pwquota; eval $setvar
10120 set d_pwage; eval $setvar
10121 set d_pwchange; eval $setvar
10122 set d_pwclass; eval $setvar
10123 set d_pwexpire; eval $setvar
10124 set d_pwcomment; eval $setvar
10125 set d_pwgecos; eval $setvar
10126 set d_pwpasswd; eval $setvar
10130 : see if readdir and friends exist
10131 set readdir d_readdir
10133 set seekdir d_seekdir
10135 set telldir d_telldir
10137 set rewinddir d_rewinddir
10140 : see if readlink exists
10141 set readlink d_readlink
10144 : see if rename exists
10145 set rename d_rename
10148 : see if rmdir exists
10152 : see if memory.h is available.
10157 : See if it conflicts with string.h
10163 $cppstdin $cppflags $cppminus < $strings > mem.h
10164 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10166 echo "We won't be including <memory.h>."
10176 : can bcopy handle overlapping blocks?
10181 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10183 #$i_memory I_MEMORY
10184 #$i_stdlib I_STDLIB
10185 #$i_string I_STRING
10186 #$i_unistd I_UNISTD
10188 $cat >>try.c <<'EOCP'
10191 # include <memory.h>
10194 # include <stdlib.h>
10197 # include <string.h>
10199 # include <strings.h>
10202 # include <unistd.h> /* Needed for NetBSD */
10206 char buf[128], abc[128];
10212 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10214 for (align = 7; align >= 0; align--) {
10215 for (len = 36; len; len--) {
10217 bcopy(abc, b, len);
10218 for (off = 1; off <= len; off++) {
10219 bcopy(b, b+off, len);
10220 bcopy(b+off, b, len);
10221 if (bcmp(b, abc, len))
10230 if eval $compile_ok; then
10231 if ./try 2>/dev/null; then
10232 echo "Yes, it can."
10235 echo "It can't, sorry."
10236 case "$d_memmove" in
10237 "$define") echo "But that's Ok since you have memmove()." ;;
10241 echo "(I can't compile the test program, so we'll assume not...)"
10242 case "$d_memmove" in
10243 "$define") echo "But that's Ok since you have memmove()." ;;
10248 $rm -f try.* try core
10252 : can memcpy handle overlapping blocks?
10254 case "$d_memcpy" in
10257 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10259 #$i_memory I_MEMORY
10260 #$i_stdlib I_STDLIB
10261 #$i_string I_STRING
10262 #$i_unistd I_UNISTD
10264 $cat >>try.c <<'EOCP'
10267 # include <memory.h>
10270 # include <stdlib.h>
10273 # include <string.h>
10275 # include <strings.h>
10278 # include <unistd.h> /* Needed for NetBSD */
10282 char buf[128], abc[128];
10288 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10289 try to store the string in read-only memory. */
10290 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10292 for (align = 7; align >= 0; align--) {
10293 for (len = 36; len; len--) {
10295 memcpy(b, abc, len);
10296 for (off = 1; off <= len; off++) {
10297 memcpy(b+off, b, len);
10298 memcpy(b, b+off, len);
10299 if (memcmp(b, abc, len))
10308 if eval $compile_ok; then
10309 if ./try 2>/dev/null; then
10310 echo "Yes, it can."
10313 echo "It can't, sorry."
10314 case "$d_memmove" in
10315 "$define") echo "But that's Ok since you have memmove()." ;;
10319 echo "(I can't compile the test program, so we'll assume not...)"
10320 case "$d_memmove" in
10321 "$define") echo "But that's Ok since you have memmove()." ;;
10326 $rm -f try.* try core
10330 : can memcmp be trusted to compare relative magnitude?
10332 case "$d_memcmp" in
10335 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10337 #$i_memory I_MEMORY
10338 #$i_stdlib I_STDLIB
10339 #$i_string I_STRING
10340 #$i_unistd I_UNISTD
10342 $cat >>try.c <<'EOCP'
10345 # include <memory.h>
10348 # include <stdlib.h>
10351 # include <string.h>
10353 # include <strings.h>
10356 # include <unistd.h> /* Needed for NetBSD */
10362 if ((a < b) && memcmp(&a, &b, 1) < 0)
10368 if eval $compile_ok; then
10369 if ./try 2>/dev/null; then
10370 echo "Yes, it can."
10373 echo "No, it can't (it uses signed chars)."
10376 echo "(I can't compile the test program, so we'll assume not...)"
10380 $rm -f try.* try core
10384 : see if select exists
10385 set select d_select
10388 : see if semctl exists
10389 set semctl d_semctl
10392 : see if semget exists
10393 set semget d_semget
10396 : see if semop exists
10400 : see how much of the 'sem*(2)' library is present.
10403 case "$d_semctl$d_semget$d_semop" in
10404 *"$undef"*) h_sem=false;;
10408 case "`ipcs 2>&1`" in
10409 "SVID messages"*"not configured"*)
10410 echo "Your $osname does not have the sem*(2) configured." >&4
10413 set semctl d_semctl
10415 set semget d_semget
10423 : we could also check for sys/ipc.h ...
10424 if $h_sem && $test `./findhdr sys/sem.h`; then
10425 echo "You have the full sem*(2) library." >&4
10428 echo "You don't have the full sem*(2) library." >&4
10434 : see whether sys/sem.h defines union semun
10436 $cat > try.c <<'END'
10437 #include <sys/types.h>
10438 #include <sys/ipc.h>
10439 #include <sys/sem.h>
10440 int main () { union semun semun; semun.buf = 0; }
10443 if eval $compile; then
10444 echo "You have union semun in <sys/sem.h>." >&4
10447 echo "You do not have union semun in <sys/sem.h>." >&4
10450 $rm -f try try.c try.h
10454 : see how to do semctl IPC_STAT
10457 : see whether semctl IPC_STAT can use union semun
10462 # define S_IRUSR S_IREAD
10463 # define S_IWUSR S_IWRITE
10464 # define S_IXUSR S_IEXEC
10466 # define S_IRUSR 0400
10467 # define S_IWUSR 0200
10468 # define S_IXUSR 0100
10470 # define S_IRGRP (S_IRUSR>>3)
10471 # define S_IWGRP (S_IWUSR>>3)
10472 # define S_IXGRP (S_IXUSR>>3)
10473 # define S_IROTH (S_IRUSR>>6)
10474 # define S_IWOTH (S_IWUSR>>6)
10475 # define S_IXOTH (S_IXUSR>>6)
10478 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10479 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10480 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10485 #include <sys/types.h>
10486 #include <sys/ipc.h>
10487 #include <sys/sem.h>
10488 #include <sys/stat.h>
10495 #$d_union_semun HAS_UNION_SEMUN
10498 #ifndef HAS_UNION_SEMUN
10501 struct semid_ds *buf;
10502 unsigned short *array;
10508 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10509 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10511 struct semid_ds argbuf;
10514 st = semctl(sem, 0, IPC_STAT, arg);
10518 # endif /* IPC_STAT */
10519 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10521 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10522 # endif /* IPC_RMID */
10523 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10525 #endif /* IPC_PRIVATE && ... */
10526 printf("semget failed: errno = %d\n", errno);
10532 if eval $compile; then
10535 semun) val="$define" ;;
10541 case "$d_semctl_semun" in
10543 echo "You can use union semun for semctl IPC_STAT." >&4
10546 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10551 : see whether semctl IPC_STAT can use struct semid_ds pointer
10552 $cat > try.c <<'END'
10553 #include <sys/types.h>
10554 #include <sys/ipc.h>
10555 #include <sys/sem.h>
10556 #include <sys/stat.h>
10564 struct semid_ds arg;
10567 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10568 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10571 st = semctl(sem, 0, IPC_STAT, &arg);
10573 printf("semid_ds\n");
10575 # endif /* IPC_STAT */
10576 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10578 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10579 # endif /* IPC_RMID */
10580 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10582 #endif /* IPC_PRIVATE && ... */
10583 printf("semget failed: errno = %d\n", errno);
10590 if eval $compile; then
10593 semid_ds) val="$define" ;;
10597 set d_semctl_semid_ds
10599 case "$d_semctl_semid_ds" in
10601 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10603 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10610 # We do not have the full sem*(2) library, so assume we can not
10616 set d_semctl_semid_ds
10621 : see if setegid exists
10622 set setegid d_setegid
10625 : see if seteuid exists
10626 set seteuid d_seteuid
10629 : see if setgrent exists
10630 set setgrent d_setgrent
10633 : see if sethostent exists
10634 set sethostent d_sethent
10637 : see if setlinebuf exists
10638 set setlinebuf d_setlinebuf
10641 : see if setlocale exists
10642 set setlocale d_setlocale
10645 : see if setnetent exists
10646 set setnetent d_setnent
10649 : see if setprotoent exists
10650 set setprotoent d_setpent
10653 : see if setpgid exists
10654 set setpgid d_setpgid
10657 : see if setpgrp2 exists
10658 set setpgrp2 d_setpgrp2
10661 : see if setpriority exists
10662 set setpriority d_setprior
10665 : see if setpwent exists
10666 set setpwent d_setpwent
10669 : see if setregid exists
10670 set setregid d_setregid
10672 set setresgid d_setresgid
10675 : see if setreuid exists
10676 set setreuid d_setreuid
10678 set setresuid d_setresuid
10681 : see if setrgid exists
10682 set setrgid d_setrgid
10685 : see if setruid exists
10686 set setruid d_setruid
10689 : see if setservent exists
10690 set setservent d_setsent
10693 : see if setsid exists
10694 set setsid d_setsid
10697 : see if setspent exists
10698 set setspent d_setspent
10701 : see if setvbuf exists
10702 set setvbuf d_setvbuf
10705 : see if sfio.h is available
10710 : see if sfio library is available
10721 : Ok, but do we want to use it.
10725 true|$define|[yY]*) dflt='y';;
10728 echo "$package can use the sfio library, but it is experimental."
10729 rp="You seem to have sfio available, do you want to try using it?"
10733 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10735 : Remove sfio from list of libraries to use
10736 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10739 echo "libs = $libs" >&4
10743 *) case "$usesfio" in
10744 true|$define|[yY]*)
10745 echo "Sorry, cannot find sfio on this machine" >&4
10746 echo "Ignoring your setting of usesfio=$usesfio" >&4
10754 $define) usesfio='true';;
10755 *) usesfio='false';;
10758 : see if shmctl exists
10759 set shmctl d_shmctl
10762 : see if shmget exists
10763 set shmget d_shmget
10766 : see if shmat exists
10769 : see what shmat returns
10772 $cat >shmat.c <<'END'
10773 #include <sys/shm.h>
10776 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10781 echo "and it returns ($shmattype)." >&4
10782 : see if a prototype for shmat is available
10783 xxx=`./findhdr sys/shm.h`
10784 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10785 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10796 set d_shmatprototype
10799 : see if shmdt exists
10803 : see how much of the 'shm*(2)' library is present.
10806 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10807 *"$undef"*) h_shm=false;;
10811 case "`ipcs 2>&1`" in
10812 "SVID shared memory"*"not configured"*)
10813 echo "Your $osname does not have the shm*(2) configured." >&4
10816 set shmctl d_shmctl
10818 set shmget d_shmget
10828 : we could also check for sys/ipc.h ...
10829 if $h_shm && $test `./findhdr sys/shm.h`; then
10830 echo "You have the full shm*(2) library." >&4
10833 echo "You don't have the full shm*(2) library." >&4
10840 : see if we have sigaction
10841 if set sigaction val -f d_sigaction; eval $csym; $val; then
10842 echo 'sigaction() found.' >&4
10843 $cat > try.c <<'EOP'
10845 #include <sys/types.h>
10846 #include <signal.h>
10849 struct sigaction act, oact;
10851 oact.sa_handler = 0;
10852 /* so that act and oact are used */
10853 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10857 if eval $compile_ok; then
10860 echo "But you don't seem to have a useable struct sigaction." >&4
10864 echo 'sigaction NOT found.' >&4
10867 set d_sigaction; eval $setvar
10868 $rm -f try try$_o try.c
10870 : see if sigsetjmp exists
10872 case "$d_sigsetjmp" in
10874 $cat >try.c <<'EOP'
10875 #include <setjmp.h>
10880 if (sigsetjmp(env,1))
10883 siglongjmp(env, 1);
10888 if eval $compile; then
10889 if ./try >/dev/null 2>&1; then
10890 echo "POSIX sigsetjmp found." >&4
10894 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10900 echo "sigsetjmp not found." >&4
10904 *) val="$d_sigsetjmp"
10905 case "$d_sigsetjmp" in
10906 $define) echo "POSIX sigsetjmp found." >&4;;
10907 $undef) echo "sigsetjmp not found." >&4;;
10915 : see if sqrtl exists
10919 : see if sys/stat.h is available
10920 set sys/stat.h i_sysstat
10924 : see if stat knows about block sizes
10926 echo "Checking to see if your struct stat has st_blocks field..." >&4
10927 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10931 : see if this is a sys/vfs.h system
10932 set sys/vfs.h i_sysvfs
10936 : see if this is a sys/statfs.h system
10937 set sys/statfs.h i_sysstatfs
10942 echo "Checking to see if your system supports struct statfs..." >&4
10943 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
10945 case "$d_statfs_s" in
10946 "$define") echo "Yes, it does." ;;
10947 *) echo "No, it doesn't." ;;
10952 : see if struct statfs knows about f_flags
10953 case "$d_statfs_s" in
10956 echo "Checking to see if your struct statfs has f_flags field..." >&4
10957 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
10961 set d_statfs_f_flags
10965 case "$d_statfs_f_flags" in
10966 "$define") echo "Yes, it does." ;;
10967 *) echo "No, it doesn't." ;;
10970 : see if _ptr and _cnt from stdio act std
10972 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10973 echo "(Looks like you have stdio.h from Linux.)"
10974 case "$stdio_ptr" in
10975 '') stdio_ptr='((fp)->_IO_read_ptr)'
10978 *) ptr_lval=$d_stdio_ptr_lval;;
10980 case "$stdio_cnt" in
10981 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10984 *) cnt_lval=$d_stdio_cnt_lval;;
10986 case "$stdio_base" in
10987 '') stdio_base='((fp)->_IO_read_base)';;
10989 case "$stdio_bufsiz" in
10990 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10993 case "$stdio_ptr" in
10994 '') stdio_ptr='((fp)->_ptr)'
10997 *) ptr_lval=$d_stdio_ptr_lval;;
10999 case "$stdio_cnt" in
11000 '') stdio_cnt='((fp)->_cnt)'
11003 *) cnt_lval=$d_stdio_cnt_lval;;
11005 case "$stdio_base" in
11006 '') stdio_base='((fp)->_base)';;
11008 case "$stdio_bufsiz" in
11009 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11012 : test whether _ptr and _cnt really work
11013 echo "Checking how std your stdio is..." >&4
11016 #define FILE_ptr(fp) $stdio_ptr
11017 #define FILE_cnt(fp) $stdio_cnt
11019 FILE *fp = fopen("try.c", "r");
11022 18 <= FILE_cnt(fp) &&
11023 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11031 if eval $compile; then
11033 echo "Your stdio acts pretty std."
11036 echo "Your stdio isn't very std."
11039 echo "Your stdio doesn't appear very std."
11045 : Can _ptr be used as an lvalue?
11046 case "$d_stdstdio$ptr_lval" in
11047 $define$define) val=$define ;;
11050 set d_stdio_ptr_lval
11053 : Can _cnt be used as an lvalue?
11054 case "$d_stdstdio$cnt_lval" in
11055 $define$define) val=$define ;;
11058 set d_stdio_cnt_lval
11061 : see if _base is also standard
11063 case "$d_stdstdio" in
11067 #define FILE_base(fp) $stdio_base
11068 #define FILE_bufsiz(fp) $stdio_bufsiz
11070 FILE *fp = fopen("try.c", "r");
11073 19 <= FILE_bufsiz(fp) &&
11074 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11081 if eval $compile; then
11083 echo "And its _base field acts std."
11086 echo "But its _base field isn't std."
11089 echo "However, it seems to be lacking the _base field."
11098 Checking how to access stdio streams by file descriptor number...
11100 case "$stdio_stream_array" in
11101 '') $cat >try.c <<EOCP
11104 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11108 for s in _iob __iob __sF
11110 set try -DSTDIO_STREAM_ARRAY=$s
11111 if eval $compile; then
11112 case "`./try$exe_ext`" in
11113 yes) stdio_stream_array=$s; break ;;
11117 $rm -f try.* try$exe_ext
11119 case "$stdio_stream_array" in
11121 I can't figure out how to access stdio streams by file descriptor number.
11123 d_stdio_stream_array="$undef"
11126 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11128 d_stdio_stream_array="$define"
11132 : see if strcoll exists
11133 set strcoll d_strcoll
11136 : check for structure copying
11138 echo "Checking to see if your C compiler can copy structs..." >&4
11139 $cat >try.c <<'EOCP'
11149 if $cc -c try.c >/dev/null 2>&1 ; then
11151 echo "Yup, it can."
11154 echo "Nope, it can't."
11160 : see if strerror and/or sys_errlist[] exist
11162 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11163 if set strerror val -f d_strerror; eval $csym; $val; then
11164 echo 'strerror() found.' >&4
11165 d_strerror="$define"
11166 d_strerrm='strerror(e)'
11167 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11168 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11169 d_syserrlst="$define"
11171 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11172 d_syserrlst="$undef"
11174 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11175 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11176 echo 'strerror() found in string header.' >&4
11177 d_strerror="$define"
11178 d_strerrm='strerror(e)'
11179 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11180 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11181 d_syserrlst="$define"
11183 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11184 d_syserrlst="$undef"
11186 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11187 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11188 d_strerror="$undef"
11189 d_syserrlst="$define"
11190 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11192 echo 'strerror() and sys_errlist[] NOT found.' >&4
11193 d_strerror="$undef"
11194 d_syserrlst="$undef"
11195 d_strerrm='"unknown"'
11199 : see if strtod exists
11200 set strtod d_strtod
11203 : see if strtol exists
11204 set strtol d_strtol
11207 : see if strtold exists
11208 set strtold d_strtold
11211 : see if strtoll exists
11212 set strtoll d_strtoll
11215 : see if strtoul exists
11216 set strtoul d_strtoul
11219 : see if strtoull exists
11220 set strtoull d_strtoull
11223 : see if strtouq exists
11224 set strtouq d_strtouq
11227 : see if strxfrm exists
11228 set strxfrm d_strxfrm
11231 : see if symlink exists
11232 set symlink d_symlink
11235 : see if syscall exists
11236 set syscall d_syscall
11239 : see if sysconf exists
11240 set sysconf d_sysconf
11243 : see if system exists
11244 set system d_system
11247 : see if tcgetpgrp exists
11248 set tcgetpgrp d_tcgetpgrp
11251 : see if tcsetpgrp exists
11252 set tcsetpgrp d_tcsetpgrp
11255 : see if prototype for telldir is available
11257 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11260 : see if this is a sys/times.h system
11261 set sys/times.h i_systimes
11264 : see if times exists
11266 if set times val -f d_times; eval $csym; $val; then
11267 echo 'times() found.' >&4
11270 case "$i_systimes" in
11271 "$define") inc='sys/times.h';;
11273 rp="What is the type returned by times() on this system?"
11274 set clock_t clocktype long stdio.h sys/types.h $inc
11277 echo 'times() NOT found, hope that will do.' >&4
11282 : see if truncate exists
11283 set truncate d_truncate
11286 : see if tzname[] exists
11288 if set tzname val -a d_tzname; eval $csym; $val; then
11290 echo 'tzname[] found.' >&4
11293 echo 'tzname[] NOT found.' >&4
11298 : see if umask exists
11302 : see if ustat exists
11306 : backward compatibility for d_hvfork
11307 if test X$d_hvfork != X; then
11308 d_vfork="$d_hvfork"
11311 : see if there is a vfork
11316 : Ok, but do we want to use it. vfork is reportedly unreliable in
11317 : perl on Solaris 2.x, and probably elsewhere.
11321 case "$usevfork" in
11327 Perl can only use a vfork() that doesn't suffer from strict
11328 restrictions on calling functions or modifying global data in
11329 the child. For example, glibc-2.1 contains such a vfork()
11330 that is unsuitable. If your system provides a proper fork()
11331 call, chances are that you do NOT want perl to use vfork().
11334 rp="Do you still want to use vfork()?"
11339 echo "Ok, we won't use vfork()."
11348 $define) usevfork='true';;
11349 *) usevfork='false';;
11352 : see if this is an sysdir system
11353 set sys/dir.h i_sysdir
11356 : see if this is an sysndir system
11357 set sys/ndir.h i_sysndir
11360 : see if closedir exists
11361 set closedir d_closedir
11364 case "$d_closedir" in
11367 echo "Checking whether closedir() returns a status..." >&4
11368 cat > closedir.c <<EOM
11369 #$i_dirent I_DIRENT /**/
11370 #$i_sysdir I_SYS_DIR /**/
11371 #$i_sysndir I_SYS_NDIR /**/
11372 #$i_systypes I_SYS_TYPES /**/
11374 #if defined(I_SYS_TYPES)
11375 #include <sys/types.h>
11377 #if defined(I_DIRENT)
11378 #include <dirent.h>
11379 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11380 #include <sys/dir.h>
11384 #include <sys/ndir.h>
11388 #include <ndir.h> /* may be wrong in the future */
11390 #include <sys/dir.h>
11395 int main() { return closedir(opendir(".")); }
11398 if eval $compile_ok; then
11399 if ./closedir > /dev/null 2>&1 ; then
11400 echo "Yes, it does."
11403 echo "No, it doesn't."
11407 echo "(I can't seem to compile the test program--assuming it doesn't)"
11415 set d_void_closedir
11418 : check for volatile keyword
11420 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11421 $cat >try.c <<'EOCP'
11424 typedef struct _goo_struct goo_struct;
11425 goo_struct * volatile goo = ((goo_struct *)0);
11426 struct _goo_struct {
11431 typedef unsigned short foo_t;
11432 char *volatile foo;
11434 volatile foo_t blech;
11438 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11440 echo "Yup, it does."
11443 echo "Nope, it doesn't."
11449 : see if there is a wait4
11453 : see if waitpid exists
11454 set waitpid d_waitpid
11457 : see if wcstombs exists
11458 set wcstombs d_wcstombs
11461 : see if wctomb exists
11462 set wctomb d_wctomb
11465 : preserve RCS keywords in files with variable substitution, grrr
11470 Revision='$Revision'
11472 case "$crosscompile" in
11473 ''|[nN]*) crosscompile="$undef" ;;
11477 next|rhapsody) multiarch="$define" ;;
11479 case "$multiarch" in
11480 ''|[nN]*) multiarch="$undef" ;;
11483 : check for alignment requirements
11485 case "$crosscompile$multiarch" in
11488 You seem to be either cross-compiling or doing a multiarchitecture build,
11489 skipping the memory alignment check.
11492 case "$alignbytes" in
11493 '') alignbytes=8 ;;
11497 case "$alignbytes" in
11498 '') echo "Checking alignment constraints..." >&4
11499 $cat >try.c <<'EOCP'
11507 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11512 if eval $compile_ok; then
11516 echo "(I can't seem to compile the test program...)"
11519 *) dflt="$alignbytes"
11522 rp="Doubles must be aligned on a how-many-byte boundary?"
11530 : check for ordering of bytes in a long
11532 case "$crosscompile$multiarch" in
11535 You seem to be either cross-compiling or doing a multiarchitecture build,
11536 skipping the byteorder check.
11542 case "$byteorder" in
11545 In the following, larger digits indicate more significance. A big-endian
11546 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11547 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11548 machines may have weird orders like 3412. A Cray will report 87654321,
11549 an Alpha will report 12345678. If the test program works the default is
11551 I'm now running the test program...
11553 $cat >try.c <<'EOCP'
11560 char c[sizeof(long)];
11563 if (sizeof(long) > 4)
11564 u.l = (0x08070605L << 32) | 0x04030201L;
11567 for (i = 0; i < sizeof(long); i++)
11568 printf("%c", u.c[i]+'0');
11575 if eval $compile && ./try > /dev/null; then
11578 [1-4][1-4][1-4][1-4]|12345678|87654321)
11579 echo "(The test program ran ok.)"
11580 echo "byteorder=$dflt"
11583 ????|????????) echo "(The test program ran ok.)" ;;
11584 *) echo "(The test program didn't run right for some reason.)" ;;
11589 (I can't seem to compile the test program. Guessing big-endian...)
11592 case "$xxx_prompt" in
11594 rp="What is the order of bytes in a long?"
11608 : how do we catenate cpp tokens here?
11610 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11611 $cat >cpp_stuff.c <<'EOCP'
11612 #define RCAT(a,b)a/**/b
11613 #define ACAT(a,b)a ## b
11617 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11618 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11619 echo "Oh! Smells like ANSI's been here." >&4
11620 echo "We can catify or stringify, separately or together!"
11622 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11623 echo "Ah, yes! The good old days!" >&4
11624 echo "However, in the good old days we don't know how to stringify and"
11625 echo "catify at the same time."
11629 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11630 to have to edit the values of CAT[2-5] in config.h...
11632 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11636 : see if this is a db.h system
11642 : Check db version.
11644 echo "Checking Berkeley DB version ..." >&4
11650 #include <sys/types.h>
11655 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11656 int Major, Minor, Patch ;
11657 unsigned long Version ;
11658 (void)db_version(&Major, &Minor, &Patch) ;
11659 printf("You have Berkeley DB Version 2 or greater\n");
11661 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11662 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11663 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11664 Major, Minor, Patch) ;
11666 /* check that db.h & libdb are compatible */
11667 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11668 printf("db.h and libdb are incompatible\n") ;
11672 printf("db.h and libdb are compatible\n") ;
11674 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11675 + DB_VERSION_PATCH ;
11677 /* needs to be >= 2.3.4 */
11678 if (Version < 2003004) {
11679 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11680 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11686 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11687 printf("You have Berkeley DB Version 1\n");
11688 exit(0); /* DB version < 2: the coast is clear. */
11690 exit(1); /* <db.h> not Berkeley DB? */
11696 if eval $compile_ok && ./try; then
11697 echo 'Looks OK.' >&4
11699 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11703 : Remove db from list of libraries to use
11704 echo "Removing unusable -ldb from library list" >&4
11705 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11708 echo "libs = $libs" >&4
11718 : Check the return type needed for hash
11720 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11726 #include <sys/types.h>
11729 #ifndef DB_VERSION_MAJOR
11730 u_int32_t hash_cb (ptr, size)
11738 info.hash = hash_cb;
11742 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11743 if $contains warning try.out >>/dev/null 2>&1 ; then
11746 db_hashtype='u_int32_t'
11749 : XXX Maybe we should just give up here.
11750 db_hashtype=u_int32_t
11752 echo "Help: I can't seem to compile the db test program." >&4
11753 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11756 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11758 *) db_hashtype=u_int32_t
11763 : Check the return type needed for prefix
11765 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11771 #include <sys/types.h>
11774 #ifndef DB_VERSION_MAJOR
11775 size_t prefix_cb (key1, key2)
11783 info.prefix = prefix_cb;
11787 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11788 if $contains warning try.out >>/dev/null 2>&1 ; then
11789 db_prefixtype='int'
11791 db_prefixtype='size_t'
11794 db_prefixtype='size_t'
11795 : XXX Maybe we should just give up here.
11797 echo "Help: I can't seem to compile the db test program." >&4
11798 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11801 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11803 *) db_prefixtype='size_t'
11807 : check for void type
11809 echo "Checking to see how well your C compiler groks the void type..." >&4
11810 case "$voidflags" in
11812 $cat >try.c <<'EOCP'
11818 extern void moo(); /* function returning void */
11819 void (*goo)(); /* ptr to func returning void */
11821 void *hue; /* generic ptr */
11834 int main() { sub(); }
11836 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11837 voidflags=$defvoidused
11838 echo "Good. It appears to support void to the level $package wants.">&4
11839 if $contains warning .out >/dev/null 2>&1; then
11840 echo "However, you might get some warnings that look like this:"
11844 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11845 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11846 echo "It supports 1..."
11847 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11848 echo "It also supports 2..."
11849 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11851 echo "And it supports 4 but not 8 definitely."
11853 echo "It doesn't support 4..."
11854 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11856 echo "But it supports 8."
11859 echo "Neither does it support 8."
11863 echo "It does not support 2..."
11864 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11866 echo "But it supports 4 and 8."
11868 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11870 echo "And it supports 4 but has not heard about 8."
11872 echo "However it supports 8 but not 4."
11877 echo "There is no support at all for void."
11882 case "$voidflags" in
11884 *) $cat >&4 <<'EOM'
11885 Support flag bits are:
11886 1: basic void declarations.
11887 2: arrays of pointers to functions returning void.
11888 4: operations between pointers to and addresses of void functions.
11889 8: generic void pointers.
11892 rp="Your void support flags add up to what?"
11900 : How can we generate normalized random numbers ?
11902 echo "Looking for a random number function..." >&4
11903 case "$randfunc" in
11905 if set drand48 val -f; eval $csym; $val; then
11907 echo "Good, found drand48()." >&4
11908 elif set random val -f; eval $csym; $val; then
11910 echo "OK, found random()." >&4
11913 echo "Yick, looks like I have to use rand()." >&4
11924 *-Dmy_rand=*|*-Dmy_srand=*)
11925 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11926 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11927 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11928 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11932 while $test "$cont"; do
11933 rp="Use which function to generate random numbers?"
11935 if $test "$ans" = "$dflt"; then
11941 if set $ans val -f; eval $csym; $val; then
11945 rp="I cannot find function $ans. Use that name anyway?"
11954 case "$randfunc" in
11956 drand01="drand48()"
11962 case "$randbits" in
11964 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11966 #$i_unistd I_UNISTD
11967 #$i_stdlib I_STDLIB
11970 # include <unistd.h>
11973 # include <stdlib.h>
11978 register unsigned long tmp;
11979 register unsigned long max = 0L;
11981 for (i = 1000; i; i--) {
11982 tmp = (unsigned long) $randfunc();
11983 if (tmp > max) max = tmp;
11985 for (i = 0; max; i++)
11991 if eval $compile_ok; then
11995 echo "(I can't seem to compile the test program...)"
12002 rp="How many bits does your $randfunc() function produce?"
12006 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12007 seedfunc="s$randfunc"
12008 randseedtype=unsigned
12012 rp="How many bits does your $randfunc() function produce?"
12015 seedfunc="s$randfunc"
12016 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12017 if set $seedfunc val -f; eval $csym; $val; then
12018 echo "(Using $seedfunc() to seed random generator)"
12020 echo "(Warning: no $seedfunc() to seed random generator)"
12023 randseedtype=unsigned
12031 echo "Determining whether or not we are on an EBCDIC system..." >&4
12032 $cat >tebcdic.c <<'EOM'
12035 if ('M'==0xd4) return 0;
12042 if eval $compile_ok; then
12044 echo "You have EBCDIC." >&4
12047 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12050 echo "I'm unable to compile the test program." >&4
12051 echo "I'll assume ASCII or some ISO Latin." >&4
12053 $rm -f tebcdic.c tebcdic
12059 Checking how to flush all pending stdio output...
12061 # I only know how to find the first 32 possibly open files on SunOS.
12062 # See also hints/sunos_4_1.sh and util.c --AD
12064 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12066 $cat >>try.c <<EOCP
12068 #$i_unistd I_UNISTD
12070 # include <unistd.h>
12072 #$d_sysconf HAS_SYSCONF
12073 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12074 #ifdef HAS_STDIO_STREAM_ARRAY
12075 # define STDIO_STREAM_ARRAY $stdio_stream_array
12078 FILE* p = fopen("try.out", "w");
12082 # ifdef TRY_FPRINTF
12086 #ifdef TRY_FFLUSH_NULL
12089 #ifdef TRY_FFLUSH_ALL
12091 long open_max = -1;
12092 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12093 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12095 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12096 open_max = sysconf(_SC_OPEN_MAX);
12099 open_max = FOPEN_MAX;
12102 open_max = OPEN_MAX;
12111 # ifdef HAS_STDIO_STREAM_ARRAY
12112 if (open_max > 0) {
12114 for (i = 0; i < open_max; i++)
12115 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12116 STDIO_STREAM_ARRAY[i]._file < open_max &&
12117 STDIO_STREAM_ARRAY[i]._flag)
12118 fflush(&STDIO_STREAM_ARRAY[i]);
12126 : first we have to find out how _not_ to flush
12127 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12129 set try -DTRY_FPUTC
12130 if eval $compile; then
12132 ./try$exe_ext 2>/dev/null
12133 if $test ! -s try.out -a "X$?" = X42; then
12139 set try -DTRY_FPRINTF
12141 if eval $compile; then
12143 ./try$exe_ext 2>/dev/null
12144 if $test ! -s try.out -a "X$?" = X42; then
12145 output=-DTRY_FPRINTF
12151 : check for fflush NULL behaviour
12152 case "$fflushNULL" in
12153 '') set try -DTRY_FFLUSH_NULL $output
12154 if eval $compile; then
12156 ./try$exe_ext 2>/dev/null
12158 if $test -s try.out -a "X$code" = X42; then
12159 fflushNULL="`$cat try.out`"
12161 if $test "X$code" != X42; then
12163 (If this test failed, don't worry, we'll try another method shortly.)
12168 $rm -f core try.core core.try.*
12169 case "$fflushNULL" in
12171 Your fflush(NULL) works okay.
12173 fflushNULL="$define"
12176 Your fflush(NULL) isn't working (contrary to ANSI C).
12178 fflushNULL="$undef"
12181 Cannot figure out whether your fflush(NULL) works or not.
12182 I'm assuming it doesn't (contrary to ANSI C).
12184 fflushNULL="$undef"
12188 $define|true|[yY]*)
12189 fflushNULL="$define"
12192 fflushNULL="$undef"
12195 : check explicit looping only if NULL did not work
12196 case "$fflushNULL" in
12198 : check for fflush all behaviour
12199 case "$fflushall" in
12200 '') set try -DTRY_FFLUSH_ALL $output
12201 if eval $compile; then
12203 (Now testing the other method--but note that also this may fail.)
12206 ./try$exe_ext 2>/dev/null
12207 if $test -s try.out -a "X$?" = X42; then
12208 fflushall="`$cat try.out`"
12211 $rm -f core try.core core.try.*
12212 case "$fflushall" in
12214 Whew. Flushing explicitly all the stdio streams works.
12216 fflushall="$define"
12219 Sigh. Flushing explicitly all the stdio streams doesn't work.
12224 Cannot figure out whether flushing stdio streams explicitly works or not.
12225 I'm assuming it doesn't.
12231 "$define"|true|[yY]*)
12232 fflushall="$define"
12239 *) fflushall="$undef"
12242 case "$fflushNULL$fflushall" in
12245 I cannot figure out how to flush pending stdio output.
12249 $rm -f try.* try$exe_ext
12251 : Store the full pathname to the ar program for use in the C program
12252 : Respect a hint or command line value for full_ar.
12257 : Store the full pathname to the sed program for use in the C program
12260 : see what type gids are declared as in the kernel
12262 echo "Looking for the type for group ids returned by getgid()."
12263 set gid_t gidtype xxx stdio.h sys/types.h
12267 xxx=`./findhdr sys/user.h`
12268 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12270 unsigned) dflt="$1 $2" ;;
12274 *) dflt="$gidtype";;
12277 gid_t) echo "gid_t found." ;;
12278 *) rp="What is the type for group ids returned by getgid()?"
12286 *_t) zzz="$gidtype" ;;
12289 echo "Checking the size of $zzz..." >&4
12291 #include <sys/types.h>
12294 printf("%d\n", (int)sizeof($gidtype));
12299 if eval $compile_ok; then
12303 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12306 echo "Your $zzz size is $gidsize bytes."
12311 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12317 *_t) zzz="$gidtype" ;;
12320 echo "Checking the sign of $zzz..." >&4
12322 #include <sys/types.h>
12333 if eval $compile; then
12337 echo "(I can't execute the test program--guessing unsigned.)" >&4
12341 1) echo "Your $zzz is unsigned." ;;
12342 -1) echo "Your $zzz is signed." ;;
12348 echo "(I can't compile the test program--guessing unsigned.)" >&4
12354 if $test X"$quadtype" != X; then
12356 echo "Checking how to print 64-bit integers..." >&4
12358 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12359 $cat >try.c <<'EOCP'
12360 #include <sys/types.h>
12363 int q = 12345678901;
12364 printf("%ld\n", q);
12368 if eval $compile; then
12369 yyy=`./try$exe_ext`
12372 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12373 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12374 echo "We will use %d."
12380 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12381 $cat >try.c <<'EOCP'
12382 #include <sys/types.h>
12385 long q = 12345678901;
12386 printf("%ld\n", q);
12390 if eval $compile; then
12391 yyy=`./try$exe_ext`
12394 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12395 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12396 echo "We will use %ld."
12402 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12403 $cat >try.c <<'EOCP'
12404 #include <sys/types.h>
12405 #include <inttypes.h>
12408 int64_t q = 12345678901;
12409 printf("%" PRId64 "\n", q);
12413 if eval $compile; then
12414 yyy=`./try$exe_ext`
12417 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12418 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12419 echo "We will use the C9X style."
12425 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12426 $cat >try.c <<'EOCP'
12427 #include <sys/types.h>
12430 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12431 printf("%lld\n", q);
12435 if eval $compile; then
12436 yyy=`./try$exe_ext`
12439 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12440 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12441 echo "We will use the %lld style."
12447 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12449 #include <sys/types.h>
12452 $quadtype q = 12345678901;
12453 printf("%Ld\n", q);
12457 if eval $compile; then
12458 yyy=`./try$exe_ext`
12461 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12462 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12463 echo "We will use %Ld."
12469 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12471 #include <sys/types.h>
12474 $quadtype q = 12345678901;
12475 printf("%qd\n", q);
12479 if eval $compile; then
12480 yyy=`./try$exe_ext`
12483 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12484 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12485 echo "We will use %qd."
12491 if $test X"$sPRId64" = X; then
12492 echo "Cannot figure out how to print 64-bit integers." >&4
12500 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12501 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12503 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12504 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12510 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12512 if $test X"$ivsize" = X8; then
12513 ivdformat="$sPRId64"
12514 uvuformat="$sPRIu64"
12515 uvoformat="$sPRIo64"
12516 uvxformat="$sPRIx64"
12518 if $test X"$ivsize" = X"$longsize"; then
12524 if $test X"$ivsize" = X"$intsize"; then
12531 if $test X"$ivsize" = X"$shortsize"; then
12541 case "$ivdformat" in
12542 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12549 $echo "Checking the format string to be used for gids..." >&4
12552 -1) if $test X"$gidsize" = X"$ivsize"; then
12553 gidformat="$ivdformat"
12555 if $test X"$gidsize" = X"$longsize"; then
12558 if $test X"$gidsize" = X"$intsize"; then
12561 if $test X"$gidsize" = X"$shortsize"; then
12568 *) if $test X"$gidsize" = X"$uvsize"; then
12569 gidformat="$uvuformat"
12571 if $test X"$gidsize" = X"$longsize"; then
12574 if $test X"$gidsize" = X"$intsize"; then
12577 if $test X"$gidsize" = X"$shortsize"; then
12586 : see if getgroups exists
12587 set getgroups d_getgrps
12590 : see if setgroups exists
12591 set setgroups d_setgrps
12595 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12597 case "$d_getgrps$d_setgrps" in
12599 case "$groupstype" in
12600 '') dflt="$gidtype" ;;
12601 *) dflt="$groupstype" ;;
12604 What type of pointer is the second argument to getgroups() and setgroups()?
12605 Usually this is the same as group ids, $gidtype, but not always.
12608 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12612 *) groupstype="$gidtype";;
12616 echo "Checking if your $make program sets \$(MAKE)..." >&4
12617 case "$make_set_make" in
12619 $sed 's/^X //' > testmake.mak << 'EOF'
12621 X @echo 'maketemp="$(MAKE)"'
12623 case "`$make -f testmake.mak 2>/dev/null`" in
12624 *maketemp=*) make_set_make='#' ;;
12625 *) make_set_make="MAKE=$make" ;;
12627 $rm -f testmake.mak
12630 case "$make_set_make" in
12631 '#') echo "Yup, it does.";;
12632 *) echo "Nope, it doesn't.";;
12635 : see what type is used for mode_t
12636 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12637 set mode_t modetype int stdio.h sys/types.h
12640 : define a fucntion to check prototypes
12641 $cat > protochk <<EOSH
12644 optimize="$optimize"
12646 prototype="$prototype"
12651 $cat >> protochk <<'EOSH'
12656 while test $# -ge 2; do
12658 $define) echo "#include <$2>" >> try.c ;;
12659 literal) echo "$2" >> try.c ;;
12663 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12664 cat >> try.c <<'EOCP'
12665 #ifdef CAN_PROTOTYPE
12666 #define _(args) args
12671 echo "$foo" >> try.c
12672 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12673 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12679 $eunicefix protochk
12681 : see what type is used for size_t
12682 rp="What is the type used for the length parameter for string functions?"
12683 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12686 : check for type of arguments to gethostbyaddr.
12687 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12688 case "$d_gethbyaddr" in
12692 Checking to see what type of arguments are accepted by gethostbyaddr().
12694 hdrs="$define sys/types.h
12695 $d_socket sys/socket.h
12696 $i_niin netinet/in.h
12698 $i_unistd unistd.h"
12699 : The first arg can 'char *' or 'void *'
12700 : The second arg is some of integral type
12701 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12702 for yyy in size_t long int; do
12703 case "$netdb_host_type" in
12704 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12705 if ./protochk "$try" $hdrs; then
12706 echo "Your system accepts $xxx for the first arg."
12707 echo "...and $yyy for the second arg."
12708 netdb_host_type="$xxx"
12709 netdb_hlen_type="$yyy"
12715 : In case none of those worked, prompt the user.
12716 case "$netdb_host_type" in
12717 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12720 netdb_host_type=$ans
12721 rp='What is the type for the 2nd argument to gethostbyaddr?'
12724 netdb_hlen_type=$ans
12728 *) : no gethostbyaddr, so pick harmless defaults
12729 netdb_host_type='char *'
12730 netdb_hlen_type="$sizetype"
12733 # Remove the "const" if needed. -- but then we'll have a
12735 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12738 : check for type of argument to gethostbyname.
12739 if test "X$netdb_name_type" = X ; then
12740 case "$d_gethbyname" in
12744 Checking to see what type of argument is accepted by gethostbyname().
12746 hdrs="$define sys/types.h
12747 $d_socket sys/socket.h
12748 $i_niin netinet/in.h
12750 $i_unistd unistd.h"
12751 for xxx in "const char *" "char *"; do
12752 case "$netdb_name_type" in
12753 '') try="extern struct hostent *gethostbyname($xxx);"
12754 if ./protochk "$try" $hdrs; then
12755 echo "Your system accepts $xxx."
12756 netdb_name_type="$xxx"
12761 : In case none of those worked, prompt the user.
12762 case "$netdb_name_type" in
12763 '') rp='What is the type for the 1st argument to gethostbyname?'
12766 netdb_name_type=$ans
12770 *) : no gethostbyname, so pick harmless default
12771 netdb_name_type='char *'
12776 : check for type of 1st argument to getnetbyaddr.
12777 if test "X$netdb_net_type" = X ; then
12778 case "$d_getnbyaddr" in
12782 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12784 hdrs="$define sys/types.h
12785 $d_socket sys/socket.h
12786 $i_niin netinet/in.h
12788 $i_unistd unistd.h"
12789 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12790 case "$netdb_net_type" in
12791 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12792 if ./protochk "$try" $hdrs; then
12793 echo "Your system accepts $xxx."
12794 netdb_net_type="$xxx"
12799 : In case none of those worked, prompt the user.
12800 case "$netdb_net_type" in
12801 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12804 netdb_net_type=$ans
12808 *) : no getnetbyaddr, so pick harmless default
12809 netdb_net_type='long'
12813 : locate the preferred pager for this system
12827 '') dflt=/usr/ucb/more;;
12834 rp='What pager is used on your system?'
12838 : see what type pids are declared as in the kernel
12839 rp="What is the type of process ids on this system?"
12840 set pid_t pidtype int stdio.h sys/types.h
12843 : check for length of pointer
12847 $echo $n "Checking to see how big your pointers are...$c" >&4
12848 if test "$voidflags" -gt 7; then
12849 echo '#define VOID_PTR char *' > try.c
12851 echo '#define VOID_PTR void *' > try.c
12853 $cat >>try.c <<'EOCP'
12857 printf("%d\n", (int)sizeof(VOID_PTR));
12862 if eval $compile_ok; then
12864 $echo " $ptrsize bytes." >&4
12867 echo "(I can't seem to compile the test program. Guessing...)" >&4
12868 rp="What is the size of a pointer (in bytes)?"
12876 : see if ar generates random libraries by itself
12878 echo "Checking how to generate random libraries on your machine..." >&4
12879 echo 'int bar1() { return bar2(); }' > bar1.c
12880 echo 'int bar2() { return 2; }' > bar2.c
12881 $cat > foo.c <<'EOP'
12882 int main() { printf("%d\n", bar1()); exit(0); }
12884 $cc $ccflags -c bar1.c >/dev/null 2>&1
12885 $cc $ccflags -c bar2.c >/dev/null 2>&1
12886 $cc $ccflags -c foo.c >/dev/null 2>&1
12887 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12888 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12889 ./foobar >/dev/null 2>&1; then
12890 echo "$ar appears to generate random libraries itself."
12893 elif $ar ts bar$_a >/dev/null 2>&1 &&
12894 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12895 ./foobar >/dev/null 2>&1; then
12896 echo "a table of contents needs to be added with '$ar ts'."
12903 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12904 $test -f $ranlib || ranlib=''
12907 if $test -n "$ranlib"; then
12908 echo "your system has '$ranlib'; we'll use that."
12911 echo "your system doesn't seem to support random libraries"
12912 echo "so we'll use lorder and tsort to order the libraries."
12919 : check for type of arguments to select.
12920 case "$selecttype" in
12921 '') case "$d_select" in
12925 Checking to see what type of arguments are accepted by select().
12927 hdrs="$define sys/types.h
12928 $i_systime sys/time.h
12929 $i_sysselct sys/select.h
12930 $d_socket sys/socket.h"
12931 : The first arg can be int, unsigned, or size_t
12932 : The last arg may or may not be 'const'
12934 : void pointer has been seen but using that
12935 : breaks the selectminbits test
12936 for xxx in 'fd_set *' 'int *'; do
12937 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12938 for tmo in 'struct timeval *' 'const struct timeval *'; do
12940 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12941 if ./protochk "$try" $hdrs; then
12942 echo "Your system accepts $xxx."
12951 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12952 case "$d_fd_set" in
12953 $define) dflt="fd_set *" ;;
12962 *) : no select, so pick a harmless default
12969 : check for the select 'width'
12970 case "$selectminbits" in
12971 '') case "$d_select" in
12975 Checking to see on how many bits at a time your select() operates...
12978 #include <sys/types.h>
12980 #$i_systime I_SYS_TIME
12981 #$i_systimek I_SYS_TIME_KERNEL
12986 # ifdef I_SYS_TIME_KERNEL
12989 # include <sys/time.h>
12990 # ifdef I_SYS_TIME_KERNEL
12994 #$i_sysselct I_SYS_SELECT
12995 #ifdef I_SYS_SELECT
12996 #include <sys/select.h>
12998 #$d_socket HAS_SOCKET
13000 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13004 #define S sizeof(*(b))
13006 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13007 #define NBITS (NBYTES * 8)
13016 fp = fopen("try.c", "r");
13022 b = ($selecttype)s;
13023 for (i = 0; i < NBITS; i++)
13027 select(fd + 1, b, 0, 0, &t);
13028 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13029 printf("%d\n", i + 1);
13034 if eval $compile_ok; then
13035 selectminbits=`./try`
13036 case "$selectminbits" in
13038 Cannot figure out on how many bits at a time your select() operates.
13039 I'll play safe and guess it is 32 bits.
13045 *) bits="$selectminbits bits" ;;
13047 echo "Your select() operates on $bits at a time." >&4
13049 rp='What is the minimum number of bits your select() operates on?'
13050 case "$byteorder" in
13051 1234|12345678) dflt=32 ;;
13056 selectminbits="$val"
13060 *) : no select, so pick a harmless default
13067 : Trace out the files included by signal.h, then look for SIGxxx names.
13068 : Remove SIGARRAYSIZE used by HPUX.
13069 : Remove SIGSTKSIZE used by Linux.
13070 : Remove SIGSTKSZ used by Posix.
13071 : Remove SIGTYP void lines used by OS2.
13072 : Some cpps, like os390, dont give the file name anywhere
13073 if [ "X$fieldn" = X ]; then
13074 : Just make some guesses. We check them later.
13075 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13077 xxx=`echo '#include <signal.h>' |
13078 $cppstdin $cppminus $cppflags 2>/dev/null |
13079 $grep '^[ ]*#.*include' |
13080 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13082 : Check this list of files to be sure we have parsed the cpp output ok.
13083 : This will also avoid potentially non-existent files, such
13086 for xx in $xxx /dev/null ; do
13087 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13089 : If we have found no files, at least try signal.h
13090 case "$xxxfiles" in
13091 '') xxxfiles=`./findhdr signal.h` ;;
13094 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13095 print substr($2, 4, 20)
13097 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13098 print substr($3, 4, 20)
13100 : Append some common names just in case the awk scan failed.
13101 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13102 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13103 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13104 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13105 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13107 : generate a few handy files for later
13108 $cat > signal.c <<'EOCP'
13109 #include <sys/types.h>
13110 #include <signal.h>
13114 /* Strange style to avoid deeply-nested #if/#else/#endif */
13117 # define NSIG (_NSIG)
13123 # define NSIG (SIGMAX+1)
13129 # define NSIG (SIG_MAX+1)
13135 # define NSIG (MAXSIG+1)
13141 # define NSIG (MAX_SIG+1)
13146 # ifdef SIGARRAYSIZE
13147 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13153 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13157 /* Default to some arbitrary number that's big enough to get most
13158 of the common signals.
13164 printf("NSIG %d\n", NSIG);
13170 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13172 printf "#ifdef SIG"; printf $1; printf "\n"
13173 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13174 printf $1; printf ");\n"
13178 printf "#endif /* JUST_NSIG */\n";
13179 printf "exit(0);\n}\n";
13182 $cat >signal.awk <<'EOP'
13183 BEGIN { ndups = 0 }
13184 $1 ~ /^NSIG$/ { nsig = $2 }
13185 ($1 !~ /^NSIG$/) && (NF == 2) {
13186 if ($2 > maxsig) { maxsig = $2 }
13187 if (sig_name[$2]) {
13188 dup_name[ndups] = $1
13189 dup_num[ndups] = $2
13201 printf("NSIG %d\n", nsig);
13202 for (n = 1; n < nsig; n++) {
13204 printf("%s %d\n", sig_name[n], sig_num[n])
13207 printf("NUM%d %d\n", n, n)
13210 for (n = 0; n < ndups; n++) {
13211 printf("%s %d\n", dup_name[n], dup_num[n])
13215 $cat >signal_cmd <<EOS
13217 if $test -s signal.lst; then
13218 echo "Using your existing signal.lst file"
13223 $cat >>signal_cmd <<'EOS'
13226 if eval $compile_ok; then
13227 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13229 echo "(I can't seem be able to compile the whole test program)" >&4
13230 echo "(I'll try it in little pieces.)" >&4
13231 set signal -DJUST_NSIG
13232 if eval $compile_ok; then
13233 ./signal$_exe > signal.nsg
13236 echo "I can't seem to figure out how many signals you have." >&4
13237 echo "Guessing 50." >&4
13238 echo 'NSIG 50' > signal.nsg
13240 : Now look at all the signal names, one at a time.
13241 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13242 $cat > signal.c <<EOCP
13243 #include <sys/types.h>
13244 #include <signal.h>
13247 printf("$xx %d\n", SIG${xx});
13252 if eval $compile; then
13253 echo "SIG${xx} found."
13254 ./signal$_exe >> signal.ls1
13256 echo "SIG${xx} NOT found."
13259 if $test -s signal.ls1; then
13260 $cat signal.nsg signal.ls1 |
13261 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13265 if $test -s signal.lst; then
13268 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13269 echo 'kill -l' >signal
13270 set X `csh -f <signal`
13274 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13276 echo $@ | $tr ' ' $trnl | \
13277 $awk '{ printf "%s %d\n", $1, ++s; }
13278 END { printf "NSIG %d\n", ++s }' >signal.lst
13280 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13282 chmod a+x signal_cmd
13283 $eunicefix signal_cmd
13285 : generate list of signal names
13287 case "$sig_name_init" in
13289 *) case "$sig_num_init" in
13290 ''|*,*) doinit=yes ;;
13295 echo "Generating a list of signal names and numbers..." >&4
13297 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13298 sig_name=`$awk 'BEGIN { printf "ZERO " }
13299 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13300 sig_num=`$awk 'BEGIN { printf "0 " }
13301 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13302 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13303 !/^NSIG/ { printf "\"%s\", ", $1 }
13304 END { printf "0\n" }' signal.lst`
13305 sig_num_init=`$awk 'BEGIN { printf "0, " }
13306 !/^NSIG/ { printf "%d, ", $2}
13307 END { printf "0\n"}' signal.lst`
13310 echo "The following $sig_count signals are available:"
13312 echo $sig_name | $awk \
13313 'BEGIN { linelen = 0 }
13315 for (i = 1; i <= NF; i++) {
13316 name = "SIG" $i " "
13317 linelen = linelen + length(name)
13318 if (linelen > 70) {
13320 linelen = length(name)
13326 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13328 : see what type is used for signed size_t
13329 set ssize_t ssizetype int stdio.h sys/types.h
13332 $cat > ssize.c <<EOM
13334 #include <sys/types.h>
13335 #define Size_t $sizetype
13336 #define SSize_t $dflt
13339 if (sizeof(Size_t) == sizeof(SSize_t))
13341 else if (sizeof(Size_t) == sizeof(int))
13350 if eval $compile_ok && ./ssize > /dev/null; then
13351 ssizetype=`./ssize`
13352 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13355 Help! I can't compile and run the ssize_t test program: please enlighten me!
13356 (This is probably a misconfiguration in your system or libraries, and
13357 you really ought to fix it. Still, I'll try anyway.)
13359 I need a type that is the same size as $sizetype, but is guaranteed to
13360 be signed. Common values are ssize_t, int and long.
13363 rp="What signed type is the same size as $sizetype?"
13367 $rm -f ssize ssize.*
13369 : see what type of char stdio uses.
13371 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13372 echo "Your stdio uses unsigned chars." >&4
13373 stdchar="unsigned char"
13375 echo "Your stdio uses signed chars." >&4
13379 : see if time exists
13381 if test "X$d_time" = X -o X"$timetype" = X; then
13382 if set time val -f d_time; eval $csym; $val; then
13383 echo 'time() found.' >&4
13385 rp="What is the type returned by time() on this system?"
13386 set time_t timetype long stdio.h sys/types.h
13389 echo 'time() not found, hope that will do.' >&4
13397 : see what type uids are declared as in the kernel
13399 echo "Looking for the type for user ids returned by getuid()."
13400 set uid_t uidtype xxx stdio.h sys/types.h
13404 xxx=`./findhdr sys/user.h`
13405 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13407 unsigned) dflt="$1 $2" ;;
13411 *) dflt="$uidtype";;
13414 uid_t) echo "uid_t found." ;;
13415 *) rp="What is the type for user ids returned by getuid()?"
13423 *_t) zzz="$uidtype" ;;
13426 echo "Checking the size of $zzz..." >&4
13428 #include <sys/types.h>
13431 printf("%d\n", (int)sizeof($uidtype));
13436 if eval $compile_ok; then
13440 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13443 echo "Your $zzz size is $uidsize bytes."
13448 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13453 *_t) zzz="$uidtype" ;;
13456 echo "Checking the sign of $zzz..." >&4
13458 #include <sys/types.h>
13469 if eval $compile; then
13473 echo "(I can't execute the test program--guessing unsigned.)" >&4
13477 1) echo "Your $zzz is unsigned." ;;
13478 -1) echo "Your $zzz is signed." ;;
13484 echo "(I can't compile the test program--guessing unsigned.)" >&4
13490 $echo "Checking the format string to be used for uids..." >&4
13493 -1) if $test X"$uidsize" = X"$ivsize"; then
13494 uidformat="$ivdformat"
13496 if $test X"$uidsize" = X"$longsize"; then
13499 if $test X"$uidsize" = X"$intsize"; then
13502 if $test X"$uidsize" = X"$shortsize"; then
13509 *) if $test X"$uidsize" = X"$uvsize"; then
13510 uidformat="$uvuformat"
13512 if $test X"$uidsize" = X"$longsize"; then
13515 if $test X"$uidsize" = X"$intsize"; then
13518 if $test X"$uidsize" = X"$shortsize"; then
13527 : see if dbm.h is available
13528 : see if dbmclose exists
13529 set dbmclose d_dbmclose
13532 case "$d_dbmclose" in
13542 *) set rpcsvc/dbm.h i_rpcsvcdbm
13547 *) echo "We won't be including <dbm.h>"
13557 : see if this is a sys/file.h system
13562 : do we need to include sys/file.h ?
13566 if $h_sysfile; then
13568 echo "We'll be including <sys/file.h>." >&4
13571 echo "We won't be including <sys/file.h>." >&4
13581 : see if fcntl.h is there
13586 : see if we can include fcntl.h
13592 echo "We'll be including <fcntl.h>." >&4
13595 if $h_sysfile; then
13596 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13598 echo "We won't be including <fcntl.h>." >&4
13610 : see if locale.h is available
13611 set locale.h i_locale
13614 : see if mach cthreads are available
13615 if test "X$usethreads" = "X$define"; then
13616 set mach/cthreads.h i_machcthr
13619 i_machcthr="$undef"
13624 : see if this is a math.h system
13628 : see if this is a mntent.h system
13629 set mntent.h i_mntent
13632 : see if ndbm.h is available
13637 : see if dbm_open exists
13638 set dbm_open d_dbm_open
13640 case "$d_dbm_open" in
13643 echo "We won't be including <ndbm.h>"
13652 : see if net/errno.h is available
13654 set net/errno.h val
13657 : Unfortunately, it causes problems on some systems. Arrgh.
13660 cat > try.c <<'EOM'
13663 #include <net/errno.h>
13669 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13670 echo "We'll be including <net/errno.h>." >&4
13672 echo "We won't be including <net/errno.h>." >&4
13681 : see if netinet/tcp.h is available
13682 set netinet/tcp.h i_netinettcp
13685 : see if this is a poll.h system
13689 : get C preprocessor symbols handy
13691 $echo $n "Hmm... $c"
13692 echo $al | $tr ' ' $trnl >Cppsym.know
13693 $cat <<EOSS >Cppsym
13701 case "\$list\$#" in
13704 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13706 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13709 unknown="\$unknown \$sym"
13719 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13721 exit 0; _ _ _ _\1\\ \1\\
13724 echo "exit 1; _ _ _" >>Cppsym\$\$
13725 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13727 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13733 $rm -f Cppsym\$\$ Cppsym2\$\$
13738 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13740 : now check the C compiler for additional symbols
13741 postprocess_cc_v=''
13743 aix) postprocess_cc_v="|$tr , ' '" ;;
13750 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13753 -D*) echo "\$i" | $sed 's/^-D//';;
13754 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13759 postprocess_cc_v=''
13762 ./ccsym > ccsym1.raw
13763 if $test -s ccsym1.raw; then
13764 $sort ccsym1.raw | $uniq >ccsym.raw
13766 mv ccsym1.raw ccsym.raw
13769 $awk '/\=/ { print $0; next }
13770 { print $0"=1" }' ccsym.raw >ccsym.list
13771 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13772 $comm -13 ccsym.true ccsym.list >ccsym.own
13773 $comm -12 ccsym.true ccsym.list >ccsym.com
13774 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13776 if $test -z ccsym.raw; then
13777 echo "Your C compiler doesn't seem to define any symbols!" >&4
13779 echo "However, your C preprocessor defines the following symbols:"
13782 cppsymbols=`$cat Cppsym.true`
13783 cppsymbols=`echo $cppsymbols`
13784 cppccsymbols="$cppsymbols"
13786 if $test -s ccsym.com; then
13787 echo "Your C compiler and pre-processor define these symbols:"
13788 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13791 cppccsymbols=`$cat ccsym.com`
13792 cppccsymbols=`echo $cppccsymbols`
13793 $test "$silent" || sleep 1
13795 if $test -s ccsym.cpp; then
13796 $test "$also" && echo " "
13797 echo "Your C pre-processor ${also}defines the following symbols:"
13798 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13800 cppsymbols=`$cat ccsym.cpp`
13801 cppsymbols=`echo $cppsymbols`
13802 $test "$silent" || sleep 1
13804 if $test -s ccsym.own; then
13805 $test "$also" && echo " "
13806 echo "Your C compiler ${also}defines the following cpp symbols:"
13807 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13808 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13809 ccsymbols=`$cat ccsym.own`
13810 ccsymbols=`echo $ccsymbols`
13811 $test "$silent" || sleep 1
13816 : see if this is a termio system
13820 if $test `./findhdr termios.h`; then
13821 set tcsetattr i_termios
13827 "$define") echo "You have POSIX termios.h... good!" >&4;;
13828 *) if ./Cppsym pyr; then
13829 case "`/bin/universe`" in
13830 ucb) if $test `./findhdr sgtty.h`; then
13832 echo "<sgtty.h> found." >&4
13834 echo "System is pyramid with BSD universe."
13835 echo "<sgtty.h> not found--you could have problems." >&4
13837 *) if $test `./findhdr termio.h`; then
13839 echo "<termio.h> found." >&4
13841 echo "System is pyramid with USG universe."
13842 echo "<termio.h> not found--you could have problems." >&4
13846 if $test `./findhdr termio.h`; then
13847 echo "<termio.h> found." >&4
13849 elif $test `./findhdr sgtty.h`; then
13850 echo "<sgtty.h> found." >&4
13853 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13856 if $test `./findhdr sgtty.h`; then
13857 echo "<sgtty.h> found." >&4
13859 elif $test `./findhdr termio.h`; then
13860 echo "<termio.h> found." >&4
13863 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13867 set i_termio; eval $setvar
13868 val=$val2; set i_sgtty; eval $setvar
13869 val=$val3; set i_termios; eval $setvar
13871 : see if this is a shadow.h system
13872 set shadow.h i_shadow
13875 : see if this is a socks.h system
13876 set socks.h i_socks
13879 : see if stdarg is available
13881 if $test `./findhdr stdarg.h`; then
13882 echo "<stdarg.h> found." >&4
13885 echo "<stdarg.h> NOT found." >&4
13889 : see if varags is available
13891 if $test `./findhdr varargs.h`; then
13892 echo "<varargs.h> found." >&4
13894 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13897 : set up the varargs testing programs
13898 $cat > varargs.c <<EOP
13900 #include <stdarg.h>
13903 #include <varargs.h>
13907 int f(char *p, ...)
13921 p = va_arg(ap, char *);
13926 $cat > varargs <<EOP
13928 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13937 : now check which varargs header should be included
13942 if `./varargs I_STDARG`; then
13944 elif `./varargs I_VARARGS`; then
13949 if `./varargs I_VARARGS`; then
13956 echo "I could not find the definition for va_dcl... You have problems..." >&4
13957 val="$undef"; set i_stdarg; eval $setvar
13958 val="$undef"; set i_varargs; eval $setvar
13963 case "$i_varhdr" in
13965 val="$define"; set i_stdarg; eval $setvar
13966 val="$undef"; set i_varargs; eval $setvar
13969 val="$undef"; set i_stdarg; eval $setvar
13970 val="$define"; set i_varargs; eval $setvar
13973 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13977 : see if stddef is available
13978 set stddef.h i_stddef
13981 : see if sys/access.h is available
13982 set sys/access.h i_sysaccess
13985 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13986 set sys/filio.h i_sysfilio
13989 if $test `./findhdr sys/ioctl.h`; then
13991 echo '<sys/ioctl.h> found.' >&4
13994 if $test $i_sysfilio = "$define"; then
13995 echo '<sys/ioctl.h> NOT found.' >&4
13997 $test $i_sgtty = "$define" && xxx="sgtty.h"
13998 $test $i_termio = "$define" && xxx="termio.h"
13999 $test $i_termios = "$define" && xxx="termios.h"
14000 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14006 : see if sys/resource.h has to be included
14007 set sys/resource.h i_sysresrc
14010 : see if sys/security.h is available
14011 set sys/security.h i_syssecrt
14014 : see if this is a sys/statvfs.h system
14015 set sys/statvfs.h i_sysstatvfs
14018 : see if this is a sys/uio.h system
14019 set sys/uio.h i_sysuio
14022 : see if this is a sys/un.h system
14023 set sys/un.h i_sysun
14026 : see if this is a syswait system
14027 set sys/wait.h i_syswait
14030 : see if this is a ustat.h system
14031 set ustat.h i_ustat
14034 : see if this is an utime system
14035 set utime.h i_utime
14038 : see if this is a values.h system
14039 set values.h i_values
14042 : see if this is a vfork system
14045 set vfork.h i_vfork
14053 : see if gdbm.h is available
14058 : see if gdbm_open exists
14059 set gdbm_open d_gdbm_open
14061 case "$d_gdbm_open" in
14064 echo "We won't be including <gdbm.h>"
14074 echo "Looking for extensions..." >&4
14075 : If we are using the old config.sh, known_extensions may contain
14076 : old or inaccurate or duplicate values.
14077 known_extensions=''
14078 nonxs_extensions=''
14079 : We do not use find because it might not be available.
14080 : We do not just use MANIFEST because the user may have dropped
14081 : some additional extensions into the source tree and expect them
14084 : Function to recursively find available extensions, ignoring DynaLoader
14085 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14089 DynaLoader|dynaload) ;;
14091 if $test -f $xxx/$xxx.xs; then
14092 known_extensions="$known_extensions $1$xxx";
14093 elif $test -f $xxx/Makefile.PL; then
14094 nonxs_extensions="$nonxs_extensions $1$xxx";
14096 if $test -d $xxx -a $# -lt 10; then
14099 eval $find_extensions;
14111 eval $find_extensions
14112 set X $nonxs_extensions
14114 nonxs_extensions="$*"
14115 set X $known_extensions
14117 known_extensions="$*"
14120 : Now see which are supported on this system.
14122 for xxx in $known_extensions ; do
14126 $define) avail_ext="$avail_ext $xxx" ;;
14129 GDBM_File|gdbm_fil)
14131 $define) avail_ext="$avail_ext $xxx" ;;
14134 NDBM_File|ndbm_fil)
14136 $define) avail_ext="$avail_ext $xxx" ;;
14139 ODBM_File|odbm_fil)
14140 case "${i_dbm}${i_rpcsvcdbm}" in
14141 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14145 case "$useposix" in
14146 true|define|y) avail_ext="$avail_ext $xxx" ;;
14150 case "$useopcode" in
14151 true|define|y) avail_ext="$avail_ext $xxx" ;;
14155 case "$d_socket" in
14156 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14160 case "$usethreads" in
14161 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14165 : XXX Do we need a useipcsysv variable here
14166 case "${d_msg}${d_sem}${d_shm}" in
14167 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14170 *) avail_ext="$avail_ext $xxx"
14179 : Now see which nonxs extensions are supported on this system.
14180 : For now assume all are.
14182 for xxx in $nonxs_extensions ; do
14184 *) nonxs_ext="$nonxs_ext $xxx"
14196 A number of extensions are supplied with $package. You may choose to
14197 compile these extensions for dynamic loading (the default), compile
14198 them into the $package executable (static loading), or not include
14199 them at all. Answer "none" to include no extensions.
14200 Note that DynaLoader is always built and need not be mentioned here.
14203 case "$dynamic_ext" in
14204 '') dflt="$avail_ext" ;;
14205 *) dflt="$dynamic_ext"
14206 # Perhaps we are reusing an old out-of-date config.sh.
14209 if test X"$dynamic_ext" != X"$avail_ext"; then
14211 NOTICE: Your previous config.sh list may be incorrect.
14212 The extensions now available to you are
14214 but the default list from your previous config.sh is
14226 rp="What extensions do you wish to load dynamically?"
14229 none) dynamic_ext=' ' ;;
14230 *) dynamic_ext="$ans" ;;
14233 case "$static_ext" in
14235 : Exclude those already listed in dynamic linking
14237 for xxx in $avail_ext; do
14238 case " $dynamic_ext " in
14240 *) dflt="$dflt $xxx" ;;
14247 *) dflt="$static_ext"
14254 rp="What extensions do you wish to load statically?"
14257 none) static_ext=' ' ;;
14258 *) static_ext="$ans" ;;
14263 A number of extensions are supplied with $package. Answer "none"
14264 to include no extensions.
14265 Note that DynaLoader is always built and need not be mentioned here.
14268 case "$static_ext" in
14269 '') dflt="$avail_ext" ;;
14270 *) dflt="$static_ext"
14271 # Perhaps we are reusing an old out-of-date config.sh.
14274 if test X"$static_ext" != X"$avail_ext"; then
14276 NOTICE: Your previous config.sh list may be incorrect.
14277 The extensions now available to you are
14279 but the default list from your previous config.sh is
14288 : Exclude those that are not xs extensions
14292 rp="What extensions do you wish to include?"
14295 none) static_ext=' ' ;;
14296 *) static_ext="$ans" ;;
14301 set X $dynamic_ext $static_ext $nonxs_ext
14305 : Remove build directory name from cppstdin so it can be used from
14306 : either the present location or the final installed location.
14308 : Get out of the UU directory to get correct path name.
14310 case "$cppstdin" in
14312 echo "Stripping down cppstdin path name"
14318 : end of configuration questions
14320 echo "End of configuration questions."
14323 : back to where it started
14324 if test -d ../UU; then
14328 : configuration may be patched via a 'config.over' file
14329 if $test -f config.over; then
14332 rp='I see a config.over file. Do you wish to load it?'
14335 n*) echo "OK, I'll ignore it.";;
14337 echo "Configuration override changes have been loaded."
14342 : in case they want portability, strip down executable paths
14343 case "$d_portable" in
14346 echo "Stripping down executable paths..." >&4
14347 for file in $loclist $trylist; do
14349 eval $file=`basename $temp`
14354 : create config.sh file
14356 echo "Creating config.sh..." >&4
14357 $spitshell <<EOT >config.sh
14360 # This file was produced by running the Configure script. It holds all the
14361 # definitions figured out by Configure. Should you modify one of these values,
14362 # do not forget to propagate your changes by running "Configure -der". You may
14363 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14366 # Package name : $package
14367 # Source directory : $src
14368 # Configuration time: $cf_time
14369 # Configured by : $cf_by
14370 # Target system : $myuname
14380 Revision='$Revision'
14387 alignbytes='$alignbytes'
14388 ansi2knr='$ansi2knr'
14389 aphostname='$aphostname'
14390 api_revision='$api_revision'
14391 api_subversion='$api_subversion'
14392 api_version='$api_version'
14393 api_versionstring='$api_versionstring'
14396 archlibexp='$archlibexp'
14397 archname64='$archname64'
14398 archname='$archname'
14399 archobjs='$archobjs'
14404 bincompat5005='$bincompat5005'
14408 byteorder='$byteorder'
14410 castflags='$castflags'
14413 cccdlflags='$cccdlflags'
14414 ccdlflags='$ccdlflags'
14416 ccsymbols='$ccsymbols'
14418 cf_email='$cf_email'
14420 charsize='$charsize'
14424 clocktype='$clocktype'
14426 compress='$compress'
14427 contains='$contains'
14431 cpp_stuff='$cpp_stuff'
14432 cppccsymbols='$cppccsymbols'
14433 cppflags='$cppflags'
14435 cppminus='$cppminus'
14437 cppstdin='$cppstdin'
14438 cppsymbols='$cppsymbols'
14439 crosscompile='$crosscompile'
14440 cryptlib='$cryptlib'
14442 d_Gconvert='$d_Gconvert'
14443 d_PRIEldbl='$d_PRIEldbl'
14444 d_PRIFldbl='$d_PRIFldbl'
14445 d_PRIGldbl='$d_PRIGldbl'
14446 d_PRIX64='$d_PRIX64'
14447 d_PRId64='$d_PRId64'
14448 d_PRIeldbl='$d_PRIeldbl'
14449 d_PRIfldbl='$d_PRIfldbl'
14450 d_PRIgldbl='$d_PRIgldbl'
14451 d_PRIi64='$d_PRIi64'
14452 d_PRIo64='$d_PRIo64'
14453 d_PRIu64='$d_PRIu64'
14454 d_PRIx64='$d_PRIx64'
14455 d_access='$d_access'
14456 d_accessx='$d_accessx'
14458 d_archlib='$d_archlib'
14461 d_attribut='$d_attribut'
14464 d_bincompat5005='$d_bincompat5005'
14466 d_bsdgetpgrp='$d_bsdgetpgrp'
14467 d_bsdsetpgrp='$d_bsdsetpgrp'
14469 d_casti32='$d_casti32'
14470 d_castneg='$d_castneg'
14471 d_charvspr='$d_charvspr'
14473 d_chroot='$d_chroot'
14474 d_chsize='$d_chsize'
14475 d_closedir='$d_closedir'
14479 d_cuserid='$d_cuserid'
14480 d_dbl_dig='$d_dbl_dig'
14481 d_difftime='$d_difftime'
14482 d_dirnamlen='$d_dirnamlen'
14483 d_dlerror='$d_dlerror'
14484 d_dlopen='$d_dlopen'
14485 d_dlsymun='$d_dlsymun'
14486 d_dosuid='$d_dosuid'
14487 d_drand48proto='$d_drand48proto'
14489 d_eaccess='$d_eaccess'
14490 d_endgrent='$d_endgrent'
14491 d_endhent='$d_endhent'
14492 d_endnent='$d_endnent'
14493 d_endpent='$d_endpent'
14494 d_endpwent='$d_endpwent'
14495 d_endsent='$d_endsent'
14496 d_endspent='$d_endspent'
14497 d_eofnblk='$d_eofnblk'
14498 d_eunice='$d_eunice'
14499 d_fchmod='$d_fchmod'
14500 d_fchown='$d_fchown'
14502 d_fd_macros='$d_fd_macros'
14503 d_fd_set='$d_fd_set'
14504 d_fds_bits='$d_fds_bits'
14505 d_fgetpos='$d_fgetpos'
14506 d_flexfnam='$d_flexfnam'
14509 d_fpathconf='$d_fpathconf'
14510 d_fpos64_t='$d_fpos64_t'
14511 d_fs_data_s='$d_fs_data_s'
14512 d_fseeko='$d_fseeko'
14513 d_fsetpos='$d_fsetpos'
14514 d_fstatfs='$d_fstatfs'
14515 d_fstatvfs='$d_fstatvfs'
14516 d_ftello='$d_ftello'
14518 d_getgrent='$d_getgrent'
14519 d_getgrps='$d_getgrps'
14520 d_gethbyaddr='$d_gethbyaddr'
14521 d_gethbyname='$d_gethbyname'
14522 d_gethent='$d_gethent'
14523 d_gethname='$d_gethname'
14524 d_gethostprotos='$d_gethostprotos'
14525 d_getlogin='$d_getlogin'
14526 d_getmnt='$d_getmnt'
14527 d_getmntent='$d_getmntent'
14528 d_getnbyaddr='$d_getnbyaddr'
14529 d_getnbyname='$d_getnbyname'
14530 d_getnent='$d_getnent'
14531 d_getnetprotos='$d_getnetprotos'
14532 d_getpbyname='$d_getpbyname'
14533 d_getpbynumber='$d_getpbynumber'
14534 d_getpent='$d_getpent'
14535 d_getpgid='$d_getpgid'
14536 d_getpgrp2='$d_getpgrp2'
14537 d_getpgrp='$d_getpgrp'
14538 d_getppid='$d_getppid'
14539 d_getprior='$d_getprior'
14540 d_getprotoprotos='$d_getprotoprotos'
14541 d_getpwent='$d_getpwent'
14542 d_getsbyname='$d_getsbyname'
14543 d_getsbyport='$d_getsbyport'
14544 d_getsent='$d_getsent'
14545 d_getservprotos='$d_getservprotos'
14546 d_getspent='$d_getspent'
14547 d_getspnam='$d_getspnam'
14548 d_gettimeod='$d_gettimeod'
14549 d_gnulibc='$d_gnulibc'
14550 d_grpasswd='$d_grpasswd'
14551 d_hasmntopt='$d_hasmntopt'
14554 d_inetaton='$d_inetaton'
14555 d_int64t='$d_int64t'
14556 d_isascii='$d_isascii'
14557 d_killpg='$d_killpg'
14558 d_lchown='$d_lchown'
14559 d_ldbl_dig='$d_ldbl_dig'
14561 d_locconv='$d_locconv'
14563 d_longdbl='$d_longdbl'
14564 d_longlong='$d_longlong'
14567 d_mbstowcs='$d_mbstowcs'
14568 d_mbtowc='$d_mbtowc'
14569 d_memchr='$d_memchr'
14570 d_memcmp='$d_memcmp'
14571 d_memcpy='$d_memcpy'
14572 d_memmove='$d_memmove'
14573 d_memset='$d_memset'
14575 d_mkfifo='$d_mkfifo'
14576 d_mktime='$d_mktime'
14578 d_msg_ctrunc='$d_msg_ctrunc'
14579 d_msg_dontroute='$d_msg_dontroute'
14580 d_msg_oob='$d_msg_oob'
14581 d_msg_peek='$d_msg_peek'
14582 d_msg_proxy='$d_msg_proxy'
14583 d_msgctl='$d_msgctl'
14584 d_msgget='$d_msgget'
14585 d_msgrcv='$d_msgrcv'
14586 d_msgsnd='$d_msgsnd'
14587 d_mymalloc='$d_mymalloc'
14589 d_nvpresuv='$d_nvpresuv'
14590 d_off64_t='$d_off64_t'
14591 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14592 d_oldpthreads='$d_oldpthreads'
14593 d_oldsock='$d_oldsock'
14595 d_pathconf='$d_pathconf'
14597 d_phostname='$d_phostname'
14600 d_portable='$d_portable'
14601 d_pthread_yield='$d_pthread_yield'
14603 d_pwchange='$d_pwchange'
14604 d_pwclass='$d_pwclass'
14605 d_pwcomment='$d_pwcomment'
14606 d_pwexpire='$d_pwexpire'
14607 d_pwgecos='$d_pwgecos'
14608 d_pwpasswd='$d_pwpasswd'
14609 d_pwquota='$d_pwquota'
14611 d_readdir='$d_readdir'
14612 d_readlink='$d_readlink'
14613 d_rename='$d_rename'
14614 d_rewinddir='$d_rewinddir'
14616 d_safebcpy='$d_safebcpy'
14617 d_safemcpy='$d_safemcpy'
14618 d_sanemcmp='$d_sanemcmp'
14619 d_sched_yield='$d_sched_yield'
14620 d_scm_rights='$d_scm_rights'
14621 d_seekdir='$d_seekdir'
14622 d_select='$d_select'
14624 d_semctl='$d_semctl'
14625 d_semctl_semid_ds='$d_semctl_semid_ds'
14626 d_semctl_semun='$d_semctl_semun'
14627 d_semget='$d_semget'
14629 d_setegid='$d_setegid'
14630 d_seteuid='$d_seteuid'
14631 d_setgrent='$d_setgrent'
14632 d_setgrps='$d_setgrps'
14633 d_sethent='$d_sethent'
14634 d_setlinebuf='$d_setlinebuf'
14635 d_setlocale='$d_setlocale'
14636 d_setnent='$d_setnent'
14637 d_setpent='$d_setpent'
14638 d_setpgid='$d_setpgid'
14639 d_setpgrp2='$d_setpgrp2'
14640 d_setpgrp='$d_setpgrp'
14641 d_setprior='$d_setprior'
14642 d_setpwent='$d_setpwent'
14643 d_setregid='$d_setregid'
14644 d_setresgid='$d_setresgid'
14645 d_setresuid='$d_setresuid'
14646 d_setreuid='$d_setreuid'
14647 d_setrgid='$d_setrgid'
14648 d_setruid='$d_setruid'
14649 d_setsent='$d_setsent'
14650 d_setsid='$d_setsid'
14651 d_setspent='$d_setspent'
14652 d_setvbuf='$d_setvbuf'
14656 d_shmatprototype='$d_shmatprototype'
14657 d_shmctl='$d_shmctl'
14659 d_shmget='$d_shmget'
14660 d_sigaction='$d_sigaction'
14661 d_sigsetjmp='$d_sigsetjmp'
14662 d_socket='$d_socket'
14663 d_sockpair='$d_sockpair'
14665 d_statblks='$d_statblks'
14666 d_statfs_f_flags='$d_statfs_f_flags'
14667 d_statfs_s='$d_statfs_s'
14668 d_statvfs='$d_statvfs'
14669 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14670 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14671 d_stdio_stream_array='$d_stdio_stream_array'
14672 d_stdiobase='$d_stdiobase'
14673 d_stdstdio='$d_stdstdio'
14674 d_strchr='$d_strchr'
14675 d_strcoll='$d_strcoll'
14676 d_strctcpy='$d_strctcpy'
14677 d_strerrm='$d_strerrm'
14678 d_strerror='$d_strerror'
14679 d_strtod='$d_strtod'
14680 d_strtol='$d_strtol'
14681 d_strtold='$d_strtold'
14682 d_strtoll='$d_strtoll'
14683 d_strtoul='$d_strtoul'
14684 d_strtoull='$d_strtoull'
14685 d_strtouq='$d_strtouq'
14686 d_strxfrm='$d_strxfrm'
14687 d_suidsafe='$d_suidsafe'
14688 d_symlink='$d_symlink'
14689 d_syscall='$d_syscall'
14690 d_sysconf='$d_sysconf'
14691 d_sysernlst='$d_sysernlst'
14692 d_syserrlst='$d_syserrlst'
14693 d_system='$d_system'
14694 d_tcgetpgrp='$d_tcgetpgrp'
14695 d_tcsetpgrp='$d_tcsetpgrp'
14696 d_telldir='$d_telldir'
14697 d_telldirproto='$d_telldirproto'
14700 d_truncate='$d_truncate'
14701 d_tzname='$d_tzname'
14704 d_union_semun='$d_union_semun'
14706 d_vendorbin='$d_vendorbin'
14707 d_vendorlib='$d_vendorlib'
14709 d_void_closedir='$d_void_closedir'
14710 d_voidsig='$d_voidsig'
14711 d_voidtty='$d_voidtty'
14712 d_volatile='$d_volatile'
14713 d_vprintf='$d_vprintf'
14715 d_waitpid='$d_waitpid'
14716 d_wcstombs='$d_wcstombs'
14717 d_wctomb='$d_wctomb'
14720 db_hashtype='$db_hashtype'
14721 db_prefixtype='$db_prefixtype'
14722 defvoidused='$defvoidused'
14723 direntrytype='$direntrytype'
14726 doublesize='$doublesize'
14728 dynamic_ext='$dynamic_ext'
14734 eunicefix='$eunicefix'
14737 extensions='$extensions'
14738 fflushNULL='$fflushNULL'
14739 fflushall='$fflushall'
14741 firstmakefile='$firstmakefile'
14743 fpossize='$fpossize'
14744 fpostype='$fpostype'
14745 freetype='$freetype'
14747 full_csh='$full_csh'
14748 full_sed='$full_sed'
14749 gccversion='$gccversion'
14750 gidformat='$gidformat'
14756 groupcat='$groupcat'
14757 groupstype='$groupstype'
14760 h_sysfile='$h_sysfile'
14772 i_arpainet='$i_arpainet'
14773 i_bsdioctl='$i_bsdioctl'
14776 i_dirent='$i_dirent'
14783 i_inttypes='$i_inttypes'
14784 i_limits='$i_limits'
14785 i_locale='$i_locale'
14786 i_machcthr='$i_machcthr'
14787 i_malloc='$i_malloc'
14789 i_memory='$i_memory'
14790 i_mntent='$i_mntent'
14793 i_neterrno='$i_neterrno'
14794 i_netinettcp='$i_netinettcp'
14797 i_pthread='$i_pthread'
14799 i_rpcsvcdbm='$i_rpcsvcdbm'
14802 i_shadow='$i_shadow'
14804 i_stdarg='$i_stdarg'
14805 i_stddef='$i_stddef'
14806 i_stdlib='$i_stdlib'
14807 i_string='$i_string'
14808 i_sysaccess='$i_sysaccess'
14809 i_sysdir='$i_sysdir'
14810 i_sysfile='$i_sysfile'
14811 i_sysfilio='$i_sysfilio'
14813 i_sysioctl='$i_sysioctl'
14814 i_sysmount='$i_sysmount'
14815 i_sysndir='$i_sysndir'
14816 i_sysparam='$i_sysparam'
14817 i_sysresrc='$i_sysresrc'
14818 i_syssecrt='$i_syssecrt'
14819 i_sysselct='$i_sysselct'
14820 i_syssockio='$i_syssockio'
14821 i_sysstat='$i_sysstat'
14822 i_sysstatfs='$i_sysstatfs'
14823 i_sysstatvfs='$i_sysstatvfs'
14824 i_systime='$i_systime'
14825 i_systimek='$i_systimek'
14826 i_systimes='$i_systimes'
14827 i_systypes='$i_systypes'
14828 i_sysuio='$i_sysuio'
14830 i_sysvfs='$i_sysvfs'
14831 i_syswait='$i_syswait'
14832 i_termio='$i_termio'
14833 i_termios='$i_termios'
14835 i_unistd='$i_unistd'
14838 i_values='$i_values'
14839 i_varargs='$i_varargs'
14840 i_varhdr='$i_varhdr'
14842 ignore_versioned_solibs='$ignore_versioned_solibs'
14843 inc_version_list='$inc_version_list'
14846 installarchlib='$installarchlib'
14847 installbin='$installbin'
14848 installman1dir='$installman1dir'
14849 installman3dir='$installman3dir'
14850 installprefix='$installprefix'
14851 installprefixexp='$installprefixexp'
14852 installprivlib='$installprivlib'
14853 installscript='$installscript'
14854 installsitearch='$installsitearch'
14855 installsitebin='$installsitebin'
14856 installsitelib='$installsitelib'
14857 installstyle='$installstyle'
14858 installusrbinperl='$installusrbinperl'
14859 installvendorbin='$installvendorbin'
14860 installvendorlib='$installvendorlib'
14862 ivdformat='$ivdformat'
14865 known_extensions='$known_extensions'
14869 lddlflags='$lddlflags'
14871 ldlibpthname='$ldlibpthname'
14878 libswanted='$libswanted'
14884 locincpth='$locincpth'
14885 loclibpth='$loclibpth'
14886 longdblsize='$longdblsize'
14887 longlongsize='$longlongsize'
14888 longsize='$longsize'
14892 lseeksize='$lseeksize'
14893 lseektype='$lseektype'
14897 make_set_make='$make_set_make'
14898 mallocobj='$mallocobj'
14899 mallocsrc='$mallocsrc'
14900 malloctype='$malloctype'
14902 man1direxp='$man1direxp'
14905 man3direxp='$man3direxp'
14908 mips_type='$mips_type'
14911 modetype='$modetype'
14913 multiarch='$multiarch'
14915 myarchname='$myarchname'
14916 mydomain='$mydomain'
14917 myhostname='$myhostname'
14920 netdb_hlen_type='$netdb_hlen_type'
14921 netdb_host_type='$netdb_host_type'
14922 netdb_name_type='$netdb_name_type'
14923 netdb_net_type='$netdb_net_type'
14926 nm_so_opt='$nm_so_opt'
14927 nonxs_ext='$nonxs_ext'
14931 o_nonblock='$o_nonblock'
14933 old_pthread_create_joinable='$old_pthread_create_joinable'
14934 optimize='$optimize'
14935 orderlib='$orderlib'
14941 patchlevel='$patchlevel'
14942 path_sep='$path_sep'
14944 perladmin='$perladmin'
14945 perlpath='$perlpath'
14947 phostname='$phostname'
14953 prefixexp='$prefixexp'
14955 privlibexp='$privlibexp'
14956 prototype='$prototype'
14958 quadkind='$quadkind'
14959 quadtype='$quadtype'
14960 randbits='$randbits'
14961 randfunc='$randfunc'
14962 randseedtype='$randseedtype'
14964 rd_nodata='$rd_nodata'
14968 sPRIEldbl='$sPRIEldbl'
14969 sPRIFldbl='$sPRIFldbl'
14970 sPRIGldbl='$sPRIGldbl'
14973 sPRIeldbl='$sPRIeldbl'
14974 sPRIfldbl='$sPRIfldbl'
14975 sPRIgldbl='$sPRIgldbl'
14980 sched_yield='$sched_yield'
14981 scriptdir='$scriptdir'
14982 scriptdirexp='$scriptdirexp'
14984 seedfunc='$seedfunc'
14985 selectminbits='$selectminbits'
14986 selecttype='$selecttype'
14987 sendmail='$sendmail'
14990 sharpbang='$sharpbang'
14991 shmattype='$shmattype'
14992 shortsize='$shortsize'
14995 sig_count='$sig_count'
14996 sig_name='$sig_name'
14997 sig_name_init='$sig_name_init'
14999 sig_num_init='$sig_num_init'
15000 signal_t='$signal_t'
15001 sitearch='$sitearch'
15002 sitearchexp='$sitearchexp'
15004 sitebinexp='$sitebinexp'
15006 sitelibexp='$sitelibexp'
15007 siteprefix='$siteprefix'
15008 siteprefixexp='$siteprefixexp'
15009 sizetype='$sizetype'
15014 sockethdr='$sockethdr'
15015 socketlib='$socketlib'
15017 spackage='$spackage'
15018 spitshell='$spitshell'
15021 ssizetype='$ssizetype'
15022 startperl='$startperl'
15024 static_ext='$static_ext'
15026 stdio_base='$stdio_base'
15027 stdio_bufsiz='$stdio_bufsiz'
15028 stdio_cnt='$stdio_cnt'
15029 stdio_filbuf='$stdio_filbuf'
15030 stdio_ptr='$stdio_ptr'
15031 stdio_stream_array='$stdio_stream_array'
15034 subversion='$subversion'
15041 timeincl='$timeincl'
15042 timetype='$timetype'
15055 uidformat='$uidformat'
15061 uquadtype='$uquadtype'
15062 use5005threads='$use5005threads'
15063 use64bits='$use64bits'
15065 useithreads='$useithreads'
15066 uselargefiles='$uselargefiles'
15067 uselongdouble='$uselongdouble'
15068 uselonglong='$uselonglong'
15069 usemorebits='$usemorebits'
15070 usemultiplicity='$usemultiplicity'
15071 usemymalloc='$usemymalloc'
15073 useopcode='$useopcode'
15074 useperlio='$useperlio'
15075 useposix='$useposix'
15077 useshrplib='$useshrplib'
15078 usesocks='$usesocks'
15079 usethreads='$usethreads'
15080 usevendorprefix='$usevendorprefix'
15081 usevfork='$usevfork'
15084 uvoformat='$uvoformat'
15087 uvuformat='$uvuformat'
15088 uvxformat='$uvxformat'
15089 vendorbin='$vendorbin'
15090 vendorbinexp='$vendorbinexp'
15091 vendorlib='$vendorlib'
15092 vendorlibexp='$vendorlibexp'
15093 vendorprefix='$vendorprefix'
15094 vendorprefixexp='$vendorprefixexp'
15097 voidflags='$voidflags'
15103 : Add in command line options if available
15104 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15106 : add special variables
15107 $test -f $src/patchlevel.h && \
15108 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15109 echo "CONFIGDOTSH=true" >>config.sh
15111 : propagate old symbols
15112 if $test -f UU/config.sh; then
15113 <UU/config.sh sort | uniq >UU/oldconfig.sh
15114 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15115 sort | uniq -u >UU/oldsyms
15116 set X `cat UU/oldsyms`
15122 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15124 echo "# Variables propagated from previous config.sh file." >>config.sh
15125 for sym in `cat UU/oldsyms`; do
15126 echo " Propagating $hint variable "'$'"$sym..."
15127 eval 'tmp="$'"${sym}"'"'
15129 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15135 : Finish up by extracting the .SH files
15149 If you'd like to make any changes to the config.sh file before I begin
15150 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15153 rp="Press return or use a shell escape to edit config.sh:"
15158 *) : in case they cannot read
15159 sh 1>&4 -c "$ans";;
15164 : if this fails, just run all the .SH files by hand
15171 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15178 Now you need to generate make dependencies by running "$make depend".
15179 You might prefer to run it in background: "$make depend > makedepend.out &"
15180 It can take a while, so you might not want to run it right now.
15185 rp="Run $make depend now?"
15189 $make depend && echo "Now you must run a $make."
15192 echo "You must run '$make depend' then '$make'."
15195 elif test -f [Mm]akefile; then
15197 echo "Now you must run a $make."
15202 if $test -f Policy.sh; then
15205 If you compile $package on a different machine or from a different object
15206 directory, copy the Policy.sh file from this object directory to the
15207 new one before you run Configure -- this will help you with most of
15208 the policy defaults.
15212 if $test -f config.msg; then
15213 echo "Hmm. I also noted the following information while running:"
15215 $cat config.msg >&4
15218 $rm -f kit*isdone ark*isdone