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 Dec 22 14:18:58 EST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
888 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
891 : We must find out about Eunice early
893 if test -f /etc/unixtovms; then
894 eunicefix=/etc/unixtovms
896 if test -f /etc/unixtovms.exe; then
897 eunicefix=/etc/unixtovms.exe
901 : Possible local include directories to search.
902 : Set locincpth to "" in a hint file to defeat local include searches.
903 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
904 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
906 : no include file wanted by default
909 : list of known cpp symbols, sorted alphabetically
910 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
911 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
912 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
913 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
914 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
915 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
916 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
917 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
918 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
919 al="$al VMS Xenix286"
920 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
921 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
922 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
923 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
924 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
925 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
926 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
927 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
928 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
929 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
930 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
931 al="$al __SVR4_2__ __UMAXV__"
932 al="$al ____386BSD____ __alpha __alpha__ __amiga"
933 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
934 al="$al __host_mips__"
935 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
936 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
937 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
938 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
939 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
940 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
941 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
942 al="$al __mc88100 __mc88100__ __mips __mips__"
943 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
944 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
945 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
946 al="$al _host_mips _mips _unix"
947 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
948 al="$al apollo ardent att386 att3b"
949 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
950 al="$al cadmus clipper concurrent convex cray ctix"
951 al="$al dmert encore gcos gcx gimpel gould"
952 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
953 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
954 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
955 al="$al i186 i286 i386 i486 i8086"
956 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
957 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
958 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
959 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
960 al="$al mc88000 mc88100 merlin mert mips mvs n16"
961 al="$al ncl_el ncl_mr"
962 al="$al news1500 news1700 news1800 news1900 news3700"
963 al="$al news700 news800 news900 ns16000 ns32000"
964 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
965 al="$al parisc pc532 pdp11 plexus posix pyr"
966 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
967 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
968 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
969 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
970 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
971 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
974 : Trailing extension. Override this in a hint file, if needed.
976 : Extra object files, if any, needed on this platform.
979 : change the next line if compiling for Xenix/286 on Xenix/386
980 xlibpth='/usr/lib/386 /lib/386'
982 : Possible local library directories to search.
983 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
984 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
986 : general looking path for locating libraries
987 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
988 glibpth="$glibpth /lib /usr/lib $xlibpth"
989 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
990 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
992 : Private path used by Configure to find libraries. Its value
993 : is prepended to libpth. This variable takes care of special
994 : machines, like the mips. Usually, it should be empty.
997 : default library list
999 : some systems want to use only the non-versioned libso:s
1000 ignore_versioned_solibs=''
1001 : full support for void wanted by default
1004 : set useposix=false in your hint file to disable the POSIX extension.
1006 : set useopcode=false in your hint file to disable the Opcode extension.
1008 : set usemultiplicity on the Configure command line to enable multiplicity.
1009 : set usesocks on the Configure command line to enable socks.
1010 : set usethreads on the Configure command line to enable threads.
1011 : List of libraries we want.
1012 : If anyone needs -lnet, put it in a hint file.
1013 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1014 libswanted="$libswanted dld ld sun m c cposix posix"
1015 libswanted="$libswanted ndir dir crypt sec"
1016 libswanted="$libswanted ucb bsd BSD PW x"
1017 : We probably want to search /usr/shlib before most other libraries.
1018 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1019 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1020 glibpth="/usr/shlib $glibpth"
1021 : Do not use vfork unless overridden by a hint file.
1024 : Find the basic shell for Bourne shell scripts
1028 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1031 if test -f "$xxx"; then
1034 : Build up a list and do a single loop so we can 'break' out.
1035 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1036 for xxx in sh bash ksh pdksh ash; do
1038 try="$try ${p}/${xxx}"
1042 if test -f "$xxx"; then
1045 elif test -f "$xxx.exe"; then
1056 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1058 Usually it's in /bin/sh. How did you even get this far?
1059 Please contact me (Perl Maintainers) at perlbug@perl.com and
1060 we'll try to straighten this all out.
1066 : see if sh knows # comments
1067 if `$sh -c '#' >/dev/null 2>&1`; then
1071 test -f $xcat || xcat=/usr/bin/cat
1076 if test -s today; then
1079 echo "#! $xcat" > try
1083 if test -s today; then
1091 echo "Your $sh doesn't grok # comments--I will strip them later on."
1094 echo "exec grep -v '^[ ]*#'" >spitshell
1096 $eunicefix spitshell
1097 spitshell=`pwd`/spitshell
1099 echo "I presume that if # doesn't work, #! won't work either!"
1104 : figure out how to guarantee sh startup
1106 '') startsh=${sharpbang}${sh} ;;
1118 : echo "Yup, it does."
1120 echo "Hmm... '$startsh' does not guarantee sh startup..."
1121 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1126 : Save command line options in file UU/cmdline.opt for later use in
1127 : generating config.sh.
1128 cat > cmdline.opt <<EOSH
1129 # Configure command line arguments.
1136 cat >>cmdline.opt <<EOSH
1137 config_arg$argn='$arg'
1139 argn=`expr $argn + 1`
1142 : produce awk script to parse command line options
1143 cat >options.awk <<'EOF'
1145 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1147 len = length(optstr);
1148 for (i = 1; i <= len; i++) {
1149 c = substr(optstr, i, 1);
1150 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1161 if (substr(str, 1, 1) != "-") {
1162 printf("'%s'\n", str);
1166 for (i = 2; i <= len; i++) {
1167 c = substr(str, i, 1);
1169 printf("-%s\n", substr(str, i));
1175 printf("'%s'\n", substr(str, i + 1));
1188 : process the command line options
1189 set X `for arg in "$@"; do echo "X$arg"; done |
1190 sed -e s/X// | awk -f options.awk`
1195 : set up default values
1205 rm -f optdef.sh posthint.sh
1206 cat >optdef.sh <<EOS
1212 while test $# -gt 0; do
1214 -d) shift; fastread=yes;;
1215 -e) shift; alldone=cont;;
1219 if test -r "$1"; then
1222 echo "$me: cannot read config file $1." >&2
1227 -h) shift; error=true;;
1228 -r) shift; reuseval=true;;
1229 -s) shift; silent=true; realsilent=true;;
1230 -E) shift; alldone=exit;;
1231 -K) shift; knowitall=true;;
1232 -O) shift; override=true;;
1233 -S) shift; silent=true; extractsh=true;;
1238 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1239 echo "$me: ignoring -D $1" >&2
1242 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1243 *) echo "$1='define'" >> optdef.sh;;
1250 *=) echo "$1" >> optdef.sh;;
1252 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1253 echo "$me: ignoring -U $1" >&2
1255 *) echo "$1='undef'" >> optdef.sh;;
1266 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1270 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1271 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1277 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1278 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1279 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1281 *) xxx=`echo $yyy|sed 's!:.*!!'`
1282 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1288 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1290 echo "$yyy=''" >> posthint.sh ;;
1295 echo "$yyy='$zzz'" >> posthint.sh ;;
1297 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1304 echo "$yyy=$zzz" >> posthint.sh ;;
1305 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1308 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1311 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1319 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1320 [-U symbol] [-U symbol=] [-A command:symbol...]
1321 -d : use defaults for all answers.
1322 -e : go on without questioning past the production of config.sh.
1323 -f : specify an alternate default configuration file.
1324 -h : print this help message and exit (with an error status).
1325 -r : reuse C symbols value if possible (skips costly nm extraction).
1326 -s : silent mode, only echoes questions and essential information.
1327 -D : define symbol to have some value:
1328 -D symbol symbol gets the value 'define'
1329 -D symbol=value symbol gets the value 'value'
1330 -E : stop at the end of questions, after having produced config.sh.
1331 -K : do not use unless you know what you are doing.
1332 -O : let -D and -U override definitions from loaded configuration file.
1333 -S : perform variable substitutions on all .SH files (can mix with -f)
1334 -U : undefine symbol:
1335 -U symbol symbol gets the value 'undef'
1336 -U symbol= symbol gets completely empty
1337 -A : manipulate symbol after the platform specific hints have been applied:
1338 -A symbol=value append " "value to symbol
1339 -A append:symbol=value append value to symbol
1340 -A define:symbol=value define symbol to have value
1341 -A clear:symbol define symbol to be ''
1342 -A define:symbol define symbol to be 'define'
1343 -A eval:symbol=value define symbol to be eval of value
1344 -A prepend:symbol=value prepend value to symbol
1345 -A undef:symbol define symbol to be 'undef'
1346 -A undef:symbol= define symbol to be ''
1347 -V : print version number and exit (with a zero status).
1354 case "$fastread$alldone" in
1357 if test ! -t 0; then
1358 echo "Say 'sh Configure', not 'sh <Configure'"
1366 true) exec 1>/dev/null;;
1369 : run the defines and the undefines, if any, but leave the file out there...
1372 : create the posthint manipulation script and leave the file out there...
1377 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1378 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1379 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1380 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1381 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1384 : Some greps do not return status, grrr.
1385 echo "grimblepritz" >grimble
1386 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1388 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1394 : the following should work in any shell
1398 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1399 cat >contains <<'EOSS'
1400 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1405 : Find the path to the source tree
1408 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1411 *) src=`cd ../$src && pwd` ;;
1424 if test -f $rsrc/Configure && \
1425 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1427 : found it, so we are ok.
1430 for src in . .. ../.. ../../.. ../../../..; do
1431 if test -f ../$src/Configure && \
1432 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1443 Sorry, I can't seem to locate the source dir for $package. Please start
1444 Configure with an explicit path -- i.e. /some/path/Configure.
1452 echo "Sources for $package found in \"$src\"." >&4
1456 : script used to extract .SH files with variable substitutions
1457 cat >extract <<'EOS'
1459 echo "Doing variable substitutions on .SH files..."
1460 if test -f $src/MANIFEST; then
1461 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1463 echo "(Looking for .SH files under the source directory.)"
1464 set x `(cd $src; find . -name "*.SH" -print)`
1468 0) set x `(cd $src; echo *.SH)`; shift;;
1470 if test ! -f $src/$1; then
1476 while test $name; do
1477 if test ! -d "$name"; then
1478 create="$name $create";
1479 name=`echo $name | sed -e "s|^[^/]*$||"`;
1480 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1485 for file in $create; do
1494 dir=`expr X$file : 'X\(.*\)/'`
1495 file=`expr X$file : 'X.*/\(.*\)'`
1496 (cd $dir && . ./$file)
1506 dir=`expr X$file : 'X\(.*\)/'`
1507 file=`expr X$file : 'X.*/\(.*\)'`
1508 (set x $dir; shift; eval $mkdir_p)
1518 if test -f $src/config_h.SH; then
1519 if test ! -f config.h; then
1520 : oops, they left it out of MANIFEST, probably, so do it anyway.
1526 : extract files and exit if asked to do so
1527 case "$extractsh" in
1529 case "$realsilent" in
1533 case "$config_sh" in
1534 '') config_sh='config.sh';;
1537 echo "Fetching answers from $config_sh..."
1540 test "$override" && . ./optdef.sh
1549 : Eunice requires " " instead of "", can you believe it
1552 echo "Beginning of configuration questions for $package."
1554 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1556 : first determine how to suppress newline on echo command
1558 echo "Checking echo to see how to suppress newlines..."
1559 (echo "hi there\c" ; echo " ") >.echotmp
1560 if $contains c .echotmp >/dev/null 2>&1 ; then
1571 echo $n "The star should be here-->$c"
1575 : Now test for existence of everything in MANIFEST
1577 if test -f $rsrc/MANIFEST; then
1578 echo "First let's make sure your kit is complete. Checking..." >&4
1579 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1582 for filelist in x??; do
1583 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1585 if test -s missing; then
1589 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1591 You have the option of continuing the configuration process, despite the
1592 distinct possibility that your kit is damaged, by typing 'y'es. If you
1593 do, don't blame me if something goes wrong. I advise you to type 'n'o
1594 and contact the author (perlbug@perl.com).
1597 echo $n "Continue? [n] $c" >&4
1601 echo "Continuing..." >&4
1605 echo "ABORTING..." >&4
1610 echo "Looks good..."
1613 echo "There is no MANIFEST file. I hope your kit is complete !"
1618 : Find the appropriate value for a newline for tr
1619 if test -n "$DJGPP"; then
1622 if test X"$trnl" = X; then
1623 case "`echo foo|tr '\n' x 2>/dev/null`" in
1627 if test X"$trnl" = X; then
1628 case "`echo foo|tr '\012' x 2>/dev/null`" in
1629 foox) trnl='\012' ;;
1632 if test X"$trnl" = X; then
1635 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1641 : compute the number of columns on the terminal for proper question formatting
1646 : set up the echo used in my read
1647 myecho="case \"\$xxxm\" in
1648 '') echo $n \"\$rp $c\" >&4;;
1650 '') echo $n \"[\$xxxm] $c\";;
1652 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1654 echo $n \"[\$xxxm] $c\" >&4
1656 echo $n \"\$rp [\$xxxm] $c\" >&4
1662 : now set up to do reads with possible shell escape and default assignment
1668 case "\$fastread" in
1669 yes) case "\$dflt" in
1672 case "\$silent-\$rp" in
1677 *) case "\$silent" in
1678 true) case "\$rp" in
1683 while expr "X\$ans" : "X!" >/dev/null; do
1687 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1695 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1704 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1709 echo "(OK, I'll run with -d after this question.)" >&4
1712 echo "*** Sorry, \$1 not supported yet." >&4
1722 echo "*** Substitution done -- please confirm."
1724 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1729 echo "*** Error -- try again."
1736 case "\$ans\$xxxm\$nostick" in
1748 : create .config dir to save info across Configure sessions
1749 test -d ../.config || mkdir ../.config
1750 cat >../.config/README <<EOF
1751 This directory created by Configure to save information that should
1752 persist across sessions for $package.
1754 You may safely delete it if you wish.
1757 : general instructions
1760 user=`(logname) 2>/dev/null`
1762 '') user=`whoami 2>&1`;;
1764 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1767 rp='Would you like to see the instructions?'
1778 This installation shell script will examine your system and ask you questions
1779 to determine how the perl5 package should be installed. If you get
1780 stuck on a question, you may use a ! shell escape to start a subshell or
1781 execute a command. Many of the questions will have default answers in square
1782 brackets; typing carriage return will give you the default.
1784 On some of the questions which ask for file or directory names you are allowed
1785 to use the ~name construct to specify the login directory belonging to "name",
1786 even if you don't have a shell which knows about that. Questions where this is
1787 allowed will be marked "(~name ok)".
1791 dflt='Type carriage return to continue'
1795 The prompter used in this script allows you to use shell variables and
1796 backticks in your answers. You may use $1, $2, etc... to refer to the words
1797 in the default answer, as if the default line was a set of arguments given to a
1798 script shell. This means you may also use $* to repeat the whole default line,
1799 so you do not have to re-type everything to add something to the default.
1801 Everytime there is a substitution, you will have to confirm. If there is an
1802 error (e.g. an unmatched backtick), the default answer will remain unchanged
1803 and you will be prompted again.
1805 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1806 the questions and use the computed defaults (or the previous answers if there
1807 was already a config.sh file). Type 'Configure -h' for a list of options.
1808 You may also start interactively and then answer '& -d' at any prompt to turn
1809 on the non-interactive behaviour for the remainder of the execution.
1815 Much effort has been expended to ensure that this shell script will run on any
1816 Unix system. If despite that it blows up on yours, your best bet is to edit
1817 Configure and run it again. If you can't run Configure for some reason,
1818 you'll have to generate a config.sh file by hand. Whatever problems you
1819 have, let me (perlbug@perl.com) know how I blew it.
1821 This installation script affects things in two ways:
1823 1) it may do direct variable substitutions on some of the files included
1825 2) it builds a config.h file for inclusion in C programs. You may edit
1826 any of these files as the need arises after running this script.
1828 If you make a mistake on a question, there is no easy way to back up to it
1829 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1830 files. Configure will offer to let you do this before it runs the SH files.
1833 dflt='Type carriage return to continue'
1835 case "$firsttime" in
1836 true) echo $user >>../.config/instruct;;
1840 : find out where common programs are
1842 echo "Locating common programs..." >&4
1855 if test -d \$dir/\$thing; then
1861 for thisthing in \$dir/\$thing; do
1862 : just loop through to pick last item
1864 if test -f \$thisthing; then
1867 elif test -f \$dir/\$thing.exe; then
1868 if test -n "$DJGPP"; then
1869 echo \$dir/\$thing.exe
1871 : on Eunice apparently
1921 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1922 pth="$pth /lib /usr/lib"
1923 for file in $loclist; do
1927 if test -f "$xxx"; then
1930 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1931 xxx=`./loc $file $file $pth`
1934 '') xxx=`./loc $file $file $pth`;;
1935 *) xxx=`./loc $xxx $xxx $pth`;;
1941 echo $file is in $xxx.
1944 echo $file is in $xxx.
1947 echo "I don't know where '$file' is, and my life depends on it." >&4
1948 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1954 echo "Don't worry if any of the following aren't found..."
1956 for file in $trylist; do
1960 if test -f "$xxx"; then
1963 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1964 xxx=`./loc $file $file $pth`
1967 '') xxx=`./loc $file $file $pth`;;
1968 *) xxx=`./loc $xxx $xxx $pth`;;
1974 echo $file is in $xxx.
1977 echo $file is in $xxx.
1980 echo "I don't see $file out there, $say."
1987 echo "Substituting grep for egrep."
1993 echo "Substituting cp for ln."
1999 echo "Hopefully test is built into your sh."
2002 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2003 echo "Using the test built into your sh."
2011 echo "Hopefully echo is built into your sh."
2016 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2017 $echo $n "hi there$c" >foo1
2018 echo $n "hi there$c" >foo2
2019 if cmp foo1 foo2 >/dev/null 2>&1; then
2020 echo "They are compatible. In fact, they may be identical."
2027 They are not compatible! You are probably running ksh on a non-USG system.
2028 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2029 have echo built in and we may have to run some Bourne shell scripts. That
2030 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2033 $echo $n "The star should be here-->$c"
2040 : determine whether symbolic links are supported
2043 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2044 echo "Symbolic links are supported." >&4
2047 echo "Symbolic links are NOT supported." >&4
2052 : see whether [:lower:] and [:upper:] are supported character classes
2054 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2056 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2060 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2061 # (0xc9 and 0xd1), therefore that is a nice testing point.
2062 if test "X$up" = X -o "X$low" = X; then
2063 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2069 if test "X$up" = X -o "X$low" = X; then
2070 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2076 if test "X$up" = X -o "X$low" = X; then
2077 case "`echo IJ | od -x 2>/dev/null`" in
2079 echo "Hey, this might be EBCDIC." >&4
2080 if test "X$up" = X -o "X$low" = X; then
2081 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2082 ij) up='[A-IJ-RS-Z]'
2087 if test "X$up" = X -o "X$low" = X; then
2088 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2098 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2100 echo "Using $up and $low to convert case." >&4
2103 echo "I don't know how to translate letters from upper to lower case." >&4
2104 echo "Your tr is not acting any way I know of." >&4
2108 : set up the translation script tr, must be called with ./tr of course
2112 '[A-Z][a-z]') exec $tr '$up' '$low';;
2113 '[a-z][A-Z]') exec $tr '$low' '$up';;
2120 : Try to determine whether config.sh was made on this system
2121 case "$config_sh" in
2123 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2124 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2125 # because the A-Z/a-z are not consecutive.
2126 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2127 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2128 newmyuname="$myuname"
2130 case "$knowitall" in
2132 if test -f ../config.sh; then
2133 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2134 eval "`grep myuname= ../config.sh`"
2136 if test "X$myuname" = "X$newmyuname"; then
2144 : Get old answers from old config file if Configure was run on the
2145 : same system, otherwise use the hints.
2148 if test -f config.sh; then
2150 rp="I see a config.sh file. Shall I use it to set the defaults?"
2153 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2154 *) echo "Fetching default answers from your old config.sh file..." >&4
2162 : Older versions did not always set $sh. Catch re-use of such
2171 if test ! -f config.sh; then
2174 First time through, eh? I have some defaults handy for some systems
2175 that need some extra help getting the Configure answers right:
2178 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2180 : Half the following guesses are probably wrong... If you have better
2181 : tests or hints, please send them to perlbug@perl.com
2182 : The metaconfig authors would also appreciate a copy...
2183 $test -f /irix && osname=irix
2184 $test -f /xenix && osname=sco_xenix
2185 $test -f /dynix && osname=dynix
2186 $test -f /dnix && osname=dnix
2187 $test -f /lynx.os && osname=lynxos
2188 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2189 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2190 $test -f /bin/mips && /bin/mips && osname=mips
2191 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2192 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2193 $test -d /usr/apollo/bin && osname=apollo
2194 $test -f /etc/saf/_sactab && osname=svr4
2195 $test -d /usr/include/minix && osname=minix
2196 if $test -d /MachTen -o -d /MachTen_Folder; then
2198 if $test -x /sbin/version; then
2199 osvers=`/sbin/version | $awk '{print $2}' |
2200 $sed -e 's/[A-Za-z]$//'`
2201 elif $test -x /usr/etc/version; then
2202 osvers=`/usr/etc/version | $awk '{print $2}' |
2203 $sed -e 's/[A-Za-z]$//'`
2208 $test -f /sys/posix.dll &&
2209 $test -f /usr/bin/what &&
2210 set X `/usr/bin/what /sys/posix.dll` &&
2211 $test "$3" = UWIN &&
2214 if $test -f $uname; then
2222 umips) osname=umips ;;
2225 [23]100) osname=mips ;;
2226 next*) osname=next ;;
2228 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2229 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2232 elif $test -f /etc/kconfig; then
2234 if test "$lns" = "$ln -s"; then
2236 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2238 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2245 if test -n "$DJGPP"; then
2254 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2256 'not found') osvers="$4"."$3" ;;
2257 '<3240'|'<>3240') osvers=3.2.0 ;;
2258 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2259 '=3250'|'>3250') osvers=3.2.5 ;;
2263 *dc.osx) osname=dcosx
2269 domainos) osname=apollo
2275 dynixptx*) osname=dynixptx
2276 osvers=`echo "$4"|sed 's/^v//'`
2278 freebsd) osname=freebsd
2280 genix) osname=genix ;;
2282 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2298 netbsd*) osname=netbsd
2301 news-os) osvers="$3"
2303 4*) osname=newsos4 ;;
2307 bsd386) osname=bsd386
2310 POSIX-BC | posix-bc ) osname=posix-bc
2313 powerux | power_ux | powermax_os | powermaxos | \
2314 powerunix | power_unix) osname=powerux
2317 next*) osname=next ;;
2318 solaris) osname=solaris
2320 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2327 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2331 titanos) osname=titanos
2340 ultrix) osname=ultrix
2343 osf1|mls+) case "$5" in
2346 osvers=`echo "$3" | sed 's/^[xvt]//'`
2348 hp*) osname=hp_osf1 ;;
2349 mips) osname=mips_osf1 ;;
2352 unixware) osname=svr5
2361 cygwin*) osname=cygwin
2364 $2) case "$osname" in
2368 : svr4.x or possibly later
2378 if test -f /stand/boot ; then
2379 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2380 if test -n "$INITPROG" -a -f "$INITPROG"; then
2381 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2382 if test -n "$isesix"; then
2390 *) if test -f /etc/systemid; then
2392 set `echo $3 | $sed 's/\./ /g'` $4
2393 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2395 elif $test -f $src/hints/sco_$1_$2.sh; then
2397 elif $test -f $src/hints/sco_$1.sh; then
2402 '') : Still unknown. Probably a generic Sys V.
2411 *) case "$osname" in
2412 '') : Still unknown. Probably a generic BSD.
2420 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2421 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2422 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2425 $rm -f UU/kernel.what
2426 elif test -d c:/.; then
2433 : Now look for a hint file osname_osvers, unless one has been
2434 : specified already.
2437 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2438 : Also try without trailing minor version numbers.
2439 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2440 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2441 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2442 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2445 *) case "$osvers" in
2448 *) if $test -f $src/hints/$file.sh ; then
2450 elif $test -f $src/hints/$xfile.sh ; then
2452 elif $test -f $src/hints/$xxfile.sh ; then
2454 elif $test -f $src/hints/$xxxfile.sh ; then
2456 elif $test -f $src/hints/$xxxxfile.sh ; then
2458 elif $test -f "$src/hints/${osname}.sh" ; then
2467 if $test -f Policy.sh ; then
2470 none) dflt="Policy" ;;
2471 *) dflt="Policy $dflt" ;;
2476 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2480 if $test -f Policy.sh ; then
2483 There's also a Policy hint file available, which should make the
2484 site-specific (policy) questions easier to answer.
2491 You may give one or more space-separated answers, or "none" if appropriate.
2492 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2493 is a good thing. DO NOT give a wrong version or a wrong OS.
2497 rp="Which of these apply, if any?"
2500 for file in $tans; do
2501 if $test X$file = XPolicy -a -f Policy.sh; then
2503 $cat Policy.sh >> UU/config.sh
2504 elif $test -f $src/hints/$file.sh; then
2505 . $src/hints/$file.sh
2506 $cat $src/hints/$file.sh >> UU/config.sh
2507 elif $test X$tans = X -o X$tans = Xnone ; then
2510 : Give one chance to correct a possible typo.
2511 echo "$file.sh does not exist"
2513 rp="hint to use instead?"
2515 for file in $ans; do
2516 if $test -f "$src/hints/$file.sh"; then
2517 . $src/hints/$file.sh
2518 $cat $src/hints/$file.sh >> UU/config.sh
2519 elif $test X$ans = X -o X$ans = Xnone ; then
2522 echo "$file.sh does not exist -- ignored."
2529 : Remember our hint file for later.
2530 if $test -f "$src/hints/$file.sh" ; then
2540 echo "Fetching default answers from $config_sh..." >&4
2544 cp $config_sh config.sh 2>/dev/null
2554 test "$override" && . ./optdef.sh
2555 myuname="$newmyuname"
2557 : Restore computed paths
2558 for file in $loclist $trylist; do
2559 eval $file="\$_$file"
2564 Configure uses the operating system name and version to set some defaults.
2565 The default value is probably right if the name rings a bell. Otherwise,
2566 since spelling matters for me, either accept the default or answer "none"
2573 ''|' '|none) dflt=none ;;
2574 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2577 *) dflt="$osname" ;;
2579 rp="Operating system name?"
2583 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2589 ''|' '|none) dflt=none ;;
2590 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2591 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2593 ''|' ') dflt=none ;;
2598 *) dflt="$osvers" ;;
2600 rp="Operating system version?"
2610 : who configured the system
2611 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2612 cf_by=`(logname) 2>/dev/null`
2615 cf_by=`(whoami) 2>/dev/null`
2617 "") cf_by=unknown ;;
2621 : set up the script used to warn in case of inconsistency
2628 echo "*** WHOA THERE!!! ***" >&4
2629 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2630 rp=" Keep the $hint value?"
2633 y) td=$was; tu=$was;;
2637 : function used to set $1 to $val
2638 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2640 $define$undef) . ./whoa; eval "$var=\$td";;
2641 $undef$define) . ./whoa; eval "$var=\$tu";;
2642 *) eval "$var=$val";;
2647 Perl can be built to take advantage of threads, on some systems.
2648 To do so, Configure must be run with -Dusethreads.
2650 Note that threading is a highly experimental feature, and
2651 some known race conditions still remain. If you choose to try
2652 it, be very sure to not actually deploy it for production
2653 purposes. README.threads has more details, and is required
2654 reading if you enable threads.
2656 case "$usethreads" in
2657 $define|true|[yY]*) dflt='y';;
2660 rp='Build a threading Perl?'
2663 y|Y) val="$define" ;;
2669 case "$d_oldpthreads" in
2670 '') : Configure tests would be welcome here. For now, assume undef.
2672 *) val="$d_oldpthreads" ;;
2678 case "$usethreads" in
2679 "$define"|true|[yY]*)
2680 : Look for a hint-file generated 'call-back-unit'. If the
2681 : user has specified that a threading perl is to be built,
2682 : we may need to set or change some other defaults.
2683 if $test -f usethreads.cbu; then
2684 echo "Your platform has some specific hints for threaded builds, using them..."
2688 (Your platform doesn't have any specific hints for threaded builds.
2689 Assuming POSIX threads, then.)
2697 Perl can be built so that multiple Perl interpreters can coexist
2698 within the same Perl executable. To do so, Configure must be run with
2701 Normally you do not need this and you should answer no.
2704 case "$usemultiplicity" in
2705 $define|true|[yY]*) dflt='y';;
2708 rp='Build Perl for multiplicity?'
2711 y|Y) val="$define" ;;
2717 : determine where manual pages are on this system
2721 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2722 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2723 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2724 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2725 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2726 sysman=`./loc . /usr/man/man1 $syspath`
2729 if $test -d "$sysman"; then
2730 echo "System manual is in $sysman." >&4
2732 echo "Could not find manual pages in source form." >&4
2735 : see what memory models we can support
2738 $cat >pdp11.c <<'EOP'
2747 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2748 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2749 dflt='unsplit split'
2751 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2754 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2759 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2762 if $test -d /lib/large || $test -d /usr/lib/large; then
2765 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2774 Some systems have different model sizes. On most systems they are called
2775 small, medium, large, and huge. On the PDP11 they are called unsplit and
2776 split. If your system doesn't support different memory models, say "none".
2777 If you wish to force everything to one memory model, say "none" here and
2778 put the appropriate flags later when it asks you for other cc and ld flags.
2779 Venix systems may wish to put "none" and let the compiler figure things out.
2780 (In the following question multiple model names should be space separated.)
2782 The default for most systems is "none".
2785 rp="Which memory models are supported?"
2800 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2801 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2808 rp="What flag indicates separate I and D space?"
2816 *large*|*small*|*medium*|*huge*)
2823 rp="What flag indicates large model?"
2833 *huge*) case "$huge" in
2837 rp="What flag indicates huge model?"
2847 *medium*) case "$medium" in
2851 rp="What flag indicates medium model?"
2858 *) medium="$large";;
2861 *small*) case "$small" in
2865 rp="What flag indicates small model?"
2876 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2879 $rm -f pdp11.* pdp11
2881 : make some quick guesses about what we are up against
2883 $echo $n "Hmm... $c"
2893 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2894 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2896 echo "Looks kind of like an OSF/1 system, but we'll see..."
2898 elif test `echo abc | tr a-z A-Z` = Abc ; then
2899 xxx=`./loc addbib blurfl $pth`
2900 if $test -f $xxx; then
2901 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2905 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2906 echo "Looks kind of like an extended USG system, but we'll see..."
2908 echo "Looks kind of like a USG system, but we'll see..."
2912 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2913 echo "Looks kind of like a BSD system, but we'll see..."
2917 echo "Looks kind of like a Version 7 system, but we'll see..."
2920 case "$eunicefix" in
2923 There is, however, a strange, musty smell in the air that reminds me of
2924 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2928 : it so happens the Eunice I know will not run shell scripts in Unix format
2932 echo "Congratulations. You aren't running Eunice."
2936 : Detect OS2. The p_ variable is set above in the Head.U unit.
2941 I have the feeling something is not exactly right, however...don't tell me...
2942 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2947 if test -f /xenix; then
2948 echo "Actually, this looks more like a XENIX system..."
2953 echo "It's not Xenix..."
2958 if test -f /venix; then
2959 echo "Actually, this looks more like a VENIX system..."
2966 echo "Nor is it Venix..."
2969 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2970 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2973 : see if we need a special compiler
2981 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2982 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2996 On some older systems the default C compiler will not resolve multiple global
2997 references that happen to have the same name. On some such systems the "Mcc"
2998 command may be used to force these to be resolved. On other systems a "cc -M"
2999 command is required. (Note that the -M flag on other systems indicates a
3000 memory model to use!) If you have the Gnu C compiler, you might wish to use
3006 rp="Use which C compiler?"
3014 rp="Use which C compiler?"
3018 : Look for a hint-file generated 'call-back-unit'. Now that the
3019 : user has specified the compiler, we may need to set or change some
3021 if $test -f cc.cbu; then
3025 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3026 $cat >gccvers.c <<EOM
3031 printf("%s\n", __VERSION__);
3033 printf("%s\n", "1");
3039 if $cc -o gccvers gccvers.c; then
3040 gccversion=`./gccvers`
3041 case "$gccversion" in
3042 '') echo "You are not using GNU cc." ;;
3043 *) echo "You are using GNU cc $gccversion." ;;
3047 echo "*** WHOA THERE!!! ***" >&4
3048 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3049 case "$knowitall" in
3051 echo " You'd better start hunting for one and let me know about it." >&4
3057 case "$gccversion" in
3058 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3061 : see how we invoke the C preprocessor
3063 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3064 cat <<'EOT' >testcpp.c
3070 if test ! -f cppstdin; then
3071 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3072 # AIX cc -E doesn't show the absolute headerfile
3073 # locations but we'll cheat by using the -M flag.
3074 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
3076 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3079 echo "Keeping your $hint cppstdin wrapper."
3082 wrapper=`pwd`/cppstdin
3086 if $test "X$cppstdin" != "X" && \
3087 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3088 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3090 echo "You used to use $cppstdin $cppminus so we'll use that again."
3092 '') echo "But let's see if we can live without a wrapper..." ;;
3094 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3095 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3097 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3100 echo "(However, $cpprun $cpplast does not work, let's see...)"
3108 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3115 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3116 $cc -E <testcpp.c >testcpp.out 2>&1; \
3117 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3118 echo "Yup, it does."
3121 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3122 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3123 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3124 echo "Yup, it does."
3127 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3128 $cc -P <testcpp.c >testcpp.out 2>&1; \
3129 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3130 echo "Yipee, that works!"
3133 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3134 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3135 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3136 echo "At long last!"
3139 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3140 $cpp <testcpp.c >testcpp.out 2>&1; \
3141 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3145 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3146 $cpp - <testcpp.c >testcpp.out 2>&1; \
3147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3148 echo "Hooray, it works! I was beginning to wonder."
3151 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3152 $wrapper <testcpp.c >testcpp.out 2>&1; \
3153 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3159 rp="No dice. I can't find a C preprocessor. Name one:"
3163 $x_cpp <testcpp.c >testcpp.out 2>&1
3164 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3165 echo "OK, that will do." >&4
3167 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3182 echo "Perhaps can we force $cc -E using a wrapper..."
3183 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3184 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3190 echo "Nope, we'll have to live without it..."
3204 "$wrapper"|'cppstdin') ;;
3205 *) $rm -f $wrapper;;
3207 $rm -f testcpp.c testcpp.out
3209 : decide how portable to be. Allow command line overrides.
3210 case "$d_portable" in
3212 *) d_portable="$define" ;;
3215 : set up shell script to do ~ expansion
3221 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3224 if $test -f /bin/csh; then
3225 /bin/csh -f -c "glob \$1"
3230 name=\`$expr x\$1 : '..\([^/]*\)'\`
3231 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3232 if $test ! -d "\$dir"; then
3234 echo "\$me: can't locate home directory for: \$name" >&2
3239 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3255 : now set up to get a file name
3259 cat <<'EOSC' >>getfile
3275 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3276 fn=`echo $fn | sed 's/(.*)//'`
3282 loc_file=`expr $fn : '.*:\(.*\)'`
3283 fn=`expr $fn : '\(.*\):.*'`
3291 */*) fullpath=true;;
3300 *e*) exp_file=true;;
3303 *p*) nopath_ok=true;;
3308 *d*) type='Directory';;
3309 *l*) type='Locate';;
3314 Locate) what='File';;
3319 case "$d_portable" in
3327 while test "$type"; do
3332 true) rp="$rp (~name ok)";;
3335 if test -f UU/getfile.ok && \
3336 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3355 value=`UU/filexp $ans`
3358 if test "$ans" != "$value"; then
3359 echo "(That expands to $value on this system.)"
3373 /*) value="$ansexp" ;;
3378 echo "I shall only accept a full path name, as in /bin/ls." >&4
3379 echo "Use a ! shell escape if you wish to check pathnames." >&4
3382 echo "Please give a full path name, starting with slash." >&4
3385 echo "Note that using ~name is ok provided it expands well." >&4
3398 for fp in $gfpth; do
3399 if test "X$fp" = X.; then
3404 if test -f "$pf"; then
3406 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3408 echo "($value is not a plain file, but that's ok.)"
3411 if test X"$type" = X; then
3418 for fp in $gfpth; do
3419 if test "X$fp" = X.; then
3424 if test -d "$pf"; then
3432 if test -d "$ansexp"; then
3433 echo "(Looking for $loc_file in directory $value.)"
3434 value="$value/$loc_file"
3435 ansexp="$ansexp/$loc_file"
3437 if test -f "$ansexp"; then
3440 case "$nopath_ok" in
3441 true) case "$value" in
3443 *) echo "Assuming $value will be in people's path."
3459 if test "$fastread" = yes; then
3464 rp="$what $value doesn't exist. Use that name anyway?"
3483 test "X$gfpthkeep" != Xy && gfpth=""
3486 : What should the include directory be ?
3488 $echo $n "Hmm... $c"
3492 if $test -f /bin/mips && /bin/mips; then
3493 echo "Looks like a MIPS system..."
3494 $cat >usr.c <<'EOCP'
3495 #ifdef SYSTYPE_BSD43
3499 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3500 dflt='/bsd43/usr/include'
3504 mips_type='System V'
3506 $rm -f usr.c usr.out
3507 echo "and you're compiling with the $mips_type compiler and libraries."
3511 echo "Doesn't look like a MIPS system."
3521 case "$xxx_prompt" in
3524 rp='Where are the include files you want to use?'
3532 : Set private lib path
3535 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3540 '') dlist="$loclibpth $plibpth $glibpth";;
3541 *) dlist="$libpth";;
3544 : Now check and see which directories actually exist, avoiding duplicates
3548 if $test -d $xxx; then
3551 *) libpth="$libpth $xxx";;
3557 Some systems have incompatible or broken versions of libraries. Among
3558 the directories listed in the question below, please remove any you
3559 know not to be holding relevant libraries, and add any that are needed.
3560 Say "none" for none.
3571 rp="Directories to use for library searches?"
3578 : compute shared library extension
3581 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3591 On some systems, shared libraries may be available. Answer 'none' if
3592 you want to suppress searching of shared libraries for the remaining
3593 of this configuration.
3596 rp='What is the file extension used for shared libraries?'
3600 : Define several unixisms.
3601 : Hints files or command line option can be used to override them.
3602 : The convoluted testing is in case hints files set either the old
3605 '') case "$exe_ext" in
3607 *) _exe="$exe_ext" ;;
3612 '') case "$lib_ext" in
3619 '') case "$obj_ext" in
3626 '') case "$path_sep" in
3637 : Which makefile gets called first. This is used by make depend.
3638 case "$firstmakefile" in
3639 '') firstmakefile='makefile';;
3644 Perl can be built to use the SOCKS proxy protocol library. To do so,
3645 Configure must be run with -Dusesocks.
3647 Normally you do not need this and you should answer no.
3651 $define|true|[yY]*) dflt='y';;
3654 rp='Build Perl for SOCKS?'
3657 y|Y) val="$define" ;;
3663 : Looking for optional libraries
3665 echo "Checking for optional libraries..." >&4
3670 case "$libswanted" in
3671 '') libswanted='c_s';;
3675 libswanted="$libswanted socks5 socks5_sh"
3678 for thislib in $libswanted; do
3680 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3681 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3682 echo "Found -l$thislib (shared)."
3685 *) dflt="$dflt -l$thislib";;
3687 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3688 echo "Found -l$thislib (shared)."
3691 *) dflt="$dflt -l$thislib";;
3693 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3694 echo "Found -l$thislib."
3697 *) dflt="$dflt -l$thislib";;
3699 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3700 echo "Found -l$thislib."
3703 *) dflt="$dflt -l$thislib";;
3705 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3706 echo "Found -l${thislib}_s."
3709 *) dflt="$dflt -l${thislib}_s";;
3711 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3712 echo "Found -l$thislib."
3715 *) dflt="$dflt -l$thislib";;
3718 echo "No -l$thislib."
3729 ' '|'') dflt='none';;
3734 In order to compile $package on your machine, a number of libraries
3735 are usually needed. Include any other special libraries here as well.
3736 Say "none" for none. The default list is almost always right.
3740 rp="What libraries to use?"
3747 : determine optimization, if desired, or use for debug flag also
3749 ' '|$undef) dflt='none';;
3751 *) dflt="$optimize";;
3755 By default, $package compiles with the -O flag to use the optimizer.
3756 Alternately, you might want to use the symbolic debugger, which uses
3757 the -g flag (on traditional Unix systems). Either flag can be
3758 specified here. To use neither flag, specify the word "none".
3761 rp="What optimizer/debugger flag should be used?"
3765 'none') optimize=" ";;
3769 : We will not override a previous value, but we might want to
3770 : augment a hint file
3772 default|recommended)
3773 case "$gccversion" in
3774 1*) dflt='-fpcc-struct-return' ;;
3777 *-g*) dflt="$dflt -DDEBUGGING";;
3779 case "$gccversion" in
3780 2*) if test -d /etc/conf/kconfig.d &&
3781 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3787 case "$gccversion" in
3791 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3792 echo 'int main(void) { return 0; }' > gcctest.c
3793 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3794 echo "Yes, it does." 2>&1
3797 echo "Leaving current flags $ccflags alone." 2>&1
3799 *) dflt="$dflt -fno-strict-aliasing" ;;
3802 echo "Nope, it doesn't, but that's ok." 2>&1
3809 case "$mips_type" in
3810 *BSD*|'') inclwanted="$locincpth $usrinc";;
3811 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3813 for thisincl in $inclwanted; do
3814 if $test -d $thisincl; then
3815 if $test x$thisincl != x$usrinc; then
3818 *) dflt="$dflt -I$thisincl";;
3824 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3826 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3834 *) dflt="$dflt -D$2";;
3838 set signal.h LANGUAGE_C; eval $inctest
3842 ccflags="$ccflags -DSOCKS"
3847 default|recommended) dflt="$ccflags $dflt" ;;
3848 *) dflt="$ccflags";;
3856 Your C compiler may want other flags. For this question you should include
3857 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3858 but you should NOT include libraries or ld flags like -lwhatever. If you
3859 want $package to honor its debug switch, you should include -DDEBUGGING here.
3860 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3862 To use no flags, specify the word "none".
3868 rp="Any additional cc flags?"
3875 : the following weeds options from ccflags that are of no interest to cpp
3877 case "$gccversion" in
3878 1*) cppflags="$cppflags -D__GNUC__"
3880 case "$mips_type" in
3882 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3888 echo "Let me guess what the preprocessor flags are..." >&4
3902 *) ftry="$previous $flag";;
3904 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3905 >cpp1.out 2>/dev/null && \
3906 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3907 >cpp2.out 2>/dev/null && \
3908 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3909 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3911 cppflags="$cppflags $ftry"
3921 *-*) echo "They appear to be: $cppflags";;
3923 $rm -f cpp.c cpp?.out
3927 : flags used in final linking phase
3929 '') if ./venix; then
3935 *-posix*) dflt="$dflt -posix" ;;
3938 *) dflt="$ldflags";;
3941 : Try to guess additional flags to pick up local libraries.
3942 for thislibdir in $libpth; do
3943 case " $loclibpth " in
3946 *"-L$thislibdir "*) ;;
3947 *) dflt="$dflt -L$thislibdir" ;;
3959 Your C linker may need flags. For this question you should
3960 include -L/whatever and any other flags used by the C linker, but you
3961 should NOT include libraries like -lwhatever.
3963 Make sure you include the appropriate -L/path flags if your C linker
3964 does not normally search all of the directories you specified above,
3967 To use no flags, specify the word "none".
3971 rp="Any additional ld flags (NOT including libraries)?"
3977 rmlist="$rmlist pdp11"
3981 echo "Checking your choice of C compiler and flags for coherency..." >&4
3982 $cat > try.c <<'EOF'
3984 int main() { printf("Ok\n"); exit(0); }
3986 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3988 $cat >try.msg <<'EOM'
3989 I've tried to compile and run the following simple program:
3992 $cat try.c >> try.msg
3994 $cat >> try.msg <<EOM
4001 and I got the following output:
4005 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4006 if sh -c './try' >>try.msg 2>&1; then
4010 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4013 cat >> try.msg <<'EOQS'
4014 If $libs contains -lsfio, and sfio is mis-configured, then it
4015 sometimes (apparently) runs and exits with a 0 status, but with no
4016 output! It may have to do with sfio's use of _exit vs. exit.
4019 rp="You have a big problem. Shall I abort Configure"
4026 echo "The program compiled OK, but exited with status $?." >>try.msg
4027 rp="You have a problem. Shall I abort Configure"
4031 echo "I can't compile the test program." >>try.msg
4032 rp="You have a BIG problem. Shall I abort Configure"
4038 case "$knowitall" in
4040 echo "(The supplied flags or libraries might be incorrect.)"
4048 *) echo "Ok. Stopping Configure." >&4
4053 n) echo "OK, that should do.";;
4055 $rm -f try try.* core
4057 : define an is-a-typedef? function
4058 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4060 "") inclist="sys/types.h";;
4062 eval "varval=\$$var";
4066 for inc in $inclist; do
4067 echo "#include <$inc>" >>temp.c;
4069 echo "#ifdef $type" >> temp.c;
4070 echo "printf(\"We have $type\");" >> temp.c;
4071 echo "#endif" >> temp.c;
4072 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4073 if $contains $type temp.E >/dev/null 2>&1; then
4079 *) eval "$var=\$varval";;
4082 : define an is-a-typedef? function that prompts if the type is not available.
4083 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4085 "") inclist="sys/types.h";;
4087 eval "varval=\$$var";
4091 for inc in $inclist; do
4092 echo "#include <$inc>" >>temp.c;
4094 echo "#ifdef $type" >> temp.c;
4095 echo "printf(\"We have $type\");" >> temp.c;
4096 echo "#endif" >> temp.c;
4097 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4099 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4100 if $contains $type temp.E >/dev/null 2>&1; then
4101 echo "$type found." >&4;
4104 echo "$type NOT found." >&4;
4110 *) eval "$var=\$varval";;
4113 : define a shorthand compile call
4117 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4118 : define a shorthand compile call for compilations that should be ok.
4122 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4124 : check for lengths of integral types
4128 echo "Checking to see how big your integers are..." >&4
4129 $cat >intsize.c <<'EOCP'
4133 printf("intsize=%d;\n", (int)sizeof(int));
4134 printf("longsize=%d;\n", (int)sizeof(long));
4135 printf("shortsize=%d;\n", (int)sizeof(short));
4140 if eval $compile_ok && ./intsize > /dev/null; then
4142 echo "Your integers are $intsize bytes long."
4143 echo "Your long integers are $longsize bytes long."
4144 echo "Your short integers are $shortsize bytes long."
4148 Help! I can't compile and run the intsize test program: please enlighten me!
4149 (This is probably a misconfiguration in your system or libraries, and
4150 you really ought to fix it. Still, I'll try anyway.)
4154 rp="What is the size of an integer (in bytes)?"
4158 rp="What is the size of a long integer (in bytes)?"
4162 rp="What is the size of a short integer (in bytes)?"
4168 $rm -f intsize intsize.*
4170 : see what type lseek is declared as in the kernel
4171 rp="What is the type used for lseek's offset on this system?"
4172 set off_t lseektype long stdio.h sys/types.h
4176 $echo $n "Checking to see how big your file offsets are...$c" >&4
4178 #include <sys/types.h>
4182 printf("%d\n", (int)sizeof($lseektype));
4187 if eval $compile_ok; then
4189 $echo " $lseeksize bytes." >&4
4193 echo "(I can't seem to compile the test program. Guessing...)"
4194 rp="What is the size of your file offsets (in bytes)?"
4200 : see what type file positions are declared as in the library
4201 rp="What is the type for file position used by fsetpos()?"
4202 set fpos_t fpostype long stdio.h sys/types.h
4207 *_t) zzz="$fpostype" ;;
4210 $echo $n "Checking the size of $zzz...$c" >&4
4212 #include <sys/types.h>
4215 printf("%d\n", (int)sizeof($fpostype));
4220 if eval $compile_ok; then
4225 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4228 echo " $fpossize bytes."
4234 echo "(I can't compile the test program. Guessing...)" >&4
4235 rp="What is the size of your file positions (in bytes)?"
4242 case "$lseeksize:$fpossize" in
4245 You can have files larger than 2 gigabytes.
4250 Perl can be built to understand large files (files larger than 2 gigabytes)
4251 on some systems. To do so, Configure must be run with -Duselargefiles.
4253 If this doesn't make any sense to you, just accept the default 'y'.
4255 case "$uselargefiles" in
4256 "$undef"|false|[nN]*) dflt='n' ;;
4259 rp='Try to understand large files, if available?'
4262 y|Y) val="$define" ;;
4269 case "$uselargefiles" in
4271 : Look for a hint-file generated 'call-back-unit'. If the
4272 : user has specified that a large files perl is to be built,
4273 : we may need to set or change some other defaults.
4274 if $test -f uselfs.cbu; then
4275 echo "Your platform has some specific hints for large file builds, using them..."
4278 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4280 #include <sys/types.h>
4284 printf("%d\n", (int)sizeof($lseektype));
4289 if eval $compile_ok; then
4291 $echo " $lseeksize bytes." >&4
4295 echo "(I can't seem to compile the test program. Guessing...)"
4296 rp="What is the size of your file offsets (in bytes)?"
4301 *_t) zzz="$fpostype" ;;
4304 $echo $n "Rechecking the size of $zzz...$c" >&4
4306 #include <sys/types.h>
4309 printf("%d\n", (int)sizeof($fpostype));
4314 if eval $compile_ok; then
4319 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4322 echo " $fpossize bytes."
4328 echo "(I can't compile the test program. Guessing...)" >&4
4329 rp="What is the size of your file positions (in bytes)?"
4339 case "$usemorebits" in
4340 "$define"|true|[yY]*)
4342 uselongdouble="$define"
4343 usemorebits="$define"
4345 *) usemorebits="$undef"
4350 case "$intsize:$longsize" in
4353 You have natively 64-bit integers.
4358 Perl can be built to take advantage of 64-bit integer types
4359 on some systems. To do so, Configure must be run with -Duse64bits.
4361 If this doesn't make any sense to you, just accept the default.
4363 case "$use64bits" in
4364 $define|true|[yY]*) dflt='y';;
4367 rp='Try to use 64-bit integers, if available?'
4370 y|Y) val="$define" ;;
4378 case "$archname64" in
4379 '') archname64='' ;; # not a typo
4382 case "$use64bits" in
4383 "$define"|true|[yY]*)
4384 : Look for a hint-file generated 'call-back-unit'. If the
4385 : user has specified that a 64-bit perl is to be built,
4386 : we may need to set or change some other defaults.
4387 if $test -f use64bits.cbu; then
4388 echo "Your platform has some specific hints for 64-bit builds, using them..."
4392 (Your platform doesn't have any specific hints for 64-bit builds.)
4394 case "$intsize:$longsize" in
4396 (This is probably okay, as your system is a natively 64-bit system.)
4400 case "$gccversion" in
4402 *) case "$ccflags" in
4403 *-DUSE_LONG_LONG*) ;;
4405 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4406 to the compilation flags.
4408 ccflags="$ccflags -DUSE_LONG_LONG"
4417 : determine the architecture name
4419 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4420 tarch=`arch`"-$osname"
4421 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4422 if uname -m > tmparch 2>&1 ; then
4423 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4424 -e 's/$/'"-$osname/" tmparch`
4432 case "$myarchname" in
4435 echo "(Your architecture name used to be $myarchname.)"
4442 *) dflt="$archname";;
4444 rp='What is your architecture name'
4447 case "$usethreads" in
4449 echo "Threads selected." >&4
4451 *-thread*) echo "...and architecture name already has -thread." >&4
4453 *) archname="$archname-thread"
4454 echo "...setting architecture name to $archname." >&4
4459 case "$usemultiplicity" in
4461 echo "Multiplicity selected." >&4
4463 *-multi*) echo "...and architecture name already has -multi." >&4
4465 *) archname="$archname-multi"
4466 echo "...setting architecture name to $archname." >&4
4471 case "$use64bits" in
4473 case "$archname64" in
4478 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4480 *) archname="$archname-$archname64"
4481 echo "...setting architecture name to $archname." >&4
4488 : determine root of directory hierarchy where package will be installed.
4491 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4499 By default, $package will be installed in $dflt/bin, manual pages
4500 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4501 installation directories. Typically this is something like /usr/local.
4502 If you wish to have binaries under /usr/bin but other parts of the
4503 installation under /usr/local, that's ok: you will be prompted
4504 separately for each of the installation directories, the prefix being
4505 only used to set the defaults.
4509 rp='Installation prefix to use?'
4517 *) oldprefix="$prefix";;
4527 $define|true) afs=true ;;
4528 $undef|false) afs=false ;;
4529 *) if test -d /afs; then
4537 echo "AFS may be running... I'll be extra cautious then..." >&4
4539 echo "AFS does not seem to be running..." >&4
4542 : determine installation prefix for where package is to be installed.
4546 Since you are running AFS, I need to distinguish the directory in which
4547 files will reside from the directory in which they are installed (and from
4548 which they are presumably copied to the former directory by occult means).
4551 case "$installprefix" in
4552 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4553 *) dflt="$installprefix";;
4558 In some special cases, particularly when building $package for distribution,
4559 it is convenient to distinguish between the directory in which files should
4560 be installed from the directory ($prefix) in which they
4561 will eventually reside. For most users, these two directories are the same.
4564 case "$installprefix" in
4566 *) dflt=$installprefix;;
4570 rp='What installation prefix should I use for installing files?'
4572 installprefix="$ans"
4573 installprefixexp="$ansexp"
4575 : set the prefixit variable, to compute a suitable default value
4576 prefixit='case "$3" in
4578 case "$oldprefix" in
4579 "") eval "$1=\"\$$2\"";;
4586 ""|" ") eval "$1=\"\$$2\"";;
4592 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4594 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4595 /*-$oldprefix/*|\~*-$oldprefix/*)
4596 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4597 *) eval "$1=\"\$$2\"";;
4601 : set the base revision
4604 : get the patchlevel
4606 echo "Getting the current patchlevel..." >&4
4607 if $test -r $rsrc/patchlevel.h;then
4608 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4609 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4610 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
4616 $echo $n "(You have $package" $c
4619 *) $echo $n " $baserev" $c ;;
4621 $echo $n " patchlevel $patchlevel" $c
4622 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4625 if test 0 -eq "$subversion"; then
4626 version=`LC_ALL=C; export LC_ALL; \
4627 echo $baserev $patchlevel | \
4628 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
4630 version=`LC_ALL=C; export LC_ALL; \
4631 echo $baserev $patchlevel $subversion | \
4632 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
4635 : determine installation style
4636 : For now, try to deduce it from prefix unless it is already set.
4637 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4638 case "$installstyle" in
4639 '') case "$prefix" in
4640 *perl*) dflt='lib';;
4641 *) dflt='lib/perl5' ;;
4644 *) dflt='lib/perl5' ;;
4646 : Probably not worth prompting for this since we prompt for all
4647 : the directories individually, and the prompt would be too long and
4651 : determine where private library files go
4652 : Usual default is /usr/local/lib/perl5/$version.
4653 : Also allow things like /opt/perl/lib/$version, since
4654 : /opt/perl/lib/perl5... would be redundant.
4655 : The default "style" setting is made in installstyle.U
4656 case "$installstyle" in
4657 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4658 *) set dflt privlib lib/$version ;;
4663 There are some auxiliary files for $package that need to be put into a
4664 private library directory that is accessible by everyone.
4668 rp='Pathname where the private library files will reside?'
4671 privlibexp="$ansexp"
4672 : Change installation prefix, if necessary.
4673 if $test X"$prefix" != X"$installprefix"; then
4674 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4676 installprivlib="$privlibexp"
4679 : set the prefixup variable, to restore leading tilda escape
4680 prefixup='case "$prefixexp" in
4682 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4685 : determine where public architecture dependent libraries go
4688 : privlib default is /usr/local/lib/$package/$version
4689 : archlib default is /usr/local/lib/$package/$version/$archname
4690 : privlib may have an optional trailing /share.
4691 tdflt=`echo $privlib | $sed 's,/share$,,'`
4692 tdflt=$tdflt/$archname
4701 $spackage contains architecture-dependent library files. If you are
4702 sharing libraries in a heterogeneous environment, you might store
4703 these files in a separate location. Otherwise, you can just include
4704 them with the rest of the public library files.
4708 rp='Where do you want to put the public architecture-dependent libraries?'
4711 archlibexp="$ansexp"
4712 if $test X"$archlib" = X"$privlib"; then
4717 : Change installation prefix, if necessary.
4718 if $test X"$prefix" != X"$installprefix"; then
4719 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4721 installarchlib="$archlibexp"
4725 : Binary compatibility with 5.005 is not possible for builds
4726 : with advanced features
4727 case "$usethreads$usemultiplicity" in
4729 bincompat5005="$undef"
4730 d_bincompat5005="$undef"
4734 Perl 5.006 can be compiled for binary compatibility with 5.005.
4735 If you decide to do so, you will be able to continue using most
4736 of the extensions that were compiled for Perl 5.005.
4739 case "$bincompat5005$d_bincompat5005" in
4740 *"$undef"*) dflt=n ;;
4743 rp='Binary compatibility with Perl 5.005?'
4746 y*) val="$define" ;;
4751 case "$d_bincompat5005" in
4753 bincompat5005="$define"
4755 *) bincompat5005="$undef"
4756 d_bincompat5005="$undef"
4763 : see if setuid scripts can be secure
4766 Some kernels have a bug that prevents setuid #! scripts from being
4767 secure. Some sites have disabled setuid #! scripts because of this.
4769 First let's decide if your kernel supports secure setuid #! scripts.
4770 (If setuid #! scripts would be secure but have been disabled anyway,
4771 don't say that they are secure if asked.)
4776 if $test -d /dev/fd; then
4777 echo "#!$ls" >reflect
4778 chmod +x,u+s reflect
4779 ./reflect >flect 2>&1
4780 if $contains "/dev/fd" flect >/dev/null; then
4781 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4785 If you are not sure if they are secure, I can check but I'll need a
4786 username and password different from the one you are using right now.
4787 If you don't have such a username or don't want me to test, simply
4791 rp='Other username to test security of setuid scripts with?'
4796 case "$d_suidsafe" in
4797 '') echo "I'll assume setuid scripts are *not* secure." >&4
4800 echo "Well, the $hint value is *not* secure." >&4
4802 *) echo "Well, the $hint value *is* secure." >&4
4807 $rm -f reflect flect
4808 echo "#!$ls" >reflect
4809 chmod +x,u+s reflect
4812 echo '"su" will (probably) prompt you for '"$ans's password."
4813 su $ans -c './reflect >flect'
4814 if $contains "/dev/fd" flect >/dev/null; then
4815 echo "Okay, it looks like setuid scripts are secure." >&4
4818 echo "I don't think setuid scripts are secure." >&4
4823 rp='Does your kernel have *secure* setuid scripts?'
4826 [yY]*) val="$define";;
4831 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4832 echo "(That's for file descriptors, not floppy disks.)"
4838 $rm -f reflect flect
4840 : now see if they want to do setuid emulation
4843 case "$d_suidsafe" in
4846 echo "No need to emulate SUID scripts since they are secure here." >& 4
4850 Some systems have disabled setuid scripts, especially systems where
4851 setuid scripts cannot be secure. On systems where setuid scripts have
4852 been disabled, the setuid/setgid bits on scripts are currently
4853 useless. It is possible for $package to detect those bits and emulate
4854 setuid/setgid in a secure fashion. This emulation will only work if
4855 setuid scripts have been disabled in your kernel.
4859 "$define") dflt=y ;;
4862 rp="Do you want to do setuid/setgid emulation?"
4865 [yY]*) val="$define";;
4873 : determine filename position in cpp output
4875 echo "Computing filename position in cpp output for #include directives..." >&4
4876 echo '#include <stdio.h>' > foo.c
4879 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4880 $grep '^[ ]*#.*stdio\.h' | \
4881 while read cline; do
4884 while $test \$# -gt 0; do
4885 if $test -r \`echo \$1 | $tr -d '"'\`; then
4890 pos=\`expr \$pos + 1\`
4902 *) pos="${fieldn}th";;
4904 echo "Your cpp writes the filename in the $pos field of the line."
4906 : locate header file
4911 for usrincdir in $usrinc
4913 if test -f \$usrincdir/\$wanted; then
4914 echo "\$usrincdir/\$wanted"
4918 awkprg='{ print \$$fieldn }'
4919 echo "#include <\$wanted>" > foo\$\$.c
4920 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4921 $grep "^[ ]*#.*\$wanted" | \
4922 while read cline; do
4923 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4925 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4926 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4931 # status = 0: grep returned 0 lines, case statement not executed
4932 # status = 1: headerfile found
4933 # status = 2: while loop executed, no headerfile found
4937 if test \$status -eq 1; then
4944 : define an alternate in-header-list? function
4945 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4946 cont=true; xxf="echo \"<\$1> found.\" >&4";
4947 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4948 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4950 case $# in 4) instead=instead;; *) instead="at last";; esac;
4951 while $test "$cont"; do
4953 var=$2; eval "was=\$$2";
4954 if $test "$xxx" && $test -r "$xxx";
4956 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4959 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4960 set $yyy; shift; shift; yyy=$@;
4961 case $# in 0) cont="";;
4962 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4963 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4964 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4965 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4969 do set $yyy; var=$2; eval "was=\$$2";
4970 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4971 set $yyy; shift; shift; yyy=$@;
4974 : see if this is a malloc.h system
4975 set malloc.h i_malloc
4978 : see if stdlib is available
4979 set stdlib.h i_stdlib
4982 : determine which malloc to compile in
4984 case "$usemymalloc" in
4985 ''|[yY]*|true|$define) dflt='y' ;;
4988 rp="Do you wish to attempt to use the malloc that comes with $package?"
4994 mallocsrc='malloc.c'
4995 mallocobj="malloc$_o"
4996 d_mymalloc="$define"
4999 : Remove malloc from list of libraries to use
5000 echo "Removing unneeded -lmalloc from library list" >&4
5001 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5004 echo "libs = $libs" >&4
5016 : compute the return types of malloc and free
5018 $cat >malloc.c <<END
5022 #include <sys/types.h>
5036 case "$malloctype" in
5038 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5045 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5049 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5056 echo "Your system uses $freetype free(), it would seem." >&4
5060 The installation process will also create a directory for
5061 vendor-supplied add-ons. Vendors who supply perl with their system
5062 may find it convenient to place all vendor-supplied files in this
5063 directory rather than in the main distribution directory. This will
5064 ease upgrades between binary-compatible maintenance versions of perl.
5066 Of course you may also use these directories in whatever way you see
5067 fit. For example, you might use them to access modules shared over a
5068 company-wide network.
5070 The default answer should be fine for most people.
5071 This causes further questions about vendor add-ons to be skipped
5072 and no vendor-specific directories will be configured for perl.
5075 rp='Do you want to configure vendor-specific add-on directories?'
5076 case "$usevendorprefix" in
5077 define|true|[yY]*) dflt=y ;;
5083 rp='Installation prefix to use for vendor-supplied add-ons?'
5084 case "$vendorprefix" in
5086 *) dflt=$vendorprefix ;;
5090 case "$vendorprefix" in
5094 *) oldvendorprefix="$prefix";;
5098 usevendorprefix="$define"
5100 vendorprefixexp="$ansexp"
5102 *) usevendorprefix="$undef"
5108 case "$vendorprefix" in
5109 '') d_vendorlib="$undef"
5113 *) d_vendorlib="$define"
5114 : determine where vendor-supplied modules go.
5115 : Usual default is /usr/local/lib/perl5/vendor_perl
5116 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5117 case "$installstyle" in
5118 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
5119 *) dflt=$vendorprefix/lib/vendor_$prog ;;
5122 rp='Pathname for the vendor-supplied library files?'
5125 vendorlibexp="$ansexp"
5126 : Change installation prefix, if necessary.
5127 if $test X"$prefix" != X"$installprefix"; then
5128 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5130 installvendorlib="$vendorlibexp"
5135 : Cruising for prototypes
5137 echo "Checking out function prototypes..." >&4
5138 $cat >prototype.c <<'EOCP'
5139 int main(int argc, char *argv[]) {
5142 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5143 echo "Your C compiler appears to support function prototypes."
5146 echo "Your C compiler doesn't seem to understand function prototypes."
5153 case "$prototype" in
5155 *) ansi2knr='ansi2knr'
5160 This version of $package can only be compiled by a compiler that
5161 understands function prototypes. Unfortunately, your C compiler
5163 doesn't seem to understand them. Sorry about that.
5165 If GNU cc is available for your system, perhaps you could try that instead.
5167 Eventually, we hope to support building Perl with pre-ANSI compilers.
5168 If you would like to help in that effort, please contact <perlbug@perl.org>.
5170 Aborting Configure now.
5176 : determine where public executables go
5181 rp='Pathname where the public executables will reside?'
5183 if $test "X$ansexp" != "X$binexp"; then
5188 : Change installation prefix, if necessary.
5189 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5190 if $test X"$prefix" != X"$installprefix"; then
5191 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5193 installbin="$binexp"
5196 : determine whether to install perl also as /usr/bin/perl
5199 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5201 Many scripts expect to perl to be installed as /usr/bin/perl.
5202 I can install the perl you are about to compile also as /usr/bin/perl
5203 (in addition to $installbin/perl).
5205 case "$installusrbinperl" in
5206 "$undef"|[nN]*) dflt='n';;
5209 rp="Do you want to install perl as /usr/bin/perl?"
5212 [yY]*) val="$define";;
5218 set installusrbinperl
5222 echo "Checking for GNU C Library..." >&4
5223 cat >gnulibc.c <<EOM
5235 if eval $compile_ok && ./gnulibc; then
5237 echo "You are using the GNU C Library"
5240 echo "You are not using the GNU C Library"
5246 : see if nm is to be used to determine whether a symbol is defined or not
5250 case "$d_gnulibc" in
5253 echo "nm probably won't work on the GNU C Library." >&4
5259 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5261 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5262 echo "'nm' won't be sufficient on this sytem." >&4
5268 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5269 if $test $dflt -gt 20; then
5279 true|$define) dflt=y;;
5286 I can use $nm to extract the symbols from your C libraries. This
5287 is a time consuming task which may generate huge output on the disk (up
5288 to 3 megabytes) but that should make the symbols extraction faster. The
5289 alternative is to skip the 'nm' extraction part and to compile a small
5290 test program instead to determine whether each symbol is present. If
5291 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5292 this may be the best solution.
5294 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5297 rp="Shall I use $nm to extract C symbols from the libraries?"
5300 [Nn]*) usenm=false;;
5309 : nm options which may be necessary
5311 '') if $test -f /mach_boot; then
5313 elif $test -d /usr/ccs/lib; then
5314 nm_opt='-p' # Solaris (and SunOS?)
5315 elif $test -f /dgux; then
5317 elif $test -f /lib64/rld; then
5318 nm_opt='-p' # 64-bit Irix
5324 : nm options which may be necessary for shared libraries but illegal
5325 : for archive libraries. Thank you, Linux.
5326 case "$nm_so_opt" in
5327 '') case "$myuname" in
5329 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5330 nm_so_opt='--dynamic'
5339 : get list of predefined functions in a handy place
5344 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5351 *) for thislib in $libs; do
5354 : Handle C library specially below.
5357 thislib=`echo $thislib | $sed -e 's/^-l//'`
5358 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5360 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5362 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5364 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5366 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5368 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5370 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5375 libnames="$libnames $try"
5377 *) libnames="$libnames $thislib" ;;
5386 for xxx in $libpth; do
5387 $test -r $1 || set $xxx/libc.$so
5388 : The messy sed command sorts on library version numbers.
5390 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5391 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5393 s/[0-9][0-9]*/0000&/g
5394 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5397 sort | $sed -e 's/^.* //'`
5400 $test -r $1 || set /usr/ccs/lib/libc.$so
5401 $test -r $1 || set /lib/libsys_s$_a
5407 if $test -r "$1"; then
5408 echo "Your (shared) C library seems to be in $1."
5410 elif $test -r /lib/libc && $test -r /lib/clib; then
5411 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5413 libc='/lib/clib /lib/libc'
5414 if $test -r /lib/syslib; then
5415 echo "(Your math library is in /lib/syslib.)"
5416 libc="$libc /lib/syslib"
5418 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5419 echo "Your C library seems to be in $libc, as you said before."
5420 elif $test -r $incpath/usr/lib/libc$_a; then
5421 libc=$incpath/usr/lib/libc$_a;
5422 echo "Your C library seems to be in $libc. That's fine."
5423 elif $test -r /lib/libc$_a; then
5425 echo "Your C library seems to be in $libc. You're normal."
5427 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5429 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5430 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5431 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5433 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5435 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5438 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5440 if $test -r "$tans"; then
5441 echo "Your C library seems to be in $tans, of all places."
5447 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5451 If the guess above is wrong (which it might be if you're using a strange
5452 compiler, or your machine supports multiple models), you can override it here.
5457 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5459 I can't seem to find your C library. I've looked in the following places:
5462 $sed 's/^/ /' libpath
5465 None of these seems to contain your C library. I need to get its name...
5470 rp='Where is your C library?'
5475 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5476 set X `cat libnames`
5479 case $# in 1) xxx=file; esac
5480 echo "Extracting names from the following $xxx for later perusal:" >&4
5482 $sed 's/^/ /' libnames >&4
5484 $echo $n "This may take a while...$c" >&4
5488 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5489 *) $nm $nm_opt $file 2>/dev/null;;
5494 $grep fprintf libc.tmp > libc.ptf
5495 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5496 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5498 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5500 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5502 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5504 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5506 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5508 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5510 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5512 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5514 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5516 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5518 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5520 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5522 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5523 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5525 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5527 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5529 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5531 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5533 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5535 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5537 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5539 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5541 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5543 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5545 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5547 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5549 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5551 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5553 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5556 $nm -p $* 2>/dev/null >libc.tmp
5557 $grep fprintf libc.tmp > libc.ptf
5558 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5559 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5565 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5567 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5568 for thisname in $libnames $libc; do
5569 $ar t $thisname >>libc.tmp
5571 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5573 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5574 # Repeat libc to extract forwarders to DLL entries too
5575 for thisname in $libnames $libc; do
5576 $ar tv $thisname >>libc.tmp
5577 # Revision 50 of EMX has bug in $ar.
5578 # it will not extract forwarders to DLL entries
5579 # Use emximp which will extract exactly them.
5580 emximp -o tmp.imp $thisname \
5582 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5583 < tmp.imp >>libc.tmp
5586 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5589 echo "$ar didn't seem to work right." >&4
5590 echo "Maybe this is a Cray...trying bld instead..." >&4
5591 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5593 for thisname in $libnames; do
5595 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5596 $ar t $thisname >>libc.tmp
5600 echo "That didn't work either. Giving up." >&4
5607 if $test -f /lib/syscalls.exp; then
5609 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5610 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5614 $rm -f libnames libpath
5616 : see if dld is available
5620 : is a C symbol defined?
5623 -v) tf=libc.tmp; tc=""; tdc="";;
5624 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5625 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5628 case "$reuseval-$4" in
5630 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5636 if $contains $tlook $tf >/dev/null 2>&1;
5641 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5642 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5650 $define) tval=true;;
5656 : define an is-in-libc? function
5657 inlibc='echo " "; td=$define; tu=$undef;
5658 sym=$1; var=$2; eval "was=\$$2";
5660 case "$reuseval$was" in
5670 echo "$sym() found." >&4;
5671 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5673 echo "$sym() NOT found." >&4;
5674 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5678 $define) echo "$sym() found." >&4;;
5679 *) echo "$sym() NOT found." >&4;;
5683 : see if dlopen exists
5690 : determine which dynamic loading, if any, to compile in
5692 dldir="ext/DynaLoader"
5705 $define) dflt='y' ;;
5708 $define) dflt='y' ;;
5710 : Does a dl_xxx.xs file exist for this operating system
5711 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5714 rp="Do you wish to use dynamic loading?"
5721 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5722 dflt="$dldir/dl_${osname}.xs"
5723 elif $test "$d_dlopen" = "$define" ; then
5724 dflt="$dldir/dl_dlopen.xs"
5725 elif $test "$i_dld" = "$define" ; then
5726 dflt="$dldir/dl_dld.xs"
5731 *) dflt="$dldir/$dlsrc"
5734 echo "The following dynamic loading files are available:"
5735 : Can not go over to $dldir because getfile has path hard-coded in.
5736 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5737 rp="Source file to use for dynamic loading"
5743 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5747 Some systems may require passing special flags to $cc -c to
5748 compile modules that will be used to create a shared library.
5749 To use no flags, say "none".
5752 case "$cccdlflags" in
5753 '') case "$gccversion" in
5754 '') case "$osname" in
5756 next) dflt='none' ;;
5757 irix*) dflt='-KPIC' ;;
5758 svr4*|esix*|solaris) dflt='-KPIC' ;;
5759 sunos) dflt='-pic' ;;
5763 *) case "$osname" in
5764 svr4*|esix*|solaris) dflt='-fPIC' ;;
5769 *) dflt="$cccdlflags" ;;
5771 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5774 none) cccdlflags=' ' ;;
5775 *) cccdlflags="$ans" ;;
5780 Some systems use ld to create libraries that can be dynamically loaded,
5781 while other systems (such as those using ELF) use $cc.
5785 '') $cat >try.c <<'EOM'
5786 /* Test for whether ELF binaries are produced */
5791 int i = open("a.out",O_RDONLY);
5794 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5795 exit(0); /* succeed (yes, it's ELF) */
5800 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5802 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5806 echo "I'll use ld to build dynamic libraries."
5815 rp="What command should be used to create dynamic libraries?"
5821 Some systems may require passing special flags to $ld to create a
5822 library that can be dynamically loaded. If your ld flags include
5823 -L/other/path options to locate libraries outside your loader's normal
5824 search path, you may need to specify those -L options here as well. To
5825 use no flags, say "none".
5828 case "$lddlflags" in
5829 '') case "$osname" in
5830 beos) dflt='-nostart' ;;
5832 linux|irix*) dflt='-shared' ;;
5833 next) dflt='none' ;;
5834 solaris) dflt='-G' ;;
5835 sunos) dflt='-assert nodefinitions' ;;
5836 svr4*|esix*) dflt="-G $ldflags" ;;
5840 *) dflt="$lddlflags" ;;
5843 : Try to guess additional flags to pick up local libraries.
5844 : Be careful not to append to a plain 'none'
5848 for thisflag in $ldflags; do
5853 *) dflt="$dflt $thisflag" ;;
5860 ''|' ') dflt='none' ;;
5863 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5866 none) lddlflags=' ' ;;
5867 *) lddlflags="$ans" ;;
5872 Some systems may require passing special flags to $cc to indicate that
5873 the resulting executable will use dynamic linking. To use no flags,
5877 case "$ccdlflags" in
5878 '') case "$osname" in
5879 hpux) dflt='-Wl,-E' ;;
5880 linux) dflt='-rdynamic' ;;
5881 next) dflt='none' ;;
5882 sunos) dflt='none' ;;
5886 *) dflt="$ccdlflags" ;;
5888 rp="Any special flags to pass to $cc to use dynamic loading?"
5891 none) ccdlflags=' ' ;;
5892 *) ccdlflags="$ans" ;;
5906 # No dynamic loading being used, so don't bother even to prompt.
5909 *) case "$useshrplib" in
5910 '') case "$osname" in
5911 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
5913 also='Building a shared libperl is required for dynamic loading to work on your system.'
5918 also='Building a shared libperl is needed for MAB support.'
5936 The perl executable is normally obtained by linking perlmain.c with
5937 libperl${_a}, any static extensions (usually just DynaLoader), and
5938 any other libraries needed on this system (such as -lm, etc.). Since
5939 your system supports dynamic loading, it is probably possible to build
5940 a shared libperl.$so. If you will have more than one executable linked
5941 to libperl.$so, this will significantly reduce the size of each
5942 executable, but it may have a noticeable affect on performance. The
5943 default is probably sensible for your system.
5947 rp="Build a shared libperl.$so (y/n)"
5951 useshrplib='true' ;;
5952 *) useshrplib='false' ;;
5957 case "$useshrplib" in
5961 # Figure out a good name for libperl.so. Since it gets stored in
5962 # a version-specific architecture-dependent library, the version
5963 # number isn't really that important, except for making cc/ld happy.
5965 # A name such as libperl.so.3.1
5966 majmin="libperl.$so.$patchlevel.$subversion"
5967 # A name such as libperl.so.301
5968 majonly=`echo $patchlevel $subversion |
5969 $awk '{printf "%d%02d", $1, $2}'`
5970 majonly=libperl.$so.$majonly
5971 # I'd prefer to keep the os-specific stuff here to a minimum, and
5972 # rely on figuring it out from the naming of libc.
5973 case "${osname}${osvers}" in
5976 # XXX How handle the --version stuff for MAB?
5978 linux*) # ld won't link with a bare -lperl otherwise.
5981 cygwin*) # include version
5982 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
5984 *) # Try to guess based on whether libc has major.minor.
5986 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5987 *libc.$so.[0-9]*) dflt=$majonly ;;
5988 *) dflt=libperl.$so ;;
5998 I need to select a good name for the shared libperl. If your system uses
5999 library names with major and minor numbers, then you might want something
6000 like $majmin. Alternatively, if your system uses a single version
6001 number for shared libraries, then you might want to use $majonly.
6002 Or, your system might be quite happy with a simple libperl.$so.
6004 Since the shared libperl will get installed into a version-specific
6005 architecture-dependent directory, the version number of the shared perl
6006 library probably isn't important, so the default should be o.k.
6009 rp='What name do you want to give to the shared libperl?'
6012 echo "Ok, I'll use $libperl"
6015 libperl="libperl${_a}"
6019 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6023 WARNING: Use of the shrpdir variable for the installation location of
6024 the shared $libperl is not supported. It was never documented and
6025 will not work in this version. Let me (perlbug@perl.com)
6026 know of any problems this may cause.
6032 But your current setting of $shrpdir is
6033 the default anyway, so it's harmless.
6038 Further, your current attempted setting of $shrpdir
6039 conflicts with the value of $archlibexp/CORE
6040 that installperl will use.
6047 # How will the perl executable find the installed shared $libperl?
6048 # Add $xxx to ccdlflags.
6049 # If we can't figure out a command-line option, use $shrpenv to
6050 # set env LD_RUN_PATH. The main perl makefile uses this.
6051 shrpdir=$archlibexp/CORE
6054 if "$useshrplib"; then
6057 # We'll set it in Makefile.SH...
6063 xxx="-Wl,-R$shrpdir"
6065 linux|irix*|dec_osf)
6066 xxx="-Wl,-rpath,$shrpdir"
6069 # next doesn't like the default...
6072 # beos doesn't like the default, either.
6075 # hpux doesn't like the default, either.
6076 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6079 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6085 # Only add $xxx if it isn't already in ccdlflags.
6086 case " $ccdlflags " in
6088 *) ccdlflags="$ccdlflags $xxx"
6091 Adding $xxx to the flags
6092 passed to $ld so that the perl executable will find the
6093 installed shared $libperl.
6101 # Fix ccdlflags in AIX for building external extensions.
6102 # (For building Perl itself bare -bE:perl.exp is needed,
6103 # Makefile.SH takes care of this.)
6105 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6107 # Respect a hint or command-line value.
6109 '') shrpenv="$tmp_shrpenv" ;;
6111 case "$ldlibpthname" in
6112 '') ldlibpthname=LD_LIBRARY_PATH ;;
6113 none) ldlibpthname='' ;;
6116 : determine where manual pages go
6117 set man1dir man1dir none
6121 $spackage has manual pages available in source form.
6125 echo "However, you don't have nroff, so they're probably useless to you."
6127 '') man1dir="none";;
6130 echo "If you don't want the manual sources installed, answer 'none'."
6135 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6136 lookpath="$lookpath $prefixexp/man/p_man/man1"
6137 lookpath="$lookpath $prefixexp/man/u_man/man1"
6138 lookpath="$lookpath $prefixexp/man/man.1"
6140 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6141 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6151 rp="Where do the main $spackage manual pages (source) go?"
6153 if $test "X$man1direxp" != "X$ansexp"; then
6157 man1direxp="$ansexp"
6163 : Change installation prefix, if necessary.
6164 if $test X"$prefix" != X"$installprefix"; then
6165 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6167 installman1dir="$man1direxp"
6170 : What suffix to use on installed man pages
6177 rp="What suffix should be used for the main $spackage man pages?"
6179 '') case "$man1dir" in
6193 *) dflt="$man1ext";;
6200 : see if we can have long filenames
6202 rmlist="$rmlist /tmp/cf$$"
6203 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6204 first=123456789abcdef
6205 second=/tmp/cf$$/$first
6206 $rm -f $first $second
6207 if (echo hi >$first) 2>/dev/null; then
6208 if $test -f 123456789abcde; then
6209 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6212 if (echo hi >$second) 2>/dev/null; then
6213 if $test -f /tmp/cf$$/123456789abcde; then
6215 That's peculiar... You can have filenames longer than 14 characters, but only
6216 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6217 I shall consider your system cannot support long filenames at all.
6221 echo 'You can have filenames longer than 14 characters.' >&4
6226 How confusing! Some of your filesystems are sane enough to allow filenames
6227 longer than 14 characters but some others like /tmp can't even think about them.
6228 So, for now on, I shall assume your kernel does not allow them at all.
6235 You can't have filenames longer than 14 chars. You can't even think about them!
6241 $rm -rf /tmp/cf$$ 123456789abcde*
6243 : determine where library module manual pages go
6244 set man3dir man3dir none
6248 $spackage has manual pages for many of the library modules.
6254 However, you don't have nroff, so they're probably useless to you.
6257 '') man3dir="none";;
6261 case "$d_flexfnam" in
6264 However, your system can't handle the long file names like File::Basename.3.
6267 '') man3dir="none";;
6271 echo "If you don't want the manual sources installed, answer 'none'."
6272 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6274 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6275 if $test -d "$privlib/man/man3"; then
6278 WARNING: Previous versions of perl installed man3 pages into
6279 $privlib/man/man3. This version will suggest a
6280 new default of $dflt.
6284 rp='Do you wish to preserve the old behavior?(y/n)'
6287 y*) dflt="$privlib/man/man3" ;;
6293 *) dflt="$man3dir" ;;
6297 rp="Where do the $package library man pages (source) go?"
6300 man3direxp="$ansexp"
6306 : Change installation prefix, if necessary.
6307 if $test X"$prefix" != X"$installprefix"; then
6308 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6310 installman3dir="$man3direxp"
6313 : What suffix to use on installed man pages
6319 rp="What suffix should be used for the $package library man pages?"
6321 '') case "$man3dir" in
6335 *) dflt="$man3ext";;
6342 : see if we have to deal with yellow pages, now NIS.
6343 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6344 if $test -f /usr/etc/nibindd; then
6346 echo "I'm fairly confident you're on a NeXT."
6348 rp='Do you get the hosts file via NetInfo?'
6357 y*) hostcat='nidump hosts .';;
6358 *) case "$hostcat" in
6359 nidump*) hostcat='';;
6369 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6377 rp='Are you getting the hosts file via yellow pages?'
6380 y*) hostcat='ypcat hosts';;
6381 *) hostcat='cat /etc/hosts';;
6387 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6390 '') test -f /etc/group && groupcat='cat /etc/group';;
6393 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6396 : now get the host name
6398 echo "Figuring out host name..." >&4
6399 case "$myhostname" in
6401 echo 'Maybe "hostname" will work...'
6402 if tans=`sh -c hostname 2>&1` ; then
6410 if $test "$cont"; then
6412 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6413 if tans=`cat /etc/systemid 2>&1` ; then
6415 phostname='cat /etc/systemid'
6416 echo "Whadyaknow. Xenix always was a bit strange..."
6419 elif $test -r /etc/systemid; then
6420 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6423 if $test "$cont"; then
6424 echo 'No, maybe "uuname -l" will work...'
6425 if tans=`sh -c 'uuname -l' 2>&1` ; then
6427 phostname='uuname -l'
6429 echo 'Strange. Maybe "uname -n" will work...'
6430 if tans=`sh -c 'uname -n' 2>&1` ; then
6432 phostname='uname -n'
6434 echo 'Oh well, maybe I can mine it out of whoami.h...'
6435 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6436 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6437 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6439 case "$myhostname" in
6440 '') echo "Does this machine have an identity crisis or something?"
6443 echo "Well, you said $myhostname before..."
6444 phostname='echo $myhostname';;
6450 : you do not want to know about this
6455 if $test "$myhostname" ; then
6457 rp='Your host name appears to be "'$myhostname'".'" Right?"
6465 : bad guess or no guess
6466 while $test "X$myhostname" = X ; do
6468 rp="Please type the (one word) name of your host:"
6473 : translate upper to lower if necessary
6474 case "$myhostname" in
6476 echo "(Normalizing case in your host name)"
6477 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6481 case "$myhostname" in
6483 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6484 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6485 echo "(Trimming domain name from host name--host name is now $myhostname)"
6487 *) case "$mydomain" in
6490 test "X$hostcat" = "Xypcat hosts" &&
6491 ypmatch "$myhostname" hosts 2>/dev/null |\
6492 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6495 test "X$hostcat" != "X" &&
6496 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6497 /[ ]$myhostname[ . ]/p" > hosts
6500 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6501 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6502 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6503 hosts | $sort | $uniq | \
6504 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6505 case `$echo X$dflt` in
6506 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6509 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6514 tans=`./loc resolv.conf X /etc /usr/etc`
6515 if $test -f "$tans"; then
6516 echo "(Attempting domain name extraction from $tans)"
6517 dflt=.`$sed -n -e 's/ / /g' \
6518 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6519 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6521 .) dflt=.`$sed -n -e 's/ / /g' \
6522 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6523 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6530 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6531 dflt=.`sh -c domainname 2>/dev/null`
6534 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6539 .) echo "(Lost all hope -- silly guess then)"
6545 *) dflt="$mydomain";;
6549 rp="What is your domain name?"
6559 : translate upper to lower if necessary
6562 echo "(Normalizing case in your domain name)"
6563 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6567 : a little sanity check here
6568 case "$phostname" in
6571 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6572 $myhostname$mydomain|$myhostname) ;;
6574 case "$phostname" in
6576 echo "(That doesn't agree with your whoami.h file, by the way.)"
6579 echo "(That doesn't agree with your $phostname command, by the way.)"
6589 I need to get your e-mail address in Internet format if possible, i.e.
6590 something like user@host.domain. Please answer accurately since I have
6591 no easy means to double check it. The default value provided below
6592 is most probably close to the reality but may not be valid from outside
6593 your organization...
6597 while test "$cont"; do
6599 '') dflt="$cf_by@$myhostname$mydomain";;
6600 *) dflt="$cf_email";;
6602 rp='What is your e-mail address?'
6608 rp='Address does not look like an Internet one. Use it anyway?'
6624 If you or somebody else will be maintaining perl at your site, please
6625 fill in the correct e-mail address here so that they may be contacted
6626 if necessary. Currently, the "perlbug" program included with perl
6627 will send mail to this address in addition to perlbug@perl.com. You may
6628 enter "none" for no administrator.
6631 case "$perladmin" in
6632 '') dflt="$cf_email";;
6633 *) dflt="$perladmin";;
6635 rp='Perl administrator e-mail address'
6639 : figure out how to guarantee perl startup
6640 case "$startperl" in
6642 case "$sharpbang" in
6646 I can use the #! construct to start perl on your system. This will
6647 make startup of perl scripts faster, but may cause problems if you
6648 want to share those scripts and perl is not in a standard place
6649 ($binexp/perl) on all your platforms. The alternative is to force
6650 a shell by starting the script with a single ':' character.
6654 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6657 none) startperl=": # use perl";;
6658 *) startperl="#!$ans"
6659 if $test 30 -lt `echo "$ans" | wc -c`; then
6662 WARNING: Some systems limit the #! command to 32 characters.
6663 If you experience difficulty running Perl scripts with #!, try
6664 installing Perl in a directory with a shorter pathname.
6670 *) startperl=": # use perl"
6675 echo "I'll use $startperl to start perl scripts."
6677 : figure best path for perl in scripts
6680 perlpath="$binexp/perl"
6681 case "$startperl" in
6686 I will use the "eval 'exec'" idiom to start Perl on your system.
6687 I can use the full path of your Perl binary for this purpose, but
6688 doing so may cause problems if you want to share those scripts and
6689 Perl is not always in a standard place ($binexp/perl).
6693 rp="What path shall I use in \"eval 'exec'\"?"
6700 case "$startperl" in
6702 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6705 : determine where public executable scripts go
6706 set scriptdir scriptdir
6708 case "$scriptdir" in
6711 : guess some guesses
6712 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6713 $test -d /usr/share/bin && dflt=/usr/share/bin
6714 $test -d /usr/local/script && dflt=/usr/local/script
6715 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6716 $test -d $prefixexp/script && dflt=$prefixexp/script
6720 *) dflt="$scriptdir"
6725 Some installations have a separate directory just for executable scripts so
6726 that they can mount it across multiple architectures but keep the scripts in
6727 one spot. You might, for example, have a subdirectory of /usr/share for this.
6728 Or you might just lump your scripts in with all your other executables.
6732 rp='Where do you keep publicly executable scripts?'
6734 if $test "X$ansexp" != "X$scriptdirexp"; then
6738 scriptdirexp="$ansexp"
6739 : Change installation prefix, if necessary.
6740 if $test X"$prefix" != X"$installprefix"; then
6741 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6743 installscript="$scriptdirexp"
6748 After $package is installed, you may wish to install various
6749 add-on modules and utilities. Typically, these add-ons will
6750 be installed under $prefix with the rest
6751 of this package. However, you may wish to install such add-ons
6752 elsewhere under a different prefix.
6754 If you do not wish to put everything under a single prefix, that's
6755 ok. You will be prompted for the individual locations; this siteprefix
6756 is only used to suggest the defaults.
6758 The default should be fine for most people.
6762 rp='Installation prefix to use for add-on modules and utilities?'
6763 : XXX Here might be another good place for an installstyle setting.
6764 case "$siteprefix" in
6766 *) dflt=$siteprefix ;;
6770 case "$siteprefix" in
6775 *) oldsiteprefix="$prefix";;
6780 siteprefixexp="$ansexp"
6782 : determine where site specific libraries go.
6783 : Usual default is /usr/local/lib/perl5/site_perl
6784 : The default "style" setting is made in installstyle.U
6785 : XXX No longer works with Prefixit stuff.
6786 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6787 case "$installstyle" in
6788 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog ;;
6789 *) dflt=$siteprefix/lib/site_$prog ;;
6793 The installation process will create a directory for
6794 site-specific extensions and modules. Most users find it convenient
6795 to place all site-specific files in this directory rather than in the
6796 main distribution directory.
6800 rp='Pathname for the site-specific library files?'
6803 sitelibexp="$ansexp"
6804 : Change installation prefix, if necessary.
6805 if $test X"$prefix" != X"$installprefix"; then
6806 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6808 installsitelib="$sitelibexp"
6811 : determine where site specific architecture-dependent libraries go.
6812 : sitelib default is /usr/local/lib/perl5/site_perl/
6813 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6814 : sitelib may have an optional trailing /share.
6815 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6816 tdflt="$tdflt/$apiversion/$archname"
6817 set sitearch sitearch none
6820 '') dflt="$tdflt" ;;
6821 *) dflt="$sitearch" ;;
6825 The installation process will also create a directory for
6826 architecture-dependent site-specific extensions and modules.
6830 rp='Pathname for the site-specific architecture-dependent library files?'
6833 sitearchexp="$ansexp"
6834 : Change installation prefix, if necessary.
6835 if $test X"$prefix" != X"$installprefix"; then
6836 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6838 installsitearch="$sitearchexp"
6841 : determine where add-on public executables go
6843 '') dflt=$siteprefix/bin ;;
6847 rp='Pathname where the add-on public executables should be installed?'
6850 sitebinexp="$ansexp"
6851 : Change installation prefix, if necessary.
6852 if $test X"$prefix" != X"$installprefix"; then
6853 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6855 installsitebin="$sitebinexp"
6860 Perl can be built to take advantage of long doubles which
6861 (if available) may give more accuracy and range for floating point numbers.
6863 If this doesn't make any sense to you, just accept the default 'n'.
6867 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6870 case "$uselongdouble" in
6871 $define|true|[yY]*) dflt='y';;
6874 rp='Try to use long doubles if available?'
6877 y|Y) val="$define" ;;
6883 case "$uselongdouble" in
6884 true|[yY]*) uselongdouble="$define" ;;
6887 case "$uselongdouble" in
6889 : Look for a hint-file generated 'call-back-unit'. If the
6890 : user has specified that long doubles should be used,
6891 : we may need to set or change some other defaults.
6892 if $test -f uselongdouble.cbu; then
6893 echo "Your platform has some specific hints for long doubles, using them..."
6894 . ./uselongdouble.cbu
6897 (Your platform doesn't have any specific hints for long doubles.)
6905 Perl can be built to take advantage of long longs which
6906 (if available) may give more range for integer numbers.
6908 If this doesn't make any sense to you, just accept the default 'n'.
6912 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6915 case "$uselonglong" in
6916 $define|true|[yY]*) dflt='y';;
6919 rp='Try to use long longs if available?'
6922 y|Y) val="$define" ;;
6928 case "$uselonglong" in
6929 true|[yY]*) uselonglong="$define" ;;
6932 case "$uselonglong" in
6934 : Look for a hint-file generated 'call-back-unit'. If the
6935 : user has specified that long longs should be used,
6936 : we may need to set or change some other defaults.
6937 if $test -f uselonglong.cbu; then
6938 echo "Your platform has some specific hints for long longs, using them..."
6942 (Your platform doesn't have any specific hints for long longs.)
6950 Previous version of $package used the standard IO mechanisms as defined
6951 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6952 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6953 the default. This abstraction layer can use AT&T's sfio (if you already
6954 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6955 problems with some extension modules. Using PerlIO with stdio is safe,
6956 but it is slower than plain stdio and therefore is not the default.
6958 If this doesn't make any sense to you, just accept the default 'n'.
6960 case "$useperlio" in
6961 $define|true|[yY]*) dflt='y';;
6964 rp='Use the experimental PerlIO abstraction layer?'
6971 echo "Ok, doing things the stdio way"
6978 case "$vendorprefix" in
6979 '') d_vendorbin="$undef"
6983 *) d_vendorbin="$define"
6984 : determine where vendor-supplied executables go.
6985 dflt=$vendorprefix/bin
6987 rp='Pathname for the vendor-supplied executables directory?'
6990 vendorbinexp="$ansexp"
6991 : Change installation prefix, if necessary.
6992 if $test X"$prefix" != X"$installprefix"; then
6993 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6995 installvendorbin="$vendorbinexp"
7000 : Check how to convert floats to strings.
7001 if test "X$d_Gconvert" = X; then
7003 echo "Checking for an efficient way to convert floats to strings."
7006 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7007 char *myname = "gconvert";
7010 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7011 char *myname = "gcvt";
7014 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7015 char *myname = "sprintf";
7021 checkit(expect, got)
7025 if (strcmp(expect, got)) {
7026 printf("%s oddity: Expected %s, got %s\n",
7027 myname, expect, got);
7037 /* This must be 1st test on (which?) platform */
7038 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7039 Gconvert(0.1, 8, 0, buf);
7040 checkit("0.1", buf);
7042 Gconvert(1.0, 8, 0, buf);
7045 Gconvert(0.0, 8, 0, buf);
7048 Gconvert(-1.0, 8, 0, buf);
7051 /* Some Linux gcvt's give 1.e+5 here. */
7052 Gconvert(100000.0, 8, 0, buf);
7053 checkit("100000", buf);
7055 /* Some Linux gcvt's give -1.e+5 here. */
7056 Gconvert(-100000.0, 8, 0, buf);
7057 checkit("-100000", buf);
7062 case "$d_Gconvert" in
7063 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7064 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7065 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7066 *) xxx_list='gconvert gcvt sprintf' ;;
7069 for xxx_convert in $xxx_list; do
7070 echo "Trying $xxx_convert"
7072 set try -DTRY_$xxx_convert
7073 if eval $compile; then
7074 echo "$xxx_convert" found. >&4
7076 echo "I'll use $xxx_convert to convert floats into a string." >&4
7079 echo "...But $xxx_convert didn't work as I expected."
7082 echo "$xxx_convert NOT found." >&4
7086 case "$xxx_convert" in
7087 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7088 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7089 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7093 : check for length of double
7095 case "$doublesize" in
7097 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7098 $cat >try.c <<'EOCP'
7102 printf("%d\n", (int)sizeof(double));
7107 if eval $compile_ok; then
7109 $echo " $doublesize bytes." >&4
7112 echo "(I can't seem to compile the test program. Guessing...)"
7113 rp="What is the size of a double precision number (in bytes)?"
7121 : check for long doubles
7123 $echo $n "Checking to see if your system supports long double..." $c >&4
7124 echo 'int main() { long double x = 7.0; }' > try.c
7126 if eval $compile; then
7128 echo " Yes, it does." >&4
7131 echo " No, it doesn't." >&4
7137 : check for length of long double
7138 case "${d_longdbl}${longdblsize}" in
7141 $echo $n "Checking to see how big your long doubles are..." $c >&4
7142 $cat >try.c <<'EOCP'
7146 printf("%d\n", sizeof(long double));
7151 if eval $compile; then
7152 longdblsize=`./try$exe_ext`
7153 $echo " $longdblsize bytes." >&4
7157 echo "(I can't seem to compile the test program. Guessing...)" >&4
7158 rp="What is the size of a long double (in bytes)?"
7162 if $test "X$doublesize" = "X$longdblsize"; then
7163 echo "(That isn't any different from an ordinary double.)"
7171 if $test X"$d_longdbl" = X"$define"; then
7173 echo "Checking how to print long doubles..." >&4
7175 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7176 $cat >try.c <<'EOCP'
7177 #include <sys/types.h>
7181 printf("%.3f\n", d);
7185 if eval $compile; then
7189 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7190 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7191 echo "We will use %f."
7197 if $test X"$sPRIfldbl" = X; then
7198 $cat >try.c <<'EOCP'
7199 #include <sys/types.h>
7202 long double d = 123.456;
7203 printf("%.3llf\n", d);
7207 if eval $compile; then
7211 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7212 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7213 echo "We will use %llf."
7219 if $test X"$sPRIfldbl" = X; then
7220 $cat >try.c <<'EOCP'
7221 #include <sys/types.h>
7224 long double d = 123.456;
7225 printf("%.3Lf\n", d);
7229 if eval $compile; then
7233 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7234 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7235 echo "We will use %Lf."
7241 if $test X"$sPRIfldbl" = X; then
7242 $cat >try.c <<'EOCP'
7243 #include <sys/types.h>
7246 long double d = 123.456;
7247 printf("%.3lf\n", d);
7251 if eval $compile; then
7255 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7256 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7257 echo "We will use %lf."
7263 if $test X"$sPRIfldbl" = X; then
7264 echo "Cannot figure out how to print long doubles." >&4
7271 case "$sPRIfldbl" in
7272 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7273 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7275 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7276 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7280 : Initialize h_fcntl
7283 : Initialize h_sysfile
7286 : access call always available on UNIX
7290 : locate the flags for 'access()'
7294 $cat >access.c <<'EOCP'
7295 #include <sys/types.h>
7300 #include <sys/file.h>
7309 : check sys/file.h first, no particular reason here
7310 if $test `./findhdr sys/file.h` && \
7311 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7313 echo "<sys/file.h> defines the *_OK access constants." >&4
7314 elif $test `./findhdr fcntl.h` && \
7315 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7317 echo "<fcntl.h> defines the *_OK access constants." >&4
7318 elif $test `./findhdr unistd.h` && \
7319 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7320 echo "<unistd.h> defines the *_OK access constants." >&4
7322 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7328 : see if accessx exists
7329 set accessx d_accessx
7332 : see if alarm exists
7336 : see if atolf exists
7340 : see if atoll exists
7344 : Look for GNU-cc style attribute checking
7346 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7347 $cat >attrib.c <<'EOCP'
7349 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7351 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7352 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7353 echo "Your C compiler doesn't fully support __attribute__."
7356 echo "Your C compiler supports __attribute__."
7360 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7367 : see if bcmp exists
7371 : see if bcopy exists
7375 : see if this is a unistd.h system
7376 set unistd.h i_unistd
7379 : see if getpgrp exists
7380 set getpgrp d_getpgrp
7383 case "$d_getpgrp" in
7386 echo "Checking to see which flavor of getpgrp is in use..."
7389 #include <sys/types.h>
7391 # include <unistd.h>
7395 if (getuid() == 0) {
7396 printf("(I see you are running Configure as super-user...)\n");
7400 if (getpgrp(1) == 0)
7409 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7410 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7412 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7413 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7416 echo "I can't seem to compile and run the test program."
7418 xxx="a USG one, i.e. you use getpgrp()."
7420 # SVR4 systems can appear rather BSD-ish.
7423 xxx="a BSD one, i.e. you use getpgrp(pid)."
7427 xxx="probably a USG one, i.e. you use getpgrp()."
7432 echo "Assuming your getpgrp is $xxx" >&4
7441 : see if setpgrp exists
7442 set setpgrp d_setpgrp
7445 case "$d_setpgrp" in
7448 echo "Checking to see which flavor of setpgrp is in use..."
7451 #include <sys/types.h>
7453 # include <unistd.h>
7457 if (getuid() == 0) {
7458 printf("(I see you are running Configure as super-user...)\n");
7462 if (-1 == setpgrp(1, 1))
7465 if (setpgrp() != -1)
7471 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7472 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7474 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7475 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7478 echo "(I can't seem to compile and run the test program.)"
7480 xxx="a USG one, i.e. you use setpgrp()."
7482 # SVR4 systems can appear rather BSD-ish.
7485 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7489 xxx="probably a USG one, i.e. you use setpgrp()."
7494 echo "Assuming your setpgrp is $xxx" >&4
7502 : see if bzero exists
7506 : see if signal is declared as pointer to function returning int or void
7508 xxx=`./findhdr signal.h`
7509 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7510 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7511 echo "You have int (*signal())() instead of void." >&4
7513 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7514 echo "You have void (*signal())()." >&4
7516 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7517 echo "You have int (*signal())() instead of void." >&4
7519 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7520 echo "You have void (*signal())()." >&4
7523 case "$d_voidsig" in
7525 echo "I can't determine whether signal handler returns void or int..." >&4
7527 rp="What type does your signal handler return?"
7534 echo "As you already told me, signal handler returns void." >&4
7537 *) echo "As you already told me, signal handler returns int." >&4
7544 case "$d_voidsig" in
7545 "$define") signal_t="void";;
7550 : check for ability to cast large floats to 32-bit ints.
7552 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7553 if $test "$intsize" -ge 4; then
7560 #include <sys/types.h>
7562 $signal_t blech(s) int s; { exit(3); }
7569 signal(SIGFPE, blech);
7571 /* Don't let compiler optimize the test away. Store the number
7572 in a writable string for gcc to pass to sscanf under HP/UX.
7574 sprintf(str, "2147483647");
7575 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7579 /* x86 processors will probably give 0x8000 0000, which is a
7580 sign change. We don't want that. We want to mimic SPARC
7581 behavior here, which is to preserve the sign and give
7584 if (i32 != ($xxx) f)
7590 if eval $compile_ok; then
7594 echo "(I can't seem to compile the test program--assuming it can't)"
7602 echo "Nope, it can't."
7609 : check for ability to cast negative floats to unsigned
7611 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7614 #include <sys/types.h>
7616 $signal_t blech(s) int s; { exit(7); }
7617 $signal_t blech_in_list(s) int s; { exit(4); }
7618 unsigned long dummy_long(p) unsigned long p; { return p; }
7619 unsigned int dummy_int(p) unsigned int p; { return p; }
7620 unsigned short dummy_short(p) unsigned short p; { return p; }
7624 unsigned long along;
7626 unsigned short ashort;
7630 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7631 a direct f = -123. assignment. gcc-2.8.0 reportedly
7632 optimized the whole file away
7634 /* Store the number in a writable string for gcc to pass to
7637 sprintf(str, "-123");
7638 sscanf(str, "%lf", &f); /* f = -123.; */
7640 signal(SIGFPE, blech);
7641 along = (unsigned long)f;
7642 aint = (unsigned int)f;
7643 ashort = (unsigned short)f;
7644 if (along != (unsigned long)-123)
7646 if (aint != (unsigned int)-123)
7648 if (ashort != (unsigned short)-123)
7650 sprintf(str, "1073741824.");
7651 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7654 along = (unsigned long)f;
7655 if (along != 0x80000000)
7659 along = (unsigned long)f;
7660 if (along != 0x7fffffff)
7664 along = (unsigned long)f;
7665 if (along != 0x80000001)
7669 signal(SIGFPE, blech_in_list);
7670 sprintf(str, "123.");
7671 sscanf(str, "%lf", &f); /* f = 123.; */
7672 along = dummy_long((unsigned long)f);
7673 aint = dummy_int((unsigned int)f);
7674 ashort = dummy_short((unsigned short)f);
7675 if (along != (unsigned long)123)
7677 if (aint != (unsigned int)123)
7679 if (ashort != (unsigned short)123)
7686 if eval $compile_ok; then
7690 echo "(I can't seem to compile the test program--assuming it can't)"
7693 case "$castflags" in
7698 echo "Nope, it can't."
7705 : see if vprintf exists
7707 if set vprintf val -f d_vprintf; eval $csym; $val; then
7708 echo 'vprintf() found.' >&4
7710 $cat >vprintf.c <<'EOF'
7711 #include <varargs.h>
7713 int main() { xxx("foo"); }
7722 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7726 if eval $compile && ./vprintf; then
7727 echo "Your vsprintf() returns (int)." >&4
7730 echo "Your vsprintf() returns (char*)." >&4
7734 echo 'vprintf() NOT found.' >&4
7744 : see if chown exists
7748 : see if chroot exists
7752 : see if chsize exists
7756 : check for const keyword
7758 echo 'Checking to see if your C compiler knows about "const"...' >&4
7759 $cat >const.c <<'EOCP'
7760 typedef struct spug { int drokk; } spug;
7767 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7769 echo "Yup, it does."
7772 echo "Nope, it doesn't."
7777 : see if crypt exists
7779 if set crypt val -f d_crypt; eval $csym; $val; then
7780 echo 'crypt() found.' >&4
7784 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7785 if $test -z "$cryptlib"; then
7786 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7790 if $test -z "$cryptlib"; then
7791 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7795 if $test -z "$cryptlib"; then
7796 cryptlib=`./loc libcrypt$_a "" $libpth`
7800 if $test -z "$cryptlib"; then
7801 echo 'crypt() NOT found.' >&4
7810 : get csh whereabouts
7812 'csh') val="$undef" ;;
7817 : Respect a hint or command line value for full_csh.
7819 '') full_csh=$csh ;;
7822 : see if cuserid exists
7823 set cuserid d_cuserid
7826 : see if this is a limits.h system
7827 set limits.h i_limits
7830 : see if this is a float.h system
7834 : See if number of significant digits in a double precision number is known
7836 $cat >dbl_dig.c <<EOM
7846 printf("Contains DBL_DIG");
7849 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7850 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7851 echo "DBL_DIG found." >&4
7854 echo "DBL_DIG NOT found." >&4
7861 : see if difftime exists
7862 set difftime d_difftime
7865 : see if this is a dirent system
7867 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7869 echo "<dirent.h> found." >&4
7872 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7873 echo "<sys/dir.h> found." >&4
7876 xinc=`./findhdr sys/ndir.h`
7878 echo "<dirent.h> NOT found." >&4
7883 : Look for type of directory structure.
7885 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7887 case "$direntrytype" in
7890 $define) guess1='struct dirent' ;;
7891 *) guess1='struct direct' ;;
7894 *) guess1="$direntrytype"
7899 'struct dirent') guess2='struct direct' ;;
7900 *) guess2='struct dirent' ;;
7903 if $contains "$guess1" try.c >/dev/null 2>&1; then
7904 direntrytype="$guess1"
7905 echo "Your directory entries are $direntrytype." >&4
7906 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7907 direntrytype="$guess2"
7908 echo "Your directory entries seem to be $direntrytype." >&4
7910 echo "I don't recognize your system's directory entries." >&4
7911 rp="What type is used for directory entries on this system?"
7919 : see if the directory entry stores field length
7921 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7922 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7923 echo "Good, your directory entry keeps length information in d_namlen." >&4
7926 echo "Your directory entry does not know about the d_namlen field." >&4
7933 : see if dlerror exists
7936 set dlerror d_dlerror
7940 : see if dlfcn is available
7948 On a few systems, the dynamically loaded modules that perl generates and uses
7949 will need a different extension than shared libs. The default will probably
7957 rp='What is the extension of dynamically loaded modules'
7966 : Check if dlsym need a leading underscore
7972 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7973 $cat >dyna.c <<'EOM'
7982 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7984 #include <sys/types.h>
7998 int mode = RTLD_LAZY ;
8000 handle = dlopen("./dyna.$dlext", mode) ;
8001 if (handle == NULL) {
8006 symbol = dlsym(handle, "fred") ;
8007 if (symbol == NULL) {
8008 /* try putting a leading underscore */
8009 symbol = dlsym(handle, "_fred") ;
8010 if (symbol == NULL) {
8023 : Call the object file tmp-dyna.o in case dlext=o.
8024 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8025 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8026 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8027 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8030 1) echo "Test program failed using dlopen." >&4
8031 echo "Perhaps you should not use dynamic loading." >&4;;
8032 2) echo "Test program failed using dlsym." >&4
8033 echo "Perhaps you should not use dynamic loading." >&4;;
8034 3) echo "dlsym needs a leading underscore" >&4
8036 4) echo "dlsym doesn't need a leading underscore." >&4;;
8039 echo "I can't compile and run the test program." >&4
8040 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8045 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8050 hasproto='varname=$1; func=$2; shift; shift;
8051 while $test $# -ge 2; do
8053 $define) echo "#include <$2>";;
8057 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8058 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8059 echo "$func() prototype found.";
8062 echo "$func() prototype NOT found.";
8067 $rm -f try.c tryout.c'
8069 : see if prototype for drand48 is available
8071 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8074 : see if dup2 exists
8078 : see if eaccess exists
8079 set eaccess d_eaccess
8082 : see if endgrent exists
8083 set endgrent d_endgrent
8086 : see if endhostent exists
8087 set endhostent d_endhent
8090 : see if endnetent exists
8091 set endnetent d_endnent
8094 : see if endprotoent exists
8095 set endprotoent d_endpent
8098 : see if endpwent exists
8099 set endpwent d_endpwent
8102 : see if endservent exists
8103 set endservent d_endsent
8106 : see if endspent exists
8107 set endspent d_endspent
8110 : Locate the flags for 'open()'
8112 $cat >open3.c <<'EOCP'
8113 #include <sys/types.h>
8118 #include <sys/file.h>
8129 : check sys/file.h first to get FREAD on Sun
8130 if $test `./findhdr sys/file.h` && \
8131 set open3 -DI_SYS_FILE && eval $compile; then
8133 echo "<sys/file.h> defines the O_* constants..." >&4
8135 echo "and you have the 3 argument form of open()." >&4
8138 echo "but not the 3 argument form of open(). Oh, well." >&4
8141 elif $test `./findhdr fcntl.h` && \
8142 set open3 -DI_FCNTL && eval $compile; then
8144 echo "<fcntl.h> defines the O_* constants..." >&4
8146 echo "and you have the 3 argument form of open()." >&4
8149 echo "but not the 3 argument form of open(). Oh, well." >&4
8154 echo "I can't find the O_* constant definitions! You got problems." >&4
8160 : see which of string.h or strings.h is needed
8162 strings=`./findhdr string.h`
8163 if $test "$strings" && $test -r "$strings"; then
8164 echo "Using <string.h> instead of <strings.h>." >&4
8168 strings=`./findhdr strings.h`
8169 if $test "$strings" && $test -r "$strings"; then
8170 echo "Using <strings.h> instead of <string.h>." >&4
8172 echo "No string header found -- You'll surely have problems." >&4
8178 "$undef") strings=`./findhdr strings.h`;;
8179 *) strings=`./findhdr string.h`;;
8182 : check for non-blocking I/O stuff
8183 case "$h_sysfile" in
8184 true) echo "#include <sys/file.h>" > head.c;;
8187 true) echo "#include <fcntl.h>" > head.c;;
8188 *) echo "#include <sys/fcntl.h>" > head.c;;
8193 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8194 case "$o_nonblock" in
8197 $cat >>try.c <<'EOCP'
8201 printf("O_NONBLOCK\n");
8205 printf("O_NDELAY\n");
8209 printf("FNDELAY\n");
8216 if eval $compile_ok; then
8218 case "$o_nonblock" in
8219 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8220 *) echo "Seems like we can use $o_nonblock.";;
8223 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8226 *) echo "Using $hint value $o_nonblock.";;
8228 $rm -f try try.* .out core
8231 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8237 #include <sys/types.h>
8240 #define MY_O_NONBLOCK $o_nonblock
8241 #ifndef errno /* XXX need better Configure test */
8251 #include <strings.h>
8253 $signal_t blech(x) int x; { exit(3); }
8255 $cat >> try.c <<'EOCP'
8263 pipe(pd); /* Down: child -> parent */
8264 pipe(pu); /* Up: parent -> child */
8267 close(pd[1]); /* Parent reads from pd[0] */
8268 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8269 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8271 signal(SIGALRM, blech);
8273 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8275 sprintf(string, "%d\n", ret);
8276 write(2, string, strlen(string));
8279 if (errno == EAGAIN) {
8285 if (errno == EWOULDBLOCK)
8286 printf("EWOULDBLOCK\n");
8289 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8290 sleep(2); /* Give it time to close our pipe */
8292 ret = read(pd[0], buf, 1); /* Should read EOF */
8294 sprintf(string, "%d\n", ret);
8295 write(3, string, strlen(string));
8299 close(pd[0]); /* We write to pd[1] */
8300 close(pu[1]); /* We read from pu[0] */
8301 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8302 close(pd[1]); /* Pipe pd is now fully closed! */
8303 exit(0); /* Bye bye, thank you for playing! */
8307 if eval $compile_ok; then
8308 echo "$startsh" >mtry
8309 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8311 ./mtry >/dev/null 2>&1
8313 0) eagain=`$cat try.out`;;
8314 1) echo "Could not perform non-blocking setting!";;
8315 2) echo "I did a successful read() for something that was not there!";;
8316 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8317 *) echo "Something terribly wrong happened during testing.";;
8319 rd_nodata=`$cat try.ret`
8320 echo "A read() system call with no data present returns $rd_nodata."
8321 case "$rd_nodata" in
8324 echo "(That's peculiar, fixing that to be -1.)"
8330 echo "Forcing errno EAGAIN on read() with no data available."
8334 echo "Your read() sets errno to $eagain when no data is available."
8337 status=`$cat try.err`
8339 0) echo "And it correctly returns 0 to signal EOF.";;
8340 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8341 *) echo "However, your read() returns '$status' on EOF??";;
8344 if test "$status" = "$rd_nodata"; then
8345 echo "WARNING: you can't distinguish between EOF and no data!"
8349 echo "I can't compile the test program--assuming errno EAGAIN will do."
8356 echo "Using $hint value $eagain."
8357 echo "Your read() returns $rd_nodata when no data is present."
8358 case "$d_eofnblk" in
8359 "$define") echo "And you can see EOF because read() returns 0.";;
8360 "$undef") echo "But you can't see EOF status from read() returned value.";;
8362 echo "(Assuming you can't see EOF status from read anyway.)"
8368 $rm -f try try.* .out core head.c mtry
8370 : see if fchmod exists
8374 : see if fchown exists
8378 : see if this is an fcntl system
8382 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8383 while $test $# -ge 2; do
8385 $define) echo "#include <$2>";;
8389 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8391 if eval $compile; then
8402 : see whether socket exists
8404 $echo $n "Hmm... $c" >&4
8405 if set socket val -f d_socket; eval $csym; $val; then
8406 echo "Looks like you have Berkeley networking support." >&4
8408 if set setsockopt val -f; eval $csym; $val; then
8411 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8415 if $contains socklib libc.list >/dev/null 2>&1; then
8416 echo "Looks like you have Berkeley networking support." >&4
8418 : we will have to assume that it supports the 4.2 BSD interface
8421 echo "You don't have Berkeley networking in libc$_a..." >&4
8422 if test "X$d_socket" = "X$define"; then
8423 echo "...but you seem to believe that you have sockets." >&4
8425 for net in net socket
8427 if test -f /usr/lib/lib$net$_a; then
8428 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8429 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8430 if $contains socket libc.list >/dev/null 2>&1; then
8435 echo "...but the Wollongong group seems to have hacked it in." >&4
8436 sockethdr="-I/usr/netinclude"
8439 echo "Found Berkeley sockets interface in lib$net." >& 4
8440 if $contains setsockopt libc.list >/dev/null 2>&1; then
8443 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8450 if test "X$d_socket" != "X$define"; then
8451 echo "or anywhere else I see." >&4
8459 : see if socketpair exists
8460 set socketpair d_sockpair
8465 echo "Checking the availability of certain socket constants..." >& 4
8466 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8467 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8469 #include <sys/types.h>
8470 #include <sys/socket.h>
8476 set try; if eval $compile; then
8479 set d_${enum}; eval $setvar
8483 : see if sys/select.h has to be included
8484 set sys/select.h i_sysselct
8487 : see if we should include time.h, sys/time.h, or both
8489 if test "X$timeincl" = X; then
8490 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8491 $echo $n "I'm now running the test program...$c"
8492 $cat >try.c <<'EOCP'
8493 #include <sys/types.h>
8498 #ifdef SYSTIMEKERNEL
8501 #include <sys/time.h>
8504 #include <sys/select.h>
8513 struct timezone tzp;
8515 if (foo.tm_sec == foo.tm_sec)
8518 if (bar.tv_sec == bar.tv_sec)
8525 for s_timezone in '-DS_TIMEZONE' ''; do
8527 for s_timeval in '-DS_TIMEVAL' ''; do
8528 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8529 for i_time in '' '-DI_TIME'; do
8530 for i_systime in '-DI_SYSTIME' ''; do
8533 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8534 if eval $compile; then
8535 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8539 $echo $n "Succeeded with $flags$c"
8551 *SYSTIMEKERNEL*) i_systimek="$define"
8552 timeincl=`./findhdr sys/time.h`
8553 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8554 *) i_systimek="$undef";;
8557 *I_TIME*) i_time="$define"
8558 timeincl=`./findhdr time.h`" $timeincl"
8559 echo "We'll include <time.h>." >&4;;
8560 *) i_time="$undef";;
8563 *I_SYSTIME*) i_systime="$define"
8564 timeincl=`./findhdr sys/time.h`" $timeincl"
8565 echo "We'll include <sys/time.h>." >&4;;
8566 *) i_systime="$undef";;
8571 : check for fd_set items
8574 Checking to see how well your C compiler handles fd_set and friends ...
8576 $cat >fd_set.c <<EOCP
8577 #$i_systime I_SYS_TIME
8578 #$i_sysselct I_SYS_SELECT
8579 #$d_socket HAS_SOCKET
8580 #include <sys/types.h>
8582 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8585 #include <sys/time.h>
8588 #include <sys/select.h>
8597 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8604 set fd_set -DTRYBITS
8605 if eval $compile; then
8606 d_fds_bits="$define"
8608 echo "Well, your system knows about the normal fd_set typedef..." >&4
8610 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8611 d_fd_macros="$define"
8614 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8616 d_fd_macros="$undef"
8620 Hmm, your compiler has some difficulty with fd_set. Checking further...
8623 if eval $compile; then
8626 echo "Well, your system has some sort of fd_set available..." >&4
8628 echo "and you have the normal fd_set macros." >&4
8629 d_fd_macros="$define"
8632 but not the normal fd_set macros! Gross! More work for me...
8634 d_fd_macros="$undef"
8637 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8640 d_fd_macros="$undef"
8645 : see if fgetpos exists
8646 set fgetpos d_fgetpos
8649 : see if flock exists
8653 : see if fork exists
8657 : see if pathconf exists
8658 set pathconf d_pathconf
8661 : see if fpathconf exists
8662 set fpathconf d_fpathconf
8668 echo "Checking to see if your system supports off64_t..." >&4
8670 #include <sys/types.h>
8672 int main() { off64_t x = 7; }'
8675 if eval $compile; then
8677 echo "Yes, it does."
8680 echo "No, it doesn't."
8681 case "$lseeksize" in
8682 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8689 : check for fpos64_t
8691 echo "Checking to see if your system supports fpos64_t..." >&4
8693 #include <sys/stdio.h>
8694 int main() { fpos64_t x x = 7; }'
8697 if eval $compile; then
8699 echo "Yes, it does."
8702 echo "No, it doesn't."
8704 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8711 hasstruct='varname=$1; struct=$2; shift; shift;
8712 while $test $# -ge 2; do
8714 $define) echo "#include <$2>";;
8718 echo "int main () { struct $struct foo; }" >> try.c;
8720 if eval $compile; then
8729 : see if this is a sys/param system
8730 set sys/param.h i_sysparam
8733 : see if this is a sys/mount.h system
8734 set sys/mount.h i_sysmount
8737 : see if sys/types.h has to be included
8738 set sys/types.h i_systypes
8743 echo "Checking to see if your system supports struct fs_data..." >&4
8744 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8746 case "$d_fs_data_s" in
8747 "$define") echo "Yes, it does." ;;
8748 *) echo "No, it doesn't." ;;
8751 : see if fseeko exists
8755 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8758 : see if fsetpos exists
8759 set fsetpos d_fsetpos
8763 : see if fstatfs exists
8764 set fstatfs d_fstatfs
8768 : see if statvfs exists
8769 set statvfs d_statvfs
8772 : see if fstatvfs exists
8773 set fstatvfs d_fstatvfs
8777 : see if ftello exists
8781 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8784 : see if getgrent exists
8785 set getgrent d_getgrent
8788 : see if gethostbyaddr exists
8789 set gethostbyaddr d_gethbyaddr
8792 : see if gethostbyname exists
8793 set gethostbyname d_gethbyname
8796 : see if gethostent exists
8797 set gethostent d_gethent
8800 : see how we will look up host name
8803 if set gethostname val -f d_gethname; eval $csym; $val; then
8804 echo 'gethostname() found.' >&4
8805 d_gethname="$define"
8808 if set uname val -f d_uname; eval $csym; $val; then
8811 uname() was found, but you're running xenix, and older versions of xenix
8812 have a broken uname(). If you don't really know whether your xenix is old
8813 enough to have a broken system call, use the default answer.
8820 rp='Is your uname() broken?'
8823 n*) d_uname="$define"; call=uname;;
8826 echo 'uname() found.' >&4
8833 case "$d_gethname" in
8834 '') d_gethname="$undef";;
8837 '') d_uname="$undef";;
8839 case "$d_uname$d_gethname" in
8844 Every now and then someone has a $call() that lies about the hostname
8845 but can't be fixed for political or economic reasons. If you wish, I can
8846 pretend $call() isn't there and maybe compute hostname at run-time
8847 thanks to the '$phostname' command.
8850 rp="Shall I ignore $call() from now on?"
8853 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8856 case "$phostname" in
8858 *) case "$aphostname" in
8864 file=`./loc $file $file $pth`
8865 aphostname=`echo $file $*`
8870 case "$d_uname$d_gethname" in
8873 case "$phostname" in
8875 echo "There will be no way for $package to get your hostname." >&4;;
8877 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8881 case "$d_phostname" in
8882 '') d_phostname="$undef";;
8885 : see if this is a netdb.h system
8889 : see if prototypes for various gethostxxx netdb.h functions are available
8891 set d_gethostprotos gethostent $i_netdb netdb.h
8894 : see if getlogin exists
8895 set getlogin d_getlogin
8898 : see if getmnt exists
8902 : see if getmntent exists
8903 set getmntent d_getmntent
8906 : see if getnetbyaddr exists
8907 set getnetbyaddr d_getnbyaddr
8910 : see if getnetbyname exists
8911 set getnetbyname d_getnbyname
8914 : see if getnetent exists
8915 set getnetent d_getnent
8918 : see if prototypes for various getnetxxx netdb.h functions are available
8920 set d_getnetprotos getnetent $i_netdb netdb.h
8924 : see if getprotobyname exists
8925 set getprotobyname d_getpbyname
8928 : see if getprotobynumber exists
8929 set getprotobynumber d_getpbynumber
8932 : see if getprotoent exists
8933 set getprotoent d_getpent
8936 : see if getpgid exists
8937 set getpgid d_getpgid
8940 : see if getpgrp2 exists
8941 set getpgrp2 d_getpgrp2
8944 : see if getppid exists
8945 set getppid d_getppid
8948 : see if getpriority exists
8949 set getpriority d_getprior
8952 : see if prototypes for various getprotoxxx netdb.h functions are available
8954 set d_getprotoprotos getprotoent $i_netdb netdb.h
8957 : see if getpwent exists
8958 set getpwent d_getpwent
8962 : see if getservbyname exists
8963 set getservbyname d_getsbyname
8966 : see if getservbyport exists
8967 set getservbyport d_getsbyport
8970 : see if getservent exists
8971 set getservent d_getsent
8974 : see if prototypes for various getservxxx netdb.h functions are available
8976 set d_getservprotos getservent $i_netdb netdb.h
8979 : see if getspent exists
8980 set getspent d_getspent
8983 : see if getspnam exists
8984 set getspnam d_getspnam
8987 : see if gettimeofday or ftime exists
8988 set gettimeofday d_gettimeod
8990 case "$d_gettimeod" in
8996 val="$undef"; set d_ftime; eval $setvar
8999 case "$d_gettimeod$d_ftime" in
9002 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9006 : see if this is an grp system
9012 xxx=`./findhdr grp.h`
9013 $cppstdin $cppflags $cppminus < $xxx >$$.h
9015 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9027 set d_grpasswd; eval $setvar
9031 : see if hasmntopt exists
9032 set hasmntopt d_hasmntopt
9035 : see if this is a netinet/in.h or sys/in.h system
9036 set netinet/in.h i_niin sys/in.h i_sysin
9039 : see if arpa/inet.h has to be included
9040 set arpa/inet.h i_arpainet
9043 : see if htonl --and friends-- exists
9048 : Maybe they are macros.
9053 #include <sys/types.h>
9054 #$i_niin I_NETINET_IN
9056 #$i_arpainet I_ARPA_INET
9058 #include <netinet/in.h>
9064 #include <arpa/inet.h>
9067 printf("Defined as a macro.");
9070 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9071 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9073 echo "But it seems to be defined as a macro." >&4
9083 if set index val -f; eval $csym; $val; then
9084 if set strchr val -f d_strchr; eval $csym; $val; then
9085 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9088 echo "strchr() found." >&4
9092 echo "index() found." >&4
9097 echo "index() found." >&4
9100 if set strchr val -f d_strchr; eval $csym; $val; then
9103 echo "strchr() found." >&4
9105 echo "No index() or strchr() found!" >&4
9110 set d_strchr; eval $setvar
9112 set d_index; eval $setvar
9114 : check whether inet_aton exists
9115 set inet_aton d_inetaton
9118 : see if inttypes.h is available
9119 : we want a real compile instead of Inhdr because some systems
9120 : have an inttypes.h which includes non-existent headers
9123 #include <inttypes.h>
9125 static int32_t foo32 = 0x12345678;
9129 if eval $compile; then
9130 echo "<inttypes.h> found." >&4
9133 echo "<inttypes.h> NOT found." >&4
9142 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9144 #include <sys/types.h>
9145 #$i_inttypes I_INTTYPES
9147 #include <inttypes.h>
9149 int main() { int64_t x = 7; }
9152 if eval $compile; then
9154 echo " Yes, it does." >&4
9157 echo " No, it doesn't." >&4
9165 $cat >isascii.c <<'EOCP'
9177 if eval $compile; then
9178 echo "isascii() found." >&4
9181 echo "isascii() NOT found." >&4
9188 : see if killpg exists
9192 : see if lchown exists
9194 $cat > try.c <<'EOCP'
9195 /* System header to define __stub macros and hopefully few prototypes,
9196 which can conflict with char lchown(); below. */
9198 /* Override any gcc2 internal prototype to avoid an error. */
9199 /* We use char because int might match the return type of a gcc2
9200 builtin and then its argument prototype would still apply. */
9203 /* The GNU C library defines this for functions which it implements
9204 to always fail with ENOSYS. Some functions are actually named
9205 something starting with __ and the normal name is an alias. */
9206 #if defined (__stub_lchown) || defined (__stub___lchown)
9214 if eval $compile; then
9215 $echo "lchown() found." >&4
9218 $echo "lchown() NOT found." >&4
9224 : See if number of significant digits in a double precision number is known
9226 $cat >ldbl_dig.c <<EOM
9236 printf("Contains LDBL_DIG");
9239 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9240 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9241 echo "LDBL_DIG found." >&4
9244 echo "LDBL_DIG NOT found." >&4
9251 : see if link exists
9255 : see if localeconv exists
9256 set localeconv d_locconv
9259 : see if lockf exists
9263 : check for long long
9265 $echo $n "Checking to see if your system supports long long..." $c >&4
9266 echo 'int main() { long long x = 7; return 0; }' > try.c
9268 if eval $compile; then
9270 echo " Yes, it does." >&4
9273 echo " No, it doesn't." >&4
9279 : check for length of long long
9280 case "${d_longlong}${longlongsize}" in
9283 $echo $n "Checking to see how big your long longs are..." $c >&4
9284 $cat >try.c <<'EOCP'
9288 printf("%d\n", (int)sizeof(long long));
9293 if eval $compile_ok; then
9294 longlongsize=`./try$exe_ext`
9295 $echo " $longlongsize bytes." >&4
9299 echo "(I can't seem to compile the test program. Guessing...)"
9300 rp="What is the size of a long long (in bytes)?"
9304 if $test "X$longsize" = "X$longlongsize"; then
9305 echo "(That isn't any different from an ordinary long.)"
9311 : see if lstat exists
9315 : see if mblen exists
9319 : see if mbstowcs exists
9320 set mbstowcs d_mbstowcs
9323 : see if mbtowc exists
9327 : see if memchr exists
9331 : see if memcmp exists
9335 : see if memcpy exists
9339 : see if memmove exists
9340 set memmove d_memmove
9343 : see if memset exists
9347 : see if mkdir exists
9351 : see if mkfifo exists
9355 : see if mktime exists
9359 : see if msgctl exists
9363 : see if msgget exists
9367 : see if msgsnd exists
9371 : see if msgrcv exists
9375 : see how much of the 'msg*(2)' library is present.
9378 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9379 *"$undef"*) h_msg=false;;
9383 case "`ipcs 2>&1`" in
9384 "SVID messages"*"not configured"*)
9385 echo "Your $osname does not have the msg*(2) configured." >&4
9400 : we could also check for sys/ipc.h ...
9401 if $h_msg && $test `./findhdr sys/msg.h`; then
9402 echo "You have the full msg*(2) library." >&4
9405 echo "You don't have the full msg*(2) library." >&4
9411 : see if nice exists
9415 : see if POSIX threads are available
9416 set pthread.h i_pthread
9422 : how to create joinable pthreads
9423 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9425 echo "Checking what constant to use for creating joinable pthreads..." >&4
9426 $cat >try.c <<'EOCP'
9427 #include <pthread.h>
9429 int detachstate = JOINABLE;
9432 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9433 if eval $compile; then
9434 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9435 val="$undef" # Yes, undef.
9436 set d_old_pthread_create_joinable
9439 set old_pthread_create_joinable
9442 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9443 if eval $compile; then
9444 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9446 set d_old_pthread_create_joinable
9448 val=PTHREAD_CREATE_UNDETACHED
9449 set old_pthread_create_joinable
9452 set try -DJOINABLE=__UNDETACHED
9453 if eval $compile; then
9454 echo "You seem to use __UNDETACHED." >&4
9456 set d_old_pthread_create_joinable
9459 set old_pthread_create_joinable
9462 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9464 set d_old_pthread_create_joinable
9467 set old_pthread_create_joinable
9474 d_old_pthread_create_joinable="$undef"
9475 old_pthread_create_joinable=""
9478 : see if pause exists
9482 : see if pipe exists
9486 : see if poll exists
9491 : see whether the various POSIXish _yields exist
9493 #include <pthread.h>
9499 #ifdef PTHREAD_YIELD
9502 #ifdef PTHREAD_YIELD_NULL
9503 pthread_yield(NULL);
9509 : see if sched_yield exists
9510 set try -DSCHED_YIELD
9511 if eval $compile; then
9513 sched_yield='sched_yield()'
9517 case "$usethreads" in
9520 $define) echo 'sched_yield() found.' >&4 ;;
9521 *) echo 'sched_yield() NOT found.' >&4 ;;
9527 : see if pthread_yield exists
9528 set try -DPTHREAD_YIELD
9529 if eval $compile; then
9531 case "$sched_yield" in
9532 '') sched_yield='pthread_yield()' ;;
9535 set try -DPTHREAD_YIELD_NULL
9536 if eval $compile; then
9538 case "$sched_yield" in
9539 '') sched_yield='pthread_yield(NULL)' ;;
9545 case "$usethreads" in
9548 $define) echo 'pthread_yield() found.' >&4 ;;
9549 *) echo 'pthread_yield() NOT found.' >&4 ;;
9556 case "$sched_yield" in
9557 '') sched_yield=undef ;;
9562 : see if this is a pwd.h system
9568 xxx=`./findhdr pwd.h`
9569 $cppstdin $cppflags $cppminus < $xxx >$$.h
9571 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9579 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9587 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9595 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9603 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9611 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9619 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9627 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9639 set d_pwquota; eval $setvar
9640 set d_pwage; eval $setvar
9641 set d_pwchange; eval $setvar
9642 set d_pwclass; eval $setvar
9643 set d_pwexpire; eval $setvar
9644 set d_pwcomment; eval $setvar
9645 set d_pwgecos; eval $setvar
9646 set d_pwpasswd; eval $setvar
9652 echo "Checking which 64-bit integer type we could use..." >&4
9658 val='"unsigned int"'
9663 *) case "$longsize" in
9667 val='"unsigned long"'
9672 *) case "$uselonglong:$d_longlong:$longlongsize" in
9677 val='"unsigned long long"'
9682 *) case "$d_int64t" in
9701 '') case "$uselonglong:$d_longlong:$longlongsize" in
9703 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9704 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9708 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9713 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9718 : see if readdir and friends exist
9719 set readdir d_readdir
9721 set seekdir d_seekdir
9723 set telldir d_telldir
9725 set rewinddir d_rewinddir
9728 : see if readlink exists
9729 set readlink d_readlink
9732 : see if rename exists
9736 : see if rmdir exists
9740 : see if memory.h is available.
9745 : See if it conflicts with string.h
9751 $cppstdin $cppflags $cppminus < $strings > mem.h
9752 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9754 echo "We won't be including <memory.h>."
9764 : can bcopy handle overlapping blocks?
9769 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9776 $cat >>try.c <<'EOCP'
9779 # include <memory.h>
9782 # include <stdlib.h>
9785 # include <string.h>
9787 # include <strings.h>
9790 # include <unistd.h> /* Needed for NetBSD */
9794 char buf[128], abc[128];
9800 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9802 for (align = 7; align >= 0; align--) {
9803 for (len = 36; len; len--) {
9806 for (off = 1; off <= len; off++) {
9807 bcopy(b, b+off, len);
9808 bcopy(b+off, b, len);
9809 if (bcmp(b, abc, len))
9818 if eval $compile_ok; then
9819 if ./try 2>/dev/null; then
9823 echo "It can't, sorry."
9824 case "$d_memmove" in
9825 "$define") echo "But that's Ok since you have memmove()." ;;
9829 echo "(I can't compile the test program, so we'll assume not...)"
9830 case "$d_memmove" in
9831 "$define") echo "But that's Ok since you have memmove()." ;;
9836 $rm -f try.* try core
9840 : can memcpy handle overlapping blocks?
9845 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9852 $cat >>try.c <<'EOCP'
9855 # include <memory.h>
9858 # include <stdlib.h>
9861 # include <string.h>
9863 # include <strings.h>
9866 # include <unistd.h> /* Needed for NetBSD */
9870 char buf[128], abc[128];
9876 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9877 try to store the string in read-only memory. */
9878 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9880 for (align = 7; align >= 0; align--) {
9881 for (len = 36; len; len--) {
9883 memcpy(b, abc, len);
9884 for (off = 1; off <= len; off++) {
9885 memcpy(b+off, b, len);
9886 memcpy(b, b+off, len);
9887 if (memcmp(b, abc, len))
9896 if eval $compile_ok; then
9897 if ./try 2>/dev/null; then
9901 echo "It can't, sorry."
9902 case "$d_memmove" in
9903 "$define") echo "But that's Ok since you have memmove()." ;;
9907 echo "(I can't compile the test program, so we'll assume not...)"
9908 case "$d_memmove" in
9909 "$define") echo "But that's Ok since you have memmove()." ;;
9914 $rm -f try.* try core
9918 : can memcmp be trusted to compare relative magnitude?
9923 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9930 $cat >>try.c <<'EOCP'
9933 # include <memory.h>
9936 # include <stdlib.h>
9939 # include <string.h>
9941 # include <strings.h>
9944 # include <unistd.h> /* Needed for NetBSD */
9950 if ((a < b) && memcmp(&a, &b, 1) < 0)
9956 if eval $compile_ok; then
9957 if ./try 2>/dev/null; then
9961 echo "No, it can't (it uses signed chars)."
9964 echo "(I can't compile the test program, so we'll assume not...)"
9968 $rm -f try.* try core
9972 : see if select exists
9976 : see if semctl exists
9980 : see if semget exists
9984 : see if semop exists
9988 : see how much of the 'sem*(2)' library is present.
9991 case "$d_semctl$d_semget$d_semop" in
9992 *"$undef"*) h_sem=false;;
9996 case "`ipcs 2>&1`" in
9997 "SVID messages"*"not configured"*)
9998 echo "Your $osname does not have the sem*(2) configured." >&4
10001 set semctl d_semctl
10003 set semget d_semget
10011 : we could also check for sys/ipc.h ...
10012 if $h_sem && $test `./findhdr sys/sem.h`; then
10013 echo "You have the full sem*(2) library." >&4
10016 echo "You don't have the full sem*(2) library." >&4
10022 : see whether sys/sem.h defines union semun
10024 $cat > try.c <<'END'
10025 #include <sys/types.h>
10026 #include <sys/ipc.h>
10027 #include <sys/sem.h>
10028 int main () { union semun semun; semun.buf = 0; }
10031 if eval $compile; then
10032 echo "You have union semun in <sys/sem.h>." >&4
10035 echo "You do not have union semun in <sys/sem.h>." >&4
10038 $rm -f try try.c try.h
10042 : see how to do semctl IPC_STAT
10045 : see whether semctl IPC_STAT can use union semun
10050 # define S_IRUSR S_IREAD
10051 # define S_IWUSR S_IWRITE
10052 # define S_IXUSR S_IEXEC
10054 # define S_IRUSR 0400
10055 # define S_IWUSR 0200
10056 # define S_IXUSR 0100
10058 # define S_IRGRP (S_IRUSR>>3)
10059 # define S_IWGRP (S_IWUSR>>3)
10060 # define S_IXGRP (S_IXUSR>>3)
10061 # define S_IROTH (S_IRUSR>>6)
10062 # define S_IWOTH (S_IWUSR>>6)
10063 # define S_IXOTH (S_IXUSR>>6)
10066 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10067 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10068 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10073 #include <sys/types.h>
10074 #include <sys/ipc.h>
10075 #include <sys/sem.h>
10076 #include <sys/stat.h>
10083 #$d_union_semun HAS_UNION_SEMUN
10086 #ifndef HAS_UNION_SEMUN
10089 struct semid_ds *buf;
10090 unsigned short *array;
10096 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10097 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10099 struct semid_ds argbuf;
10102 st = semctl(sem, 0, IPC_STAT, arg);
10106 # endif /* IPC_STAT */
10107 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10109 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10110 # endif /* IPC_RMID */
10111 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10113 #endif /* IPC_PRIVATE && ... */
10114 printf("semget failed: errno = %d\n", errno);
10120 if eval $compile; then
10123 semun) val="$define" ;;
10129 case "$d_semctl_semun" in
10131 echo "You can use union semun for semctl IPC_STAT." >&4
10134 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10139 : see whether semctl IPC_STAT can use struct semid_ds pointer
10140 $cat > try.c <<'END'
10141 #include <sys/types.h>
10142 #include <sys/ipc.h>
10143 #include <sys/sem.h>
10144 #include <sys/stat.h>
10152 struct semid_ds arg;
10155 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10156 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10159 st = semctl(sem, 0, IPC_STAT, &arg);
10161 printf("semid_ds\n");
10163 # endif /* IPC_STAT */
10164 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10166 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10167 # endif /* IPC_RMID */
10168 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10170 #endif /* IPC_PRIVATE && ... */
10171 printf("semget failed: errno = %d\n", errno);
10178 if eval $compile; then
10181 semid_ds) val="$define" ;;
10185 set d_semctl_semid_ds
10187 case "$d_semctl_semid_ds" in
10189 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10191 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10198 # We do not have the full sem*(2) library, so assume we can not
10204 set d_semctl_semid_ds
10209 : see if setegid exists
10210 set setegid d_setegid
10213 : see if seteuid exists
10214 set seteuid d_seteuid
10217 : see if setgrent exists
10218 set setgrent d_setgrent
10221 : see if sethostent exists
10222 set sethostent d_sethent
10225 : see if setlinebuf exists
10226 set setlinebuf d_setlinebuf
10229 : see if setlocale exists
10230 set setlocale d_setlocale
10233 : see if setnetent exists
10234 set setnetent d_setnent
10237 : see if setprotoent exists
10238 set setprotoent d_setpent
10241 : see if setpgid exists
10242 set setpgid d_setpgid
10245 : see if setpgrp2 exists
10246 set setpgrp2 d_setpgrp2
10249 : see if setpriority exists
10250 set setpriority d_setprior
10253 : see if setpwent exists
10254 set setpwent d_setpwent
10257 : see if setregid exists
10258 set setregid d_setregid
10260 set setresgid d_setresgid
10263 : see if setreuid exists
10264 set setreuid d_setreuid
10266 set setresuid d_setresuid
10269 : see if setrgid exists
10270 set setrgid d_setrgid
10273 : see if setruid exists
10274 set setruid d_setruid
10277 : see if setservent exists
10278 set setservent d_setsent
10281 : see if setsid exists
10282 set setsid d_setsid
10285 : see if setspent exists
10286 set setspent d_setspent
10289 : see if setvbuf exists
10290 set setvbuf d_setvbuf
10293 : see if sfio.h is available
10298 : see if sfio library is available
10309 : Ok, but do we want to use it.
10313 true|$define|[yY]*) dflt='y';;
10316 echo "$package can use the sfio library, but it is experimental."
10317 rp="You seem to have sfio available, do you want to try using it?"
10321 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10323 : Remove sfio from list of libraries to use
10324 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10327 echo "libs = $libs" >&4
10331 *) case "$usesfio" in
10332 true|$define|[yY]*)
10333 echo "Sorry, cannot find sfio on this machine" >&4
10334 echo "Ignoring your setting of usesfio=$usesfio" >&4
10342 $define) usesfio='true';;
10343 *) usesfio='false';;
10346 : see if shmctl exists
10347 set shmctl d_shmctl
10350 : see if shmget exists
10351 set shmget d_shmget
10354 : see if shmat exists
10357 : see what shmat returns
10360 $cat >shmat.c <<'END'
10361 #include <sys/shm.h>
10364 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10369 echo "and it returns ($shmattype)." >&4
10370 : see if a prototype for shmat is available
10371 xxx=`./findhdr sys/shm.h`
10372 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10373 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10384 set d_shmatprototype
10387 : see if shmdt exists
10391 : see how much of the 'shm*(2)' library is present.
10394 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10395 *"$undef"*) h_shm=false;;
10399 case "`ipcs 2>&1`" in
10400 "SVID shared memory"*"not configured"*)
10401 echo "Your $osname does not have the shm*(2) configured." >&4
10404 set shmctl d_shmctl
10406 set shmget d_shmget
10416 : we could also check for sys/ipc.h ...
10417 if $h_shm && $test `./findhdr sys/shm.h`; then
10418 echo "You have the full shm*(2) library." >&4
10421 echo "You don't have the full shm*(2) library." >&4
10428 : see if we have sigaction
10429 if set sigaction val -f d_sigaction; eval $csym; $val; then
10430 echo 'sigaction() found.' >&4
10431 $cat > try.c <<'EOP'
10433 #include <sys/types.h>
10434 #include <signal.h>
10437 struct sigaction act, oact;
10439 oact.sa_handler = 0;
10440 /* so that act and oact are used */
10441 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10445 if eval $compile_ok; then
10448 echo "But you don't seem to have a useable struct sigaction." >&4
10452 echo 'sigaction NOT found.' >&4
10455 set d_sigaction; eval $setvar
10456 $rm -f try try$_o try.c
10458 : see if sigsetjmp exists
10460 case "$d_sigsetjmp" in
10462 $cat >try.c <<'EOP'
10463 #include <setjmp.h>
10468 if (sigsetjmp(env,1))
10471 siglongjmp(env, 1);
10476 if eval $compile; then
10477 if ./try >/dev/null 2>&1; then
10478 echo "POSIX sigsetjmp found." >&4
10482 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10488 echo "sigsetjmp not found." >&4
10492 *) val="$d_sigsetjmp"
10493 case "$d_sigsetjmp" in
10494 $define) echo "POSIX sigsetjmp found." >&4;;
10495 $undef) echo "sigsetjmp not found." >&4;;
10503 : see if sqrtl exists
10507 : see if sys/stat.h is available
10508 set sys/stat.h i_sysstat
10512 : see if stat knows about block sizes
10514 echo "Checking to see if your struct stat has st_blocks field..." >&4
10515 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10519 : see if this is a sys/vfs.h system
10520 set sys/vfs.h i_sysvfs
10524 : see if this is a sys/statfs.h system
10525 set sys/statfs.h i_sysstatfs
10530 echo "Checking to see if your system supports struct statfs..." >&4
10531 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
10533 case "$d_statfs_s" in
10534 "$define") echo "Yes, it does." ;;
10535 *) echo "No, it doesn't." ;;
10540 : see if struct statfs knows about f_flags
10541 case "$d_statfs_s" in
10544 echo "Checking to see if your struct statfs has f_flags field..." >&4
10545 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
10549 set d_statfs_f_flags
10553 case "$d_statfs_f_flags" in
10554 "$define") echo "Yes, it does." ;;
10555 *) echo "No, it doesn't." ;;
10558 : see if _ptr and _cnt from stdio act std
10560 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10561 echo "(Looks like you have stdio.h from Linux.)"
10562 case "$stdio_ptr" in
10563 '') stdio_ptr='((fp)->_IO_read_ptr)'
10566 *) ptr_lval=$d_stdio_ptr_lval;;
10568 case "$stdio_cnt" in
10569 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10572 *) cnt_lval=$d_stdio_cnt_lval;;
10574 case "$stdio_base" in
10575 '') stdio_base='((fp)->_IO_read_base)';;
10577 case "$stdio_bufsiz" in
10578 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10581 case "$stdio_ptr" in
10582 '') stdio_ptr='((fp)->_ptr)'
10585 *) ptr_lval=$d_stdio_ptr_lval;;
10587 case "$stdio_cnt" in
10588 '') stdio_cnt='((fp)->_cnt)'
10591 *) cnt_lval=$d_stdio_cnt_lval;;
10593 case "$stdio_base" in
10594 '') stdio_base='((fp)->_base)';;
10596 case "$stdio_bufsiz" in
10597 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10600 : test whether _ptr and _cnt really work
10601 echo "Checking how std your stdio is..." >&4
10604 #define FILE_ptr(fp) $stdio_ptr
10605 #define FILE_cnt(fp) $stdio_cnt
10607 FILE *fp = fopen("try.c", "r");
10610 18 <= FILE_cnt(fp) &&
10611 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10619 if eval $compile; then
10621 echo "Your stdio acts pretty std."
10624 echo "Your stdio isn't very std."
10627 echo "Your stdio doesn't appear very std."
10633 : Can _ptr be used as an lvalue?
10634 case "$d_stdstdio$ptr_lval" in
10635 $define$define) val=$define ;;
10638 set d_stdio_ptr_lval
10641 : Can _cnt be used as an lvalue?
10642 case "$d_stdstdio$cnt_lval" in
10643 $define$define) val=$define ;;
10646 set d_stdio_cnt_lval
10649 : see if _base is also standard
10651 case "$d_stdstdio" in
10655 #define FILE_base(fp) $stdio_base
10656 #define FILE_bufsiz(fp) $stdio_bufsiz
10658 FILE *fp = fopen("try.c", "r");
10661 19 <= FILE_bufsiz(fp) &&
10662 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10669 if eval $compile; then
10671 echo "And its _base field acts std."
10674 echo "But its _base field isn't std."
10677 echo "However, it seems to be lacking the _base field."
10686 Checking how to access stdio streams by file descriptor number...
10688 case "$stdio_stream_array" in
10689 '') $cat >try.c <<EOCP
10692 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10696 for s in _iob __iob __sF
10698 set try -DSTDIO_STREAM_ARRAY=$s
10699 if eval $compile; then
10700 case "`./try$exe_ext`" in
10701 yes) stdio_stream_array=$s; break ;;
10705 $rm -f try.* try$exe_ext
10707 case "$stdio_stream_array" in
10709 I can't figure out how to access stdio streams by file descriptor number.
10711 d_stdio_stream_array="$undef"
10714 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10716 d_stdio_stream_array="$define"
10720 : see if strcoll exists
10721 set strcoll d_strcoll
10724 : check for structure copying
10726 echo "Checking to see if your C compiler can copy structs..." >&4
10727 $cat >try.c <<'EOCP'
10737 if $cc -c try.c >/dev/null 2>&1 ; then
10739 echo "Yup, it can."
10742 echo "Nope, it can't."
10748 : see if strerror and/or sys_errlist[] exist
10750 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10751 if set strerror val -f d_strerror; eval $csym; $val; then
10752 echo 'strerror() found.' >&4
10753 d_strerror="$define"
10754 d_strerrm='strerror(e)'
10755 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10756 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10757 d_syserrlst="$define"
10759 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10760 d_syserrlst="$undef"
10762 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10763 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10764 echo 'strerror() found in string header.' >&4
10765 d_strerror="$define"
10766 d_strerrm='strerror(e)'
10767 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10768 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10769 d_syserrlst="$define"
10771 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10772 d_syserrlst="$undef"
10774 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10775 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10776 d_strerror="$undef"
10777 d_syserrlst="$define"
10778 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10780 echo 'strerror() and sys_errlist[] NOT found.' >&4
10781 d_strerror="$undef"
10782 d_syserrlst="$undef"
10783 d_strerrm='"unknown"'
10787 : see if strtod exists
10788 set strtod d_strtod
10791 : see if strtol exists
10792 set strtol d_strtol
10795 : see if strtoul exists
10796 set strtoul d_strtoul
10799 : see if strtoull exists
10800 set strtoull d_strtoull
10803 : see if strxfrm exists
10804 set strxfrm d_strxfrm
10807 : see if symlink exists
10808 set symlink d_symlink
10811 : see if syscall exists
10812 set syscall d_syscall
10815 : see if sysconf exists
10816 set sysconf d_sysconf
10819 : see if system exists
10820 set system d_system
10823 : see if tcgetpgrp exists
10824 set tcgetpgrp d_tcgetpgrp
10827 : see if tcsetpgrp exists
10828 set tcsetpgrp d_tcsetpgrp
10831 : see if prototype for telldir is available
10833 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10836 : see if this is a sys/times.h system
10837 set sys/times.h i_systimes
10840 : see if times exists
10842 if set times val -f d_times; eval $csym; $val; then
10843 echo 'times() found.' >&4
10846 case "$i_systimes" in
10847 "$define") inc='sys/times.h';;
10849 rp="What is the type returned by times() on this system?"
10850 set clock_t clocktype long stdio.h sys/types.h $inc
10853 echo 'times() NOT found, hope that will do.' >&4
10858 : see if truncate exists
10859 set truncate d_truncate
10862 : see if tzname[] exists
10864 if set tzname val -a d_tzname; eval $csym; $val; then
10866 echo 'tzname[] found.' >&4
10869 echo 'tzname[] NOT found.' >&4
10874 : see if umask exists
10878 : see if ustat exists
10882 : backward compatibility for d_hvfork
10883 if test X$d_hvfork != X; then
10884 d_vfork="$d_hvfork"
10887 : see if there is a vfork
10892 : Ok, but do we want to use it. vfork is reportedly unreliable in
10893 : perl on Solaris 2.x, and probably elsewhere.
10897 case "$usevfork" in
10903 Perl can only use a vfork() that doesn't suffer from strict
10904 restrictions on calling functions or modifying global data in
10905 the child. For example, glibc-2.1 contains such a vfork()
10906 that is unsuitable. If your system provides a proper fork()
10907 call, chances are that you do NOT want perl to use vfork().
10910 rp="Do you still want to use vfork()?"
10915 echo "Ok, we won't use vfork()."
10924 $define) usevfork='true';;
10925 *) usevfork='false';;
10928 : see if this is an sysdir system
10929 set sys/dir.h i_sysdir
10932 : see if this is an sysndir system
10933 set sys/ndir.h i_sysndir
10936 : see if closedir exists
10937 set closedir d_closedir
10940 case "$d_closedir" in
10943 echo "Checking whether closedir() returns a status..." >&4
10944 cat > closedir.c <<EOM
10945 #$i_dirent I_DIRENT /**/
10946 #$i_sysdir I_SYS_DIR /**/
10947 #$i_sysndir I_SYS_NDIR /**/
10948 #$i_systypes I_SYS_TYPES /**/
10950 #if defined(I_SYS_TYPES)
10951 #include <sys/types.h>
10953 #if defined(I_DIRENT)
10954 #include <dirent.h>
10955 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10956 #include <sys/dir.h>
10960 #include <sys/ndir.h>
10964 #include <ndir.h> /* may be wrong in the future */
10966 #include <sys/dir.h>
10971 int main() { return closedir(opendir(".")); }
10974 if eval $compile_ok; then
10975 if ./closedir > /dev/null 2>&1 ; then
10976 echo "Yes, it does."
10979 echo "No, it doesn't."
10983 echo "(I can't seem to compile the test program--assuming it doesn't)"
10991 set d_void_closedir
10994 : check for volatile keyword
10996 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10997 $cat >try.c <<'EOCP'
11000 typedef struct _goo_struct goo_struct;
11001 goo_struct * volatile goo = ((goo_struct *)0);
11002 struct _goo_struct {
11007 typedef unsigned short foo_t;
11008 char *volatile foo;
11010 volatile foo_t blech;
11014 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11016 echo "Yup, it does."
11019 echo "Nope, it doesn't."
11025 : see if there is a wait4
11029 : see if waitpid exists
11030 set waitpid d_waitpid
11033 : see if wcstombs exists
11034 set wcstombs d_wcstombs
11037 : see if wctomb exists
11038 set wctomb d_wctomb
11041 : preserve RCS keywords in files with variable substitution, grrr
11046 Revision='$Revision'
11048 case "$crosscompile" in
11049 ''|[nN]*) crosscompile="$undef" ;;
11053 next|rhapsody) multiarch="$define" ;;
11055 case "$multiarch" in
11056 ''|[nN]*) multiarch="$undef" ;;
11059 : check for alignment requirements
11061 case "$crosscompile$multiarch" in
11064 You seem to be either cross-compiling or doing a multiarchitecture build,
11065 skipping the memory alignment check.
11068 case "$alignbytes" in
11069 '') alignbytes=8 ;;
11073 case "$alignbytes" in
11074 '') echo "Checking alignment constraints..." >&4
11075 $cat >try.c <<'EOCP'
11083 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11088 if eval $compile_ok; then
11092 echo "(I can't seem to compile the test program...)"
11095 *) dflt="$alignbytes"
11098 rp="Doubles must be aligned on a how-many-byte boundary?"
11106 : check for ordering of bytes in a long
11108 case "$crosscompile$multiarch" in
11111 You seem to be either cross-compiling or doing a multiarchitecture build,
11112 skipping the byteorder check.
11118 case "$byteorder" in
11121 In the following, larger digits indicate more significance. A big-endian
11122 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11123 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11124 machines may have weird orders like 3412. A Cray will report 87654321,
11125 an Alpha will report 12345678. If the test program works the default is
11127 I'm now running the test program...
11129 $cat >try.c <<'EOCP'
11136 char c[sizeof(long)];
11139 if (sizeof(long) > 4)
11140 u.l = (0x08070605L << 32) | 0x04030201L;
11143 for (i = 0; i < sizeof(long); i++)
11144 printf("%c", u.c[i]+'0');
11151 if eval $compile && ./try > /dev/null; then
11154 [1-4][1-4][1-4][1-4]|12345678|87654321)
11155 echo "(The test program ran ok.)"
11156 echo "byteorder=$dflt"
11159 ????|????????) echo "(The test program ran ok.)" ;;
11160 *) echo "(The test program didn't run right for some reason.)" ;;
11165 (I can't seem to compile the test program. Guessing big-endian...)
11168 case "$xxx_prompt" in
11170 rp="What is the order of bytes in a long?"
11184 : how do we catenate cpp tokens here?
11186 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11187 $cat >cpp_stuff.c <<'EOCP'
11188 #define RCAT(a,b)a/**/b
11189 #define ACAT(a,b)a ## b
11193 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11194 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11195 echo "Oh! Smells like ANSI's been here." >&4
11196 echo "We can catify or stringify, separately or together!"
11198 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11199 echo "Ah, yes! The good old days!" >&4
11200 echo "However, in the good old days we don't know how to stringify and"
11201 echo "catify at the same time."
11205 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11206 to have to edit the values of CAT[2-5] in config.h...
11208 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11212 : see if this is a db.h system
11218 : Check db version.
11220 echo "Checking Berkeley DB version ..." >&4
11226 #include <sys/types.h>
11231 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11232 int Major, Minor, Patch ;
11233 unsigned long Version ;
11234 (void)db_version(&Major, &Minor, &Patch) ;
11235 printf("You have Berkeley DB Version 2 or greater\n");
11237 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11238 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11239 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11240 Major, Minor, Patch) ;
11242 /* check that db.h & libdb are compatible */
11243 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11244 printf("db.h and libdb are incompatible\n") ;
11248 printf("db.h and libdb are compatible\n") ;
11250 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11251 + DB_VERSION_PATCH ;
11253 /* needs to be >= 2.3.4 */
11254 if (Version < 2003004) {
11255 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11256 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11262 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11263 printf("You have Berkeley DB Version 1\n");
11264 exit(0); /* DB version < 2: the coast is clear. */
11266 exit(1); /* <db.h> not Berkeley DB? */
11272 if eval $compile_ok && ./try; then
11273 echo 'Looks OK.' >&4
11275 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11279 : Remove db from list of libraries to use
11280 echo "Removing unusable -ldb from library list" >&4
11281 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11284 echo "libs = $libs" >&4
11294 : Check the return type needed for hash
11296 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11302 #include <sys/types.h>
11305 #ifndef DB_VERSION_MAJOR
11306 u_int32_t hash_cb (ptr, size)
11314 info.hash = hash_cb;
11318 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11319 if $contains warning try.out >>/dev/null 2>&1 ; then
11322 db_hashtype='u_int32_t'
11325 : XXX Maybe we should just give up here.
11326 db_hashtype=u_int32_t
11328 echo "Help: I can't seem to compile the db test program." >&4
11329 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11332 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11334 *) db_hashtype=u_int32_t
11339 : Check the return type needed for prefix
11341 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11347 #include <sys/types.h>
11350 #ifndef DB_VERSION_MAJOR
11351 size_t prefix_cb (key1, key2)
11359 info.prefix = prefix_cb;
11363 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11364 if $contains warning try.out >>/dev/null 2>&1 ; then
11365 db_prefixtype='int'
11367 db_prefixtype='size_t'
11370 db_prefixtype='size_t'
11371 : XXX Maybe we should just give up here.
11373 echo "Help: I can't seem to compile the db test program." >&4
11374 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11377 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11379 *) db_prefixtype='size_t'
11383 : check for void type
11385 echo "Checking to see how well your C compiler groks the void type..." >&4
11386 case "$voidflags" in
11388 $cat >try.c <<'EOCP'
11394 extern void moo(); /* function returning void */
11395 void (*goo)(); /* ptr to func returning void */
11397 void *hue; /* generic ptr */
11410 int main() { sub(); }
11412 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11413 voidflags=$defvoidused
11414 echo "Good. It appears to support void to the level $package wants.">&4
11415 if $contains warning .out >/dev/null 2>&1; then
11416 echo "However, you might get some warnings that look like this:"
11420 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11421 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11422 echo "It supports 1..."
11423 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11424 echo "It also supports 2..."
11425 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11427 echo "And it supports 4 but not 8 definitely."
11429 echo "It doesn't support 4..."
11430 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11432 echo "But it supports 8."
11435 echo "Neither does it support 8."
11439 echo "It does not support 2..."
11440 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11442 echo "But it supports 4 and 8."
11444 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11446 echo "And it supports 4 but has not heard about 8."
11448 echo "However it supports 8 but not 4."
11453 echo "There is no support at all for void."
11458 case "$voidflags" in
11460 *) $cat >&4 <<'EOM'
11461 Support flag bits are:
11462 1: basic void declarations.
11463 2: arrays of pointers to functions returning void.
11464 4: operations between pointers to and addresses of void functions.
11465 8: generic void pointers.
11468 rp="Your void support flags add up to what?"
11476 : How can we generate normalized random numbers ?
11478 echo "Looking for a random number function..." >&4
11479 case "$randfunc" in
11481 if set drand48 val -f; eval $csym; $val; then
11483 echo "Good, found drand48()." >&4
11484 elif set random val -f; eval $csym; $val; then
11486 echo "OK, found random()." >&4
11489 echo "Yick, looks like I have to use rand()." >&4
11500 *-Dmy_rand=*|*-Dmy_srand=*)
11501 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11502 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11503 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11504 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11508 while $test "$cont"; do
11509 rp="Use which function to generate random numbers?"
11511 if $test "$ans" = "$dflt"; then
11517 if set $ans val -f; eval $csym; $val; then
11521 rp="I cannot find function $ans. Use that name anyway?"
11530 case "$randfunc" in
11532 drand01="drand48()"
11538 case "$randbits" in
11540 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11542 #$i_unistd I_UNISTD
11543 #$i_stdlib I_STDLIB
11546 # include <unistd.h>
11549 # include <stdlib.h>
11554 register unsigned long tmp;
11555 register unsigned long max = 0L;
11557 for (i = 1000; i; i--) {
11558 tmp = (unsigned long) $randfunc();
11559 if (tmp > max) max = tmp;
11561 for (i = 0; max; i++)
11567 if eval $compile_ok; then
11571 echo "(I can't seem to compile the test program...)"
11578 rp="How many bits does your $randfunc() function produce?"
11582 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11583 seedfunc="s$randfunc"
11584 randseedtype=unsigned
11588 rp="How many bits does your $randfunc() function produce?"
11591 seedfunc="s$randfunc"
11592 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11593 if set $seedfunc val -f; eval $csym; $val; then
11594 echo "(Using $seedfunc() to seed random generator)"
11596 echo "(Warning: no $seedfunc() to seed random generator)"
11599 randseedtype=unsigned
11607 echo "Determining whether or not we are on an EBCDIC system..." >&4
11608 $cat >tebcdic.c <<'EOM'
11611 if ('M'==0xd4) return 0;
11618 if eval $compile_ok; then
11620 echo "You have EBCDIC." >&4
11623 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11626 echo "I'm unable to compile the test program." >&4
11627 echo "I'll assume ASCII or some ISO Latin." >&4
11629 $rm -f tebcdic.c tebcdic
11635 Checking how to flush all pending stdio output...
11637 # I only know how to find the first 32 possibly open files on SunOS.
11638 # See also hints/sunos_4_1.sh and util.c --AD
11640 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11642 $cat >>try.c <<EOCP
11644 #$i_unistd I_UNISTD
11646 # include <unistd.h>
11648 #$d_sysconf HAS_SYSCONF
11649 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11650 #ifdef HAS_STDIO_STREAM_ARRAY
11651 # define STDIO_STREAM_ARRAY $stdio_stream_array
11654 FILE* p = fopen("try.out", "w");
11658 # ifdef TRY_FPRINTF
11662 #ifdef TRY_FFLUSH_NULL
11665 #ifdef TRY_FFLUSH_ALL
11667 long open_max = -1;
11668 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11669 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11671 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11672 open_max = sysconf(_SC_OPEN_MAX);
11675 open_max = FOPEN_MAX;
11678 open_max = OPEN_MAX;
11687 # ifdef HAS_STDIO_STREAM_ARRAY
11688 if (open_max > 0) {
11690 for (i = 0; i < open_max; i++)
11691 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11692 STDIO_STREAM_ARRAY[i]._file < open_max &&
11693 STDIO_STREAM_ARRAY[i]._flag)
11694 fflush(&STDIO_STREAM_ARRAY[i]);
11702 : first we have to find out how _not_ to flush
11703 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11705 set try -DTRY_FPUTC
11706 if eval $compile; then
11708 ./try$exe_ext 2>/dev/null
11709 if $test ! -s try.out -a "X$?" = X42; then
11715 set try -DTRY_FPRINTF
11717 if eval $compile; then
11719 ./try$exe_ext 2>/dev/null
11720 if $test ! -s try.out -a "X$?" = X42; then
11721 output=-DTRY_FPRINTF
11727 : check for fflush NULL behaviour
11728 case "$fflushNULL" in
11729 '') set try -DTRY_FFLUSH_NULL $output
11730 if eval $compile; then
11732 ./try$exe_ext 2>/dev/null
11734 if $test -s try.out -a "X$code" = X42; then
11735 fflushNULL="`$cat try.out`"
11737 if $test "X$code" != X42; then
11739 (If this test failed, don't worry, we'll try another method shortly.)
11744 $rm -f core try.core core.try.*
11745 case "$fflushNULL" in
11747 Your fflush(NULL) works okay.
11749 fflushNULL="$define"
11752 Your fflush(NULL) isn't working (contrary to ANSI C).
11754 fflushNULL="$undef"
11757 Cannot figure out whether your fflush(NULL) works or not.
11758 I'm assuming it doesn't (contrary to ANSI C).
11760 fflushNULL="$undef"
11764 $define|true|[yY]*)
11765 fflushNULL="$define"
11768 fflushNULL="$undef"
11771 : check explicit looping only if NULL did not work
11772 case "$fflushNULL" in
11774 : check for fflush all behaviour
11775 case "$fflushall" in
11776 '') set try -DTRY_FFLUSH_ALL $output
11777 if eval $compile; then
11779 (Now testing the other method--but note that also this may fail.)
11782 ./try$exe_ext 2>/dev/null
11783 if $test -s try.out -a "X$?" = X42; then
11784 fflushall="`$cat try.out`"
11787 $rm -f core try.core core.try.*
11788 case "$fflushall" in
11790 Whew. Flushing explicitly all the stdio streams works.
11792 fflushall="$define"
11795 Sigh. Flushing explicitly all the stdio streams doesn't work.
11800 Cannot figure out whether flushing stdio streams explicitly works or not.
11801 I'm assuming it doesn't.
11807 "$define"|true|[yY]*)
11808 fflushall="$define"
11815 *) fflushall="$undef"
11818 case "$fflushNULL$fflushall" in
11821 I cannot figure out how to flush pending stdio output.
11825 $rm -f try.* try$exe_ext
11827 : Store the full pathname to the ar program for use in the C program
11828 : Respect a hint or command line value for full_ar.
11833 : Store the full pathname to the sed program for use in the C program
11836 : see what type gids are declared as in the kernel
11838 echo "Looking for the type for group ids returned by getgid()."
11839 set gid_t gidtype xxx stdio.h sys/types.h
11843 xxx=`./findhdr sys/user.h`
11844 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11846 unsigned) dflt="$1 $2" ;;
11850 *) dflt="$gidtype";;
11853 gid_t) echo "gid_t found." ;;
11854 *) rp="What is the type for group ids returned by getgid()?"
11862 *_t) zzz="$gidtype" ;;
11865 echo "Checking the size of $zzz..." >&4
11867 #include <sys/types.h>
11870 printf("%d\n", (int)sizeof($gidtype));
11875 if eval $compile_ok; then
11879 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11882 echo "Your $zzz size is $gidsize bytes."
11887 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11893 *_t) zzz="$gidtype" ;;
11896 echo "Checking the sign of $zzz..." >&4
11898 #include <sys/types.h>
11909 if eval $compile; then
11913 echo "(I can't execute the test program--guessing unsigned.)" >&4
11917 1) echo "Your $zzz is unsigned." ;;
11918 -1) echo "Your $zzz is signed." ;;
11924 echo "(I can't compile the test program--guessing unsigned.)" >&4
11928 : check for length of character
11930 case "$charsize" in
11932 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11933 $cat >try.c <<'EOCP'
11937 printf("%d\n", (int)sizeof(char));
11942 if eval $compile_ok; then
11946 echo "(I can't seem to compile the test program. Guessing...)"
11953 rp="What is the size of a character (in bytes)?"
11960 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11962 case "$use64bits:$d_quad:$quadtype" in
11965 uvtype="$uquadtype"
11970 uvtype="unsigned long"
11976 case "$uselongdouble:$d_longdbl" in
11978 nvtype="long double"
11979 nvsize=$longdblsize
11986 echo "(IV will be "$ivtype", $ivsize bytes)"
11987 echo "(UV will be "$uvtype", $uvsize bytes)"
11988 echo "(NV will be "$nvtype", $nvsize bytes)"
11991 #$i_inttypes I_INTTYPES
11993 #include <inttypes.h>
11998 int8_t i = INT8_MAX;
11999 uint8_t u = UINT8_MAX;
12000 printf("int8_t\n");
12003 int16_t i = INT16_MAX;
12004 uint16_t i = UINT16_MAX;
12005 printf("int16_t\n");
12008 int32_t i = INT32_MAX;
12009 uint32_t u = UINT32_MAX;
12010 printf("int32_t\n");
12016 '') case "$charsize" in
12018 u8type="unsigned char"
12027 if eval $compile; then
12028 case "`./try$exe_ext`" in
12029 int8_t) i8type=int8_t
12039 '') if $test $charsize -ge 1; then
12041 u8type="unsigned char"
12049 '') case "$shortsize" in
12051 u16type="unsigned short"
12059 '') set try -DINT16
12060 if eval $compile; then
12061 case "`./try$exe_ext`" in
12073 '') if $test $shortsize -ge 2; then
12075 u16type="unsigned short"
12083 '') case "$longsize" in
12085 u32type="unsigned long"
12089 *) case "$intsize" in
12091 u32type="unsigned int"
12101 '') set try -DINT32
12102 if eval $compile; then
12103 case "`./try$exe_ext`" in
12115 '') if $test $intsize -ge 4; then
12117 u32type="unsigned int"
12125 '') case "$d_quad:$quadtype" in
12127 i64type="$quadtype"
12128 u64type="$uquadtype"
12140 if $test X"$quadtype" != X; then
12142 echo "Checking how to print 64-bit integers..." >&4
12144 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12145 $cat >try.c <<'EOCP'
12146 #include <sys/types.h>
12149 int q = 12345678901;
12150 printf("%ld\n", q);
12154 if eval $compile; then
12155 yyy=`./try$exe_ext`
12158 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12159 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12160 echo "We will use %d."
12166 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12167 $cat >try.c <<'EOCP'
12168 #include <sys/types.h>
12171 long q = 12345678901;
12172 printf("%ld\n", q);
12176 if eval $compile; then
12177 yyy=`./try$exe_ext`
12180 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12181 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12182 echo "We will use %ld."
12188 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12189 $cat >try.c <<'EOCP'
12190 #include <sys/types.h>
12191 #include <inttypes.h>
12194 int64_t q = 12345678901;
12195 printf("%" PRId64 "\n", q);
12199 if eval $compile; then
12200 yyy=`./try$exe_ext`
12203 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12204 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12205 echo "We will use the C9X style."
12211 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12212 $cat >try.c <<'EOCP'
12213 #include <sys/types.h>
12216 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12217 printf("%lld\n", q);
12221 if eval $compile; then
12222 yyy=`./try$exe_ext`
12225 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12226 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12227 echo "We will use the %lld style."
12233 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12235 #include <sys/types.h>
12238 $quadtype q = 12345678901;
12239 printf("%Ld\n", q);
12243 if eval $compile; then
12244 yyy=`./try$exe_ext`
12247 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12248 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12249 echo "We will use %Ld."
12255 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12257 #include <sys/types.h>
12260 $quadtype q = 12345678901;
12261 printf("%qd\n", q);
12265 if eval $compile; then
12266 yyy=`./try$exe_ext`
12269 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12270 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12271 echo "We will use %qd."
12277 if $test X"$sPRId64" = X; then
12278 echo "Cannot figure out how to print 64-bit integers." >&4
12286 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12287 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12289 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12290 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12296 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12298 if $test X"$ivsize" = X8; then
12299 ivdformat="$sPRId64"
12300 uvuformat="$sPRIu64"
12301 uvoformat="$sPRIo64"
12302 uvxformat="$sPRIx64"
12304 if $test X"$ivsize" = X"$longsize"; then
12310 if $test X"$ivsize" = X"$intsize"; then
12317 if $test X"$ivsize" = X"$shortsize"; then
12327 case "$ivdformat" in
12328 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12335 $echo "Checking the format string to be used for gids..." >&4
12338 -1) if $test X"$gidsize" = X"$ivsize"; then
12339 gidformat="$ivdformat"
12341 if $test X"$gidsize" = X"$longsize"; then
12344 if $test X"$gidsize" = X"$intsize"; then
12347 if $test X"$gidsize" = X"$shortsize"; then
12354 *) if $test X"$gidsize" = X"$uvsize"; then
12355 gidformat="$uvuformat"
12357 if $test X"$gidsize" = X"$longsize"; then
12360 if $test X"$gidsize" = X"$intsize"; then
12363 if $test X"$gidsize" = X"$shortsize"; then
12372 : see if getgroups exists
12373 set getgroups d_getgrps
12376 : see if setgroups exists
12377 set setgroups d_setgrps
12381 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12383 case "$d_getgrps$d_setgrps" in
12385 case "$groupstype" in
12386 '') dflt="$gidtype" ;;
12387 *) dflt="$groupstype" ;;
12390 What type of pointer is the second argument to getgroups() and setgroups()?
12391 Usually this is the same as group ids, $gidtype, but not always.
12394 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12398 *) groupstype="$gidtype";;
12402 echo "Checking if your $make program sets \$(MAKE)..." >&4
12403 case "$make_set_make" in
12405 $sed 's/^X //' > testmake.mak << 'EOF'
12407 X @echo 'maketemp="$(MAKE)"'
12409 case "`$make -f testmake.mak 2>/dev/null`" in
12410 *maketemp=*) make_set_make='#' ;;
12411 *) make_set_make="MAKE=$make" ;;
12413 $rm -f testmake.mak
12416 case "$make_set_make" in
12417 '#') echo "Yup, it does.";;
12418 *) echo "Nope, it doesn't.";;
12421 : see what type is used for mode_t
12422 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12423 set mode_t modetype int stdio.h sys/types.h
12426 : define a fucntion to check prototypes
12427 $cat > protochk <<EOSH
12430 optimize="$optimize"
12432 prototype="$prototype"
12437 $cat >> protochk <<'EOSH'
12442 while test $# -ge 2; do
12444 $define) echo "#include <$2>" >> try.c ;;
12445 literal) echo "$2" >> try.c ;;
12449 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12450 cat >> try.c <<'EOCP'
12451 #ifdef CAN_PROTOTYPE
12452 #define _(args) args
12457 echo "$foo" >> try.c
12458 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12459 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12465 $eunicefix protochk
12467 : see what type is used for size_t
12468 rp="What is the type used for the length parameter for string functions?"
12469 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12472 : check for type of arguments to gethostbyaddr.
12473 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12474 case "$d_gethbyaddr" in
12478 Checking to see what type of arguments are accepted by gethostbyaddr().
12480 hdrs="$define sys/types.h
12481 $d_socket sys/socket.h
12482 $i_niin netinet/in.h
12484 $i_unistd unistd.h"
12485 : The first arg can 'char *' or 'void *'
12486 : The second arg is some of integral type
12487 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12488 for yyy in size_t long int; do
12489 case "$netdb_host_type" in
12490 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12491 if ./protochk "$try" $hdrs; then
12492 echo "Your system accepts $xxx for the first arg."
12493 echo "...and $yyy for the second arg."
12494 netdb_host_type="$xxx"
12495 netdb_hlen_type="$yyy"
12501 : In case none of those worked, prompt the user.
12502 case "$netdb_host_type" in
12503 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12506 netdb_host_type=$ans
12507 rp='What is the type for the 2nd argument to gethostbyaddr?'
12510 netdb_hlen_type=$ans
12514 *) : no gethostbyaddr, so pick harmless defaults
12515 netdb_host_type='char *'
12516 netdb_hlen_type="$sizetype"
12519 # Remove the "const" if needed. -- but then we'll have a
12521 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12524 : check for type of argument to gethostbyname.
12525 if test "X$netdb_name_type" = X ; then
12526 case "$d_gethbyname" in
12530 Checking to see what type of argument is accepted by gethostbyname().
12532 hdrs="$define sys/types.h
12533 $d_socket sys/socket.h
12534 $i_niin netinet/in.h
12536 $i_unistd unistd.h"
12537 for xxx in "const char *" "char *"; do
12538 case "$netdb_name_type" in
12539 '') try="extern struct hostent *gethostbyname($xxx);"
12540 if ./protochk "$try" $hdrs; then
12541 echo "Your system accepts $xxx."
12542 netdb_name_type="$xxx"
12547 : In case none of those worked, prompt the user.
12548 case "$netdb_name_type" in
12549 '') rp='What is the type for the 1st argument to gethostbyname?'
12552 netdb_name_type=$ans
12556 *) : no gethostbyname, so pick harmless default
12557 netdb_name_type='char *'
12562 : check for type of 1st argument to getnetbyaddr.
12563 if test "X$netdb_net_type" = X ; then
12564 case "$d_getnbyaddr" in
12568 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12570 hdrs="$define sys/types.h
12571 $d_socket sys/socket.h
12572 $i_niin netinet/in.h
12574 $i_unistd unistd.h"
12575 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12576 case "$netdb_net_type" in
12577 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12578 if ./protochk "$try" $hdrs; then
12579 echo "Your system accepts $xxx."
12580 netdb_net_type="$xxx"
12585 : In case none of those worked, prompt the user.
12586 case "$netdb_net_type" in
12587 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12590 netdb_net_type=$ans
12594 *) : no getnetbyaddr, so pick harmless default
12595 netdb_net_type='long'
12599 : locate the preferred pager for this system
12613 '') dflt=/usr/ucb/more;;
12620 rp='What pager is used on your system?'
12624 : see what type pids are declared as in the kernel
12625 rp="What is the type of process ids on this system?"
12626 set pid_t pidtype int stdio.h sys/types.h
12629 : Find earliest binary compatible site_perl subdirectory perl can use.
12630 case "$bincompat5005" in
12631 "$define") xs_apiversion='5.005' ;;
12632 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12634 : Find earliest pure perl site_perl subdirectory perl can use.
12635 : The versioned directories started at 5.005.
12636 pm_apiversion='5.005'
12638 : check for length of pointer
12642 $echo $n "Checking to see how big your pointers are...$c" >&4
12643 if test "$voidflags" -gt 7; then
12644 echo '#define VOID_PTR char *' > try.c
12646 echo '#define VOID_PTR void *' > try.c
12648 $cat >>try.c <<'EOCP'
12652 printf("%d\n", (int)sizeof(VOID_PTR));
12657 if eval $compile_ok; then
12659 $echo " $ptrsize bytes." >&4
12662 echo "(I can't seem to compile the test program. Guessing...)" >&4
12663 rp="What is the size of a pointer (in bytes)?"
12671 : see if ar generates random libraries by itself
12673 echo "Checking how to generate random libraries on your machine..." >&4
12674 echo 'int bar1() { return bar2(); }' > bar1.c
12675 echo 'int bar2() { return 2; }' > bar2.c
12676 $cat > foo.c <<'EOP'
12677 int main() { printf("%d\n", bar1()); exit(0); }
12679 $cc $ccflags -c bar1.c >/dev/null 2>&1
12680 $cc $ccflags -c bar2.c >/dev/null 2>&1
12681 $cc $ccflags -c foo.c >/dev/null 2>&1
12682 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12683 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12684 ./foobar >/dev/null 2>&1; then
12685 echo "$ar appears to generate random libraries itself."
12688 elif $ar ts bar$_a >/dev/null 2>&1 &&
12689 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12690 ./foobar >/dev/null 2>&1; then
12691 echo "a table of contents needs to be added with '$ar ts'."
12698 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12699 $test -f $ranlib || ranlib=''
12702 if $test -n "$ranlib"; then
12703 echo "your system has '$ranlib'; we'll use that."
12706 echo "your system doesn't seem to support random libraries"
12707 echo "so we'll use lorder and tsort to order the libraries."
12714 : check for type of arguments to select.
12715 case "$selecttype" in
12716 '') case "$d_select" in
12719 Checking to see what type of arguments are accepted by select().
12721 hdrs="$define sys/types.h
12722 $i_systime sys/time.h
12723 $i_sysselct sys/select.h
12724 $d_socket sys/socket.h"
12725 : The first arg can be int, unsigned, or size_t
12726 : The last arg may or may not be 'const'
12728 : void pointer has been seen but using that
12729 : breaks the selectminbits test
12730 for xxx in 'fd_set *' 'int *'; do
12731 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12732 for tmo in 'struct timeval *' 'const struct timeval *'; do
12734 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12735 if ./protochk "$try" $hdrs; then
12736 echo "Your system accepts $xxx."
12745 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12746 case "$d_fd_set" in
12747 $define) dflt="fd_set *" ;;
12756 *) : no select, so pick a harmless default
12763 : check for the select 'width'
12764 case "$selectminbits" in
12765 '') case "$d_select" in
12769 Checking to see on how many bits at a time your select() operates...
12772 #include <sys/types.h>
12774 #$i_systime I_SYS_TIME
12775 #$i_systimek I_SYS_TIME_KERNEL
12780 # ifdef I_SYS_TIME_KERNEL
12783 # include <sys/time.h>
12784 # ifdef I_SYS_TIME_KERNEL
12788 #$i_sysselct I_SYS_SELECT
12789 #ifdef I_SYS_SELECT
12790 #include <sys/select.h>
12792 #$d_socket HAS_SOCKET
12794 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12798 #define S sizeof(*(b))
12800 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12801 #define NBITS (NBYTES * 8)
12810 fp = fopen("try.c", "r");
12816 b = ($selecttype)s;
12817 for (i = 0; i < NBITS; i++)
12821 select(fd + 1, b, 0, 0, &t);
12822 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12823 printf("%d\n", i + 1);
12828 if eval $compile_ok; then
12829 selectminbits=`./try`
12830 case "$selectminbits" in
12832 Cannot figure out on how many bits at a time your select() operates.
12833 I'll play safe and guess it is 32 bits.
12839 *) bits="$selectminbits bits" ;;
12841 echo "Your select() operates on $bits at a time." >&4
12843 rp='What is the minimum number of bits your select() operates on?'
12844 case "$byteorder" in
12845 1234|12345678) dflt=32 ;;
12850 selectminbits="$val"
12854 *) : no select, so pick a harmless default
12861 : Trace out the files included by signal.h, then look for SIGxxx names.
12862 : Remove SIGARRAYSIZE used by HPUX.
12863 : Remove SIGSTKSIZE used by Linux.
12864 : Remove SIGSTKSZ used by Posix.
12865 : Remove SIGTYP void lines used by OS2.
12866 : Some cpps, like os390, dont give the file name anywhere
12867 if [ "X$fieldn" = X ]; then
12868 : Just make some guesses. We check them later.
12869 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
12871 xxx=`echo '#include <signal.h>' |
12872 $cppstdin $cppminus $cppflags 2>/dev/null |
12873 $grep '^[ ]*#.*include' |
12874 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12876 : Check this list of files to be sure we have parsed the cpp output ok.
12877 : This will also avoid potentially non-existent files, such
12880 for xx in $xxx /dev/null ; do
12881 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12883 : If we have found no files, at least try signal.h
12884 case "$xxxfiles" in
12885 '') xxxfiles=`./findhdr signal.h` ;;
12888 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12889 print substr($2, 4, 20)
12891 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12892 print substr($3, 4, 20)
12894 : Append some common names just in case the awk scan failed.
12895 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
12896 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
12897 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
12898 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
12899 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
12901 : generate a few handy files for later
12902 $cat > signal.c <<'EOCP'
12903 #include <sys/types.h>
12904 #include <signal.h>
12908 /* Strange style to avoid deeply-nested #if/#else/#endif */
12911 # define NSIG (_NSIG)
12917 # define NSIG (SIGMAX+1)
12923 # define NSIG (SIG_MAX+1)
12929 # define NSIG (MAXSIG+1)
12935 # define NSIG (MAX_SIG+1)
12940 # ifdef SIGARRAYSIZE
12941 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12947 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12951 /* Default to some arbitrary number that's big enough to get most
12952 of the common signals.
12958 printf("NSIG %d\n", NSIG);
12964 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12966 printf "#ifdef SIG"; printf $1; printf "\n"
12967 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12968 printf $1; printf ");\n"
12972 printf "#endif /* JUST_NSIG */\n";
12973 printf "exit(0);\n}\n";
12976 $cat >signal.awk <<'EOP'
12977 BEGIN { ndups = 0 }
12978 $1 ~ /^NSIG$/ { nsig = $2 }
12979 ($1 !~ /^NSIG$/) && (NF == 2) {
12980 if ($2 > maxsig) { maxsig = $2 }
12981 if (sig_name[$2]) {
12982 dup_name[ndups] = $1
12983 dup_num[ndups] = $2
12995 printf("NSIG %d\n", nsig);
12996 for (n = 1; n < nsig; n++) {
12998 printf("%s %d\n", sig_name[n], sig_num[n])
13001 printf("NUM%d %d\n", n, n)
13004 for (n = 0; n < ndups; n++) {
13005 printf("%s %d\n", dup_name[n], dup_num[n])
13009 $cat >signal_cmd <<EOS
13011 if $test -s signal.lst; then
13012 echo "Using your existing signal.lst file"
13017 $cat >>signal_cmd <<'EOS'
13020 if eval $compile_ok; then
13021 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13023 echo "(I can't seem be able to compile the whole test program)" >&4
13024 echo "(I'll try it in little pieces.)" >&4
13025 set signal -DJUST_NSIG
13026 if eval $compile_ok; then
13027 ./signal$_exe > signal.nsg
13030 echo "I can't seem to figure out how many signals you have." >&4
13031 echo "Guessing 50." >&4
13032 echo 'NSIG 50' > signal.nsg
13034 : Now look at all the signal names, one at a time.
13035 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13036 $cat > signal.c <<EOCP
13037 #include <sys/types.h>
13038 #include <signal.h>
13041 printf("$xx %d\n", SIG${xx});
13046 if eval $compile; then
13047 echo "SIG${xx} found."
13048 ./signal$_exe >> signal.ls1
13050 echo "SIG${xx} NOT found."
13053 if $test -s signal.ls1; then
13054 $cat signal.nsg signal.ls1 |
13055 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13059 if $test -s signal.lst; then
13062 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13063 echo 'kill -l' >signal
13064 set X `csh -f <signal`
13068 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13070 echo $@ | $tr ' ' $trnl | \
13071 $awk '{ printf "%s %d\n", $1, ++s; }
13072 END { printf "NSIG %d\n", ++s }' >signal.lst
13074 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13076 chmod a+x signal_cmd
13077 $eunicefix signal_cmd
13079 : generate list of signal names
13081 case "$sig_name_init" in
13083 *) case "$sig_num_init" in
13084 ''|*,*) doinit=yes ;;
13089 echo "Generating a list of signal names and numbers..." >&4
13091 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13092 sig_name=`$awk 'BEGIN { printf "ZERO " }
13093 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13094 sig_num=`$awk 'BEGIN { printf "0 " }
13095 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13096 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13097 !/^NSIG/ { printf "\"%s\", ", $1 }
13098 END { printf "0\n" }' signal.lst`
13099 sig_num_init=`$awk 'BEGIN { printf "0, " }
13100 !/^NSIG/ { printf "%d, ", $2}
13101 END { printf "0\n"}' signal.lst`
13104 echo "The following $sig_count signals are available:"
13106 echo $sig_name | $awk \
13107 'BEGIN { linelen = 0 }
13109 for (i = 1; i <= NF; i++) {
13110 name = "SIG" $i " "
13111 linelen = linelen + length(name)
13112 if (linelen > 70) {
13114 linelen = length(name)
13120 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13122 : see what type is used for signed size_t
13123 set ssize_t ssizetype int stdio.h sys/types.h
13126 $cat > ssize.c <<EOM
13128 #include <sys/types.h>
13129 #define Size_t $sizetype
13130 #define SSize_t $dflt
13133 if (sizeof(Size_t) == sizeof(SSize_t))
13135 else if (sizeof(Size_t) == sizeof(int))
13144 if eval $compile_ok && ./ssize > /dev/null; then
13145 ssizetype=`./ssize`
13146 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13149 Help! I can't compile and run the ssize_t test program: please enlighten me!
13150 (This is probably a misconfiguration in your system or libraries, and
13151 you really ought to fix it. Still, I'll try anyway.)
13153 I need a type that is the same size as $sizetype, but is guaranteed to
13154 be signed. Common values are ssize_t, int and long.
13157 rp="What signed type is the same size as $sizetype?"
13161 $rm -f ssize ssize.*
13163 : see what type of char stdio uses.
13165 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13166 echo "Your stdio uses unsigned chars." >&4
13167 stdchar="unsigned char"
13169 echo "Your stdio uses signed chars." >&4
13173 : see if time exists
13175 if test "X$d_time" = X -o X"$timetype" = X; then
13176 if set time val -f d_time; eval $csym; $val; then
13177 echo 'time() found.' >&4
13179 rp="What is the type returned by time() on this system?"
13180 set time_t timetype long stdio.h sys/types.h
13183 echo 'time() not found, hope that will do.' >&4
13191 : see what type uids are declared as in the kernel
13193 echo "Looking for the type for user ids returned by getuid()."
13194 set uid_t uidtype xxx stdio.h sys/types.h
13198 xxx=`./findhdr sys/user.h`
13199 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13201 unsigned) dflt="$1 $2" ;;
13205 *) dflt="$uidtype";;
13208 uid_t) echo "uid_t found." ;;
13209 *) rp="What is the type for user ids returned by getuid()?"
13217 *_t) zzz="$uidtype" ;;
13220 echo "Checking the size of $zzz..." >&4
13222 #include <sys/types.h>
13225 printf("%d\n", (int)sizeof($uidtype));
13230 if eval $compile_ok; then
13234 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13237 echo "Your $zzz size is $uidsize bytes."
13242 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13247 *_t) zzz="$uidtype" ;;
13250 echo "Checking the sign of $zzz..." >&4
13252 #include <sys/types.h>
13263 if eval $compile; then
13267 echo "(I can't execute the test program--guessing unsigned.)" >&4
13271 1) echo "Your $zzz is unsigned." ;;
13272 -1) echo "Your $zzz is signed." ;;
13278 echo "(I can't compile the test program--guessing unsigned.)" >&4
13284 $echo "Checking the format string to be used for uids..." >&4
13287 -1) if $test X"$uidsize" = X"$ivsize"; then
13288 uidformat="$ivdformat"
13290 if $test X"$uidsize" = X"$longsize"; then
13293 if $test X"$uidsize" = X"$intsize"; then
13296 if $test X"$uidsize" = X"$shortsize"; then
13303 *) if $test X"$uidsize" = X"$uvsize"; then
13304 uidformat="$uvuformat"
13306 if $test X"$uidsize" = X"$longsize"; then
13309 if $test X"$uidsize" = X"$intsize"; then
13312 if $test X"$uidsize" = X"$shortsize"; then
13321 : see if dbm.h is available
13322 : see if dbmclose exists
13323 set dbmclose d_dbmclose
13326 case "$d_dbmclose" in
13336 *) set rpcsvc/dbm.h i_rpcsvcdbm
13341 *) echo "We won't be including <dbm.h>"
13351 : see if this is a sys/file.h system
13356 : do we need to include sys/file.h ?
13360 if $h_sysfile; then
13362 echo "We'll be including <sys/file.h>." >&4
13365 echo "We won't be including <sys/file.h>." >&4
13375 : see if fcntl.h is there
13380 : see if we can include fcntl.h
13386 echo "We'll be including <fcntl.h>." >&4
13389 if $h_sysfile; then
13390 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13392 echo "We won't be including <fcntl.h>." >&4
13404 : see if locale.h is available
13405 set locale.h i_locale
13408 : see if mach cthreads are available
13409 if test "X$usethreads" = "X$define"; then
13410 set mach/cthreads.h i_machcthr
13413 i_machcthr="$undef"
13418 : see if this is a math.h system
13422 : see if this is a mntent.h system
13423 set mntent.h i_mntent
13426 : see if ndbm.h is available
13431 : see if dbm_open exists
13432 set dbm_open d_dbm_open
13434 case "$d_dbm_open" in
13437 echo "We won't be including <ndbm.h>"
13446 : see if net/errno.h is available
13448 set net/errno.h val
13451 : Unfortunately, it causes problems on some systems. Arrgh.
13454 cat > try.c <<'EOM'
13457 #include <net/errno.h>
13463 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13464 echo "We'll be including <net/errno.h>." >&4
13466 echo "We won't be including <net/errno.h>." >&4
13475 : see if netinet/tcp.h is available
13476 set netinet/tcp.h i_netinettcp
13479 : see if this is a poll.h system
13483 : get C preprocessor symbols handy
13485 $echo $n "Hmm... $c"
13486 echo $al | $tr ' ' $trnl >Cppsym.know
13487 $cat <<EOSS >Cppsym
13495 case "\$list\$#" in
13498 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13500 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13503 unknown="\$unknown \$sym"
13513 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13515 exit 0; _ _ _ _\1\\ \1\\
13518 echo "exit 1; _ _ _" >>Cppsym\$\$
13519 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13521 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13527 $rm -f Cppsym\$\$ Cppsym2\$\$
13532 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13534 : now check the C compiler for additional symbols
13535 postprocess_cc_v=''
13537 aix) postprocess_cc_v="|$tr , ' '" ;;
13544 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13547 -D*) echo "\$i" | $sed 's/^-D//';;
13548 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13553 postprocess_cc_v=''
13556 ./ccsym > ccsym1.raw
13557 if $test -s ccsym1.raw; then
13558 $sort ccsym1.raw | $uniq >ccsym.raw
13560 mv ccsym1.raw ccsym.raw
13563 $awk '/\=/ { print $0; next }
13564 { print $0"=1" }' ccsym.raw >ccsym.list
13565 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13566 $comm -13 ccsym.true ccsym.list >ccsym.own
13567 $comm -12 ccsym.true ccsym.list >ccsym.com
13568 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13570 if $test -z ccsym.raw; then
13571 echo "Your C compiler doesn't seem to define any symbols!" >&4
13573 echo "However, your C preprocessor defines the following symbols:"
13576 cppsymbols=`$cat Cppsym.true`
13577 cppsymbols=`echo $cppsymbols`
13578 cppccsymbols="$cppsymbols"
13580 if $test -s ccsym.com; then
13581 echo "Your C compiler and pre-processor define these symbols:"
13582 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13585 cppccsymbols=`$cat ccsym.com`
13586 cppccsymbols=`echo $cppccsymbols`
13587 $test "$silent" || sleep 1
13589 if $test -s ccsym.cpp; then
13590 $test "$also" && echo " "
13591 echo "Your C pre-processor ${also}defines the following symbols:"
13592 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13594 cppsymbols=`$cat ccsym.cpp`
13595 cppsymbols=`echo $cppsymbols`
13596 $test "$silent" || sleep 1
13598 if $test -s ccsym.own; then
13599 $test "$also" && echo " "
13600 echo "Your C compiler ${also}defines the following cpp symbols:"
13601 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13602 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13603 ccsymbols=`$cat ccsym.own`
13604 ccsymbols=`echo $ccsymbols`
13605 $test "$silent" || sleep 1
13610 : see if this is a termio system
13614 if $test `./findhdr termios.h`; then
13615 set tcsetattr i_termios
13621 "$define") echo "You have POSIX termios.h... good!" >&4;;
13622 *) if ./Cppsym pyr; then
13623 case "`/bin/universe`" in
13624 ucb) if $test `./findhdr sgtty.h`; then
13626 echo "<sgtty.h> found." >&4
13628 echo "System is pyramid with BSD universe."
13629 echo "<sgtty.h> not found--you could have problems." >&4
13631 *) if $test `./findhdr termio.h`; then
13633 echo "<termio.h> found." >&4
13635 echo "System is pyramid with USG universe."
13636 echo "<termio.h> not found--you could have problems." >&4
13640 if $test `./findhdr termio.h`; then
13641 echo "<termio.h> found." >&4
13643 elif $test `./findhdr sgtty.h`; then
13644 echo "<sgtty.h> found." >&4
13647 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13650 if $test `./findhdr sgtty.h`; then
13651 echo "<sgtty.h> found." >&4
13653 elif $test `./findhdr termio.h`; then
13654 echo "<termio.h> found." >&4
13657 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13661 set i_termio; eval $setvar
13662 val=$val2; set i_sgtty; eval $setvar
13663 val=$val3; set i_termios; eval $setvar
13665 : see if this is a shadow.h system
13666 set shadow.h i_shadow
13669 : see if this is a socks.h system
13670 set socks.h i_socks
13673 : see if stdarg is available
13675 if $test `./findhdr stdarg.h`; then
13676 echo "<stdarg.h> found." >&4
13679 echo "<stdarg.h> NOT found." >&4
13683 : see if varags is available
13685 if $test `./findhdr varargs.h`; then
13686 echo "<varargs.h> found." >&4
13688 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13691 : set up the varargs testing programs
13692 $cat > varargs.c <<EOP
13694 #include <stdarg.h>
13697 #include <varargs.h>
13701 int f(char *p, ...)
13715 p = va_arg(ap, char *);
13720 $cat > varargs <<EOP
13722 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13731 : now check which varargs header should be included
13736 if `./varargs I_STDARG`; then
13738 elif `./varargs I_VARARGS`; then
13743 if `./varargs I_VARARGS`; then
13750 echo "I could not find the definition for va_dcl... You have problems..." >&4
13751 val="$undef"; set i_stdarg; eval $setvar
13752 val="$undef"; set i_varargs; eval $setvar
13757 case "$i_varhdr" in
13759 val="$define"; set i_stdarg; eval $setvar
13760 val="$undef"; set i_varargs; eval $setvar
13763 val="$undef"; set i_stdarg; eval $setvar
13764 val="$define"; set i_varargs; eval $setvar
13767 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13771 : see if stddef is available
13772 set stddef.h i_stddef
13775 : see if sys/access.h is available
13776 set sys/access.h i_sysaccess
13779 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13780 set sys/filio.h i_sysfilio
13783 if $test `./findhdr sys/ioctl.h`; then
13785 echo '<sys/ioctl.h> found.' >&4
13788 if $test $i_sysfilio = "$define"; then
13789 echo '<sys/ioctl.h> NOT found.' >&4
13791 $test $i_sgtty = "$define" && xxx="sgtty.h"
13792 $test $i_termio = "$define" && xxx="termio.h"
13793 $test $i_termios = "$define" && xxx="termios.h"
13794 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13800 : see if sys/resource.h has to be included
13801 set sys/resource.h i_sysresrc
13804 : see if sys/security.h is available
13805 set sys/security.h i_syssecrt
13808 : see if this is a sys/statvfs.h system
13809 set sys/statvfs.h i_sysstatvfs
13812 : see if this is a sys/uio.h system
13813 set sys/uio.h i_sysuio
13816 : see if this is a sys/un.h system
13817 set sys/un.h i_sysun
13820 : see if this is a syswait system
13821 set sys/wait.h i_syswait
13824 : see if this is a ustat.h system
13825 set ustat.h i_ustat
13828 : see if this is an utime system
13829 set utime.h i_utime
13832 : see if this is a values.h system
13833 set values.h i_values
13836 : see if this is a vfork system
13839 set vfork.h i_vfork
13847 : see if gdbm.h is available
13852 : see if gdbm_open exists
13853 set gdbm_open d_gdbm_open
13855 case "$d_gdbm_open" in
13858 echo "We won't be including <gdbm.h>"
13868 echo "Looking for extensions..." >&4
13869 : If we are using the old config.sh, known_extensions may contain
13870 : old or inaccurate or duplicate values.
13871 known_extensions=''
13872 nonxs_extensions=''
13873 : We do not use find because it might not be available.
13874 : We do not just use MANIFEST because the user may have dropped
13875 : some additional extensions into the source tree and expect them
13878 : Function to recursively find available extensions, ignoring DynaLoader
13879 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13883 DynaLoader|dynaload) ;;
13885 if $test -f $xxx/$xxx.xs; then
13886 known_extensions="$known_extensions $1$xxx";
13887 elif $test -f $xxx/Makefile.PL; then
13888 nonxs_extensions="$nonxs_extensions $1$xxx";
13890 if $test -d $xxx -a $# -lt 10; then
13893 eval $find_extensions;
13905 eval $find_extensions
13906 set X $nonxs_extensions
13908 nonxs_extensions="$*"
13909 set X $known_extensions
13911 known_extensions="$*"
13914 : Now see which are supported on this system.
13916 for xxx in $known_extensions ; do
13920 $define) avail_ext="$avail_ext $xxx" ;;
13923 GDBM_File|gdbm_fil)
13925 $define) avail_ext="$avail_ext $xxx" ;;
13928 NDBM_File|ndbm_fil)
13930 $define) avail_ext="$avail_ext $xxx" ;;
13933 ODBM_File|odbm_fil)
13934 case "${i_dbm}${i_rpcsvcdbm}" in
13935 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13939 case "$useposix" in
13940 true|define|y) avail_ext="$avail_ext $xxx" ;;
13944 case "$useopcode" in
13945 true|define|y) avail_ext="$avail_ext $xxx" ;;
13949 case "$d_socket" in
13950 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13954 case "$usethreads" in
13955 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13959 : XXX Do we need a useipcsysv variable here
13960 case "${d_msg}${d_sem}${d_shm}" in
13961 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13964 *) avail_ext="$avail_ext $xxx"
13973 : Now see which nonxs extensions are supported on this system.
13974 : For now assume all are.
13976 for xxx in $nonxs_extensions ; do
13978 *) nonxs_ext="$nonxs_ext $xxx"
13990 A number of extensions are supplied with $package. You may choose to
13991 compile these extensions for dynamic loading (the default), compile
13992 them into the $package executable (static loading), or not include
13993 them at all. Answer "none" to include no extensions.
13994 Note that DynaLoader is always built and need not be mentioned here.
13997 case "$dynamic_ext" in
13998 '') dflt="$avail_ext" ;;
13999 *) dflt="$dynamic_ext"
14000 # Perhaps we are reusing an old out-of-date config.sh.
14003 if test X"$dynamic_ext" != X"$avail_ext"; then
14005 NOTICE: Your previous config.sh list may be incorrect.
14006 The extensions now available to you are
14008 but the default list from your previous config.sh is
14020 rp="What extensions do you wish to load dynamically?"
14023 none) dynamic_ext=' ' ;;
14024 *) dynamic_ext="$ans" ;;
14027 case "$static_ext" in
14029 : Exclude those already listed in dynamic linking
14031 for xxx in $avail_ext; do
14032 case " $dynamic_ext " in
14034 *) dflt="$dflt $xxx" ;;
14041 *) dflt="$static_ext"
14048 rp="What extensions do you wish to load statically?"
14051 none) static_ext=' ' ;;
14052 *) static_ext="$ans" ;;
14057 A number of extensions are supplied with $package. Answer "none"
14058 to include no extensions.
14059 Note that DynaLoader is always built and need not be mentioned here.
14062 case "$static_ext" in
14063 '') dflt="$avail_ext" ;;
14064 *) dflt="$static_ext"
14065 # Perhaps we are reusing an old out-of-date config.sh.
14068 if test X"$static_ext" != X"$avail_ext"; then
14070 NOTICE: Your previous config.sh list may be incorrect.
14071 The extensions now available to you are
14073 but the default list from your previous config.sh is
14082 : Exclude those that are not xs extensions
14086 rp="What extensions do you wish to include?"
14089 none) static_ext=' ' ;;
14090 *) static_ext="$ans" ;;
14095 set X $dynamic_ext $static_ext $nonxs_ext
14099 : Remove build directory name from cppstdin so it can be used from
14100 : either the present location or the final installed location.
14102 : Get out of the UU directory to get correct path name.
14104 case "$cppstdin" in
14106 echo "Stripping down cppstdin path name"
14112 : end of configuration questions
14114 echo "End of configuration questions."
14117 : back to where it started
14118 if test -d ../UU; then
14122 : configuration may be patched via a 'config.over' file
14123 if $test -f config.over; then
14126 rp='I see a config.over file. Do you wish to load it?'
14129 n*) echo "OK, I'll ignore it.";;
14131 echo "Configuration override changes have been loaded."
14136 : in case they want portability, strip down executable paths
14137 case "$d_portable" in
14140 echo "Stripping down executable paths..." >&4
14141 for file in $loclist $trylist; do
14143 eval $file=`basename $temp`
14148 : create config.sh file
14150 echo "Creating config.sh..." >&4
14151 $spitshell <<EOT >config.sh
14154 # This file was produced by running the Configure script. It holds all the
14155 # definitions figured out by Configure. Should you modify one of these values,
14156 # do not forget to propagate your changes by running "Configure -der". You may
14157 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14160 # Package name : $package
14161 # Source directory : $src
14162 # Configuration time: $cf_time
14163 # Configured by : $cf_by
14164 # Target system : $myuname
14174 Revision='$Revision'
14181 alignbytes='$alignbytes'
14182 ansi2knr='$ansi2knr'
14183 aphostname='$aphostname'
14184 apiversion='$apiversion'
14187 archlibexp='$archlibexp'
14188 archname64='$archname64'
14189 archname='$archname'
14190 archobjs='$archobjs'
14195 bincompat5005='$bincompat5005'
14199 byteorder='$byteorder'
14201 castflags='$castflags'
14204 cccdlflags='$cccdlflags'
14205 ccdlflags='$ccdlflags'
14207 ccsymbols='$ccsymbols'
14209 cf_email='$cf_email'
14211 charsize='$charsize'
14215 clocktype='$clocktype'
14217 compress='$compress'
14218 contains='$contains'
14222 cpp_stuff='$cpp_stuff'
14223 cppccsymbols='$cppccsymbols'
14224 cppflags='$cppflags'
14226 cppminus='$cppminus'
14228 cppstdin='$cppstdin'
14229 cppsymbols='$cppsymbols'
14230 crosscompile='$crosscompile'
14231 cryptlib='$cryptlib'
14233 d_Gconvert='$d_Gconvert'
14234 d_PRIEldbl='$d_PRIEldbl'
14235 d_PRIFldbl='$d_PRIFldbl'
14236 d_PRIGldbl='$d_PRIGldbl'
14237 d_PRIX64='$d_PRIX64'
14238 d_PRId64='$d_PRId64'
14239 d_PRIeldbl='$d_PRIeldbl'
14240 d_PRIfldbl='$d_PRIfldbl'
14241 d_PRIgldbl='$d_PRIgldbl'
14242 d_PRIi64='$d_PRIi64'
14243 d_PRIo64='$d_PRIo64'
14244 d_PRIu64='$d_PRIu64'
14245 d_PRIx64='$d_PRIx64'
14246 d_access='$d_access'
14247 d_accessx='$d_accessx'
14249 d_archlib='$d_archlib'
14252 d_attribut='$d_attribut'
14255 d_bincompat5005='$d_bincompat5005'
14257 d_bsdgetpgrp='$d_bsdgetpgrp'
14258 d_bsdsetpgrp='$d_bsdsetpgrp'
14260 d_casti32='$d_casti32'
14261 d_castneg='$d_castneg'
14262 d_charvspr='$d_charvspr'
14264 d_chroot='$d_chroot'
14265 d_chsize='$d_chsize'
14266 d_closedir='$d_closedir'
14270 d_cuserid='$d_cuserid'
14271 d_dbl_dig='$d_dbl_dig'
14272 d_difftime='$d_difftime'
14273 d_dirnamlen='$d_dirnamlen'
14274 d_dlerror='$d_dlerror'
14275 d_dlopen='$d_dlopen'
14276 d_dlsymun='$d_dlsymun'
14277 d_dosuid='$d_dosuid'
14278 d_drand48proto='$d_drand48proto'
14280 d_eaccess='$d_eaccess'
14281 d_endgrent='$d_endgrent'
14282 d_endhent='$d_endhent'
14283 d_endnent='$d_endnent'
14284 d_endpent='$d_endpent'
14285 d_endpwent='$d_endpwent'
14286 d_endsent='$d_endsent'
14287 d_endspent='$d_endspent'
14288 d_eofnblk='$d_eofnblk'
14289 d_eunice='$d_eunice'
14290 d_fchmod='$d_fchmod'
14291 d_fchown='$d_fchown'
14293 d_fd_macros='$d_fd_macros'
14294 d_fd_set='$d_fd_set'
14295 d_fds_bits='$d_fds_bits'
14296 d_fgetpos='$d_fgetpos'
14297 d_flexfnam='$d_flexfnam'
14300 d_fpathconf='$d_fpathconf'
14301 d_fpos64_t='$d_fpos64_t'
14302 d_fs_data_s='$d_fs_data_s'
14303 d_fseeko='$d_fseeko'
14304 d_fsetpos='$d_fsetpos'
14305 d_fstatfs='$d_fstatfs'
14306 d_fstatvfs='$d_fstatvfs'
14307 d_ftello='$d_ftello'
14309 d_getgrent='$d_getgrent'
14310 d_getgrps='$d_getgrps'
14311 d_gethbyaddr='$d_gethbyaddr'
14312 d_gethbyname='$d_gethbyname'
14313 d_gethent='$d_gethent'
14314 d_gethname='$d_gethname'
14315 d_gethostprotos='$d_gethostprotos'
14316 d_getlogin='$d_getlogin'
14317 d_getmnt='$d_getmnt'
14318 d_getmntent='$d_getmntent'
14319 d_getnbyaddr='$d_getnbyaddr'
14320 d_getnbyname='$d_getnbyname'
14321 d_getnent='$d_getnent'
14322 d_getnetprotos='$d_getnetprotos'
14323 d_getpbyname='$d_getpbyname'
14324 d_getpbynumber='$d_getpbynumber'
14325 d_getpent='$d_getpent'
14326 d_getpgid='$d_getpgid'
14327 d_getpgrp2='$d_getpgrp2'
14328 d_getpgrp='$d_getpgrp'
14329 d_getppid='$d_getppid'
14330 d_getprior='$d_getprior'
14331 d_getprotoprotos='$d_getprotoprotos'
14332 d_getpwent='$d_getpwent'
14333 d_getsbyname='$d_getsbyname'
14334 d_getsbyport='$d_getsbyport'
14335 d_getsent='$d_getsent'
14336 d_getservprotos='$d_getservprotos'
14337 d_getspent='$d_getspent'
14338 d_getspnam='$d_getspnam'
14339 d_gettimeod='$d_gettimeod'
14340 d_gnulibc='$d_gnulibc'
14341 d_grpasswd='$d_grpasswd'
14342 d_hasmntopt='$d_hasmntopt'
14345 d_inetaton='$d_inetaton'
14346 d_int64t='$d_int64t'
14347 d_isascii='$d_isascii'
14348 d_killpg='$d_killpg'
14349 d_lchown='$d_lchown'
14350 d_ldbl_dig='$d_ldbl_dig'
14352 d_locconv='$d_locconv'
14354 d_longdbl='$d_longdbl'
14355 d_longlong='$d_longlong'
14358 d_mbstowcs='$d_mbstowcs'
14359 d_mbtowc='$d_mbtowc'
14360 d_memchr='$d_memchr'
14361 d_memcmp='$d_memcmp'
14362 d_memcpy='$d_memcpy'
14363 d_memmove='$d_memmove'
14364 d_memset='$d_memset'
14366 d_mkfifo='$d_mkfifo'
14367 d_mktime='$d_mktime'
14369 d_msg_ctrunc='$d_msg_ctrunc'
14370 d_msg_dontroute='$d_msg_dontroute'
14371 d_msg_oob='$d_msg_oob'
14372 d_msg_peek='$d_msg_peek'
14373 d_msg_proxy='$d_msg_proxy'
14374 d_msgctl='$d_msgctl'
14375 d_msgget='$d_msgget'
14376 d_msgrcv='$d_msgrcv'
14377 d_msgsnd='$d_msgsnd'
14378 d_mymalloc='$d_mymalloc'
14380 d_off64_t='$d_off64_t'
14381 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14382 d_oldpthreads='$d_oldpthreads'
14383 d_oldsock='$d_oldsock'
14385 d_pathconf='$d_pathconf'
14387 d_phostname='$d_phostname'
14390 d_portable='$d_portable'
14391 d_pthread_yield='$d_pthread_yield'
14393 d_pwchange='$d_pwchange'
14394 d_pwclass='$d_pwclass'
14395 d_pwcomment='$d_pwcomment'
14396 d_pwexpire='$d_pwexpire'
14397 d_pwgecos='$d_pwgecos'
14398 d_pwpasswd='$d_pwpasswd'
14399 d_pwquota='$d_pwquota'
14401 d_readdir='$d_readdir'
14402 d_readlink='$d_readlink'
14403 d_rename='$d_rename'
14404 d_rewinddir='$d_rewinddir'
14406 d_safebcpy='$d_safebcpy'
14407 d_safemcpy='$d_safemcpy'
14408 d_sanemcmp='$d_sanemcmp'
14409 d_sched_yield='$d_sched_yield'
14410 d_scm_rights='$d_scm_rights'
14411 d_seekdir='$d_seekdir'
14412 d_select='$d_select'
14414 d_semctl='$d_semctl'
14415 d_semctl_semid_ds='$d_semctl_semid_ds'
14416 d_semctl_semun='$d_semctl_semun'
14417 d_semget='$d_semget'
14419 d_setegid='$d_setegid'
14420 d_seteuid='$d_seteuid'
14421 d_setgrent='$d_setgrent'
14422 d_setgrps='$d_setgrps'
14423 d_sethent='$d_sethent'
14424 d_setlinebuf='$d_setlinebuf'
14425 d_setlocale='$d_setlocale'
14426 d_setnent='$d_setnent'
14427 d_setpent='$d_setpent'
14428 d_setpgid='$d_setpgid'
14429 d_setpgrp2='$d_setpgrp2'
14430 d_setpgrp='$d_setpgrp'
14431 d_setprior='$d_setprior'
14432 d_setpwent='$d_setpwent'
14433 d_setregid='$d_setregid'
14434 d_setresgid='$d_setresgid'
14435 d_setresuid='$d_setresuid'
14436 d_setreuid='$d_setreuid'
14437 d_setrgid='$d_setrgid'
14438 d_setruid='$d_setruid'
14439 d_setsent='$d_setsent'
14440 d_setsid='$d_setsid'
14441 d_setspent='$d_setspent'
14442 d_setvbuf='$d_setvbuf'
14446 d_shmatprototype='$d_shmatprototype'
14447 d_shmctl='$d_shmctl'
14449 d_shmget='$d_shmget'
14450 d_sigaction='$d_sigaction'
14451 d_sigsetjmp='$d_sigsetjmp'
14452 d_socket='$d_socket'
14453 d_sockpair='$d_sockpair'
14455 d_statblks='$d_statblks'
14456 d_statfs_f_flags='$d_statfs_f_flags'
14457 d_statfs_s='$d_statfs_s'
14458 d_statvfs='$d_statvfs'
14459 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14460 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14461 d_stdio_stream_array='$d_stdio_stream_array'
14462 d_stdiobase='$d_stdiobase'
14463 d_stdstdio='$d_stdstdio'
14464 d_strchr='$d_strchr'
14465 d_strcoll='$d_strcoll'
14466 d_strctcpy='$d_strctcpy'
14467 d_strerrm='$d_strerrm'
14468 d_strerror='$d_strerror'
14469 d_strtod='$d_strtod'
14470 d_strtol='$d_strtol'
14471 d_strtoul='$d_strtoul'
14472 d_strtoull='$d_strtoull'
14473 d_strxfrm='$d_strxfrm'
14474 d_suidsafe='$d_suidsafe'
14475 d_symlink='$d_symlink'
14476 d_syscall='$d_syscall'
14477 d_sysconf='$d_sysconf'
14478 d_sysernlst='$d_sysernlst'
14479 d_syserrlst='$d_syserrlst'
14480 d_system='$d_system'
14481 d_tcgetpgrp='$d_tcgetpgrp'
14482 d_tcsetpgrp='$d_tcsetpgrp'
14483 d_telldir='$d_telldir'
14484 d_telldirproto='$d_telldirproto'
14487 d_truncate='$d_truncate'
14488 d_tzname='$d_tzname'
14491 d_union_semun='$d_union_semun'
14493 d_vendorbin='$d_vendorbin'
14494 d_vendorlib='$d_vendorlib'
14496 d_void_closedir='$d_void_closedir'
14497 d_voidsig='$d_voidsig'
14498 d_voidtty='$d_voidtty'
14499 d_volatile='$d_volatile'
14500 d_vprintf='$d_vprintf'
14502 d_waitpid='$d_waitpid'
14503 d_wcstombs='$d_wcstombs'
14504 d_wctomb='$d_wctomb'
14507 db_hashtype='$db_hashtype'
14508 db_prefixtype='$db_prefixtype'
14509 defvoidused='$defvoidused'
14510 direntrytype='$direntrytype'
14513 doublesize='$doublesize'
14515 dynamic_ext='$dynamic_ext'
14521 eunicefix='$eunicefix'
14524 extensions='$extensions'
14525 fflushNULL='$fflushNULL'
14526 fflushall='$fflushall'
14528 firstmakefile='$firstmakefile'
14530 fpossize='$fpossize'
14531 fpostype='$fpostype'
14532 freetype='$freetype'
14534 full_csh='$full_csh'
14535 full_sed='$full_sed'
14536 gccversion='$gccversion'
14537 gidformat='$gidformat'
14543 groupcat='$groupcat'
14544 groupstype='$groupstype'
14547 h_sysfile='$h_sysfile'
14559 i_arpainet='$i_arpainet'
14560 i_bsdioctl='$i_bsdioctl'
14563 i_dirent='$i_dirent'
14570 i_inttypes='$i_inttypes'
14571 i_limits='$i_limits'
14572 i_locale='$i_locale'
14573 i_machcthr='$i_machcthr'
14574 i_malloc='$i_malloc'
14576 i_memory='$i_memory'
14577 i_mntent='$i_mntent'
14580 i_neterrno='$i_neterrno'
14581 i_netinettcp='$i_netinettcp'
14584 i_pthread='$i_pthread'
14586 i_rpcsvcdbm='$i_rpcsvcdbm'
14589 i_shadow='$i_shadow'
14591 i_stdarg='$i_stdarg'
14592 i_stddef='$i_stddef'
14593 i_stdlib='$i_stdlib'
14594 i_string='$i_string'
14595 i_sysaccess='$i_sysaccess'
14596 i_sysdir='$i_sysdir'
14597 i_sysfile='$i_sysfile'
14598 i_sysfilio='$i_sysfilio'
14600 i_sysioctl='$i_sysioctl'
14601 i_sysmount='$i_sysmount'
14602 i_sysndir='$i_sysndir'
14603 i_sysparam='$i_sysparam'
14604 i_sysresrc='$i_sysresrc'
14605 i_syssecrt='$i_syssecrt'
14606 i_sysselct='$i_sysselct'
14607 i_syssockio='$i_syssockio'
14608 i_sysstat='$i_sysstat'
14609 i_sysstatfs='$i_sysstatfs'
14610 i_sysstatvfs='$i_sysstatvfs'
14611 i_systime='$i_systime'
14612 i_systimek='$i_systimek'
14613 i_systimes='$i_systimes'
14614 i_systypes='$i_systypes'
14615 i_sysuio='$i_sysuio'
14617 i_sysvfs='$i_sysvfs'
14618 i_syswait='$i_syswait'
14619 i_termio='$i_termio'
14620 i_termios='$i_termios'
14622 i_unistd='$i_unistd'
14625 i_values='$i_values'
14626 i_varargs='$i_varargs'
14627 i_varhdr='$i_varhdr'
14629 ignore_versioned_solibs='$ignore_versioned_solibs'
14632 installarchlib='$installarchlib'
14633 installbin='$installbin'
14634 installman1dir='$installman1dir'
14635 installman3dir='$installman3dir'
14636 installprefix='$installprefix'
14637 installprefixexp='$installprefixexp'
14638 installprivlib='$installprivlib'
14639 installscript='$installscript'
14640 installsitearch='$installsitearch'
14641 installsitebin='$installsitebin'
14642 installsitelib='$installsitelib'
14643 installstyle='$installstyle'
14644 installusrbinperl='$installusrbinperl'
14645 installvendorbin='$installvendorbin'
14646 installvendorlib='$installvendorlib'
14648 ivdformat='$ivdformat'
14651 known_extensions='$known_extensions'
14655 lddlflags='$lddlflags'
14657 ldlibpthname='$ldlibpthname'
14664 libswanted='$libswanted'
14670 locincpth='$locincpth'
14671 loclibpth='$loclibpth'
14672 longdblsize='$longdblsize'
14673 longlongsize='$longlongsize'
14674 longsize='$longsize'
14678 lseeksize='$lseeksize'
14679 lseektype='$lseektype'
14683 make_set_make='$make_set_make'
14684 mallocobj='$mallocobj'
14685 mallocsrc='$mallocsrc'
14686 malloctype='$malloctype'
14688 man1direxp='$man1direxp'
14691 man3direxp='$man3direxp'
14694 mips_type='$mips_type'
14697 modetype='$modetype'
14699 multiarch='$multiarch'
14701 myarchname='$myarchname'
14702 mydomain='$mydomain'
14703 myhostname='$myhostname'
14706 netdb_hlen_type='$netdb_hlen_type'
14707 netdb_host_type='$netdb_host_type'
14708 netdb_name_type='$netdb_name_type'
14709 netdb_net_type='$netdb_net_type'
14712 nm_so_opt='$nm_so_opt'
14713 nonxs_ext='$nonxs_ext'
14717 o_nonblock='$o_nonblock'
14719 old_pthread_create_joinable='$old_pthread_create_joinable'
14720 optimize='$optimize'
14721 orderlib='$orderlib'
14727 patchlevel='$patchlevel'
14728 path_sep='$path_sep'
14730 perladmin='$perladmin'
14731 perlpath='$perlpath'
14733 phostname='$phostname'
14736 pm_apiversion='$pm_apiversion'
14740 prefixexp='$prefixexp'
14742 privlibexp='$privlibexp'
14743 prototype='$prototype'
14745 quadkind='$quadkind'
14746 quadtype='$quadtype'
14747 randbits='$randbits'
14748 randfunc='$randfunc'
14749 randseedtype='$randseedtype'
14751 rd_nodata='$rd_nodata'
14755 sPRIEldbl='$sPRIEldbl'
14756 sPRIFldbl='$sPRIFldbl'
14757 sPRIGldbl='$sPRIGldbl'
14760 sPRIeldbl='$sPRIeldbl'
14761 sPRIfldbl='$sPRIfldbl'
14762 sPRIgldbl='$sPRIgldbl'
14767 sched_yield='$sched_yield'
14768 scriptdir='$scriptdir'
14769 scriptdirexp='$scriptdirexp'
14771 seedfunc='$seedfunc'
14772 selectminbits='$selectminbits'
14773 selecttype='$selecttype'
14774 sendmail='$sendmail'
14777 sharpbang='$sharpbang'
14778 shmattype='$shmattype'
14779 shortsize='$shortsize'
14782 sig_count='$sig_count'
14783 sig_name='$sig_name'
14784 sig_name_init='$sig_name_init'
14786 sig_num_init='$sig_num_init'
14787 signal_t='$signal_t'
14788 sitearch='$sitearch'
14789 sitearchexp='$sitearchexp'
14791 sitebinexp='$sitebinexp'
14793 sitelibexp='$sitelibexp'
14794 siteprefix='$siteprefix'
14795 siteprefixexp='$siteprefixexp'
14796 sizetype='$sizetype'
14801 sockethdr='$sockethdr'
14802 socketlib='$socketlib'
14804 spackage='$spackage'
14805 spitshell='$spitshell'
14808 ssizetype='$ssizetype'
14809 startperl='$startperl'
14811 static_ext='$static_ext'
14813 stdio_base='$stdio_base'
14814 stdio_bufsiz='$stdio_bufsiz'
14815 stdio_cnt='$stdio_cnt'
14816 stdio_filbuf='$stdio_filbuf'
14817 stdio_ptr='$stdio_ptr'
14818 stdio_stream_array='$stdio_stream_array'
14821 subversion='$subversion'
14828 timeincl='$timeincl'
14829 timetype='$timetype'
14842 uidformat='$uidformat'
14848 uquadtype='$uquadtype'
14849 use64bits='$use64bits'
14851 uselargefiles='$uselargefiles'
14852 uselongdouble='$uselongdouble'
14853 uselonglong='$uselonglong'
14854 usemorebits='$usemorebits'
14855 usemultiplicity='$usemultiplicity'
14856 usemymalloc='$usemymalloc'
14858 useopcode='$useopcode'
14859 useperlio='$useperlio'
14860 useposix='$useposix'
14862 useshrplib='$useshrplib'
14863 usesocks='$usesocks'
14864 usethreads='$usethreads'
14865 usevendorprefix='$usevendorprefix'
14866 usevfork='$usevfork'
14869 uvoformat='$uvoformat'
14872 uvuformat='$uvuformat'
14873 uvxformat='$uvxformat'
14874 vendorbin='$vendorbin'
14875 vendorbinexp='$vendorbinexp'
14876 vendorlib='$vendorlib'
14877 vendorlibexp='$vendorlibexp'
14878 vendorprefix='$vendorprefix'
14879 vendorprefixexp='$vendorprefixexp'
14882 voidflags='$voidflags'
14884 xs_apiversion='$xs_apiversion'
14889 : Add in command line options if available
14890 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14892 : add special variables
14893 $test -f $src/patchlevel.h && \
14894 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14895 echo "CONFIGDOTSH=true" >>config.sh
14897 : propagate old symbols
14898 if $test -f UU/config.sh; then
14899 <UU/config.sh sort | uniq >UU/oldconfig.sh
14900 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14901 sort | uniq -u >UU/oldsyms
14902 set X `cat UU/oldsyms`
14908 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14910 echo "# Variables propagated from previous config.sh file." >>config.sh
14911 for sym in `cat UU/oldsyms`; do
14912 echo " Propagating $hint variable "'$'"$sym..."
14913 eval 'tmp="$'"${sym}"'"'
14915 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14921 : Finish up by extracting the .SH files
14935 If you'd like to make any changes to the config.sh file before I begin
14936 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14939 rp="Press return or use a shell escape to edit config.sh:"
14944 *) : in case they cannot read
14945 sh 1>&4 -c "$ans";;
14950 : if this fails, just run all the .SH files by hand
14957 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14964 Now you need to generate make dependencies by running "$make depend".
14965 You might prefer to run it in background: "$make depend > makedepend.out &"
14966 It can take a while, so you might not want to run it right now.
14971 rp="Run $make depend now?"
14975 $make depend && echo "Now you must run a $make."
14978 echo "You must run '$make depend' then '$make'."
14981 elif test -f [Mm]akefile; then
14983 echo "Now you must run a $make."
14988 if $test -f Policy.sh; then
14991 If you compile $package on a different machine or from a different object
14992 directory, copy the Policy.sh file from this object directory to the
14993 new one before you run Configure -- this will help you with most of
14994 the policy defaults.
14998 if $test -f config.msg; then
14999 echo "Hmm. I also noted the following information while running:"
15001 $cat config.msg >&4
15004 $rm -f kit*isdone ark*isdone