3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Jan 7 16:14:30 EST 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
890 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
893 : We must find out about Eunice early
895 if test -f /etc/unixtovms; then
896 eunicefix=/etc/unixtovms
898 if test -f /etc/unixtovms.exe; then
899 eunicefix=/etc/unixtovms.exe
903 : Possible local include directories to search.
904 : Set locincpth to "" in a hint file to defeat local include searches.
905 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
906 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
908 : no include file wanted by default
911 : list of known cpp symbols, sorted alphabetically
912 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
913 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
914 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
915 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
916 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
917 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
918 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
919 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
920 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
921 al="$al VMS Xenix286"
922 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
923 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
924 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
925 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
926 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
927 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
928 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
929 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
930 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
931 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
932 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
933 al="$al __SVR4_2__ __UMAXV__"
934 al="$al ____386BSD____ __alpha __alpha__ __amiga"
935 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
936 al="$al __host_mips__"
937 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
938 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
939 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
940 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
941 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
942 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
943 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
944 al="$al __mc88100 __mc88100__ __mips __mips__"
945 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
946 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
947 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
948 al="$al _host_mips _mips _unix"
949 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
950 al="$al apollo ardent att386 att3b"
951 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
952 al="$al cadmus clipper concurrent convex cray ctix"
953 al="$al dmert encore gcos gcx gimpel gould"
954 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
955 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
956 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
957 al="$al i186 i286 i386 i486 i8086"
958 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
959 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
960 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
961 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
962 al="$al mc88000 mc88100 merlin mert mips mvs n16"
963 al="$al ncl_el ncl_mr"
964 al="$al news1500 news1700 news1800 news1900 news3700"
965 al="$al news700 news800 news900 ns16000 ns32000"
966 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
967 al="$al parisc pc532 pdp11 plexus posix pyr"
968 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
969 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
970 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
971 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
972 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
973 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
976 : Trailing extension. Override this in a hint file, if needed.
978 : Extra object files, if any, needed on this platform.
981 : change the next line if compiling for Xenix/286 on Xenix/386
982 xlibpth='/usr/lib/386 /lib/386'
984 : Possible local library directories to search.
985 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
986 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
988 : general looking path for locating libraries
989 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
990 glibpth="$glibpth /lib /usr/lib $xlibpth"
991 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
992 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
994 : Private path used by Configure to find libraries. Its value
995 : is prepended to libpth. This variable takes care of special
996 : machines, like the mips. Usually, it should be empty.
999 : default library list
1001 : some systems want to use only the non-versioned libso:s
1002 ignore_versioned_solibs=''
1003 : full support for void wanted by default
1006 : set useposix=false in your hint file to disable the POSIX extension.
1008 : set useopcode=false in your hint file to disable the Opcode extension.
1010 : set usemultiplicity on the Configure command line to enable multiplicity.
1011 : set usesocks on the Configure command line to enable socks.
1012 : set usethreads on the Configure command line to enable threads.
1013 : List of libraries we want.
1014 : If anyone needs -lnet, put it in a hint file.
1015 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1016 libswanted="$libswanted dld ld sun m c cposix posix"
1017 libswanted="$libswanted ndir dir crypt sec"
1018 libswanted="$libswanted ucb bsd BSD PW x"
1019 : We probably want to search /usr/shlib before most other libraries.
1020 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1021 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1022 glibpth="/usr/shlib $glibpth"
1023 : Do not use vfork unless overridden by a hint file.
1026 : Find the basic shell for Bourne shell scripts
1030 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1033 if test -f "$xxx"; then
1036 : Build up a list and do a single loop so we can 'break' out.
1037 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1038 for xxx in sh bash ksh pdksh ash; do
1040 try="$try ${p}/${xxx}"
1044 if test -f "$xxx"; then
1047 elif test -f "$xxx.exe"; then
1058 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1060 Usually it's in /bin/sh. How did you even get this far?
1061 Please contact me (Perl Maintainers) at perlbug@perl.com and
1062 we'll try to straighten this all out.
1068 : see if sh knows # comments
1069 if `$sh -c '#' >/dev/null 2>&1`; then
1073 test -f $xcat || xcat=/usr/bin/cat
1078 if test -s today; then
1081 echo "#! $xcat" > try
1085 if test -s today; then
1093 echo "Your $sh doesn't grok # comments--I will strip them later on."
1096 echo "exec grep -v '^[ ]*#'" >spitshell
1098 $eunicefix spitshell
1099 spitshell=`pwd`/spitshell
1101 echo "I presume that if # doesn't work, #! won't work either!"
1106 : figure out how to guarantee sh startup
1108 '') startsh=${sharpbang}${sh} ;;
1120 : echo "Yup, it does."
1122 echo "Hmm... '$startsh' does not guarantee sh startup..."
1123 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1128 : Save command line options in file UU/cmdline.opt for later use in
1129 : generating config.sh.
1130 cat > cmdline.opt <<EOSH
1131 # Configure command line arguments.
1138 cat >>cmdline.opt <<EOSH
1139 config_arg$argn='$arg'
1141 argn=`expr $argn + 1`
1144 : produce awk script to parse command line options
1145 cat >options.awk <<'EOF'
1147 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1149 len = length(optstr);
1150 for (i = 1; i <= len; i++) {
1151 c = substr(optstr, i, 1);
1152 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1163 if (substr(str, 1, 1) != "-") {
1164 printf("'%s'\n", str);
1168 for (i = 2; i <= len; i++) {
1169 c = substr(str, i, 1);
1171 printf("-%s\n", substr(str, i));
1177 printf("'%s'\n", substr(str, i + 1));
1190 : process the command line options
1191 set X `for arg in "$@"; do echo "X$arg"; done |
1192 sed -e s/X// | awk -f options.awk`
1197 : set up default values
1207 rm -f optdef.sh posthint.sh
1208 cat >optdef.sh <<EOS
1214 while test $# -gt 0; do
1216 -d) shift; fastread=yes;;
1217 -e) shift; alldone=cont;;
1221 if test -r "$1"; then
1224 echo "$me: cannot read config file $1." >&2
1229 -h) shift; error=true;;
1230 -r) shift; reuseval=true;;
1231 -s) shift; silent=true; realsilent=true;;
1232 -E) shift; alldone=exit;;
1233 -K) shift; knowitall=true;;
1234 -O) shift; override=true;;
1235 -S) shift; silent=true; extractsh=true;;
1240 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1241 echo "$me: ignoring -D $1" >&2
1244 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1245 *) echo "$1='define'" >> optdef.sh;;
1252 *=) echo "$1" >> optdef.sh;;
1254 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1255 echo "$me: ignoring -U $1" >&2
1257 *) echo "$1='undef'" >> optdef.sh;;
1268 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1272 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1273 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1279 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1280 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1281 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1282 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1283 *) xxx=`echo $yyy|sed 's!:.*!!'`
1284 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1290 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1292 echo "$yyy=''" >> posthint.sh ;;
1297 echo "$yyy='$zzz'" >> posthint.sh ;;
1299 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1301 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1306 echo "$yyy=$zzz" >> posthint.sh ;;
1307 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1310 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1313 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1321 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1322 [-U symbol] [-U symbol=] [-A command:symbol...]
1323 -d : use defaults for all answers.
1324 -e : go on without questioning past the production of config.sh.
1325 -f : specify an alternate default configuration file.
1326 -h : print this help message and exit (with an error status).
1327 -r : reuse C symbols value if possible (skips costly nm extraction).
1328 -s : silent mode, only echoes questions and essential information.
1329 -D : define symbol to have some value:
1330 -D symbol symbol gets the value 'define'
1331 -D symbol=value symbol gets the value 'value'
1332 -E : stop at the end of questions, after having produced config.sh.
1333 -K : do not use unless you know what you are doing.
1334 -O : let -D and -U override definitions from loaded configuration file.
1335 -S : perform variable substitutions on all .SH files (can mix with -f)
1336 -U : undefine symbol:
1337 -U symbol symbol gets the value 'undef'
1338 -U symbol= symbol gets completely empty
1339 -A : manipulate symbol after the platform specific hints have been applied:
1340 -A symbol=value append " "value to symbol
1341 -A append:symbol=value append value to symbol
1342 -A define:symbol=value define symbol to have value
1343 -A clear:symbol define symbol to be ''
1344 -A define:symbol define symbol to be 'define'
1345 -A eval:symbol=value define symbol to be eval of value
1346 -A prepend:symbol=value prepend value to symbol
1347 -A undef:symbol define symbol to be 'undef'
1348 -A undef:symbol= define symbol to be ''
1349 -V : print version number and exit (with a zero status).
1356 case "$fastread$alldone" in
1359 if test ! -t 0; then
1360 echo "Say 'sh Configure', not 'sh <Configure'"
1368 true) exec 1>/dev/null;;
1371 : run the defines and the undefines, if any, but leave the file out there...
1374 : create the posthint manipulation script and leave the file out there...
1379 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1380 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1381 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1382 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1383 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1386 : Some greps do not return status, grrr.
1387 echo "grimblepritz" >grimble
1388 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1390 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1396 : the following should work in any shell
1400 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1401 cat >contains <<'EOSS'
1402 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1407 : Find the path to the source tree
1410 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1413 *) src=`cd ../$src && pwd` ;;
1426 if test -f $rsrc/Configure && \
1427 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1429 : found it, so we are ok.
1432 for src in . .. ../.. ../../.. ../../../..; do
1433 if test -f ../$src/Configure && \
1434 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1445 Sorry, I can't seem to locate the source dir for $package. Please start
1446 Configure with an explicit path -- i.e. /some/path/Configure.
1454 echo "Sources for $package found in \"$src\"." >&4
1458 : script used to extract .SH files with variable substitutions
1459 cat >extract <<'EOS'
1461 echo "Doing variable substitutions on .SH files..."
1462 if test -f $src/MANIFEST; then
1463 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1465 echo "(Looking for .SH files under the source directory.)"
1466 set x `(cd $src; find . -name "*.SH" -print)`
1470 0) set x `(cd $src; echo *.SH)`; shift;;
1472 if test ! -f $src/$1; then
1478 while test $name; do
1479 if test ! -d "$name"; then
1480 create="$name $create";
1481 name=`echo $name | sed -e "s|^[^/]*$||"`;
1482 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1487 for file in $create; do
1496 dir=`expr X$file : 'X\(.*\)/'`
1497 file=`expr X$file : 'X.*/\(.*\)'`
1498 (cd $dir && . ./$file)
1508 dir=`expr X$file : 'X\(.*\)/'`
1509 file=`expr X$file : 'X.*/\(.*\)'`
1510 (set x $dir; shift; eval $mkdir_p)
1520 if test -f $src/config_h.SH; then
1521 if test ! -f config.h; then
1522 : oops, they left it out of MANIFEST, probably, so do it anyway.
1528 : extract files and exit if asked to do so
1529 case "$extractsh" in
1531 case "$realsilent" in
1535 case "$config_sh" in
1536 '') config_sh='config.sh';;
1539 echo "Fetching answers from $config_sh..."
1542 test "$override" && . ./optdef.sh
1551 : Eunice requires " " instead of "", can you believe it
1554 echo "Beginning of configuration questions for $package."
1556 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1558 : first determine how to suppress newline on echo command
1560 echo "Checking echo to see how to suppress newlines..."
1561 (echo "hi there\c" ; echo " ") >.echotmp
1562 if $contains c .echotmp >/dev/null 2>&1 ; then
1573 echo $n "The star should be here-->$c"
1577 : Now test for existence of everything in MANIFEST
1579 if test -f $rsrc/MANIFEST; then
1580 echo "First let's make sure your kit is complete. Checking..." >&4
1581 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1584 for filelist in x??; do
1585 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1587 if test -s missing; then
1591 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1593 You have the option of continuing the configuration process, despite the
1594 distinct possibility that your kit is damaged, by typing 'y'es. If you
1595 do, don't blame me if something goes wrong. I advise you to type 'n'o
1596 and contact the author (perlbug@perl.com).
1599 echo $n "Continue? [n] $c" >&4
1603 echo "Continuing..." >&4
1607 echo "ABORTING..." >&4
1612 echo "Looks good..."
1615 echo "There is no MANIFEST file. I hope your kit is complete !"
1620 : Find the appropriate value for a newline for tr
1621 if test -n "$DJGPP"; then
1624 if test X"$trnl" = X; then
1625 case "`echo foo|tr '\n' x 2>/dev/null`" in
1629 if test X"$trnl" = X; then
1630 case "`echo foo|tr '\012' x 2>/dev/null`" in
1631 foox) trnl='\012' ;;
1634 if test X"$trnl" = X; then
1637 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1643 : compute the number of columns on the terminal for proper question formatting
1648 : set up the echo used in my read
1649 myecho="case \"\$xxxm\" in
1650 '') echo $n \"\$rp $c\" >&4;;
1652 '') echo $n \"[\$xxxm] $c\";;
1654 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1656 echo $n \"[\$xxxm] $c\" >&4
1658 echo $n \"\$rp [\$xxxm] $c\" >&4
1664 : now set up to do reads with possible shell escape and default assignment
1670 case "\$fastread" in
1671 yes) case "\$dflt" in
1674 case "\$silent-\$rp" in
1679 *) case "\$silent" in
1680 true) case "\$rp" in
1685 while expr "X\$ans" : "X!" >/dev/null; do
1689 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1697 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1706 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1711 echo "(OK, I'll run with -d after this question.)" >&4
1714 echo "*** Sorry, \$1 not supported yet." >&4
1724 echo "*** Substitution done -- please confirm."
1726 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1731 echo "*** Error -- try again."
1738 case "\$ans\$xxxm\$nostick" in
1750 : create .config dir to save info across Configure sessions
1751 test -d ../.config || mkdir ../.config
1752 cat >../.config/README <<EOF
1753 This directory created by Configure to save information that should
1754 persist across sessions for $package.
1756 You may safely delete it if you wish.
1759 : general instructions
1762 user=`(logname) 2>/dev/null`
1764 '') user=`whoami 2>&1`;;
1766 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1769 rp='Would you like to see the instructions?'
1780 This installation shell script will examine your system and ask you questions
1781 to determine how the perl5 package should be installed. If you get
1782 stuck on a question, you may use a ! shell escape to start a subshell or
1783 execute a command. Many of the questions will have default answers in square
1784 brackets; typing carriage return will give you the default.
1786 On some of the questions which ask for file or directory names you are allowed
1787 to use the ~name construct to specify the login directory belonging to "name",
1788 even if you don't have a shell which knows about that. Questions where this is
1789 allowed will be marked "(~name ok)".
1793 dflt='Type carriage return to continue'
1797 The prompter used in this script allows you to use shell variables and
1798 backticks in your answers. You may use $1, $2, etc... to refer to the words
1799 in the default answer, as if the default line was a set of arguments given to a
1800 script shell. This means you may also use $* to repeat the whole default line,
1801 so you do not have to re-type everything to add something to the default.
1803 Everytime there is a substitution, you will have to confirm. If there is an
1804 error (e.g. an unmatched backtick), the default answer will remain unchanged
1805 and you will be prompted again.
1807 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1808 the questions and use the computed defaults (or the previous answers if there
1809 was already a config.sh file). Type 'Configure -h' for a list of options.
1810 You may also start interactively and then answer '& -d' at any prompt to turn
1811 on the non-interactive behaviour for the remainder of the execution.
1817 Much effort has been expended to ensure that this shell script will run on any
1818 Unix system. If despite that it blows up on yours, your best bet is to edit
1819 Configure and run it again. If you can't run Configure for some reason,
1820 you'll have to generate a config.sh file by hand. Whatever problems you
1821 have, let me (perlbug@perl.com) know how I blew it.
1823 This installation script affects things in two ways:
1825 1) it may do direct variable substitutions on some of the files included
1827 2) it builds a config.h file for inclusion in C programs. You may edit
1828 any of these files as the need arises after running this script.
1830 If you make a mistake on a question, there is no easy way to back up to it
1831 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1832 files. Configure will offer to let you do this before it runs the SH files.
1835 dflt='Type carriage return to continue'
1837 case "$firsttime" in
1838 true) echo $user >>../.config/instruct;;
1842 : find out where common programs are
1844 echo "Locating common programs..." >&4
1857 if test -d \$dir/\$thing; then
1863 for thisthing in \$dir/\$thing; do
1864 : just loop through to pick last item
1866 if test -f \$thisthing; then
1869 elif test -f \$dir/\$thing.exe; then
1870 if test -n "$DJGPP"; then
1871 echo \$dir/\$thing.exe
1873 : on Eunice apparently
1927 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1928 pth="$pth /lib /usr/lib"
1929 for file in $loclist; do
1933 if test -f "$xxx"; then
1936 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1937 xxx=`./loc $file $file $pth`
1940 '') xxx=`./loc $file $file $pth`;;
1941 *) xxx=`./loc $xxx $xxx $pth`;;
1947 echo $file is in $xxx.
1950 echo $file is in $xxx.
1953 echo "I don't know where '$file' is, and my life depends on it." >&4
1954 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1960 echo "Don't worry if any of the following aren't found..."
1962 for file in $trylist; do
1966 if test -f "$xxx"; then
1969 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1970 xxx=`./loc $file $file $pth`
1973 '') xxx=`./loc $file $file $pth`;;
1974 *) xxx=`./loc $xxx $xxx $pth`;;
1980 echo $file is in $xxx.
1983 echo $file is in $xxx.
1986 echo "I don't see $file out there, $say."
1993 echo "Substituting grep for egrep."
1999 echo "Substituting cp for ln."
2005 echo "Hopefully test is built into your sh."
2008 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2009 echo "Using the test built into your sh."
2017 echo "Hopefully echo is built into your sh."
2022 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2023 $echo $n "hi there$c" >foo1
2024 echo $n "hi there$c" >foo2
2025 if cmp foo1 foo2 >/dev/null 2>&1; then
2026 echo "They are compatible. In fact, they may be identical."
2033 They are not compatible! You are probably running ksh on a non-USG system.
2034 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2035 have echo built in and we may have to run some Bourne shell scripts. That
2036 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2039 $echo $n "The star should be here-->$c"
2046 : determine whether symbolic links are supported
2049 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2050 echo "Symbolic links are supported." >&4
2053 echo "Symbolic links are NOT supported." >&4
2058 : see whether [:lower:] and [:upper:] are supported character classes
2060 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2062 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2066 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2067 # (0xc9 and 0xd1), therefore that is a nice testing point.
2068 if test "X$up" = X -o "X$low" = X; then
2069 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2075 if test "X$up" = X -o "X$low" = X; then
2076 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2082 if test "X$up" = X -o "X$low" = X; then
2083 case "`echo IJ | od -x 2>/dev/null`" in
2085 echo "Hey, this might be EBCDIC." >&4
2086 if test "X$up" = X -o "X$low" = X; then
2087 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2088 ij) up='[A-IJ-RS-Z]'
2093 if test "X$up" = X -o "X$low" = X; then
2094 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2104 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2106 echo "Using $up and $low to convert case." >&4
2109 echo "I don't know how to translate letters from upper to lower case." >&4
2110 echo "Your tr is not acting any way I know of." >&4
2114 : set up the translation script tr, must be called with ./tr of course
2118 '[A-Z][a-z]') exec $tr '$up' '$low';;
2119 '[a-z][A-Z]') exec $tr '$low' '$up';;
2126 : Try to determine whether config.sh was made on this system
2127 case "$config_sh" in
2129 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2130 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2131 # because the A-Z/a-z are not consecutive.
2132 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2133 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2134 newmyuname="$myuname"
2136 case "$knowitall" in
2138 if test -f ../config.sh; then
2139 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2140 eval "`grep myuname= ../config.sh`"
2142 if test "X$myuname" = "X$newmyuname"; then
2150 : Get old answers from old config file if Configure was run on the
2151 : same system, otherwise use the hints.
2154 if test -f config.sh; then
2156 rp="I see a config.sh file. Shall I use it to set the defaults?"
2159 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2160 *) echo "Fetching default answers from your old config.sh file..." >&4
2168 : Older versions did not always set $sh. Catch re-use of such
2177 if test ! -f config.sh; then
2180 First time through, eh? I have some defaults handy for some systems
2181 that need some extra help getting the Configure answers right:
2184 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2186 : Half the following guesses are probably wrong... If you have better
2187 : tests or hints, please send them to perlbug@perl.com
2188 : The metaconfig authors would also appreciate a copy...
2189 $test -f /irix && osname=irix
2190 $test -f /xenix && osname=sco_xenix
2191 $test -f /dynix && osname=dynix
2192 $test -f /dnix && osname=dnix
2193 $test -f /lynx.os && osname=lynxos
2194 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2195 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2196 $test -f /bin/mips && /bin/mips && osname=mips
2197 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2198 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2199 $test -d /usr/apollo/bin && osname=apollo
2200 $test -f /etc/saf/_sactab && osname=svr4
2201 $test -d /usr/include/minix && osname=minix
2202 if $test -d /MachTen -o -d /MachTen_Folder; then
2204 if $test -x /sbin/version; then
2205 osvers=`/sbin/version | $awk '{print $2}' |
2206 $sed -e 's/[A-Za-z]$//'`
2207 elif $test -x /usr/etc/version; then
2208 osvers=`/usr/etc/version | $awk '{print $2}' |
2209 $sed -e 's/[A-Za-z]$//'`
2215 $test -f /sys/posix.dll &&
2216 $test -f /usr/bin/what &&
2217 set X `/usr/bin/what /sys/posix.dll` &&
2218 $test "$3" = UWIN &&
2222 if $test -f $uname; then
2230 umips) osname=umips ;;
2233 [23]100) osname=mips ;;
2234 next*) osname=next ;;
2236 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2237 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2240 elif $test -f /etc/kconfig; then
2242 if test "$lns" = "$ln -s"; then
2244 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2246 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2253 if test -n "$DJGPP"; then
2262 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2264 'not found') osvers="$4"."$3" ;;
2265 '<3240'|'<>3240') osvers=3.2.0 ;;
2266 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2267 '=3250'|'>3250') osvers=3.2.5 ;;
2271 bsd386) osname=bsd386
2274 cygwin*) osname=cygwin
2277 *dc.osx) osname=dcosx
2283 domainos) osname=apollo
2289 dynixptx*) osname=dynixptx
2290 osvers=`echo "$4"|sed 's/^v//'`
2292 freebsd) osname=freebsd
2294 genix) osname=genix ;;
2296 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2312 netbsd*) osname=netbsd
2315 news-os) osvers="$3"
2317 4*) osname=newsos4 ;;
2321 next*) osname=next ;;
2322 POSIX-BC | posix-bc ) osname=posix-bc
2325 powerux | power_ux | powermax_os | powermaxos | \
2326 powerunix | power_unix) osname=powerux
2332 solaris) osname=solaris
2334 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2341 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2345 titanos) osname=titanos
2354 ultrix) osname=ultrix
2357 osf1|mls+) case "$5" in
2360 osvers=`echo "$3" | sed 's/^[xvt]//'`
2362 hp*) osname=hp_osf1 ;;
2363 mips) osname=mips_osf1 ;;
2366 unixware) osname=svr5
2372 $2) case "$osname" in
2376 : svr4.x or possibly later
2386 if test -f /stand/boot ; then
2387 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2388 if test -n "$INITPROG" -a -f "$INITPROG"; then
2389 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2390 if test -n "$isesix"; then
2398 *) if test -f /etc/systemid; then
2400 set `echo $3 | $sed 's/\./ /g'` $4
2401 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2403 elif $test -f $src/hints/sco_$1_$2.sh; then
2405 elif $test -f $src/hints/sco_$1.sh; then
2410 '') : Still unknown. Probably a generic Sys V.
2419 *) case "$osname" in
2420 '') : Still unknown. Probably a generic BSD.
2428 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2429 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2430 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2433 $rm -f UU/kernel.what
2434 elif test -d c:/.; then
2441 : Now look for a hint file osname_osvers, unless one has been
2442 : specified already.
2445 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2446 : Also try without trailing minor version numbers.
2447 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2448 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2449 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2450 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2453 *) case "$osvers" in
2456 *) if $test -f $src/hints/$file.sh ; then
2458 elif $test -f $src/hints/$xfile.sh ; then
2460 elif $test -f $src/hints/$xxfile.sh ; then
2462 elif $test -f $src/hints/$xxxfile.sh ; then
2464 elif $test -f $src/hints/$xxxxfile.sh ; then
2466 elif $test -f "$src/hints/${osname}.sh" ; then
2475 if $test -f Policy.sh ; then
2478 none) dflt="Policy" ;;
2479 *) dflt="Policy $dflt" ;;
2484 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2488 if $test -f Policy.sh ; then
2491 There's also a Policy hint file available, which should make the
2492 site-specific (policy) questions easier to answer.
2499 You may give one or more space-separated answers, or "none" if appropriate.
2500 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2501 is a good thing. DO NOT give a wrong version or a wrong OS.
2505 rp="Which of these apply, if any?"
2508 for file in $tans; do
2509 if $test X$file = XPolicy -a -f Policy.sh; then
2511 $cat Policy.sh >> UU/config.sh
2512 elif $test -f $src/hints/$file.sh; then
2513 . $src/hints/$file.sh
2514 $cat $src/hints/$file.sh >> UU/config.sh
2515 elif $test X$tans = X -o X$tans = Xnone ; then
2518 : Give one chance to correct a possible typo.
2519 echo "$file.sh does not exist"
2521 rp="hint to use instead?"
2523 for file in $ans; do
2524 if $test -f "$src/hints/$file.sh"; then
2525 . $src/hints/$file.sh
2526 $cat $src/hints/$file.sh >> UU/config.sh
2527 elif $test X$ans = X -o X$ans = Xnone ; then
2530 echo "$file.sh does not exist -- ignored."
2537 : Remember our hint file for later.
2538 if $test -f "$src/hints/$file.sh" ; then
2548 echo "Fetching default answers from $config_sh..." >&4
2552 cp $config_sh config.sh 2>/dev/null
2562 test "$override" && . ./optdef.sh
2563 myuname="$newmyuname"
2565 : Restore computed paths
2566 for file in $loclist $trylist; do
2567 eval $file="\$_$file"
2572 Configure uses the operating system name and version to set some defaults.
2573 The default value is probably right if the name rings a bell. Otherwise,
2574 since spelling matters for me, either accept the default or answer "none"
2581 ''|' '|none) dflt=none ;;
2582 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2585 *) dflt="$osname" ;;
2587 rp="Operating system name?"
2591 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2597 ''|' '|none) dflt=none ;;
2598 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2599 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2601 ''|' ') dflt=none ;;
2606 *) dflt="$osvers" ;;
2608 rp="Operating system version?"
2618 : who configured the system
2619 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2620 cf_by=`(logname) 2>/dev/null`
2623 cf_by=`(whoami) 2>/dev/null`
2625 "") cf_by=unknown ;;
2629 : set up the script used to warn in case of inconsistency
2636 echo "*** WHOA THERE!!! ***" >&4
2637 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2638 rp=" Keep the $hint value?"
2641 y) td=$was; tu=$was;;
2645 : function used to set $1 to $val
2646 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2648 $define$undef) . ./whoa; eval "$var=\$td";;
2649 $undef$define) . ./whoa; eval "$var=\$tu";;
2650 *) eval "$var=$val";;
2655 Perl can be built to take advantage of threads, on some systems.
2656 To do so, Configure must be run with -Dusethreads.
2658 Note that threading is a highly experimental feature, and
2659 some known race conditions still remain. If you choose to try
2660 it, be very sure to not actually deploy it for production
2661 purposes. README.threads has more details, and is required
2662 reading if you enable threads.
2664 case "$usethreads" in
2665 $define|true|[yY]*) dflt='y';;
2668 rp='Build a threading Perl?'
2671 y|Y) val="$define" ;;
2677 case "$usethreads" in
2681 As of 5.5.64, Perl has two different internal threading implementations,
2682 the 5.005 version (5005threads) and an interpreter-based version
2683 (ithreads) that has one interpreter per thread. Both are very
2684 experimental. This arrangement exists to help developers work out
2685 which one is better.
2687 : Default to ithreads unless overridden on command line or with
2690 case "$use5005threads" in
2691 $define|true|[yY]*) dflt='n';;
2693 case "$useithreads" in
2694 $undef|false|[nN]*) dflt='n';;
2696 rp='Use interpreter-based ithreads?'
2699 y|Y) val="$define" ;;
2704 : Now set use5005threads to the opposite value.
2705 case "$useithreads" in
2706 $define) val="$undef" ;;
2713 useithreads="$undef"
2714 use5005threads="$undef"
2718 case "$d_oldpthreads" in
2719 '') : Configure tests would be welcome here. For now, assume undef.
2721 *) val="$d_oldpthreads" ;;
2727 case "$usethreads" in
2728 "$define"|true|[yY]*)
2729 : Look for a hint-file generated 'call-back-unit'. If the
2730 : user has specified that a threading perl is to be built,
2731 : we may need to set or change some other defaults.
2732 if $test -f usethreads.cbu; then
2733 echo "Your platform has some specific hints for threaded builds, using them..."
2737 (Your platform doesn't have any specific hints for threaded builds.
2738 Assuming POSIX threads, then.)
2746 Perl can be built so that multiple Perl interpreters can coexist
2747 within the same Perl executable. To do so, Configure must be run with
2750 Normally you do not need this and you should answer no.
2753 case "$usemultiplicity" in
2754 $define|true|[yY]*) dflt='y';;
2757 rp='Build Perl for multiplicity?'
2760 y|Y) val="$define" ;;
2766 : determine where manual pages are on this system
2770 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2771 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2772 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2773 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2774 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2775 sysman=`./loc . /usr/man/man1 $syspath`
2778 if $test -d "$sysman"; then
2779 echo "System manual is in $sysman." >&4
2781 echo "Could not find manual pages in source form." >&4
2784 : see what memory models we can support
2787 $cat >pdp11.c <<'EOP'
2796 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2797 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2798 dflt='unsplit split'
2800 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2803 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2808 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2811 if $test -d /lib/large || $test -d /usr/lib/large; then
2814 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2823 Some systems have different model sizes. On most systems they are called
2824 small, medium, large, and huge. On the PDP11 they are called unsplit and
2825 split. If your system doesn't support different memory models, say "none".
2826 If you wish to force everything to one memory model, say "none" here and
2827 put the appropriate flags later when it asks you for other cc and ld flags.
2828 Venix systems may wish to put "none" and let the compiler figure things out.
2829 (In the following question multiple model names should be space separated.)
2831 The default for most systems is "none".
2834 rp="Which memory models are supported?"
2849 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2850 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2857 rp="What flag indicates separate I and D space?"
2865 *large*|*small*|*medium*|*huge*)
2872 rp="What flag indicates large model?"
2882 *huge*) case "$huge" in
2886 rp="What flag indicates huge model?"
2896 *medium*) case "$medium" in
2900 rp="What flag indicates medium model?"
2907 *) medium="$large";;
2910 *small*) case "$small" in
2914 rp="What flag indicates small model?"
2925 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2928 $rm -f pdp11.* pdp11
2930 : make some quick guesses about what we are up against
2932 $echo $n "Hmm... $c"
2942 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2943 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2945 echo "Looks kind of like an OSF/1 system, but we'll see..."
2947 elif test `echo abc | tr a-z A-Z` = Abc ; then
2948 xxx=`./loc addbib blurfl $pth`
2949 if $test -f $xxx; then
2950 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2954 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2955 echo "Looks kind of like an extended USG system, but we'll see..."
2957 echo "Looks kind of like a USG system, but we'll see..."
2961 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2962 echo "Looks kind of like a BSD system, but we'll see..."
2966 echo "Looks kind of like a Version 7 system, but we'll see..."
2969 case "$eunicefix" in
2972 There is, however, a strange, musty smell in the air that reminds me of
2973 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2977 : it so happens the Eunice I know will not run shell scripts in Unix format
2981 echo "Congratulations. You aren't running Eunice."
2985 : Detect OS2. The p_ variable is set above in the Head.U unit.
2990 I have the feeling something is not exactly right, however...don't tell me...
2991 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2996 if test -f /xenix; then
2997 echo "Actually, this looks more like a XENIX system..."
3002 echo "It's not Xenix..."
3007 if test -f /venix; then
3008 echo "Actually, this looks more like a VENIX system..."
3015 echo "Nor is it Venix..."
3018 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3019 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3022 : see if we need a special compiler
3030 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3031 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3045 On some older systems the default C compiler will not resolve multiple global
3046 references that happen to have the same name. On some such systems the "Mcc"
3047 command may be used to force these to be resolved. On other systems a "cc -M"
3048 command is required. (Note that the -M flag on other systems indicates a
3049 memory model to use!) If you have the Gnu C compiler, you might wish to use
3055 rp="Use which C compiler?"
3063 rp="Use which C compiler?"
3067 : Look for a hint-file generated 'call-back-unit'. Now that the
3068 : user has specified the compiler, we may need to set or change some
3070 if $test -f cc.cbu; then
3074 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3075 $cat >gccvers.c <<EOM
3080 printf("%s\n", __VERSION__);
3082 printf("%s\n", "1");
3088 if $cc -o gccvers gccvers.c; then
3089 gccversion=`./gccvers`
3090 case "$gccversion" in
3091 '') echo "You are not using GNU cc." ;;
3092 *) echo "You are using GNU cc $gccversion." ;;
3096 echo "*** WHOA THERE!!! ***" >&4
3097 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3098 case "$knowitall" in
3100 echo " You'd better start hunting for one and let me know about it." >&4
3106 case "$gccversion" in
3107 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3110 : see how we invoke the C preprocessor
3112 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3113 cat <<'EOT' >testcpp.c
3119 if test ! -f cppstdin; then
3120 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3121 # AIX cc -E doesn't show the absolute headerfile
3122 # locations but we'll cheat by using the -M flag.
3123 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
3125 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3128 echo "Keeping your $hint cppstdin wrapper."
3131 wrapper=`pwd`/cppstdin
3135 if $test "X$cppstdin" != "X" && \
3136 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3137 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3139 echo "You used to use $cppstdin $cppminus so we'll use that again."
3141 '') echo "But let's see if we can live without a wrapper..." ;;
3143 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3144 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3146 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3149 echo "(However, $cpprun $cpplast does not work, let's see...)"
3157 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3164 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3165 $cc -E <testcpp.c >testcpp.out 2>&1; \
3166 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3167 echo "Yup, it does."
3170 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3171 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3172 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3173 echo "Yup, it does."
3176 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3177 $cc -P <testcpp.c >testcpp.out 2>&1; \
3178 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3179 echo "Yipee, that works!"
3182 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3183 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3184 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3185 echo "At long last!"
3188 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3189 $cpp <testcpp.c >testcpp.out 2>&1; \
3190 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3194 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3195 $cpp - <testcpp.c >testcpp.out 2>&1; \
3196 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3197 echo "Hooray, it works! I was beginning to wonder."
3200 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3201 $wrapper <testcpp.c >testcpp.out 2>&1; \
3202 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3208 rp="No dice. I can't find a C preprocessor. Name one:"
3212 $x_cpp <testcpp.c >testcpp.out 2>&1
3213 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3214 echo "OK, that will do." >&4
3216 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3231 echo "Perhaps can we force $cc -E using a wrapper..."
3232 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3233 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3239 echo "Nope, we'll have to live without it..."
3253 "$wrapper"|'cppstdin') ;;
3254 *) $rm -f $wrapper;;
3256 $rm -f testcpp.c testcpp.out
3258 : decide how portable to be. Allow command line overrides.
3259 case "$d_portable" in
3261 *) d_portable="$define" ;;
3264 : set up shell script to do ~ expansion
3270 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3273 if $test -f /bin/csh; then
3274 /bin/csh -f -c "glob \$1"
3279 name=\`$expr x\$1 : '..\([^/]*\)'\`
3280 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3281 if $test ! -d "\$dir"; then
3283 echo "\$me: can't locate home directory for: \$name" >&2
3288 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3304 : now set up to get a file name
3308 cat <<'EOSC' >>getfile
3324 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3325 fn=`echo $fn | sed 's/(.*)//'`
3331 loc_file=`expr $fn : '.*:\(.*\)'`
3332 fn=`expr $fn : '\(.*\):.*'`
3340 */*) fullpath=true;;
3349 *e*) exp_file=true;;
3352 *p*) nopath_ok=true;;
3357 *d*) type='Directory';;
3358 *l*) type='Locate';;
3363 Locate) what='File';;
3368 case "$d_portable" in
3376 while test "$type"; do
3381 true) rp="$rp (~name ok)";;
3384 if test -f UU/getfile.ok && \
3385 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3404 value=`UU/filexp $ans`
3407 if test "$ans" != "$value"; then
3408 echo "(That expands to $value on this system.)"
3422 /*) value="$ansexp" ;;
3427 echo "I shall only accept a full path name, as in /bin/ls." >&4
3428 echo "Use a ! shell escape if you wish to check pathnames." >&4
3431 echo "Please give a full path name, starting with slash." >&4
3434 echo "Note that using ~name is ok provided it expands well." >&4
3447 for fp in $gfpth; do
3448 if test "X$fp" = X.; then
3453 if test -f "$pf"; then
3455 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3457 echo "($value is not a plain file, but that's ok.)"
3460 if test X"$type" = X; then
3467 for fp in $gfpth; do
3468 if test "X$fp" = X.; then
3473 if test -d "$pf"; then
3481 if test -d "$ansexp"; then
3482 echo "(Looking for $loc_file in directory $value.)"
3483 value="$value/$loc_file"
3484 ansexp="$ansexp/$loc_file"
3486 if test -f "$ansexp"; then
3489 case "$nopath_ok" in
3490 true) case "$value" in
3492 *) echo "Assuming $value will be in people's path."
3508 if test "$fastread" = yes; then
3513 rp="$what $value doesn't exist. Use that name anyway?"
3532 test "X$gfpthkeep" != Xy && gfpth=""
3535 : What should the include directory be ?
3537 $echo $n "Hmm... $c"
3541 if $test -f /bin/mips && /bin/mips; then
3542 echo "Looks like a MIPS system..."
3543 $cat >usr.c <<'EOCP'
3544 #ifdef SYSTYPE_BSD43
3548 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3549 dflt='/bsd43/usr/include'
3553 mips_type='System V'
3555 $rm -f usr.c usr.out
3556 echo "and you're compiling with the $mips_type compiler and libraries."
3560 echo "Doesn't look like a MIPS system."
3570 case "$xxx_prompt" in
3573 rp='Where are the include files you want to use?'
3581 : Set private lib path
3584 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3589 '') dlist="$loclibpth $plibpth $glibpth";;
3590 *) dlist="$libpth";;
3593 : Now check and see which directories actually exist, avoiding duplicates
3597 if $test -d $xxx; then
3600 *) libpth="$libpth $xxx";;
3606 Some systems have incompatible or broken versions of libraries. Among
3607 the directories listed in the question below, please remove any you
3608 know not to be holding relevant libraries, and add any that are needed.
3609 Say "none" for none.
3620 rp="Directories to use for library searches?"
3627 : compute shared library extension
3630 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3640 On some systems, shared libraries may be available. Answer 'none' if
3641 you want to suppress searching of shared libraries for the remaining
3642 of this configuration.
3645 rp='What is the file extension used for shared libraries?'
3649 : Define several unixisms.
3650 : Hints files or command line option can be used to override them.
3651 : The convoluted testing is in case hints files set either the old
3654 '') case "$exe_ext" in
3656 *) _exe="$exe_ext" ;;
3661 '') case "$lib_ext" in
3668 '') case "$obj_ext" in
3675 '') case "$path_sep" in
3686 : Which makefile gets called first. This is used by make depend.
3687 case "$firstmakefile" in
3688 '') firstmakefile='makefile';;
3693 Perl can be built to use the SOCKS proxy protocol library. To do so,
3694 Configure must be run with -Dusesocks.
3696 Normally you do not need this and you should answer no.
3700 $define|true|[yY]*) dflt='y';;
3703 rp='Build Perl for SOCKS?'
3706 y|Y) val="$define" ;;
3712 : Looking for optional libraries
3714 echo "Checking for optional libraries..." >&4
3719 case "$libswanted" in
3720 '') libswanted='c_s';;
3724 libswanted="$libswanted socks5 socks5_sh"
3727 for thislib in $libswanted; do
3729 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3730 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3731 echo "Found -l$thislib (shared)."
3734 *) dflt="$dflt -l$thislib";;
3736 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3737 echo "Found -l$thislib (shared)."
3740 *) dflt="$dflt -l$thislib";;
3742 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3743 echo "Found -l$thislib."
3746 *) dflt="$dflt -l$thislib";;
3748 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3749 echo "Found -l$thislib."
3752 *) dflt="$dflt -l$thislib";;
3754 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3755 echo "Found -l${thislib}_s."
3758 *) dflt="$dflt -l${thislib}_s";;
3760 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3761 echo "Found -l$thislib."
3764 *) dflt="$dflt -l$thislib";;
3767 echo "No -l$thislib."
3778 ' '|'') dflt='none';;
3783 In order to compile $package on your machine, a number of libraries
3784 are usually needed. Include any other special libraries here as well.
3785 Say "none" for none. The default list is almost always right.
3789 rp="What libraries to use?"
3796 : determine optimization, if desired, or use for debug flag also
3798 ' '|$undef) dflt='none';;
3800 *) dflt="$optimize";;
3804 By default, $package compiles with the -O flag to use the optimizer.
3805 Alternately, you might want to use the symbolic debugger, which uses
3806 the -g flag (on traditional Unix systems). Either flag can be
3807 specified here. To use neither flag, specify the word "none".
3810 rp="What optimizer/debugger flag should be used?"
3814 'none') optimize=" ";;
3818 : We will not override a previous value, but we might want to
3819 : augment a hint file
3821 default|recommended)
3822 case "$gccversion" in
3823 1*) dflt='-fpcc-struct-return' ;;
3826 *-g*) dflt="$dflt -DDEBUGGING";;
3828 case "$gccversion" in
3829 2*) if test -d /etc/conf/kconfig.d &&
3830 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3836 case "$gccversion" in
3840 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3841 echo 'int main(void) { return 0; }' > gcctest.c
3842 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3843 echo "Yes, it does." 2>&1
3846 echo "Leaving current flags $ccflags alone." 2>&1
3848 *) dflt="$dflt -fno-strict-aliasing" ;;
3851 echo "Nope, it doesn't, but that's ok." 2>&1
3858 case "$mips_type" in
3859 *BSD*|'') inclwanted="$locincpth $usrinc";;
3860 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3862 for thisincl in $inclwanted; do
3863 if $test -d $thisincl; then
3864 if $test x$thisincl != x$usrinc; then
3867 *) dflt="$dflt -I$thisincl";;
3873 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3875 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3883 *) dflt="$dflt -D$2";;
3887 set signal.h LANGUAGE_C; eval $inctest
3891 ccflags="$ccflags -DSOCKS"
3896 default|recommended) dflt="$ccflags $dflt" ;;
3897 *) dflt="$ccflags";;
3905 Your C compiler may want other flags. For this question you should include
3906 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3907 but you should NOT include libraries or ld flags like -lwhatever. If you
3908 want $package to honor its debug switch, you should include -DDEBUGGING here.
3909 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3911 To use no flags, specify the word "none".
3917 rp="Any additional cc flags?"
3924 : the following weeds options from ccflags that are of no interest to cpp
3926 case "$gccversion" in
3927 1*) cppflags="$cppflags -D__GNUC__"
3929 case "$mips_type" in
3931 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3937 echo "Let me guess what the preprocessor flags are..." >&4
3951 *) ftry="$previous $flag";;
3953 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3954 >cpp1.out 2>/dev/null && \
3955 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3956 >cpp2.out 2>/dev/null && \
3957 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3958 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3960 cppflags="$cppflags $ftry"
3970 *-*) echo "They appear to be: $cppflags";;
3972 $rm -f cpp.c cpp?.out
3976 : flags used in final linking phase
3978 '') if ./venix; then
3984 *-posix*) dflt="$dflt -posix" ;;
3987 *) dflt="$ldflags";;
3990 : Try to guess additional flags to pick up local libraries.
3991 for thislibdir in $libpth; do
3992 case " $loclibpth " in
3995 *"-L$thislibdir "*) ;;
3996 *) dflt="$dflt -L$thislibdir" ;;
4008 Your C linker may need flags. For this question you should
4009 include -L/whatever and any other flags used by the C linker, but you
4010 should NOT include libraries like -lwhatever.
4012 Make sure you include the appropriate -L/path flags if your C linker
4013 does not normally search all of the directories you specified above,
4016 To use no flags, specify the word "none".
4020 rp="Any additional ld flags (NOT including libraries)?"
4026 rmlist="$rmlist pdp11"
4030 echo "Checking your choice of C compiler and flags for coherency..." >&4
4031 $cat > try.c <<'EOF'
4033 int main() { printf("Ok\n"); exit(0); }
4035 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4037 $cat >try.msg <<'EOM'
4038 I've tried to compile and run the following simple program:
4041 $cat try.c >> try.msg
4043 $cat >> try.msg <<EOM
4050 and I got the following output:
4054 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4055 if sh -c './try' >>try.msg 2>&1; then
4059 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4062 cat >> try.msg <<'EOQS'
4063 If $libs contains -lsfio, and sfio is mis-configured, then it
4064 sometimes (apparently) runs and exits with a 0 status, but with no
4065 output! It may have to do with sfio's use of _exit vs. exit.
4068 rp="You have a big problem. Shall I abort Configure"
4075 echo "The program compiled OK, but exited with status $?." >>try.msg
4076 rp="You have a problem. Shall I abort Configure"
4080 echo "I can't compile the test program." >>try.msg
4081 rp="You have a BIG problem. Shall I abort Configure"
4087 case "$knowitall" in
4089 echo "(The supplied flags or libraries might be incorrect.)"
4097 *) echo "Ok. Stopping Configure." >&4
4102 n) echo "OK, that should do.";;
4104 $rm -f try try.* core
4106 : define an is-a-typedef? function
4107 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4109 "") inclist="sys/types.h";;
4111 eval "varval=\$$var";
4115 for inc in $inclist; do
4116 echo "#include <$inc>" >>temp.c;
4118 echo "#ifdef $type" >> temp.c;
4119 echo "printf(\"We have $type\");" >> temp.c;
4120 echo "#endif" >> temp.c;
4121 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4122 if $contains $type temp.E >/dev/null 2>&1; then
4128 *) eval "$var=\$varval";;
4131 : define an is-a-typedef? function that prompts if the type is not available.
4132 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4134 "") inclist="sys/types.h";;
4136 eval "varval=\$$var";
4140 for inc in $inclist; do
4141 echo "#include <$inc>" >>temp.c;
4143 echo "#ifdef $type" >> temp.c;
4144 echo "printf(\"We have $type\");" >> temp.c;
4145 echo "#endif" >> temp.c;
4146 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4148 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4149 if $contains $type temp.E >/dev/null 2>&1; then
4150 echo "$type found." >&4;
4153 echo "$type NOT found." >&4;
4159 *) eval "$var=\$varval";;
4162 : define a shorthand compile call
4166 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4167 : define a shorthand compile call for compilations that should be ok.
4171 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4173 : check for lengths of integral types
4177 echo "Checking to see how big your integers are..." >&4
4178 $cat >intsize.c <<'EOCP'
4182 printf("intsize=%d;\n", (int)sizeof(int));
4183 printf("longsize=%d;\n", (int)sizeof(long));
4184 printf("shortsize=%d;\n", (int)sizeof(short));
4189 if eval $compile_ok && ./intsize > /dev/null; then
4191 echo "Your integers are $intsize bytes long."
4192 echo "Your long integers are $longsize bytes long."
4193 echo "Your short integers are $shortsize bytes long."
4197 Help! I can't compile and run the intsize test program: please enlighten me!
4198 (This is probably a misconfiguration in your system or libraries, and
4199 you really ought to fix it. Still, I'll try anyway.)
4203 rp="What is the size of an integer (in bytes)?"
4207 rp="What is the size of a long integer (in bytes)?"
4211 rp="What is the size of a short integer (in bytes)?"
4217 $rm -f intsize intsize.*
4219 : see what type lseek is declared as in the kernel
4220 rp="What is the type used for lseek's offset on this system?"
4221 set off_t lseektype long stdio.h sys/types.h
4225 $echo $n "Checking to see how big your file offsets are...$c" >&4
4227 #include <sys/types.h>
4231 printf("%d\n", (int)sizeof($lseektype));
4236 if eval $compile_ok; then
4238 $echo " $lseeksize bytes." >&4
4242 echo "(I can't seem to compile the test program. Guessing...)"
4243 rp="What is the size of your file offsets (in bytes)?"
4249 : see what type file positions are declared as in the library
4250 rp="What is the type for file position used by fsetpos()?"
4251 set fpos_t fpostype long stdio.h sys/types.h
4256 *_t) zzz="$fpostype" ;;
4259 $echo $n "Checking the size of $zzz...$c" >&4
4261 #include <sys/types.h>
4264 printf("%d\n", (int)sizeof($fpostype));
4269 if eval $compile_ok; then
4274 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4277 echo " $fpossize bytes."
4283 echo "(I can't compile the test program. Guessing...)" >&4
4284 rp="What is the size of your file positions (in bytes)?"
4291 case "$lseeksize:$fpossize" in
4294 You can have files larger than 2 gigabytes.
4299 Perl can be built to understand large files (files larger than 2 gigabytes)
4300 on some systems. To do so, Configure must be run with -Duselargefiles.
4302 If this doesn't make any sense to you, just accept the default 'y'.
4304 case "$uselargefiles" in
4305 "$undef"|false|[nN]*) dflt='n' ;;
4308 rp='Try to understand large files, if available?'
4311 y|Y) val="$define" ;;
4318 case "$uselargefiles" in
4320 : Look for a hint-file generated 'call-back-unit'. If the
4321 : user has specified that a large files perl is to be built,
4322 : we may need to set or change some other defaults.
4323 if $test -f uselfs.cbu; then
4324 echo "Your platform has some specific hints for large file builds, using them..."
4327 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4329 #include <sys/types.h>
4333 printf("%d\n", (int)sizeof($lseektype));
4338 if eval $compile_ok; then
4340 $echo " $lseeksize bytes." >&4
4344 echo "(I can't seem to compile the test program. Guessing...)"
4345 rp="What is the size of your file offsets (in bytes)?"
4350 *_t) zzz="$fpostype" ;;
4353 $echo $n "Rechecking the size of $zzz...$c" >&4
4355 #include <sys/types.h>
4358 printf("%d\n", (int)sizeof($fpostype));
4363 if eval $compile_ok; then
4368 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4371 echo " $fpossize bytes."
4377 echo "(I can't compile the test program. Guessing...)" >&4
4378 rp="What is the size of your file positions (in bytes)?"
4388 case "$usemorebits" in
4389 "$define"|true|[yY]*)
4391 uselongdouble="$define"
4392 usemorebits="$define"
4394 *) usemorebits="$undef"
4399 case "$intsize:$longsize" in
4402 You have natively 64-bit integers.
4407 Perl can be built to take advantage of 64-bit integer types
4408 on some systems. To do so, Configure must be run with -Duse64bits.
4410 If this doesn't make any sense to you, just accept the default.
4412 case "$use64bits" in
4413 $define|true|[yY]*) dflt='y';;
4416 rp='Try to use 64-bit integers, if available?'
4419 y|Y) val="$define" ;;
4427 case "$archname64" in
4428 '') archname64='' ;; # not a typo
4431 case "$use64bits" in
4432 "$define"|true|[yY]*)
4433 : Look for a hint-file generated 'call-back-unit'. If the
4434 : user has specified that a 64-bit perl is to be built,
4435 : we may need to set or change some other defaults.
4436 if $test -f use64bits.cbu; then
4437 echo "Your platform has some specific hints for 64-bit builds, using them..."
4441 (Your platform doesn't have any specific hints for 64-bit builds.)
4443 case "$intsize:$longsize" in
4445 (This is probably okay, as your system is a natively 64-bit system.)
4449 case "$gccversion" in
4451 *) case "$ccflags" in
4452 *-DUSE_LONG_LONG*) ;;
4454 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4455 to the compilation flags.
4457 ccflags="$ccflags -DUSE_LONG_LONG"
4466 : determine the architecture name
4468 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4469 tarch=`arch`"-$osname"
4470 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4471 if uname -m > tmparch 2>&1 ; then
4472 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4473 -e 's/$/'"-$osname/" tmparch`
4481 case "$myarchname" in
4484 echo "(Your architecture name used to be $myarchname.)"
4491 *) dflt="$archname";;
4493 rp='What is your architecture name'
4496 case "$usethreads" in
4498 echo "Threads selected." >&4
4500 *-thread*) echo "...and architecture name already has -thread." >&4
4502 *) archname="$archname-thread"
4503 echo "...setting architecture name to $archname." >&4
4508 case "$usemultiplicity" in
4510 echo "Multiplicity selected." >&4
4512 *-multi*) echo "...and architecture name already has -multi." >&4
4514 *) archname="$archname-multi"
4515 echo "...setting architecture name to $archname." >&4
4520 case "$use64bits" in
4522 case "$archname64" in
4527 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4529 *) archname="$archname-$archname64"
4530 echo "...setting architecture name to $archname." >&4
4537 : determine root of directory hierarchy where package will be installed.
4540 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4548 By default, $package will be installed in $dflt/bin, manual pages
4549 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4550 installation directories. Typically this is something like /usr/local.
4551 If you wish to have binaries under /usr/bin but other parts of the
4552 installation under /usr/local, that's ok: you will be prompted
4553 separately for each of the installation directories, the prefix being
4554 only used to set the defaults.
4558 rp='Installation prefix to use?'
4566 *) oldprefix="$prefix";;
4576 $define|true) afs=true ;;
4577 $undef|false) afs=false ;;
4578 *) if test -d /afs; then
4586 echo "AFS may be running... I'll be extra cautious then..." >&4
4588 echo "AFS does not seem to be running..." >&4
4591 : determine installation prefix for where package is to be installed.
4595 Since you are running AFS, I need to distinguish the directory in which
4596 files will reside from the directory in which they are installed (and from
4597 which they are presumably copied to the former directory by occult means).
4600 case "$installprefix" in
4601 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4602 *) dflt="$installprefix";;
4607 In some special cases, particularly when building $package for distribution,
4608 it is convenient to distinguish between the directory in which files should
4609 be installed from the directory ($prefix) in which they
4610 will eventually reside. For most users, these two directories are the same.
4613 case "$installprefix" in
4615 *) dflt=$installprefix;;
4619 rp='What installation prefix should I use for installing files?'
4621 installprefix="$ans"
4622 installprefixexp="$ansexp"
4624 : set the prefixit variable, to compute a suitable default value
4625 prefixit='case "$3" in
4627 case "$oldprefix" in
4628 "") eval "$1=\"\$$2\"";;
4635 ""|" ") eval "$1=\"\$$2\"";;
4641 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4643 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4644 /*-$oldprefix/*|\~*-$oldprefix/*)
4645 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4646 *) eval "$1=\"\$$2\"";;
4650 : set the base revision
4653 : get the patchlevel
4655 echo "Getting the current patchlevel..." >&4
4656 if $test -r $rsrc/patchlevel.h;then
4657 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4658 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4659 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
4665 $echo $n "(You have $package" $c
4668 *) $echo $n " $baserev" $c ;;
4670 $echo $n " patchlevel $patchlevel" $c
4671 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4674 version=`LC_ALL=C; export LC_ALL; \
4675 echo $baserev $patchlevel $subversion | \
4676 $awk '{ printf "%.6f\n", $1 + $2/1000.0 + $3/1000000.0 }' | \
4679 : determine installation style
4680 : For now, try to deduce it from prefix unless it is already set.
4681 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4682 case "$installstyle" in
4683 '') case "$prefix" in
4684 *perl*) dflt='lib';;
4685 *) dflt='lib/perl5' ;;
4688 *) dflt='lib/perl5' ;;
4690 : Probably not worth prompting for this since we prompt for all
4691 : the directories individually, and the prompt would be too long and
4695 : determine where private library files go
4696 : Usual default is /usr/local/lib/perl5/$version.
4697 : Also allow things like /opt/perl/lib/$version, since
4698 : /opt/perl/lib/perl5... would be redundant.
4699 : The default "style" setting is made in installstyle.U
4700 case "$installstyle" in
4701 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4702 *) set dflt privlib lib/$version ;;
4707 There are some auxiliary files for $package that need to be put into a
4708 private library directory that is accessible by everyone.
4712 rp='Pathname where the private library files will reside?'
4715 privlibexp="$ansexp"
4716 : Change installation prefix, if necessary.
4717 if $test X"$prefix" != X"$installprefix"; then
4718 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4720 installprivlib="$privlibexp"
4723 : set the prefixup variable, to restore leading tilda escape
4724 prefixup='case "$prefixexp" in
4726 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4729 : determine where public architecture dependent libraries go
4732 : privlib default is /usr/local/lib/$package/$version
4733 : archlib default is /usr/local/lib/$package/$version/$archname
4734 : privlib may have an optional trailing /share.
4735 tdflt=`echo $privlib | $sed 's,/share$,,'`
4736 tdflt=$tdflt/$archname
4745 $spackage contains architecture-dependent library files. If you are
4746 sharing libraries in a heterogeneous environment, you might store
4747 these files in a separate location. Otherwise, you can just include
4748 them with the rest of the public library files.
4752 rp='Where do you want to put the public architecture-dependent libraries?'
4755 archlibexp="$ansexp"
4756 if $test X"$archlib" = X"$privlib"; then
4761 : Change installation prefix, if necessary.
4762 if $test X"$prefix" != X"$installprefix"; then
4763 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4765 installarchlib="$archlibexp"
4769 : Binary compatibility with 5.005 is not possible for builds
4770 : with advanced features
4771 case "$usethreads$usemultiplicity" in
4773 bincompat5005="$undef"
4774 d_bincompat5005="$undef"
4778 Perl 5.006 can be compiled for binary compatibility with 5.005.
4779 If you decide to do so, you will be able to continue using most
4780 of the extensions that were compiled for Perl 5.005.
4783 case "$bincompat5005$d_bincompat5005" in
4784 *"$undef"*) dflt=n ;;
4787 rp='Binary compatibility with Perl 5.005?'
4790 y*) val="$define" ;;
4795 case "$d_bincompat5005" in
4797 bincompat5005="$define"
4799 *) bincompat5005="$undef"
4800 d_bincompat5005="$undef"
4807 : see if setuid scripts can be secure
4810 Some kernels have a bug that prevents setuid #! scripts from being
4811 secure. Some sites have disabled setuid #! scripts because of this.
4813 First let's decide if your kernel supports secure setuid #! scripts.
4814 (If setuid #! scripts would be secure but have been disabled anyway,
4815 don't say that they are secure if asked.)
4820 if $test -d /dev/fd; then
4821 echo "#!$ls" >reflect
4822 chmod +x,u+s reflect
4823 ./reflect >flect 2>&1
4824 if $contains "/dev/fd" flect >/dev/null; then
4825 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4829 If you are not sure if they are secure, I can check but I'll need a
4830 username and password different from the one you are using right now.
4831 If you don't have such a username or don't want me to test, simply
4835 rp='Other username to test security of setuid scripts with?'
4840 case "$d_suidsafe" in
4841 '') echo "I'll assume setuid scripts are *not* secure." >&4
4844 echo "Well, the $hint value is *not* secure." >&4
4846 *) echo "Well, the $hint value *is* secure." >&4
4851 $rm -f reflect flect
4852 echo "#!$ls" >reflect
4853 chmod +x,u+s reflect
4856 echo '"su" will (probably) prompt you for '"$ans's password."
4857 su $ans -c './reflect >flect'
4858 if $contains "/dev/fd" flect >/dev/null; then
4859 echo "Okay, it looks like setuid scripts are secure." >&4
4862 echo "I don't think setuid scripts are secure." >&4
4867 rp='Does your kernel have *secure* setuid scripts?'
4870 [yY]*) val="$define";;
4875 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4876 echo "(That's for file descriptors, not floppy disks.)"
4882 $rm -f reflect flect
4884 : now see if they want to do setuid emulation
4887 case "$d_suidsafe" in
4890 echo "No need to emulate SUID scripts since they are secure here." >& 4
4894 Some systems have disabled setuid scripts, especially systems where
4895 setuid scripts cannot be secure. On systems where setuid scripts have
4896 been disabled, the setuid/setgid bits on scripts are currently
4897 useless. It is possible for $package to detect those bits and emulate
4898 setuid/setgid in a secure fashion. This emulation will only work if
4899 setuid scripts have been disabled in your kernel.
4903 "$define") dflt=y ;;
4906 rp="Do you want to do setuid/setgid emulation?"
4909 [yY]*) val="$define";;
4917 : determine filename position in cpp output
4919 echo "Computing filename position in cpp output for #include directives..." >&4
4920 echo '#include <stdio.h>' > foo.c
4923 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4924 $grep '^[ ]*#.*stdio\.h' | \
4925 while read cline; do
4928 while $test \$# -gt 0; do
4929 if $test -r \`echo \$1 | $tr -d '"'\`; then
4934 pos=\`expr \$pos + 1\`
4946 *) pos="${fieldn}th";;
4948 echo "Your cpp writes the filename in the $pos field of the line."
4950 : locate header file
4955 for usrincdir in $usrinc
4957 if test -f \$usrincdir/\$wanted; then
4958 echo "\$usrincdir/\$wanted"
4962 awkprg='{ print \$$fieldn }'
4963 echo "#include <\$wanted>" > foo\$\$.c
4964 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4965 $grep "^[ ]*#.*\$wanted" | \
4966 while read cline; do
4967 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4969 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4970 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4975 # status = 0: grep returned 0 lines, case statement not executed
4976 # status = 1: headerfile found
4977 # status = 2: while loop executed, no headerfile found
4981 if test \$status -eq 1; then
4988 : define an alternate in-header-list? function
4989 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4990 cont=true; xxf="echo \"<\$1> found.\" >&4";
4991 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4992 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4994 case $# in 4) instead=instead;; *) instead="at last";; esac;
4995 while $test "$cont"; do
4997 var=$2; eval "was=\$$2";
4998 if $test "$xxx" && $test -r "$xxx";
5000 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5003 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5004 set $yyy; shift; shift; yyy=$@;
5005 case $# in 0) cont="";;
5006 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5007 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5008 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5009 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5013 do set $yyy; var=$2; eval "was=\$$2";
5014 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5015 set $yyy; shift; shift; yyy=$@;
5018 : see if this is a malloc.h system
5019 set malloc.h i_malloc
5022 : see if stdlib is available
5023 set stdlib.h i_stdlib
5026 : determine which malloc to compile in
5028 case "$usemymalloc" in
5029 ''|[yY]*|true|$define) dflt='y' ;;
5032 rp="Do you wish to attempt to use the malloc that comes with $package?"
5038 mallocsrc='malloc.c'
5039 mallocobj="malloc$_o"
5040 d_mymalloc="$define"
5043 : Remove malloc from list of libraries to use
5044 echo "Removing unneeded -lmalloc from library list" >&4
5045 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5048 echo "libs = $libs" >&4
5060 : compute the return types of malloc and free
5062 $cat >malloc.c <<END
5066 #include <sys/types.h>
5080 case "$malloctype" in
5082 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5089 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5093 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5100 echo "Your system uses $freetype free(), it would seem." >&4
5104 The installation process will also create a directory for
5105 vendor-supplied add-ons. Vendors who supply perl with their system
5106 may find it convenient to place all vendor-supplied files in this
5107 directory rather than in the main distribution directory. This will
5108 ease upgrades between binary-compatible maintenance versions of perl.
5110 Of course you may also use these directories in whatever way you see
5111 fit. For example, you might use them to access modules shared over a
5112 company-wide network.
5114 The default answer should be fine for most people.
5115 This causes further questions about vendor add-ons to be skipped
5116 and no vendor-specific directories will be configured for perl.
5119 rp='Do you want to configure vendor-specific add-on directories?'
5120 case "$usevendorprefix" in
5121 define|true|[yY]*) dflt=y ;;
5127 rp='Installation prefix to use for vendor-supplied add-ons?'
5128 case "$vendorprefix" in
5130 *) dflt=$vendorprefix ;;
5134 case "$vendorprefix" in
5138 *) oldvendorprefix="$prefix";;
5142 usevendorprefix="$define"
5144 vendorprefixexp="$ansexp"
5146 *) usevendorprefix="$undef"
5152 case "$vendorprefix" in
5153 '') d_vendorlib="$undef"
5157 *) d_vendorlib="$define"
5158 : determine where vendor-supplied modules go.
5159 : Usual default is /usr/local/lib/perl5/vendor_perl
5160 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5161 case "$installstyle" in
5162 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
5163 *) dflt=$vendorprefix/lib/vendor_$prog ;;
5166 rp='Pathname for the vendor-supplied library files?'
5169 vendorlibexp="$ansexp"
5170 : Change installation prefix, if necessary.
5171 if $test X"$prefix" != X"$installprefix"; then
5172 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5174 installvendorlib="$vendorlibexp"
5179 : Cruising for prototypes
5181 echo "Checking out function prototypes..." >&4
5182 $cat >prototype.c <<'EOCP'
5183 int main(int argc, char *argv[]) {
5186 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5187 echo "Your C compiler appears to support function prototypes."
5190 echo "Your C compiler doesn't seem to understand function prototypes."
5197 case "$prototype" in
5199 *) ansi2knr='ansi2knr'
5204 This version of $package can only be compiled by a compiler that
5205 understands function prototypes. Unfortunately, your C compiler
5207 doesn't seem to understand them. Sorry about that.
5209 If GNU cc is available for your system, perhaps you could try that instead.
5211 Eventually, we hope to support building Perl with pre-ANSI compilers.
5212 If you would like to help in that effort, please contact <perlbug@perl.org>.
5214 Aborting Configure now.
5220 : determine where public executables go
5225 rp='Pathname where the public executables will reside?'
5227 if $test "X$ansexp" != "X$binexp"; then
5232 : Change installation prefix, if necessary.
5233 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5234 if $test X"$prefix" != X"$installprefix"; then
5235 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5237 installbin="$binexp"
5240 : determine whether to install perl also as /usr/bin/perl
5243 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5245 Many scripts expect to perl to be installed as /usr/bin/perl.
5246 I can install the perl you are about to compile also as /usr/bin/perl
5247 (in addition to $installbin/perl).
5249 case "$installusrbinperl" in
5250 "$undef"|[nN]*) dflt='n';;
5253 rp="Do you want to install perl as /usr/bin/perl?"
5256 [yY]*) val="$define";;
5262 set installusrbinperl
5266 echo "Checking for GNU C Library..." >&4
5267 cat >gnulibc.c <<EOM
5279 if eval $compile_ok && ./gnulibc; then
5281 echo "You are using the GNU C Library"
5284 echo "You are not using the GNU C Library"
5290 : see if nm is to be used to determine whether a symbol is defined or not
5294 case "$d_gnulibc" in
5297 echo "nm probably won't work on the GNU C Library." >&4
5303 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5305 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5306 echo "'nm' won't be sufficient on this sytem." >&4
5312 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5313 if $test $dflt -gt 20; then
5323 true|$define) dflt=y;;
5330 I can use $nm to extract the symbols from your C libraries. This
5331 is a time consuming task which may generate huge output on the disk (up
5332 to 3 megabytes) but that should make the symbols extraction faster. The
5333 alternative is to skip the 'nm' extraction part and to compile a small
5334 test program instead to determine whether each symbol is present. If
5335 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5336 this may be the best solution.
5338 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5341 rp="Shall I use $nm to extract C symbols from the libraries?"
5344 [Nn]*) usenm=false;;
5353 : nm options which may be necessary
5355 '') if $test -f /mach_boot; then
5357 elif $test -d /usr/ccs/lib; then
5358 nm_opt='-p' # Solaris (and SunOS?)
5359 elif $test -f /dgux; then
5361 elif $test -f /lib64/rld; then
5362 nm_opt='-p' # 64-bit Irix
5368 : nm options which may be necessary for shared libraries but illegal
5369 : for archive libraries. Thank you, Linux.
5370 case "$nm_so_opt" in
5371 '') case "$myuname" in
5373 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5374 nm_so_opt='--dynamic'
5383 : get list of predefined functions in a handy place
5388 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5395 *) for thislib in $libs; do
5398 : Handle C library specially below.
5401 thislib=`echo $thislib | $sed -e 's/^-l//'`
5402 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5404 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5406 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5408 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5410 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5412 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5414 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5419 libnames="$libnames $try"
5421 *) libnames="$libnames $thislib" ;;
5430 for xxx in $libpth; do
5431 $test -r $1 || set $xxx/libc.$so
5432 : The messy sed command sorts on library version numbers.
5434 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5435 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5437 s/[0-9][0-9]*/0000&/g
5438 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5441 sort | $sed -e 's/^.* //'`
5444 $test -r $1 || set /usr/ccs/lib/libc.$so
5445 $test -r $1 || set /lib/libsys_s$_a
5451 if $test -r "$1"; then
5452 echo "Your (shared) C library seems to be in $1."
5454 elif $test -r /lib/libc && $test -r /lib/clib; then
5455 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5457 libc='/lib/clib /lib/libc'
5458 if $test -r /lib/syslib; then
5459 echo "(Your math library is in /lib/syslib.)"
5460 libc="$libc /lib/syslib"
5462 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5463 echo "Your C library seems to be in $libc, as you said before."
5464 elif $test -r $incpath/usr/lib/libc$_a; then
5465 libc=$incpath/usr/lib/libc$_a;
5466 echo "Your C library seems to be in $libc. That's fine."
5467 elif $test -r /lib/libc$_a; then
5469 echo "Your C library seems to be in $libc. You're normal."
5471 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5473 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5474 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5475 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5477 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5479 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5482 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5484 if $test -r "$tans"; then
5485 echo "Your C library seems to be in $tans, of all places."
5491 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5495 If the guess above is wrong (which it might be if you're using a strange
5496 compiler, or your machine supports multiple models), you can override it here.
5501 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5503 I can't seem to find your C library. I've looked in the following places:
5506 $sed 's/^/ /' libpath
5509 None of these seems to contain your C library. I need to get its name...
5514 rp='Where is your C library?'
5519 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5520 set X `cat libnames`
5523 case $# in 1) xxx=file; esac
5524 echo "Extracting names from the following $xxx for later perusal:" >&4
5526 $sed 's/^/ /' libnames >&4
5528 $echo $n "This may take a while...$c" >&4
5532 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5533 *) $nm $nm_opt $file 2>/dev/null;;
5538 $grep fprintf libc.tmp > libc.ptf
5539 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5540 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5542 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5544 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5546 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5548 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5550 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5552 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5554 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5556 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5558 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5560 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5562 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5564 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5566 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5567 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5569 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5571 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5573 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5575 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5577 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5579 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5583 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5587 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5591 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5595 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5600 $nm -p $* 2>/dev/null >libc.tmp
5601 $grep fprintf libc.tmp > libc.ptf
5602 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5603 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5609 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5611 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5612 for thisname in $libnames $libc; do
5613 $ar t $thisname >>libc.tmp
5615 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5617 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5618 # Repeat libc to extract forwarders to DLL entries too
5619 for thisname in $libnames $libc; do
5620 $ar tv $thisname >>libc.tmp
5621 # Revision 50 of EMX has bug in $ar.
5622 # it will not extract forwarders to DLL entries
5623 # Use emximp which will extract exactly them.
5624 emximp -o tmp.imp $thisname \
5626 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5627 < tmp.imp >>libc.tmp
5630 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5633 echo "$ar didn't seem to work right." >&4
5634 echo "Maybe this is a Cray...trying bld instead..." >&4
5635 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5637 for thisname in $libnames; do
5639 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5640 $ar t $thisname >>libc.tmp
5644 echo "That didn't work either. Giving up." >&4
5651 if $test -f /lib/syscalls.exp; then
5653 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5654 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5658 $rm -f libnames libpath
5660 : see if dld is available
5664 : is a C symbol defined?
5667 -v) tf=libc.tmp; tc=""; tdc="";;
5668 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5669 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5672 case "$reuseval-$4" in
5674 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5680 if $contains $tlook $tf >/dev/null 2>&1;
5685 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5686 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5694 $define) tval=true;;
5700 : define an is-in-libc? function
5701 inlibc='echo " "; td=$define; tu=$undef;
5702 sym=$1; var=$2; eval "was=\$$2";
5704 case "$reuseval$was" in
5714 echo "$sym() found." >&4;
5715 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5717 echo "$sym() NOT found." >&4;
5718 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5722 $define) echo "$sym() found." >&4;;
5723 *) echo "$sym() NOT found." >&4;;
5727 : see if dlopen exists
5734 : determine which dynamic loading, if any, to compile in
5736 dldir="ext/DynaLoader"
5749 $define) dflt='y' ;;
5752 $define) dflt='y' ;;
5754 : Does a dl_xxx.xs file exist for this operating system
5755 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5758 rp="Do you wish to use dynamic loading?"
5765 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5766 dflt="$dldir/dl_${osname}.xs"
5767 elif $test "$d_dlopen" = "$define" ; then
5768 dflt="$dldir/dl_dlopen.xs"
5769 elif $test "$i_dld" = "$define" ; then
5770 dflt="$dldir/dl_dld.xs"
5775 *) dflt="$dldir/$dlsrc"
5778 echo "The following dynamic loading files are available:"
5779 : Can not go over to $dldir because getfile has path hard-coded in.
5780 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5781 rp="Source file to use for dynamic loading"
5787 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5791 Some systems may require passing special flags to $cc -c to
5792 compile modules that will be used to create a shared library.
5793 To use no flags, say "none".
5796 case "$cccdlflags" in
5797 '') case "$gccversion" in
5798 '') case "$osname" in
5800 next) dflt='none' ;;
5801 irix*) dflt='-KPIC' ;;
5802 svr4*|esix*|solaris) dflt='-KPIC' ;;
5803 sunos) dflt='-pic' ;;
5807 *) case "$osname" in
5808 svr4*|esix*|solaris) dflt='-fPIC' ;;
5813 *) dflt="$cccdlflags" ;;
5815 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5818 none) cccdlflags=' ' ;;
5819 *) cccdlflags="$ans" ;;
5824 Some systems use ld to create libraries that can be dynamically loaded,
5825 while other systems (such as those using ELF) use $cc.
5829 '') $cat >try.c <<'EOM'
5830 /* Test for whether ELF binaries are produced */
5835 int i = open("a.out",O_RDONLY);
5838 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5839 exit(0); /* succeed (yes, it's ELF) */
5844 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5846 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5850 echo "I'll use ld to build dynamic libraries."
5859 rp="What command should be used to create dynamic libraries?"
5865 Some systems may require passing special flags to $ld to create a
5866 library that can be dynamically loaded. If your ld flags include
5867 -L/other/path options to locate libraries outside your loader's normal
5868 search path, you may need to specify those -L options here as well. To
5869 use no flags, say "none".
5872 case "$lddlflags" in
5873 '') case "$osname" in
5874 beos) dflt='-nostart' ;;
5876 linux|irix*) dflt='-shared' ;;
5877 next) dflt='none' ;;
5878 solaris) dflt='-G' ;;
5879 sunos) dflt='-assert nodefinitions' ;;
5880 svr4*|esix*) dflt="-G $ldflags" ;;
5884 *) dflt="$lddlflags" ;;
5887 : Try to guess additional flags to pick up local libraries.
5888 : Be careful not to append to a plain 'none'
5892 for thisflag in $ldflags; do
5897 *) dflt="$dflt $thisflag" ;;
5904 ''|' ') dflt='none' ;;
5907 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5910 none) lddlflags=' ' ;;
5911 *) lddlflags="$ans" ;;
5916 Some systems may require passing special flags to $cc to indicate that
5917 the resulting executable will use dynamic linking. To use no flags,
5921 case "$ccdlflags" in
5922 '') case "$osname" in
5923 hpux) dflt='-Wl,-E' ;;
5924 linux) dflt='-rdynamic' ;;
5925 next) dflt='none' ;;
5926 sunos) dflt='none' ;;
5930 *) dflt="$ccdlflags" ;;
5932 rp="Any special flags to pass to $cc to use dynamic loading?"
5935 none) ccdlflags=' ' ;;
5936 *) ccdlflags="$ans" ;;
5950 # No dynamic loading being used, so don't bother even to prompt.
5953 *) case "$useshrplib" in
5954 '') case "$osname" in
5955 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
5957 also='Building a shared libperl is required for dynamic loading to work on your system.'
5962 also='Building a shared libperl is needed for MAB support.'
5980 The perl executable is normally obtained by linking perlmain.c with
5981 libperl${_a}, any static extensions (usually just DynaLoader), and
5982 any other libraries needed on this system (such as -lm, etc.). Since
5983 your system supports dynamic loading, it is probably possible to build
5984 a shared libperl.$so. If you will have more than one executable linked
5985 to libperl.$so, this will significantly reduce the size of each
5986 executable, but it may have a noticeable affect on performance. The
5987 default is probably sensible for your system.
5991 rp="Build a shared libperl.$so (y/n)"
5995 useshrplib='true' ;;
5996 *) useshrplib='false' ;;
6001 case "$useshrplib" in
6005 # Figure out a good name for libperl.so. Since it gets stored in
6006 # a version-specific architecture-dependent library, the version
6007 # number isn't really that important, except for making cc/ld happy.
6009 # A name such as libperl.so.3.1
6010 majmin="libperl.$so.$patchlevel.$subversion"
6011 # A name such as libperl.so.301
6012 majonly=`echo $patchlevel $subversion |
6013 $awk '{printf "%d%02d", $1, $2}'`
6014 majonly=libperl.$so.$majonly
6015 # I'd prefer to keep the os-specific stuff here to a minimum, and
6016 # rely on figuring it out from the naming of libc.
6017 case "${osname}${osvers}" in
6020 # XXX How handle the --version stuff for MAB?
6022 linux*) # ld won't link with a bare -lperl otherwise.
6025 cygwin*) # include version
6026 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6028 *) # Try to guess based on whether libc has major.minor.
6030 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6031 *libc.$so.[0-9]*) dflt=$majonly ;;
6032 *) dflt=libperl.$so ;;
6042 I need to select a good name for the shared libperl. If your system uses
6043 library names with major and minor numbers, then you might want something
6044 like $majmin. Alternatively, if your system uses a single version
6045 number for shared libraries, then you might want to use $majonly.
6046 Or, your system might be quite happy with a simple libperl.$so.
6048 Since the shared libperl will get installed into a version-specific
6049 architecture-dependent directory, the version number of the shared perl
6050 library probably isn't important, so the default should be o.k.
6053 rp='What name do you want to give to the shared libperl?'
6056 echo "Ok, I'll use $libperl"
6059 libperl="libperl${_a}"
6063 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6067 WARNING: Use of the shrpdir variable for the installation location of
6068 the shared $libperl is not supported. It was never documented and
6069 will not work in this version. Let me (perlbug@perl.com)
6070 know of any problems this may cause.
6076 But your current setting of $shrpdir is
6077 the default anyway, so it's harmless.
6082 Further, your current attempted setting of $shrpdir
6083 conflicts with the value of $archlibexp/CORE
6084 that installperl will use.
6091 # How will the perl executable find the installed shared $libperl?
6092 # Add $xxx to ccdlflags.
6093 # If we can't figure out a command-line option, use $shrpenv to
6094 # set env LD_RUN_PATH. The main perl makefile uses this.
6095 shrpdir=$archlibexp/CORE
6098 if "$useshrplib"; then
6101 # We'll set it in Makefile.SH...
6107 xxx="-Wl,-R$shrpdir"
6109 linux|irix*|dec_osf)
6110 xxx="-Wl,-rpath,$shrpdir"
6113 # next doesn't like the default...
6116 # beos doesn't like the default, either.
6119 # hpux doesn't like the default, either.
6120 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6123 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6129 # Only add $xxx if it isn't already in ccdlflags.
6130 case " $ccdlflags " in
6132 *) ccdlflags="$ccdlflags $xxx"
6135 Adding $xxx to the flags
6136 passed to $ld so that the perl executable will find the
6137 installed shared $libperl.
6145 # Fix ccdlflags in AIX for building external extensions.
6146 # (For building Perl itself bare -bE:perl.exp is needed,
6147 # Makefile.SH takes care of this.)
6149 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6151 # Respect a hint or command-line value.
6153 '') shrpenv="$tmp_shrpenv" ;;
6155 case "$ldlibpthname" in
6156 '') ldlibpthname=LD_LIBRARY_PATH ;;
6157 none) ldlibpthname='' ;;
6160 : determine where manual pages go
6161 set man1dir man1dir none
6165 $spackage has manual pages available in source form.
6169 echo "However, you don't have nroff, so they're probably useless to you."
6171 '') man1dir="none";;
6174 echo "If you don't want the manual sources installed, answer 'none'."
6179 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6180 lookpath="$lookpath $prefixexp/man/p_man/man1"
6181 lookpath="$lookpath $prefixexp/man/u_man/man1"
6182 lookpath="$lookpath $prefixexp/man/man.1"
6184 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6185 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6195 rp="Where do the main $spackage manual pages (source) go?"
6197 if $test "X$man1direxp" != "X$ansexp"; then
6201 man1direxp="$ansexp"
6207 : Change installation prefix, if necessary.
6208 if $test X"$prefix" != X"$installprefix"; then
6209 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6211 installman1dir="$man1direxp"
6214 : What suffix to use on installed man pages
6221 rp="What suffix should be used for the main $spackage man pages?"
6223 '') case "$man1dir" in
6237 *) dflt="$man1ext";;
6244 : see if we can have long filenames
6246 rmlist="$rmlist /tmp/cf$$"
6247 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6248 first=123456789abcdef
6249 second=/tmp/cf$$/$first
6250 $rm -f $first $second
6251 if (echo hi >$first) 2>/dev/null; then
6252 if $test -f 123456789abcde; then
6253 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6256 if (echo hi >$second) 2>/dev/null; then
6257 if $test -f /tmp/cf$$/123456789abcde; then
6259 That's peculiar... You can have filenames longer than 14 characters, but only
6260 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6261 I shall consider your system cannot support long filenames at all.
6265 echo 'You can have filenames longer than 14 characters.' >&4
6270 How confusing! Some of your filesystems are sane enough to allow filenames
6271 longer than 14 characters but some others like /tmp can't even think about them.
6272 So, for now on, I shall assume your kernel does not allow them at all.
6279 You can't have filenames longer than 14 chars. You can't even think about them!
6285 $rm -rf /tmp/cf$$ 123456789abcde*
6287 : determine where library module manual pages go
6288 set man3dir man3dir none
6292 $spackage has manual pages for many of the library modules.
6298 However, you don't have nroff, so they're probably useless to you.
6301 '') man3dir="none";;
6305 case "$d_flexfnam" in
6308 However, your system can't handle the long file names like File::Basename.3.
6311 '') man3dir="none";;
6315 echo "If you don't want the manual sources installed, answer 'none'."
6316 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6318 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6319 if $test -d "$privlib/man/man3"; then
6322 WARNING: Previous versions of perl installed man3 pages into
6323 $privlib/man/man3. This version will suggest a
6324 new default of $dflt.
6328 rp='Do you wish to preserve the old behavior?(y/n)'
6331 y*) dflt="$privlib/man/man3" ;;
6337 *) dflt="$man3dir" ;;
6341 rp="Where do the $package library man pages (source) go?"
6344 man3direxp="$ansexp"
6350 : Change installation prefix, if necessary.
6351 if $test X"$prefix" != X"$installprefix"; then
6352 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6354 installman3dir="$man3direxp"
6357 : What suffix to use on installed man pages
6363 rp="What suffix should be used for the $package library man pages?"
6365 '') case "$man3dir" in
6379 *) dflt="$man3ext";;
6386 : see if we have to deal with yellow pages, now NIS.
6387 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6388 if $test -f /usr/etc/nibindd; then
6390 echo "I'm fairly confident you're on a NeXT."
6392 rp='Do you get the hosts file via NetInfo?'
6401 y*) hostcat='nidump hosts .';;
6402 *) case "$hostcat" in
6403 nidump*) hostcat='';;
6413 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6421 rp='Are you getting the hosts file via yellow pages?'
6424 y*) hostcat='ypcat hosts';;
6425 *) hostcat='cat /etc/hosts';;
6431 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6434 '') test -f /etc/group && groupcat='cat /etc/group';;
6437 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6440 : now get the host name
6442 echo "Figuring out host name..." >&4
6443 case "$myhostname" in
6445 echo 'Maybe "hostname" will work...'
6446 if tans=`sh -c hostname 2>&1` ; then
6454 if $test "$cont"; then
6456 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6457 if tans=`cat /etc/systemid 2>&1` ; then
6459 phostname='cat /etc/systemid'
6460 echo "Whadyaknow. Xenix always was a bit strange..."
6463 elif $test -r /etc/systemid; then
6464 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6467 if $test "$cont"; then
6468 echo 'No, maybe "uuname -l" will work...'
6469 if tans=`sh -c 'uuname -l' 2>&1` ; then
6471 phostname='uuname -l'
6473 echo 'Strange. Maybe "uname -n" will work...'
6474 if tans=`sh -c 'uname -n' 2>&1` ; then
6476 phostname='uname -n'
6478 echo 'Oh well, maybe I can mine it out of whoami.h...'
6479 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6480 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6481 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6483 case "$myhostname" in
6484 '') echo "Does this machine have an identity crisis or something?"
6487 echo "Well, you said $myhostname before..."
6488 phostname='echo $myhostname';;
6494 : you do not want to know about this
6499 if $test "$myhostname" ; then
6501 rp='Your host name appears to be "'$myhostname'".'" Right?"
6509 : bad guess or no guess
6510 while $test "X$myhostname" = X ; do
6512 rp="Please type the (one word) name of your host:"
6517 : translate upper to lower if necessary
6518 case "$myhostname" in
6520 echo "(Normalizing case in your host name)"
6521 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6525 case "$myhostname" in
6527 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6528 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6529 echo "(Trimming domain name from host name--host name is now $myhostname)"
6531 *) case "$mydomain" in
6534 test "X$hostcat" = "Xypcat hosts" &&
6535 ypmatch "$myhostname" hosts 2>/dev/null |\
6536 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6539 test "X$hostcat" != "X" &&
6540 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6541 /[ ]$myhostname[ . ]/p" > hosts
6544 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6545 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6546 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6547 hosts | $sort | $uniq | \
6548 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6549 case `$echo X$dflt` in
6550 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6553 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6558 tans=`./loc resolv.conf X /etc /usr/etc`
6559 if $test -f "$tans"; then
6560 echo "(Attempting domain name extraction from $tans)"
6561 dflt=.`$sed -n -e 's/ / /g' \
6562 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6563 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6565 .) dflt=.`$sed -n -e 's/ / /g' \
6566 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6567 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6574 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6575 dflt=.`sh -c domainname 2>/dev/null`
6578 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6583 .) echo "(Lost all hope -- silly guess then)"
6589 *) dflt="$mydomain";;
6593 rp="What is your domain name?"
6603 : translate upper to lower if necessary
6606 echo "(Normalizing case in your domain name)"
6607 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6611 : a little sanity check here
6612 case "$phostname" in
6615 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6616 $myhostname$mydomain|$myhostname) ;;
6618 case "$phostname" in
6620 echo "(That doesn't agree with your whoami.h file, by the way.)"
6623 echo "(That doesn't agree with your $phostname command, by the way.)"
6633 I need to get your e-mail address in Internet format if possible, i.e.
6634 something like user@host.domain. Please answer accurately since I have
6635 no easy means to double check it. The default value provided below
6636 is most probably close to the reality but may not be valid from outside
6637 your organization...
6641 while test "$cont"; do
6643 '') dflt="$cf_by@$myhostname$mydomain";;
6644 *) dflt="$cf_email";;
6646 rp='What is your e-mail address?'
6652 rp='Address does not look like an Internet one. Use it anyway?'
6668 If you or somebody else will be maintaining perl at your site, please
6669 fill in the correct e-mail address here so that they may be contacted
6670 if necessary. Currently, the "perlbug" program included with perl
6671 will send mail to this address in addition to perlbug@perl.com. You may
6672 enter "none" for no administrator.
6675 case "$perladmin" in
6676 '') dflt="$cf_email";;
6677 *) dflt="$perladmin";;
6679 rp='Perl administrator e-mail address'
6683 : figure out how to guarantee perl startup
6684 case "$startperl" in
6686 case "$sharpbang" in
6690 I can use the #! construct to start perl on your system. This will
6691 make startup of perl scripts faster, but may cause problems if you
6692 want to share those scripts and perl is not in a standard place
6693 ($binexp/perl) on all your platforms. The alternative is to force
6694 a shell by starting the script with a single ':' character.
6698 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6701 none) startperl=": # use perl";;
6702 *) startperl="#!$ans"
6703 if $test 30 -lt `echo "$ans" | wc -c`; then
6706 WARNING: Some systems limit the #! command to 32 characters.
6707 If you experience difficulty running Perl scripts with #!, try
6708 installing Perl in a directory with a shorter pathname.
6714 *) startperl=": # use perl"
6719 echo "I'll use $startperl to start perl scripts."
6721 : figure best path for perl in scripts
6724 perlpath="$binexp/perl"
6725 case "$startperl" in
6730 I will use the "eval 'exec'" idiom to start Perl on your system.
6731 I can use the full path of your Perl binary for this purpose, but
6732 doing so may cause problems if you want to share those scripts and
6733 Perl is not always in a standard place ($binexp/perl).
6737 rp="What path shall I use in \"eval 'exec'\"?"
6744 case "$startperl" in
6746 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6749 : determine where public executable scripts go
6750 set scriptdir scriptdir
6752 case "$scriptdir" in
6755 : guess some guesses
6756 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6757 $test -d /usr/share/bin && dflt=/usr/share/bin
6758 $test -d /usr/local/script && dflt=/usr/local/script
6759 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6760 $test -d $prefixexp/script && dflt=$prefixexp/script
6764 *) dflt="$scriptdir"
6769 Some installations have a separate directory just for executable scripts so
6770 that they can mount it across multiple architectures but keep the scripts in
6771 one spot. You might, for example, have a subdirectory of /usr/share for this.
6772 Or you might just lump your scripts in with all your other executables.
6776 rp='Where do you keep publicly executable scripts?'
6778 if $test "X$ansexp" != "X$scriptdirexp"; then
6782 scriptdirexp="$ansexp"
6783 : Change installation prefix, if necessary.
6784 if $test X"$prefix" != X"$installprefix"; then
6785 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6787 installscript="$scriptdirexp"
6792 After $package is installed, you may wish to install various
6793 add-on modules and utilities. Typically, these add-ons will
6794 be installed under $prefix with the rest
6795 of this package. However, you may wish to install such add-ons
6796 elsewhere under a different prefix.
6798 If you do not wish to put everything under a single prefix, that's
6799 ok. You will be prompted for the individual locations; this siteprefix
6800 is only used to suggest the defaults.
6802 The default should be fine for most people.
6806 rp='Installation prefix to use for add-on modules and utilities?'
6807 : XXX Here might be another good place for an installstyle setting.
6808 case "$siteprefix" in
6810 *) dflt=$siteprefix ;;
6814 case "$siteprefix" in
6819 *) oldsiteprefix="$prefix";;
6824 siteprefixexp="$ansexp"
6826 : determine where site specific libraries go.
6827 : Usual default is /usr/local/lib/perl5/site_perl
6828 : The default "style" setting is made in installstyle.U
6829 : XXX No longer works with Prefixit stuff.
6830 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6831 case "$installstyle" in
6832 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog ;;
6833 *) dflt=$siteprefix/lib/site_$prog ;;
6837 The installation process will create a directory for
6838 site-specific extensions and modules. Most users find it convenient
6839 to place all site-specific files in this directory rather than in the
6840 main distribution directory.
6844 rp='Pathname for the site-specific library files?'
6847 sitelibexp="$ansexp"
6848 : Change installation prefix, if necessary.
6849 if $test X"$prefix" != X"$installprefix"; then
6850 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6852 installsitelib="$sitelibexp"
6855 : determine where site specific architecture-dependent libraries go.
6856 : sitelib default is /usr/local/lib/perl5/site_perl/
6857 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6858 : sitelib may have an optional trailing /share.
6859 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6860 tdflt="$tdflt/$apiversion/$archname"
6861 set sitearch sitearch none
6864 '') dflt="$tdflt" ;;
6865 *) dflt="$sitearch" ;;
6869 The installation process will also create a directory for
6870 architecture-dependent site-specific extensions and modules.
6874 rp='Pathname for the site-specific architecture-dependent library files?'
6877 sitearchexp="$ansexp"
6878 : Change installation prefix, if necessary.
6879 if $test X"$prefix" != X"$installprefix"; then
6880 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6882 installsitearch="$sitearchexp"
6885 : determine where add-on public executables go
6887 '') dflt=$siteprefix/bin ;;
6891 rp='Pathname where the add-on public executables should be installed?'
6894 sitebinexp="$ansexp"
6895 : Change installation prefix, if necessary.
6896 if $test X"$prefix" != X"$installprefix"; then
6897 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6899 installsitebin="$sitebinexp"
6904 Perl can be built to take advantage of long doubles which
6905 (if available) may give more accuracy and range for floating point numbers.
6907 If this doesn't make any sense to you, just accept the default 'n'.
6911 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6914 case "$uselongdouble" in
6915 $define|true|[yY]*) dflt='y';;
6918 rp='Try to use long doubles if available?'
6921 y|Y) val="$define" ;;
6927 case "$uselongdouble" in
6928 true|[yY]*) uselongdouble="$define" ;;
6931 case "$uselongdouble" in
6933 : Look for a hint-file generated 'call-back-unit'. If the
6934 : user has specified that long doubles should be used,
6935 : we may need to set or change some other defaults.
6936 if $test -f uselongdouble.cbu; then
6937 echo "Your platform has some specific hints for long doubles, using them..."
6938 . ./uselongdouble.cbu
6941 (Your platform doesn't have any specific hints for long doubles.)
6949 Perl can be built to take advantage of long longs which
6950 (if available) may give more range for integer numbers.
6952 If this doesn't make any sense to you, just accept the default 'n'.
6956 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6959 case "$uselonglong" in
6960 $define|true|[yY]*) dflt='y';;
6963 rp='Try to use long longs if available?'
6966 y|Y) val="$define" ;;
6972 case "$uselonglong" in
6973 true|[yY]*) uselonglong="$define" ;;
6976 case "$uselonglong" in
6978 : Look for a hint-file generated 'call-back-unit'. If the
6979 : user has specified that long longs should be used,
6980 : we may need to set or change some other defaults.
6981 if $test -f uselonglong.cbu; then
6982 echo "Your platform has some specific hints for long longs, using them..."
6986 (Your platform doesn't have any specific hints for long longs.)
6994 Previous version of $package used the standard IO mechanisms as defined
6995 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6996 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6997 the default. This abstraction layer can use AT&T's sfio (if you already
6998 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6999 problems with some extension modules. Using PerlIO with stdio is safe,
7000 but it is slower than plain stdio and therefore is not the default.
7002 If this doesn't make any sense to you, just accept the default 'n'.
7004 case "$useperlio" in
7005 $define|true|[yY]*) dflt='y';;
7008 rp='Use the experimental PerlIO abstraction layer?'
7015 echo "Ok, doing things the stdio way"
7022 case "$vendorprefix" in
7023 '') d_vendorbin="$undef"
7027 *) d_vendorbin="$define"
7028 : determine where vendor-supplied executables go.
7029 dflt=$vendorprefix/bin
7031 rp='Pathname for the vendor-supplied executables directory?'
7034 vendorbinexp="$ansexp"
7035 : Change installation prefix, if necessary.
7036 if $test X"$prefix" != X"$installprefix"; then
7037 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7039 installvendorbin="$vendorbinexp"
7044 : Check how to convert floats to strings.
7045 if test "X$d_Gconvert" = X; then
7047 echo "Checking for an efficient way to convert floats to strings."
7050 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7051 char *myname = "gconvert";
7054 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7055 char *myname = "gcvt";
7058 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7059 char *myname = "sprintf";
7065 checkit(expect, got)
7069 if (strcmp(expect, got)) {
7070 printf("%s oddity: Expected %s, got %s\n",
7071 myname, expect, got);
7081 /* This must be 1st test on (which?) platform */
7082 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7083 Gconvert(0.1, 8, 0, buf);
7084 checkit("0.1", buf);
7086 Gconvert(1.0, 8, 0, buf);
7089 Gconvert(0.0, 8, 0, buf);
7092 Gconvert(-1.0, 8, 0, buf);
7095 /* Some Linux gcvt's give 1.e+5 here. */
7096 Gconvert(100000.0, 8, 0, buf);
7097 checkit("100000", buf);
7099 /* Some Linux gcvt's give -1.e+5 here. */
7100 Gconvert(-100000.0, 8, 0, buf);
7101 checkit("-100000", buf);
7106 case "$d_Gconvert" in
7107 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7108 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7109 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7110 *) xxx_list='gconvert gcvt sprintf' ;;
7113 for xxx_convert in $xxx_list; do
7114 echo "Trying $xxx_convert"
7116 set try -DTRY_$xxx_convert
7117 if eval $compile; then
7118 echo "$xxx_convert" found. >&4
7120 echo "I'll use $xxx_convert to convert floats into a string." >&4
7123 echo "...But $xxx_convert didn't work as I expected."
7126 echo "$xxx_convert NOT found." >&4
7130 case "$xxx_convert" in
7131 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7132 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7133 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7137 : check for length of double
7139 case "$doublesize" in
7141 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7142 $cat >try.c <<'EOCP'
7146 printf("%d\n", (int)sizeof(double));
7151 if eval $compile_ok; then
7153 $echo " $doublesize bytes." >&4
7156 echo "(I can't seem to compile the test program. Guessing...)"
7157 rp="What is the size of a double precision number (in bytes)?"
7165 : check for long doubles
7167 $echo $n "Checking to see if your system supports long double..." $c >&4
7168 echo 'int main() { long double x = 7.0; }' > try.c
7170 if eval $compile; then
7172 echo " Yes, it does." >&4
7175 echo " No, it doesn't." >&4
7181 : check for length of long double
7182 case "${d_longdbl}${longdblsize}" in
7185 $echo $n "Checking to see how big your long doubles are..." $c >&4
7186 $cat >try.c <<'EOCP'
7190 printf("%d\n", sizeof(long double));
7195 if eval $compile; then
7196 longdblsize=`./try$exe_ext`
7197 $echo " $longdblsize bytes." >&4
7201 echo "(I can't seem to compile the test program. Guessing...)" >&4
7202 rp="What is the size of a long double (in bytes)?"
7206 if $test "X$doublesize" = "X$longdblsize"; then
7207 echo "(That isn't any different from an ordinary double.)"
7215 if $test X"$d_longdbl" = X"$define"; then
7217 echo "Checking how to print long doubles..." >&4
7219 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7220 $cat >try.c <<'EOCP'
7221 #include <sys/types.h>
7225 printf("%.3f\n", d);
7229 if eval $compile; then
7233 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7234 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7235 echo "We will use %f."
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("%.3llf\n", d);
7251 if eval $compile; then
7255 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7256 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7257 echo "We will use %llf."
7263 if $test X"$sPRIfldbl" = X; then
7264 $cat >try.c <<'EOCP'
7265 #include <sys/types.h>
7268 long double d = 123.456;
7269 printf("%.3Lf\n", d);
7273 if eval $compile; then
7277 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7278 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7279 echo "We will use %Lf."
7285 if $test X"$sPRIfldbl" = X; then
7286 $cat >try.c <<'EOCP'
7287 #include <sys/types.h>
7290 long double d = 123.456;
7291 printf("%.3lf\n", d);
7295 if eval $compile; then
7299 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7300 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7301 echo "We will use %lf."
7307 if $test X"$sPRIfldbl" = X; then
7308 echo "Cannot figure out how to print long doubles." >&4
7315 case "$sPRIfldbl" in
7316 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7317 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7319 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7320 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7324 : Initialize h_fcntl
7327 : Initialize h_sysfile
7330 : access call always available on UNIX
7334 : locate the flags for 'access()'
7338 $cat >access.c <<'EOCP'
7339 #include <sys/types.h>
7344 #include <sys/file.h>
7353 : check sys/file.h first, no particular reason here
7354 if $test `./findhdr sys/file.h` && \
7355 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7357 echo "<sys/file.h> defines the *_OK access constants." >&4
7358 elif $test `./findhdr fcntl.h` && \
7359 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7361 echo "<fcntl.h> defines the *_OK access constants." >&4
7362 elif $test `./findhdr unistd.h` && \
7363 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7364 echo "<unistd.h> defines the *_OK access constants." >&4
7366 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7372 : see if accessx exists
7373 set accessx d_accessx
7376 : see if alarm exists
7380 : see if atolf exists
7384 : see if atoll exists
7388 : Look for GNU-cc style attribute checking
7390 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7391 $cat >attrib.c <<'EOCP'
7393 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7395 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7396 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7397 echo "Your C compiler doesn't fully support __attribute__."
7400 echo "Your C compiler supports __attribute__."
7404 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7411 : see if bcmp exists
7415 : see if bcopy exists
7419 : see if this is a unistd.h system
7420 set unistd.h i_unistd
7423 : see if getpgrp exists
7424 set getpgrp d_getpgrp
7427 case "$d_getpgrp" in
7430 echo "Checking to see which flavor of getpgrp is in use..."
7433 #include <sys/types.h>
7435 # include <unistd.h>
7439 if (getuid() == 0) {
7440 printf("(I see you are running Configure as super-user...)\n");
7444 if (getpgrp(1) == 0)
7453 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7454 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7456 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7457 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7460 echo "I can't seem to compile and run the test program."
7462 xxx="a USG one, i.e. you use getpgrp()."
7464 # SVR4 systems can appear rather BSD-ish.
7467 xxx="a BSD one, i.e. you use getpgrp(pid)."
7471 xxx="probably a USG one, i.e. you use getpgrp()."
7476 echo "Assuming your getpgrp is $xxx" >&4
7485 : see if setpgrp exists
7486 set setpgrp d_setpgrp
7489 case "$d_setpgrp" in
7492 echo "Checking to see which flavor of setpgrp is in use..."
7495 #include <sys/types.h>
7497 # include <unistd.h>
7501 if (getuid() == 0) {
7502 printf("(I see you are running Configure as super-user...)\n");
7506 if (-1 == setpgrp(1, 1))
7509 if (setpgrp() != -1)
7515 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7516 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7518 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7519 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7522 echo "(I can't seem to compile and run the test program.)"
7524 xxx="a USG one, i.e. you use setpgrp()."
7526 # SVR4 systems can appear rather BSD-ish.
7529 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7533 xxx="probably a USG one, i.e. you use setpgrp()."
7538 echo "Assuming your setpgrp is $xxx" >&4
7546 : see if bzero exists
7550 : see if signal is declared as pointer to function returning int or void
7552 xxx=`./findhdr signal.h`
7553 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7554 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7555 echo "You have int (*signal())() instead of void." >&4
7557 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7558 echo "You have void (*signal())()." >&4
7560 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7561 echo "You have int (*signal())() instead of void." >&4
7563 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7564 echo "You have void (*signal())()." >&4
7567 case "$d_voidsig" in
7569 echo "I can't determine whether signal handler returns void or int..." >&4
7571 rp="What type does your signal handler return?"
7578 echo "As you already told me, signal handler returns void." >&4
7581 *) echo "As you already told me, signal handler returns int." >&4
7588 case "$d_voidsig" in
7589 "$define") signal_t="void";;
7594 : check for ability to cast large floats to 32-bit ints.
7596 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7597 if $test "$intsize" -ge 4; then
7604 #include <sys/types.h>
7606 $signal_t blech(s) int s; { exit(3); }
7613 signal(SIGFPE, blech);
7615 /* Don't let compiler optimize the test away. Store the number
7616 in a writable string for gcc to pass to sscanf under HP/UX.
7618 sprintf(str, "2147483647");
7619 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7623 /* x86 processors will probably give 0x8000 0000, which is a
7624 sign change. We don't want that. We want to mimic SPARC
7625 behavior here, which is to preserve the sign and give
7628 if (i32 != ($xxx) f)
7634 if eval $compile_ok; then
7638 echo "(I can't seem to compile the test program--assuming it can't)"
7646 echo "Nope, it can't."
7653 : check for ability to cast negative floats to unsigned
7655 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7658 #include <sys/types.h>
7660 $signal_t blech(s) int s; { exit(7); }
7661 $signal_t blech_in_list(s) int s; { exit(4); }
7662 unsigned long dummy_long(p) unsigned long p; { return p; }
7663 unsigned int dummy_int(p) unsigned int p; { return p; }
7664 unsigned short dummy_short(p) unsigned short p; { return p; }
7668 unsigned long along;
7670 unsigned short ashort;
7674 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7675 a direct f = -123. assignment. gcc-2.8.0 reportedly
7676 optimized the whole file away
7678 /* Store the number in a writable string for gcc to pass to
7681 sprintf(str, "-123");
7682 sscanf(str, "%lf", &f); /* f = -123.; */
7684 signal(SIGFPE, blech);
7685 along = (unsigned long)f;
7686 aint = (unsigned int)f;
7687 ashort = (unsigned short)f;
7688 if (along != (unsigned long)-123)
7690 if (aint != (unsigned int)-123)
7692 if (ashort != (unsigned short)-123)
7694 sprintf(str, "1073741824.");
7695 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7698 along = (unsigned long)f;
7699 if (along != 0x80000000)
7703 along = (unsigned long)f;
7704 if (along != 0x7fffffff)
7708 along = (unsigned long)f;
7709 if (along != 0x80000001)
7713 signal(SIGFPE, blech_in_list);
7714 sprintf(str, "123.");
7715 sscanf(str, "%lf", &f); /* f = 123.; */
7716 along = dummy_long((unsigned long)f);
7717 aint = dummy_int((unsigned int)f);
7718 ashort = dummy_short((unsigned short)f);
7719 if (along != (unsigned long)123)
7721 if (aint != (unsigned int)123)
7723 if (ashort != (unsigned short)123)
7730 if eval $compile_ok; then
7734 echo "(I can't seem to compile the test program--assuming it can't)"
7737 case "$castflags" in
7742 echo "Nope, it can't."
7749 : see if vprintf exists
7751 if set vprintf val -f d_vprintf; eval $csym; $val; then
7752 echo 'vprintf() found.' >&4
7754 $cat >vprintf.c <<'EOF'
7755 #include <varargs.h>
7757 int main() { xxx("foo"); }
7766 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7770 if eval $compile && ./vprintf; then
7771 echo "Your vsprintf() returns (int)." >&4
7774 echo "Your vsprintf() returns (char*)." >&4
7778 echo 'vprintf() NOT found.' >&4
7788 : see if chown exists
7792 : see if chroot exists
7796 : see if chsize exists
7800 : check for const keyword
7802 echo 'Checking to see if your C compiler knows about "const"...' >&4
7803 $cat >const.c <<'EOCP'
7804 typedef struct spug { int drokk; } spug;
7811 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7813 echo "Yup, it does."
7816 echo "Nope, it doesn't."
7821 : see if crypt exists
7823 if set crypt val -f d_crypt; eval $csym; $val; then
7824 echo 'crypt() found.' >&4
7828 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7829 if $test -z "$cryptlib"; then
7830 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7834 if $test -z "$cryptlib"; then
7835 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7839 if $test -z "$cryptlib"; then
7840 cryptlib=`./loc libcrypt$_a "" $libpth`
7844 if $test -z "$cryptlib"; then
7845 echo 'crypt() NOT found.' >&4
7854 : get csh whereabouts
7856 'csh') val="$undef" ;;
7861 : Respect a hint or command line value for full_csh.
7863 '') full_csh=$csh ;;
7866 : see if cuserid exists
7867 set cuserid d_cuserid
7870 : see if this is a limits.h system
7871 set limits.h i_limits
7874 : see if this is a float.h system
7878 : See if number of significant digits in a double precision number is known
7880 $cat >dbl_dig.c <<EOM
7890 printf("Contains DBL_DIG");
7893 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7894 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7895 echo "DBL_DIG found." >&4
7898 echo "DBL_DIG NOT found." >&4
7905 : see if difftime exists
7906 set difftime d_difftime
7909 : see if this is a dirent system
7911 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7913 echo "<dirent.h> found." >&4
7916 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7917 echo "<sys/dir.h> found." >&4
7920 xinc=`./findhdr sys/ndir.h`
7922 echo "<dirent.h> NOT found." >&4
7927 : Look for type of directory structure.
7929 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7931 case "$direntrytype" in
7934 $define) guess1='struct dirent' ;;
7935 *) guess1='struct direct' ;;
7938 *) guess1="$direntrytype"
7943 'struct dirent') guess2='struct direct' ;;
7944 *) guess2='struct dirent' ;;
7947 if $contains "$guess1" try.c >/dev/null 2>&1; then
7948 direntrytype="$guess1"
7949 echo "Your directory entries are $direntrytype." >&4
7950 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7951 direntrytype="$guess2"
7952 echo "Your directory entries seem to be $direntrytype." >&4
7954 echo "I don't recognize your system's directory entries." >&4
7955 rp="What type is used for directory entries on this system?"
7963 : see if the directory entry stores field length
7965 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7966 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7967 echo "Good, your directory entry keeps length information in d_namlen." >&4
7970 echo "Your directory entry does not know about the d_namlen field." >&4
7977 : see if dlerror exists
7980 set dlerror d_dlerror
7984 : see if dlfcn is available
7992 On a few systems, the dynamically loaded modules that perl generates and uses
7993 will need a different extension than shared libs. The default will probably
8001 rp='What is the extension of dynamically loaded modules'
8010 : Check if dlsym need a leading underscore
8016 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8017 $cat >dyna.c <<'EOM'
8026 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8028 #include <sys/types.h>
8042 int mode = RTLD_LAZY ;
8044 handle = dlopen("./dyna.$dlext", mode) ;
8045 if (handle == NULL) {
8050 symbol = dlsym(handle, "fred") ;
8051 if (symbol == NULL) {
8052 /* try putting a leading underscore */
8053 symbol = dlsym(handle, "_fred") ;
8054 if (symbol == NULL) {
8067 : Call the object file tmp-dyna.o in case dlext=o.
8068 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8069 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8070 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8071 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8074 1) echo "Test program failed using dlopen." >&4
8075 echo "Perhaps you should not use dynamic loading." >&4;;
8076 2) echo "Test program failed using dlsym." >&4
8077 echo "Perhaps you should not use dynamic loading." >&4;;
8078 3) echo "dlsym needs a leading underscore" >&4
8080 4) echo "dlsym doesn't need a leading underscore." >&4;;
8083 echo "I can't compile and run the test program." >&4
8084 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8089 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8094 hasproto='varname=$1; func=$2; shift; shift;
8095 while $test $# -ge 2; do
8097 $define) echo "#include <$2>";;
8101 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8102 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8103 echo "$func() prototype found.";
8106 echo "$func() prototype NOT found.";
8111 $rm -f try.c tryout.c'
8113 : see if prototype for drand48 is available
8115 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8118 : see if dup2 exists
8122 : see if eaccess exists
8123 set eaccess d_eaccess
8126 : see if endgrent exists
8127 set endgrent d_endgrent
8130 : see if endhostent exists
8131 set endhostent d_endhent
8134 : see if endnetent exists
8135 set endnetent d_endnent
8138 : see if endprotoent exists
8139 set endprotoent d_endpent
8142 : see if endpwent exists
8143 set endpwent d_endpwent
8146 : see if endservent exists
8147 set endservent d_endsent
8150 : see if endspent exists
8151 set endspent d_endspent
8154 : Locate the flags for 'open()'
8156 $cat >open3.c <<'EOCP'
8157 #include <sys/types.h>
8162 #include <sys/file.h>
8173 : check sys/file.h first to get FREAD on Sun
8174 if $test `./findhdr sys/file.h` && \
8175 set open3 -DI_SYS_FILE && eval $compile; then
8177 echo "<sys/file.h> defines the O_* constants..." >&4
8179 echo "and you have the 3 argument form of open()." >&4
8182 echo "but not the 3 argument form of open(). Oh, well." >&4
8185 elif $test `./findhdr fcntl.h` && \
8186 set open3 -DI_FCNTL && eval $compile; then
8188 echo "<fcntl.h> defines the O_* constants..." >&4
8190 echo "and you have the 3 argument form of open()." >&4
8193 echo "but not the 3 argument form of open(). Oh, well." >&4
8198 echo "I can't find the O_* constant definitions! You got problems." >&4
8204 : see which of string.h or strings.h is needed
8206 strings=`./findhdr string.h`
8207 if $test "$strings" && $test -r "$strings"; then
8208 echo "Using <string.h> instead of <strings.h>." >&4
8212 strings=`./findhdr strings.h`
8213 if $test "$strings" && $test -r "$strings"; then
8214 echo "Using <strings.h> instead of <string.h>." >&4
8216 echo "No string header found -- You'll surely have problems." >&4
8222 "$undef") strings=`./findhdr strings.h`;;
8223 *) strings=`./findhdr string.h`;;
8226 : check for non-blocking I/O stuff
8227 case "$h_sysfile" in
8228 true) echo "#include <sys/file.h>" > head.c;;
8231 true) echo "#include <fcntl.h>" > head.c;;
8232 *) echo "#include <sys/fcntl.h>" > head.c;;
8237 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8238 case "$o_nonblock" in
8241 $cat >>try.c <<'EOCP'
8245 printf("O_NONBLOCK\n");
8249 printf("O_NDELAY\n");
8253 printf("FNDELAY\n");
8260 if eval $compile_ok; then
8262 case "$o_nonblock" in
8263 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8264 *) echo "Seems like we can use $o_nonblock.";;
8267 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8270 *) echo "Using $hint value $o_nonblock.";;
8272 $rm -f try try.* .out core
8275 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8281 #include <sys/types.h>
8284 #define MY_O_NONBLOCK $o_nonblock
8285 #ifndef errno /* XXX need better Configure test */
8295 #include <strings.h>
8297 $signal_t blech(x) int x; { exit(3); }
8299 $cat >> try.c <<'EOCP'
8307 pipe(pd); /* Down: child -> parent */
8308 pipe(pu); /* Up: parent -> child */
8311 close(pd[1]); /* Parent reads from pd[0] */
8312 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8313 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8315 signal(SIGALRM, blech);
8317 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8319 sprintf(string, "%d\n", ret);
8320 write(2, string, strlen(string));
8323 if (errno == EAGAIN) {
8329 if (errno == EWOULDBLOCK)
8330 printf("EWOULDBLOCK\n");
8333 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8334 sleep(2); /* Give it time to close our pipe */
8336 ret = read(pd[0], buf, 1); /* Should read EOF */
8338 sprintf(string, "%d\n", ret);
8339 write(3, string, strlen(string));
8343 close(pd[0]); /* We write to pd[1] */
8344 close(pu[1]); /* We read from pu[0] */
8345 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8346 close(pd[1]); /* Pipe pd is now fully closed! */
8347 exit(0); /* Bye bye, thank you for playing! */
8351 if eval $compile_ok; then
8352 echo "$startsh" >mtry
8353 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8355 ./mtry >/dev/null 2>&1
8357 0) eagain=`$cat try.out`;;
8358 1) echo "Could not perform non-blocking setting!";;
8359 2) echo "I did a successful read() for something that was not there!";;
8360 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8361 *) echo "Something terribly wrong happened during testing.";;
8363 rd_nodata=`$cat try.ret`
8364 echo "A read() system call with no data present returns $rd_nodata."
8365 case "$rd_nodata" in
8368 echo "(That's peculiar, fixing that to be -1.)"
8374 echo "Forcing errno EAGAIN on read() with no data available."
8378 echo "Your read() sets errno to $eagain when no data is available."
8381 status=`$cat try.err`
8383 0) echo "And it correctly returns 0 to signal EOF.";;
8384 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8385 *) echo "However, your read() returns '$status' on EOF??";;
8388 if test "$status" = "$rd_nodata"; then
8389 echo "WARNING: you can't distinguish between EOF and no data!"
8393 echo "I can't compile the test program--assuming errno EAGAIN will do."
8400 echo "Using $hint value $eagain."
8401 echo "Your read() returns $rd_nodata when no data is present."
8402 case "$d_eofnblk" in
8403 "$define") echo "And you can see EOF because read() returns 0.";;
8404 "$undef") echo "But you can't see EOF status from read() returned value.";;
8406 echo "(Assuming you can't see EOF status from read anyway.)"
8412 $rm -f try try.* .out core head.c mtry
8414 : see if fchmod exists
8418 : see if fchown exists
8422 : see if this is an fcntl system
8426 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8427 while $test $# -ge 2; do
8429 $define) echo "#include <$2>";;
8433 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8435 if eval $compile; then
8446 : see whether socket exists
8448 $echo $n "Hmm... $c" >&4
8449 if set socket val -f d_socket; eval $csym; $val; then
8450 echo "Looks like you have Berkeley networking support." >&4
8452 if set setsockopt val -f; eval $csym; $val; then
8455 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8459 if $contains socklib libc.list >/dev/null 2>&1; then
8460 echo "Looks like you have Berkeley networking support." >&4
8462 : we will have to assume that it supports the 4.2 BSD interface
8465 echo "You don't have Berkeley networking in libc$_a..." >&4
8466 if test "X$d_socket" = "X$define"; then
8467 echo "...but you seem to believe that you have sockets." >&4
8469 for net in net socket
8471 if test -f /usr/lib/lib$net$_a; then
8472 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8473 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8474 if $contains socket libc.list >/dev/null 2>&1; then
8479 echo "...but the Wollongong group seems to have hacked it in." >&4
8480 sockethdr="-I/usr/netinclude"
8483 echo "Found Berkeley sockets interface in lib$net." >& 4
8484 if $contains setsockopt libc.list >/dev/null 2>&1; then
8487 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8494 if test "X$d_socket" != "X$define"; then
8495 echo "or anywhere else I see." >&4
8503 : see if socketpair exists
8504 set socketpair d_sockpair
8509 echo "Checking the availability of certain socket constants..." >& 4
8510 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8511 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8513 #include <sys/types.h>
8514 #include <sys/socket.h>
8520 set try; if eval $compile; then
8523 set d_${enum}; eval $setvar
8527 : see if sys/select.h has to be included
8528 set sys/select.h i_sysselct
8531 : see if we should include time.h, sys/time.h, or both
8533 if test "X$timeincl" = X; then
8534 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8535 $echo $n "I'm now running the test program...$c"
8536 $cat >try.c <<'EOCP'
8537 #include <sys/types.h>
8542 #ifdef SYSTIMEKERNEL
8545 #include <sys/time.h>
8548 #include <sys/select.h>
8557 struct timezone tzp;
8559 if (foo.tm_sec == foo.tm_sec)
8562 if (bar.tv_sec == bar.tv_sec)
8569 for s_timezone in '-DS_TIMEZONE' ''; do
8571 for s_timeval in '-DS_TIMEVAL' ''; do
8572 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8573 for i_time in '' '-DI_TIME'; do
8574 for i_systime in '-DI_SYSTIME' ''; do
8577 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8578 if eval $compile; then
8579 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8583 $echo $n "Succeeded with $flags$c"
8595 *SYSTIMEKERNEL*) i_systimek="$define"
8596 timeincl=`./findhdr sys/time.h`
8597 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8598 *) i_systimek="$undef";;
8601 *I_TIME*) i_time="$define"
8602 timeincl=`./findhdr time.h`" $timeincl"
8603 echo "We'll include <time.h>." >&4;;
8604 *) i_time="$undef";;
8607 *I_SYSTIME*) i_systime="$define"
8608 timeincl=`./findhdr sys/time.h`" $timeincl"
8609 echo "We'll include <sys/time.h>." >&4;;
8610 *) i_systime="$undef";;
8615 : check for fd_set items
8618 Checking to see how well your C compiler handles fd_set and friends ...
8620 $cat >fd_set.c <<EOCP
8621 #$i_systime I_SYS_TIME
8622 #$i_sysselct I_SYS_SELECT
8623 #$d_socket HAS_SOCKET
8624 #include <sys/types.h>
8626 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8629 #include <sys/time.h>
8632 #include <sys/select.h>
8641 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8648 set fd_set -DTRYBITS
8649 if eval $compile; then
8650 d_fds_bits="$define"
8652 echo "Well, your system knows about the normal fd_set typedef..." >&4
8654 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8655 d_fd_macros="$define"
8658 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8660 d_fd_macros="$undef"
8664 Hmm, your compiler has some difficulty with fd_set. Checking further...
8667 if eval $compile; then
8670 echo "Well, your system has some sort of fd_set available..." >&4
8672 echo "and you have the normal fd_set macros." >&4
8673 d_fd_macros="$define"
8676 but not the normal fd_set macros! Gross! More work for me...
8678 d_fd_macros="$undef"
8681 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8684 d_fd_macros="$undef"
8689 : see if fgetpos exists
8690 set fgetpos d_fgetpos
8693 : see if flock exists
8697 : see if fork exists
8701 : see if pathconf exists
8702 set pathconf d_pathconf
8705 : see if fpathconf exists
8706 set fpathconf d_fpathconf
8712 echo "Checking to see if your system supports off64_t..." >&4
8714 #include <sys/types.h>
8716 int main() { off64_t x = 7; }'
8719 if eval $compile; then
8721 echo "Yes, it does."
8724 echo "No, it doesn't."
8725 case "$lseeksize" in
8726 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8733 : check for fpos64_t
8735 echo "Checking to see if your system supports fpos64_t..." >&4
8737 #include <sys/stdio.h>
8738 int main() { fpos64_t x x = 7; }'
8741 if eval $compile; then
8743 echo "Yes, it does."
8746 echo "No, it doesn't."
8748 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8755 hasstruct='varname=$1; struct=$2; shift; shift;
8756 while $test $# -ge 2; do
8758 $define) echo "#include <$2>";;
8762 echo "int main () { struct $struct foo; }" >> try.c;
8764 if eval $compile; then
8773 : see if this is a sys/param system
8774 set sys/param.h i_sysparam
8777 : see if this is a sys/mount.h system
8778 set sys/mount.h i_sysmount
8781 : see if sys/types.h has to be included
8782 set sys/types.h i_systypes
8787 echo "Checking to see if your system supports struct fs_data..." >&4
8788 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8790 case "$d_fs_data_s" in
8791 "$define") echo "Yes, it does." ;;
8792 *) echo "No, it doesn't." ;;
8795 : see if fseeko exists
8799 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8802 : see if fsetpos exists
8803 set fsetpos d_fsetpos
8807 : see if fstatfs exists
8808 set fstatfs d_fstatfs
8812 : see if statvfs exists
8813 set statvfs d_statvfs
8816 : see if fstatvfs exists
8817 set fstatvfs d_fstatvfs
8821 : see if ftello exists
8825 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8828 : see if getgrent exists
8829 set getgrent d_getgrent
8832 : see if gethostbyaddr exists
8833 set gethostbyaddr d_gethbyaddr
8836 : see if gethostbyname exists
8837 set gethostbyname d_gethbyname
8840 : see if gethostent exists
8841 set gethostent d_gethent
8844 : see how we will look up host name
8847 if set gethostname val -f d_gethname; eval $csym; $val; then
8848 echo 'gethostname() found.' >&4
8849 d_gethname="$define"
8852 if set uname val -f d_uname; eval $csym; $val; then
8855 uname() was found, but you're running xenix, and older versions of xenix
8856 have a broken uname(). If you don't really know whether your xenix is old
8857 enough to have a broken system call, use the default answer.
8864 rp='Is your uname() broken?'
8867 n*) d_uname="$define"; call=uname;;
8870 echo 'uname() found.' >&4
8877 case "$d_gethname" in
8878 '') d_gethname="$undef";;
8881 '') d_uname="$undef";;
8883 case "$d_uname$d_gethname" in
8888 Every now and then someone has a $call() that lies about the hostname
8889 but can't be fixed for political or economic reasons. If you wish, I can
8890 pretend $call() isn't there and maybe compute hostname at run-time
8891 thanks to the '$phostname' command.
8894 rp="Shall I ignore $call() from now on?"
8897 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8900 case "$phostname" in
8902 *) case "$aphostname" in
8908 file=`./loc $file $file $pth`
8909 aphostname=`echo $file $*`
8914 case "$d_uname$d_gethname" in
8917 case "$phostname" in
8919 echo "There will be no way for $package to get your hostname." >&4;;
8921 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8925 case "$d_phostname" in
8926 '') d_phostname="$undef";;
8929 : see if this is a netdb.h system
8933 : see if prototypes for various gethostxxx netdb.h functions are available
8935 set d_gethostprotos gethostent $i_netdb netdb.h
8938 : see if getlogin exists
8939 set getlogin d_getlogin
8942 : see if getmnt exists
8946 : see if getmntent exists
8947 set getmntent d_getmntent
8950 : see if getnetbyaddr exists
8951 set getnetbyaddr d_getnbyaddr
8954 : see if getnetbyname exists
8955 set getnetbyname d_getnbyname
8958 : see if getnetent exists
8959 set getnetent d_getnent
8962 : see if prototypes for various getnetxxx netdb.h functions are available
8964 set d_getnetprotos getnetent $i_netdb netdb.h
8968 : see if getprotobyname exists
8969 set getprotobyname d_getpbyname
8972 : see if getprotobynumber exists
8973 set getprotobynumber d_getpbynumber
8976 : see if getprotoent exists
8977 set getprotoent d_getpent
8980 : see if getpgid exists
8981 set getpgid d_getpgid
8984 : see if getpgrp2 exists
8985 set getpgrp2 d_getpgrp2
8988 : see if getppid exists
8989 set getppid d_getppid
8992 : see if getpriority exists
8993 set getpriority d_getprior
8996 : see if prototypes for various getprotoxxx netdb.h functions are available
8998 set d_getprotoprotos getprotoent $i_netdb netdb.h
9001 : see if getpwent exists
9002 set getpwent d_getpwent
9006 : see if getservbyname exists
9007 set getservbyname d_getsbyname
9010 : see if getservbyport exists
9011 set getservbyport d_getsbyport
9014 : see if getservent exists
9015 set getservent d_getsent
9018 : see if prototypes for various getservxxx netdb.h functions are available
9020 set d_getservprotos getservent $i_netdb netdb.h
9023 : see if getspent exists
9024 set getspent d_getspent
9027 : see if getspnam exists
9028 set getspnam d_getspnam
9031 : see if gettimeofday or ftime exists
9032 set gettimeofday d_gettimeod
9034 case "$d_gettimeod" in
9040 val="$undef"; set d_ftime; eval $setvar
9043 case "$d_gettimeod$d_ftime" in
9046 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9050 : see if this is an grp system
9056 xxx=`./findhdr grp.h`
9057 $cppstdin $cppflags $cppminus < $xxx >$$.h
9059 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9071 set d_grpasswd; eval $setvar
9075 : see if hasmntopt exists
9076 set hasmntopt d_hasmntopt
9079 : see if this is a netinet/in.h or sys/in.h system
9080 set netinet/in.h i_niin sys/in.h i_sysin
9083 : see if arpa/inet.h has to be included
9084 set arpa/inet.h i_arpainet
9087 : see if htonl --and friends-- exists
9092 : Maybe they are macros.
9097 #include <sys/types.h>
9098 #$i_niin I_NETINET_IN
9100 #$i_arpainet I_ARPA_INET
9102 #include <netinet/in.h>
9108 #include <arpa/inet.h>
9111 printf("Defined as a macro.");
9114 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9115 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9117 echo "But it seems to be defined as a macro." >&4
9127 if set index val -f; eval $csym; $val; then
9128 if set strchr val -f d_strchr; eval $csym; $val; then
9129 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9132 echo "strchr() found." >&4
9136 echo "index() found." >&4
9141 echo "index() found." >&4
9144 if set strchr val -f d_strchr; eval $csym; $val; then
9147 echo "strchr() found." >&4
9149 echo "No index() or strchr() found!" >&4
9154 set d_strchr; eval $setvar
9156 set d_index; eval $setvar
9158 : check whether inet_aton exists
9159 set inet_aton d_inetaton
9162 : see if inttypes.h is available
9163 : we want a real compile instead of Inhdr because some systems
9164 : have an inttypes.h which includes non-existent headers
9167 #include <inttypes.h>
9169 static int32_t foo32 = 0x12345678;
9173 if eval $compile; then
9174 echo "<inttypes.h> found." >&4
9177 echo "<inttypes.h> NOT found." >&4
9186 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9188 #include <sys/types.h>
9189 #$i_inttypes I_INTTYPES
9191 #include <inttypes.h>
9193 int main() { int64_t x = 7; }
9196 if eval $compile; then
9198 echo " Yes, it does." >&4
9201 echo " No, it doesn't." >&4
9209 $cat >isascii.c <<'EOCP'
9221 if eval $compile; then
9222 echo "isascii() found." >&4
9225 echo "isascii() NOT found." >&4
9232 : see if killpg exists
9236 : see if lchown exists
9238 $cat > try.c <<'EOCP'
9239 /* System header to define __stub macros and hopefully few prototypes,
9240 which can conflict with char lchown(); below. */
9242 /* Override any gcc2 internal prototype to avoid an error. */
9243 /* We use char because int might match the return type of a gcc2
9244 builtin and then its argument prototype would still apply. */
9247 /* The GNU C library defines this for functions which it implements
9248 to always fail with ENOSYS. Some functions are actually named
9249 something starting with __ and the normal name is an alias. */
9250 #if defined (__stub_lchown) || defined (__stub___lchown)
9258 if eval $compile; then
9259 $echo "lchown() found." >&4
9262 $echo "lchown() NOT found." >&4
9268 : See if number of significant digits in a double precision number is known
9270 $cat >ldbl_dig.c <<EOM
9280 printf("Contains LDBL_DIG");
9283 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9284 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9285 echo "LDBL_DIG found." >&4
9288 echo "LDBL_DIG NOT found." >&4
9295 : see if link exists
9299 : see if localeconv exists
9300 set localeconv d_locconv
9303 : see if lockf exists
9307 : check for long long
9309 $echo $n "Checking to see if your system supports long long..." $c >&4
9310 echo 'int main() { long long x = 7; return 0; }' > try.c
9312 if eval $compile; then
9314 echo " Yes, it does." >&4
9317 echo " No, it doesn't." >&4
9323 : check for length of long long
9324 case "${d_longlong}${longlongsize}" in
9327 $echo $n "Checking to see how big your long longs are..." $c >&4
9328 $cat >try.c <<'EOCP'
9332 printf("%d\n", (int)sizeof(long long));
9337 if eval $compile_ok; then
9338 longlongsize=`./try$exe_ext`
9339 $echo " $longlongsize bytes." >&4
9343 echo "(I can't seem to compile the test program. Guessing...)"
9344 rp="What is the size of a long long (in bytes)?"
9348 if $test "X$longsize" = "X$longlongsize"; then
9349 echo "(That isn't any different from an ordinary long.)"
9355 : see if lstat exists
9359 : see if mblen exists
9363 : see if mbstowcs exists
9364 set mbstowcs d_mbstowcs
9367 : see if mbtowc exists
9371 : see if memchr exists
9375 : see if memcmp exists
9379 : see if memcpy exists
9383 : see if memmove exists
9384 set memmove d_memmove
9387 : see if memset exists
9391 : see if mkdir exists
9395 : see if mkfifo exists
9399 : see if mktime exists
9403 : see if msgctl exists
9407 : see if msgget exists
9411 : see if msgsnd exists
9415 : see if msgrcv exists
9419 : see how much of the 'msg*(2)' library is present.
9422 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9423 *"$undef"*) h_msg=false;;
9427 case "`ipcs 2>&1`" in
9428 "SVID messages"*"not configured"*)
9429 echo "Your $osname does not have the msg*(2) configured." >&4
9444 : we could also check for sys/ipc.h ...
9445 if $h_msg && $test `./findhdr sys/msg.h`; then
9446 echo "You have the full msg*(2) library." >&4
9449 echo "You don't have the full msg*(2) library." >&4
9455 : see if nice exists
9459 : see if POSIX threads are available
9460 set pthread.h i_pthread
9466 : how to create joinable pthreads
9467 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9469 echo "Checking what constant to use for creating joinable pthreads..." >&4
9470 $cat >try.c <<'EOCP'
9471 #include <pthread.h>
9473 int detachstate = JOINABLE;
9476 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9477 if eval $compile; then
9478 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9479 val="$undef" # Yes, undef.
9480 set d_old_pthread_create_joinable
9483 set old_pthread_create_joinable
9486 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9487 if eval $compile; then
9488 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9490 set d_old_pthread_create_joinable
9492 val=PTHREAD_CREATE_UNDETACHED
9493 set old_pthread_create_joinable
9496 set try -DJOINABLE=__UNDETACHED
9497 if eval $compile; then
9498 echo "You seem to use __UNDETACHED." >&4
9500 set d_old_pthread_create_joinable
9503 set old_pthread_create_joinable
9506 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9508 set d_old_pthread_create_joinable
9511 set old_pthread_create_joinable
9518 d_old_pthread_create_joinable="$undef"
9519 old_pthread_create_joinable=""
9522 : see if pause exists
9526 : see if pipe exists
9530 : see if poll exists
9535 : see whether the various POSIXish _yields exist
9537 #include <pthread.h>
9543 #ifdef PTHREAD_YIELD
9546 #ifdef PTHREAD_YIELD_NULL
9547 pthread_yield(NULL);
9553 : see if sched_yield exists
9554 set try -DSCHED_YIELD
9555 if eval $compile; then
9557 sched_yield='sched_yield()'
9561 case "$usethreads" in
9564 $define) echo 'sched_yield() found.' >&4 ;;
9565 *) echo 'sched_yield() NOT found.' >&4 ;;
9571 : see if pthread_yield exists
9572 set try -DPTHREAD_YIELD
9573 if eval $compile; then
9575 case "$sched_yield" in
9576 '') sched_yield='pthread_yield()' ;;
9579 set try -DPTHREAD_YIELD_NULL
9580 if eval $compile; then
9582 case "$sched_yield" in
9583 '') sched_yield='pthread_yield(NULL)' ;;
9589 case "$usethreads" in
9592 $define) echo 'pthread_yield() found.' >&4 ;;
9593 *) echo 'pthread_yield() NOT found.' >&4 ;;
9600 case "$sched_yield" in
9601 '') sched_yield=undef ;;
9606 : see if this is a pwd.h system
9612 xxx=`./findhdr pwd.h`
9613 $cppstdin $cppflags $cppminus < $xxx >$$.h
9615 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9623 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9631 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9639 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9647 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9655 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9663 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9671 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9683 set d_pwquota; eval $setvar
9684 set d_pwage; eval $setvar
9685 set d_pwchange; eval $setvar
9686 set d_pwclass; eval $setvar
9687 set d_pwexpire; eval $setvar
9688 set d_pwcomment; eval $setvar
9689 set d_pwgecos; eval $setvar
9690 set d_pwpasswd; eval $setvar
9696 echo "Checking which 64-bit integer type we could use..." >&4
9702 val='"unsigned int"'
9707 *) case "$longsize" in
9711 val='"unsigned long"'
9716 *) case "$uselonglong:$d_longlong:$longlongsize" in
9721 val='"unsigned long long"'
9726 *) case "$d_int64t" in
9745 '') case "$uselonglong:$d_longlong:$longlongsize" in
9747 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9748 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9752 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9757 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9762 : see if readdir and friends exist
9763 set readdir d_readdir
9765 set seekdir d_seekdir
9767 set telldir d_telldir
9769 set rewinddir d_rewinddir
9772 : see if readlink exists
9773 set readlink d_readlink
9776 : see if rename exists
9780 : see if rmdir exists
9784 : see if memory.h is available.
9789 : See if it conflicts with string.h
9795 $cppstdin $cppflags $cppminus < $strings > mem.h
9796 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9798 echo "We won't be including <memory.h>."
9808 : can bcopy handle overlapping blocks?
9813 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9820 $cat >>try.c <<'EOCP'
9823 # include <memory.h>
9826 # include <stdlib.h>
9829 # include <string.h>
9831 # include <strings.h>
9834 # include <unistd.h> /* Needed for NetBSD */
9838 char buf[128], abc[128];
9844 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9846 for (align = 7; align >= 0; align--) {
9847 for (len = 36; len; len--) {
9850 for (off = 1; off <= len; off++) {
9851 bcopy(b, b+off, len);
9852 bcopy(b+off, b, len);
9853 if (bcmp(b, abc, len))
9862 if eval $compile_ok; then
9863 if ./try 2>/dev/null; then
9867 echo "It can't, sorry."
9868 case "$d_memmove" in
9869 "$define") echo "But that's Ok since you have memmove()." ;;
9873 echo "(I can't compile the test program, so we'll assume not...)"
9874 case "$d_memmove" in
9875 "$define") echo "But that's Ok since you have memmove()." ;;
9880 $rm -f try.* try core
9884 : can memcpy handle overlapping blocks?
9889 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9896 $cat >>try.c <<'EOCP'
9899 # include <memory.h>
9902 # include <stdlib.h>
9905 # include <string.h>
9907 # include <strings.h>
9910 # include <unistd.h> /* Needed for NetBSD */
9914 char buf[128], abc[128];
9920 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9921 try to store the string in read-only memory. */
9922 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9924 for (align = 7; align >= 0; align--) {
9925 for (len = 36; len; len--) {
9927 memcpy(b, abc, len);
9928 for (off = 1; off <= len; off++) {
9929 memcpy(b+off, b, len);
9930 memcpy(b, b+off, len);
9931 if (memcmp(b, abc, len))
9940 if eval $compile_ok; then
9941 if ./try 2>/dev/null; then
9945 echo "It can't, sorry."
9946 case "$d_memmove" in
9947 "$define") echo "But that's Ok since you have memmove()." ;;
9951 echo "(I can't compile the test program, so we'll assume not...)"
9952 case "$d_memmove" in
9953 "$define") echo "But that's Ok since you have memmove()." ;;
9958 $rm -f try.* try core
9962 : can memcmp be trusted to compare relative magnitude?
9967 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9974 $cat >>try.c <<'EOCP'
9977 # include <memory.h>
9980 # include <stdlib.h>
9983 # include <string.h>
9985 # include <strings.h>
9988 # include <unistd.h> /* Needed for NetBSD */
9994 if ((a < b) && memcmp(&a, &b, 1) < 0)
10000 if eval $compile_ok; then
10001 if ./try 2>/dev/null; then
10002 echo "Yes, it can."
10005 echo "No, it can't (it uses signed chars)."
10008 echo "(I can't compile the test program, so we'll assume not...)"
10012 $rm -f try.* try core
10016 : see if select exists
10017 set select d_select
10020 : see if semctl exists
10021 set semctl d_semctl
10024 : see if semget exists
10025 set semget d_semget
10028 : see if semop exists
10032 : see how much of the 'sem*(2)' library is present.
10035 case "$d_semctl$d_semget$d_semop" in
10036 *"$undef"*) h_sem=false;;
10040 case "`ipcs 2>&1`" in
10041 "SVID messages"*"not configured"*)
10042 echo "Your $osname does not have the sem*(2) configured." >&4
10045 set semctl d_semctl
10047 set semget d_semget
10055 : we could also check for sys/ipc.h ...
10056 if $h_sem && $test `./findhdr sys/sem.h`; then
10057 echo "You have the full sem*(2) library." >&4
10060 echo "You don't have the full sem*(2) library." >&4
10066 : see whether sys/sem.h defines union semun
10068 $cat > try.c <<'END'
10069 #include <sys/types.h>
10070 #include <sys/ipc.h>
10071 #include <sys/sem.h>
10072 int main () { union semun semun; semun.buf = 0; }
10075 if eval $compile; then
10076 echo "You have union semun in <sys/sem.h>." >&4
10079 echo "You do not have union semun in <sys/sem.h>." >&4
10082 $rm -f try try.c try.h
10086 : see how to do semctl IPC_STAT
10089 : see whether semctl IPC_STAT can use union semun
10094 # define S_IRUSR S_IREAD
10095 # define S_IWUSR S_IWRITE
10096 # define S_IXUSR S_IEXEC
10098 # define S_IRUSR 0400
10099 # define S_IWUSR 0200
10100 # define S_IXUSR 0100
10102 # define S_IRGRP (S_IRUSR>>3)
10103 # define S_IWGRP (S_IWUSR>>3)
10104 # define S_IXGRP (S_IXUSR>>3)
10105 # define S_IROTH (S_IRUSR>>6)
10106 # define S_IWOTH (S_IWUSR>>6)
10107 # define S_IXOTH (S_IXUSR>>6)
10110 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10111 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10112 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10117 #include <sys/types.h>
10118 #include <sys/ipc.h>
10119 #include <sys/sem.h>
10120 #include <sys/stat.h>
10127 #$d_union_semun HAS_UNION_SEMUN
10130 #ifndef HAS_UNION_SEMUN
10133 struct semid_ds *buf;
10134 unsigned short *array;
10140 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10141 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10143 struct semid_ds argbuf;
10146 st = semctl(sem, 0, IPC_STAT, arg);
10150 # endif /* IPC_STAT */
10151 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10153 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10154 # endif /* IPC_RMID */
10155 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10157 #endif /* IPC_PRIVATE && ... */
10158 printf("semget failed: errno = %d\n", errno);
10164 if eval $compile; then
10167 semun) val="$define" ;;
10173 case "$d_semctl_semun" in
10175 echo "You can use union semun for semctl IPC_STAT." >&4
10178 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10183 : see whether semctl IPC_STAT can use struct semid_ds pointer
10184 $cat > try.c <<'END'
10185 #include <sys/types.h>
10186 #include <sys/ipc.h>
10187 #include <sys/sem.h>
10188 #include <sys/stat.h>
10196 struct semid_ds arg;
10199 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10200 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10203 st = semctl(sem, 0, IPC_STAT, &arg);
10205 printf("semid_ds\n");
10207 # endif /* IPC_STAT */
10208 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10210 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10211 # endif /* IPC_RMID */
10212 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10214 #endif /* IPC_PRIVATE && ... */
10215 printf("semget failed: errno = %d\n", errno);
10222 if eval $compile; then
10225 semid_ds) val="$define" ;;
10229 set d_semctl_semid_ds
10231 case "$d_semctl_semid_ds" in
10233 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10235 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10242 # We do not have the full sem*(2) library, so assume we can not
10248 set d_semctl_semid_ds
10253 : see if setegid exists
10254 set setegid d_setegid
10257 : see if seteuid exists
10258 set seteuid d_seteuid
10261 : see if setgrent exists
10262 set setgrent d_setgrent
10265 : see if sethostent exists
10266 set sethostent d_sethent
10269 : see if setlinebuf exists
10270 set setlinebuf d_setlinebuf
10273 : see if setlocale exists
10274 set setlocale d_setlocale
10277 : see if setnetent exists
10278 set setnetent d_setnent
10281 : see if setprotoent exists
10282 set setprotoent d_setpent
10285 : see if setpgid exists
10286 set setpgid d_setpgid
10289 : see if setpgrp2 exists
10290 set setpgrp2 d_setpgrp2
10293 : see if setpriority exists
10294 set setpriority d_setprior
10297 : see if setpwent exists
10298 set setpwent d_setpwent
10301 : see if setregid exists
10302 set setregid d_setregid
10304 set setresgid d_setresgid
10307 : see if setreuid exists
10308 set setreuid d_setreuid
10310 set setresuid d_setresuid
10313 : see if setrgid exists
10314 set setrgid d_setrgid
10317 : see if setruid exists
10318 set setruid d_setruid
10321 : see if setservent exists
10322 set setservent d_setsent
10325 : see if setsid exists
10326 set setsid d_setsid
10329 : see if setspent exists
10330 set setspent d_setspent
10333 : see if setvbuf exists
10334 set setvbuf d_setvbuf
10337 : see if sfio.h is available
10342 : see if sfio library is available
10353 : Ok, but do we want to use it.
10357 true|$define|[yY]*) dflt='y';;
10360 echo "$package can use the sfio library, but it is experimental."
10361 rp="You seem to have sfio available, do you want to try using it?"
10365 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10367 : Remove sfio from list of libraries to use
10368 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10371 echo "libs = $libs" >&4
10375 *) case "$usesfio" in
10376 true|$define|[yY]*)
10377 echo "Sorry, cannot find sfio on this machine" >&4
10378 echo "Ignoring your setting of usesfio=$usesfio" >&4
10386 $define) usesfio='true';;
10387 *) usesfio='false';;
10390 : see if shmctl exists
10391 set shmctl d_shmctl
10394 : see if shmget exists
10395 set shmget d_shmget
10398 : see if shmat exists
10401 : see what shmat returns
10404 $cat >shmat.c <<'END'
10405 #include <sys/shm.h>
10408 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10413 echo "and it returns ($shmattype)." >&4
10414 : see if a prototype for shmat is available
10415 xxx=`./findhdr sys/shm.h`
10416 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10417 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10428 set d_shmatprototype
10431 : see if shmdt exists
10435 : see how much of the 'shm*(2)' library is present.
10438 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10439 *"$undef"*) h_shm=false;;
10443 case "`ipcs 2>&1`" in
10444 "SVID shared memory"*"not configured"*)
10445 echo "Your $osname does not have the shm*(2) configured." >&4
10448 set shmctl d_shmctl
10450 set shmget d_shmget
10460 : we could also check for sys/ipc.h ...
10461 if $h_shm && $test `./findhdr sys/shm.h`; then
10462 echo "You have the full shm*(2) library." >&4
10465 echo "You don't have the full shm*(2) library." >&4
10472 : see if we have sigaction
10473 if set sigaction val -f d_sigaction; eval $csym; $val; then
10474 echo 'sigaction() found.' >&4
10475 $cat > try.c <<'EOP'
10477 #include <sys/types.h>
10478 #include <signal.h>
10481 struct sigaction act, oact;
10483 oact.sa_handler = 0;
10484 /* so that act and oact are used */
10485 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10489 if eval $compile_ok; then
10492 echo "But you don't seem to have a useable struct sigaction." >&4
10496 echo 'sigaction NOT found.' >&4
10499 set d_sigaction; eval $setvar
10500 $rm -f try try$_o try.c
10502 : see if sigsetjmp exists
10504 case "$d_sigsetjmp" in
10506 $cat >try.c <<'EOP'
10507 #include <setjmp.h>
10512 if (sigsetjmp(env,1))
10515 siglongjmp(env, 1);
10520 if eval $compile; then
10521 if ./try >/dev/null 2>&1; then
10522 echo "POSIX sigsetjmp found." >&4
10526 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10532 echo "sigsetjmp not found." >&4
10536 *) val="$d_sigsetjmp"
10537 case "$d_sigsetjmp" in
10538 $define) echo "POSIX sigsetjmp found." >&4;;
10539 $undef) echo "sigsetjmp not found." >&4;;
10547 : see if sqrtl exists
10551 : see if sys/stat.h is available
10552 set sys/stat.h i_sysstat
10556 : see if stat knows about block sizes
10558 echo "Checking to see if your struct stat has st_blocks field..." >&4
10559 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10563 : see if this is a sys/vfs.h system
10564 set sys/vfs.h i_sysvfs
10568 : see if this is a sys/statfs.h system
10569 set sys/statfs.h i_sysstatfs
10574 echo "Checking to see if your system supports struct statfs..." >&4
10575 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
10577 case "$d_statfs_s" in
10578 "$define") echo "Yes, it does." ;;
10579 *) echo "No, it doesn't." ;;
10584 : see if struct statfs knows about f_flags
10585 case "$d_statfs_s" in
10588 echo "Checking to see if your struct statfs has f_flags field..." >&4
10589 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
10593 set d_statfs_f_flags
10597 case "$d_statfs_f_flags" in
10598 "$define") echo "Yes, it does." ;;
10599 *) echo "No, it doesn't." ;;
10602 : see if _ptr and _cnt from stdio act std
10604 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10605 echo "(Looks like you have stdio.h from Linux.)"
10606 case "$stdio_ptr" in
10607 '') stdio_ptr='((fp)->_IO_read_ptr)'
10610 *) ptr_lval=$d_stdio_ptr_lval;;
10612 case "$stdio_cnt" in
10613 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10616 *) cnt_lval=$d_stdio_cnt_lval;;
10618 case "$stdio_base" in
10619 '') stdio_base='((fp)->_IO_read_base)';;
10621 case "$stdio_bufsiz" in
10622 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10625 case "$stdio_ptr" in
10626 '') stdio_ptr='((fp)->_ptr)'
10629 *) ptr_lval=$d_stdio_ptr_lval;;
10631 case "$stdio_cnt" in
10632 '') stdio_cnt='((fp)->_cnt)'
10635 *) cnt_lval=$d_stdio_cnt_lval;;
10637 case "$stdio_base" in
10638 '') stdio_base='((fp)->_base)';;
10640 case "$stdio_bufsiz" in
10641 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10644 : test whether _ptr and _cnt really work
10645 echo "Checking how std your stdio is..." >&4
10648 #define FILE_ptr(fp) $stdio_ptr
10649 #define FILE_cnt(fp) $stdio_cnt
10651 FILE *fp = fopen("try.c", "r");
10654 18 <= FILE_cnt(fp) &&
10655 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10663 if eval $compile; then
10665 echo "Your stdio acts pretty std."
10668 echo "Your stdio isn't very std."
10671 echo "Your stdio doesn't appear very std."
10677 : Can _ptr be used as an lvalue?
10678 case "$d_stdstdio$ptr_lval" in
10679 $define$define) val=$define ;;
10682 set d_stdio_ptr_lval
10685 : Can _cnt be used as an lvalue?
10686 case "$d_stdstdio$cnt_lval" in
10687 $define$define) val=$define ;;
10690 set d_stdio_cnt_lval
10693 : see if _base is also standard
10695 case "$d_stdstdio" in
10699 #define FILE_base(fp) $stdio_base
10700 #define FILE_bufsiz(fp) $stdio_bufsiz
10702 FILE *fp = fopen("try.c", "r");
10705 19 <= FILE_bufsiz(fp) &&
10706 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10713 if eval $compile; then
10715 echo "And its _base field acts std."
10718 echo "But its _base field isn't std."
10721 echo "However, it seems to be lacking the _base field."
10730 Checking how to access stdio streams by file descriptor number...
10732 case "$stdio_stream_array" in
10733 '') $cat >try.c <<EOCP
10736 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10740 for s in _iob __iob __sF
10742 set try -DSTDIO_STREAM_ARRAY=$s
10743 if eval $compile; then
10744 case "`./try$exe_ext`" in
10745 yes) stdio_stream_array=$s; break ;;
10749 $rm -f try.* try$exe_ext
10751 case "$stdio_stream_array" in
10753 I can't figure out how to access stdio streams by file descriptor number.
10755 d_stdio_stream_array="$undef"
10758 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10760 d_stdio_stream_array="$define"
10764 : see if strcoll exists
10765 set strcoll d_strcoll
10768 : check for structure copying
10770 echo "Checking to see if your C compiler can copy structs..." >&4
10771 $cat >try.c <<'EOCP'
10781 if $cc -c try.c >/dev/null 2>&1 ; then
10783 echo "Yup, it can."
10786 echo "Nope, it can't."
10792 : see if strerror and/or sys_errlist[] exist
10794 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10795 if set strerror val -f d_strerror; eval $csym; $val; then
10796 echo 'strerror() found.' >&4
10797 d_strerror="$define"
10798 d_strerrm='strerror(e)'
10799 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10800 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10801 d_syserrlst="$define"
10803 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10804 d_syserrlst="$undef"
10806 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10807 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10808 echo 'strerror() found in string header.' >&4
10809 d_strerror="$define"
10810 d_strerrm='strerror(e)'
10811 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10812 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10813 d_syserrlst="$define"
10815 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10816 d_syserrlst="$undef"
10818 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10819 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10820 d_strerror="$undef"
10821 d_syserrlst="$define"
10822 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10824 echo 'strerror() and sys_errlist[] NOT found.' >&4
10825 d_strerror="$undef"
10826 d_syserrlst="$undef"
10827 d_strerrm='"unknown"'
10831 : see if strtod exists
10832 set strtod d_strtod
10835 : see if strtol exists
10836 set strtol d_strtol
10839 : see if strtoul exists
10840 set strtoul d_strtoul
10843 : see if strtoull exists
10844 set strtoull d_strtoull
10847 : see if strxfrm exists
10848 set strxfrm d_strxfrm
10851 : see if symlink exists
10852 set symlink d_symlink
10855 : see if syscall exists
10856 set syscall d_syscall
10859 : see if sysconf exists
10860 set sysconf d_sysconf
10863 : see if system exists
10864 set system d_system
10867 : see if tcgetpgrp exists
10868 set tcgetpgrp d_tcgetpgrp
10871 : see if tcsetpgrp exists
10872 set tcsetpgrp d_tcsetpgrp
10875 : see if prototype for telldir is available
10877 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10880 : see if this is a sys/times.h system
10881 set sys/times.h i_systimes
10884 : see if times exists
10886 if set times val -f d_times; eval $csym; $val; then
10887 echo 'times() found.' >&4
10890 case "$i_systimes" in
10891 "$define") inc='sys/times.h';;
10893 rp="What is the type returned by times() on this system?"
10894 set clock_t clocktype long stdio.h sys/types.h $inc
10897 echo 'times() NOT found, hope that will do.' >&4
10902 : see if truncate exists
10903 set truncate d_truncate
10906 : see if tzname[] exists
10908 if set tzname val -a d_tzname; eval $csym; $val; then
10910 echo 'tzname[] found.' >&4
10913 echo 'tzname[] NOT found.' >&4
10918 : see if umask exists
10922 : see if ustat exists
10926 : backward compatibility for d_hvfork
10927 if test X$d_hvfork != X; then
10928 d_vfork="$d_hvfork"
10931 : see if there is a vfork
10936 : Ok, but do we want to use it. vfork is reportedly unreliable in
10937 : perl on Solaris 2.x, and probably elsewhere.
10941 case "$usevfork" in
10947 Perl can only use a vfork() that doesn't suffer from strict
10948 restrictions on calling functions or modifying global data in
10949 the child. For example, glibc-2.1 contains such a vfork()
10950 that is unsuitable. If your system provides a proper fork()
10951 call, chances are that you do NOT want perl to use vfork().
10954 rp="Do you still want to use vfork()?"
10959 echo "Ok, we won't use vfork()."
10968 $define) usevfork='true';;
10969 *) usevfork='false';;
10972 : see if this is an sysdir system
10973 set sys/dir.h i_sysdir
10976 : see if this is an sysndir system
10977 set sys/ndir.h i_sysndir
10980 : see if closedir exists
10981 set closedir d_closedir
10984 case "$d_closedir" in
10987 echo "Checking whether closedir() returns a status..." >&4
10988 cat > closedir.c <<EOM
10989 #$i_dirent I_DIRENT /**/
10990 #$i_sysdir I_SYS_DIR /**/
10991 #$i_sysndir I_SYS_NDIR /**/
10992 #$i_systypes I_SYS_TYPES /**/
10994 #if defined(I_SYS_TYPES)
10995 #include <sys/types.h>
10997 #if defined(I_DIRENT)
10998 #include <dirent.h>
10999 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11000 #include <sys/dir.h>
11004 #include <sys/ndir.h>
11008 #include <ndir.h> /* may be wrong in the future */
11010 #include <sys/dir.h>
11015 int main() { return closedir(opendir(".")); }
11018 if eval $compile_ok; then
11019 if ./closedir > /dev/null 2>&1 ; then
11020 echo "Yes, it does."
11023 echo "No, it doesn't."
11027 echo "(I can't seem to compile the test program--assuming it doesn't)"
11035 set d_void_closedir
11038 : check for volatile keyword
11040 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11041 $cat >try.c <<'EOCP'
11044 typedef struct _goo_struct goo_struct;
11045 goo_struct * volatile goo = ((goo_struct *)0);
11046 struct _goo_struct {
11051 typedef unsigned short foo_t;
11052 char *volatile foo;
11054 volatile foo_t blech;
11058 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11060 echo "Yup, it does."
11063 echo "Nope, it doesn't."
11069 : see if there is a wait4
11073 : see if waitpid exists
11074 set waitpid d_waitpid
11077 : see if wcstombs exists
11078 set wcstombs d_wcstombs
11081 : see if wctomb exists
11082 set wctomb d_wctomb
11085 : preserve RCS keywords in files with variable substitution, grrr
11090 Revision='$Revision'
11092 case "$crosscompile" in
11093 ''|[nN]*) crosscompile="$undef" ;;
11097 next|rhapsody) multiarch="$define" ;;
11099 case "$multiarch" in
11100 ''|[nN]*) multiarch="$undef" ;;
11103 : check for alignment requirements
11105 case "$crosscompile$multiarch" in
11108 You seem to be either cross-compiling or doing a multiarchitecture build,
11109 skipping the memory alignment check.
11112 case "$alignbytes" in
11113 '') alignbytes=8 ;;
11117 case "$alignbytes" in
11118 '') echo "Checking alignment constraints..." >&4
11119 $cat >try.c <<'EOCP'
11127 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11132 if eval $compile_ok; then
11136 echo "(I can't seem to compile the test program...)"
11139 *) dflt="$alignbytes"
11142 rp="Doubles must be aligned on a how-many-byte boundary?"
11150 : check for ordering of bytes in a long
11152 case "$crosscompile$multiarch" in
11155 You seem to be either cross-compiling or doing a multiarchitecture build,
11156 skipping the byteorder check.
11162 case "$byteorder" in
11165 In the following, larger digits indicate more significance. A big-endian
11166 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11167 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11168 machines may have weird orders like 3412. A Cray will report 87654321,
11169 an Alpha will report 12345678. If the test program works the default is
11171 I'm now running the test program...
11173 $cat >try.c <<'EOCP'
11180 char c[sizeof(long)];
11183 if (sizeof(long) > 4)
11184 u.l = (0x08070605L << 32) | 0x04030201L;
11187 for (i = 0; i < sizeof(long); i++)
11188 printf("%c", u.c[i]+'0');
11195 if eval $compile && ./try > /dev/null; then
11198 [1-4][1-4][1-4][1-4]|12345678|87654321)
11199 echo "(The test program ran ok.)"
11200 echo "byteorder=$dflt"
11203 ????|????????) echo "(The test program ran ok.)" ;;
11204 *) echo "(The test program didn't run right for some reason.)" ;;
11209 (I can't seem to compile the test program. Guessing big-endian...)
11212 case "$xxx_prompt" in
11214 rp="What is the order of bytes in a long?"
11228 : how do we catenate cpp tokens here?
11230 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11231 $cat >cpp_stuff.c <<'EOCP'
11232 #define RCAT(a,b)a/**/b
11233 #define ACAT(a,b)a ## b
11237 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11238 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11239 echo "Oh! Smells like ANSI's been here." >&4
11240 echo "We can catify or stringify, separately or together!"
11242 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11243 echo "Ah, yes! The good old days!" >&4
11244 echo "However, in the good old days we don't know how to stringify and"
11245 echo "catify at the same time."
11249 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11250 to have to edit the values of CAT[2-5] in config.h...
11252 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11256 : see if this is a db.h system
11262 : Check db version.
11264 echo "Checking Berkeley DB version ..." >&4
11270 #include <sys/types.h>
11275 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11276 int Major, Minor, Patch ;
11277 unsigned long Version ;
11278 (void)db_version(&Major, &Minor, &Patch) ;
11279 printf("You have Berkeley DB Version 2 or greater\n");
11281 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11282 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11283 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11284 Major, Minor, Patch) ;
11286 /* check that db.h & libdb are compatible */
11287 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11288 printf("db.h and libdb are incompatible\n") ;
11292 printf("db.h and libdb are compatible\n") ;
11294 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11295 + DB_VERSION_PATCH ;
11297 /* needs to be >= 2.3.4 */
11298 if (Version < 2003004) {
11299 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11300 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11306 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11307 printf("You have Berkeley DB Version 1\n");
11308 exit(0); /* DB version < 2: the coast is clear. */
11310 exit(1); /* <db.h> not Berkeley DB? */
11316 if eval $compile_ok && ./try; then
11317 echo 'Looks OK.' >&4
11319 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11323 : Remove db from list of libraries to use
11324 echo "Removing unusable -ldb from library list" >&4
11325 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11328 echo "libs = $libs" >&4
11338 : Check the return type needed for hash
11340 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11346 #include <sys/types.h>
11349 #ifndef DB_VERSION_MAJOR
11350 u_int32_t hash_cb (ptr, size)
11358 info.hash = hash_cb;
11362 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11363 if $contains warning try.out >>/dev/null 2>&1 ; then
11366 db_hashtype='u_int32_t'
11369 : XXX Maybe we should just give up here.
11370 db_hashtype=u_int32_t
11372 echo "Help: I can't seem to compile the db test program." >&4
11373 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11376 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11378 *) db_hashtype=u_int32_t
11383 : Check the return type needed for prefix
11385 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11391 #include <sys/types.h>
11394 #ifndef DB_VERSION_MAJOR
11395 size_t prefix_cb (key1, key2)
11403 info.prefix = prefix_cb;
11407 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11408 if $contains warning try.out >>/dev/null 2>&1 ; then
11409 db_prefixtype='int'
11411 db_prefixtype='size_t'
11414 db_prefixtype='size_t'
11415 : XXX Maybe we should just give up here.
11417 echo "Help: I can't seem to compile the db test program." >&4
11418 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11421 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11423 *) db_prefixtype='size_t'
11427 : check for void type
11429 echo "Checking to see how well your C compiler groks the void type..." >&4
11430 case "$voidflags" in
11432 $cat >try.c <<'EOCP'
11438 extern void moo(); /* function returning void */
11439 void (*goo)(); /* ptr to func returning void */
11441 void *hue; /* generic ptr */
11454 int main() { sub(); }
11456 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11457 voidflags=$defvoidused
11458 echo "Good. It appears to support void to the level $package wants.">&4
11459 if $contains warning .out >/dev/null 2>&1; then
11460 echo "However, you might get some warnings that look like this:"
11464 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11465 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11466 echo "It supports 1..."
11467 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11468 echo "It also supports 2..."
11469 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11471 echo "And it supports 4 but not 8 definitely."
11473 echo "It doesn't support 4..."
11474 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11476 echo "But it supports 8."
11479 echo "Neither does it support 8."
11483 echo "It does not support 2..."
11484 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11486 echo "But it supports 4 and 8."
11488 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11490 echo "And it supports 4 but has not heard about 8."
11492 echo "However it supports 8 but not 4."
11497 echo "There is no support at all for void."
11502 case "$voidflags" in
11504 *) $cat >&4 <<'EOM'
11505 Support flag bits are:
11506 1: basic void declarations.
11507 2: arrays of pointers to functions returning void.
11508 4: operations between pointers to and addresses of void functions.
11509 8: generic void pointers.
11512 rp="Your void support flags add up to what?"
11520 : How can we generate normalized random numbers ?
11522 echo "Looking for a random number function..." >&4
11523 case "$randfunc" in
11525 if set drand48 val -f; eval $csym; $val; then
11527 echo "Good, found drand48()." >&4
11528 elif set random val -f; eval $csym; $val; then
11530 echo "OK, found random()." >&4
11533 echo "Yick, looks like I have to use rand()." >&4
11544 *-Dmy_rand=*|*-Dmy_srand=*)
11545 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11546 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11547 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11548 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11552 while $test "$cont"; do
11553 rp="Use which function to generate random numbers?"
11555 if $test "$ans" = "$dflt"; then
11561 if set $ans val -f; eval $csym; $val; then
11565 rp="I cannot find function $ans. Use that name anyway?"
11574 case "$randfunc" in
11576 drand01="drand48()"
11582 case "$randbits" in
11584 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11586 #$i_unistd I_UNISTD
11587 #$i_stdlib I_STDLIB
11590 # include <unistd.h>
11593 # include <stdlib.h>
11598 register unsigned long tmp;
11599 register unsigned long max = 0L;
11601 for (i = 1000; i; i--) {
11602 tmp = (unsigned long) $randfunc();
11603 if (tmp > max) max = tmp;
11605 for (i = 0; max; i++)
11611 if eval $compile_ok; then
11615 echo "(I can't seem to compile the test program...)"
11622 rp="How many bits does your $randfunc() function produce?"
11626 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11627 seedfunc="s$randfunc"
11628 randseedtype=unsigned
11632 rp="How many bits does your $randfunc() function produce?"
11635 seedfunc="s$randfunc"
11636 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11637 if set $seedfunc val -f; eval $csym; $val; then
11638 echo "(Using $seedfunc() to seed random generator)"
11640 echo "(Warning: no $seedfunc() to seed random generator)"
11643 randseedtype=unsigned
11651 echo "Determining whether or not we are on an EBCDIC system..." >&4
11652 $cat >tebcdic.c <<'EOM'
11655 if ('M'==0xd4) return 0;
11662 if eval $compile_ok; then
11664 echo "You have EBCDIC." >&4
11667 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11670 echo "I'm unable to compile the test program." >&4
11671 echo "I'll assume ASCII or some ISO Latin." >&4
11673 $rm -f tebcdic.c tebcdic
11679 Checking how to flush all pending stdio output...
11681 # I only know how to find the first 32 possibly open files on SunOS.
11682 # See also hints/sunos_4_1.sh and util.c --AD
11684 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11686 $cat >>try.c <<EOCP
11688 #$i_unistd I_UNISTD
11690 # include <unistd.h>
11692 #$d_sysconf HAS_SYSCONF
11693 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11694 #ifdef HAS_STDIO_STREAM_ARRAY
11695 # define STDIO_STREAM_ARRAY $stdio_stream_array
11698 FILE* p = fopen("try.out", "w");
11702 # ifdef TRY_FPRINTF
11706 #ifdef TRY_FFLUSH_NULL
11709 #ifdef TRY_FFLUSH_ALL
11711 long open_max = -1;
11712 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11713 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11715 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11716 open_max = sysconf(_SC_OPEN_MAX);
11719 open_max = FOPEN_MAX;
11722 open_max = OPEN_MAX;
11731 # ifdef HAS_STDIO_STREAM_ARRAY
11732 if (open_max > 0) {
11734 for (i = 0; i < open_max; i++)
11735 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11736 STDIO_STREAM_ARRAY[i]._file < open_max &&
11737 STDIO_STREAM_ARRAY[i]._flag)
11738 fflush(&STDIO_STREAM_ARRAY[i]);
11746 : first we have to find out how _not_ to flush
11747 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11749 set try -DTRY_FPUTC
11750 if eval $compile; then
11752 ./try$exe_ext 2>/dev/null
11753 if $test ! -s try.out -a "X$?" = X42; then
11759 set try -DTRY_FPRINTF
11761 if eval $compile; then
11763 ./try$exe_ext 2>/dev/null
11764 if $test ! -s try.out -a "X$?" = X42; then
11765 output=-DTRY_FPRINTF
11771 : check for fflush NULL behaviour
11772 case "$fflushNULL" in
11773 '') set try -DTRY_FFLUSH_NULL $output
11774 if eval $compile; then
11776 ./try$exe_ext 2>/dev/null
11778 if $test -s try.out -a "X$code" = X42; then
11779 fflushNULL="`$cat try.out`"
11781 if $test "X$code" != X42; then
11783 (If this test failed, don't worry, we'll try another method shortly.)
11788 $rm -f core try.core core.try.*
11789 case "$fflushNULL" in
11791 Your fflush(NULL) works okay.
11793 fflushNULL="$define"
11796 Your fflush(NULL) isn't working (contrary to ANSI C).
11798 fflushNULL="$undef"
11801 Cannot figure out whether your fflush(NULL) works or not.
11802 I'm assuming it doesn't (contrary to ANSI C).
11804 fflushNULL="$undef"
11808 $define|true|[yY]*)
11809 fflushNULL="$define"
11812 fflushNULL="$undef"
11815 : check explicit looping only if NULL did not work
11816 case "$fflushNULL" in
11818 : check for fflush all behaviour
11819 case "$fflushall" in
11820 '') set try -DTRY_FFLUSH_ALL $output
11821 if eval $compile; then
11823 (Now testing the other method--but note that also this may fail.)
11826 ./try$exe_ext 2>/dev/null
11827 if $test -s try.out -a "X$?" = X42; then
11828 fflushall="`$cat try.out`"
11831 $rm -f core try.core core.try.*
11832 case "$fflushall" in
11834 Whew. Flushing explicitly all the stdio streams works.
11836 fflushall="$define"
11839 Sigh. Flushing explicitly all the stdio streams doesn't work.
11844 Cannot figure out whether flushing stdio streams explicitly works or not.
11845 I'm assuming it doesn't.
11851 "$define"|true|[yY]*)
11852 fflushall="$define"
11859 *) fflushall="$undef"
11862 case "$fflushNULL$fflushall" in
11865 I cannot figure out how to flush pending stdio output.
11869 $rm -f try.* try$exe_ext
11871 : Store the full pathname to the ar program for use in the C program
11872 : Respect a hint or command line value for full_ar.
11877 : Store the full pathname to the sed program for use in the C program
11880 : see what type gids are declared as in the kernel
11882 echo "Looking for the type for group ids returned by getgid()."
11883 set gid_t gidtype xxx stdio.h sys/types.h
11887 xxx=`./findhdr sys/user.h`
11888 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11890 unsigned) dflt="$1 $2" ;;
11894 *) dflt="$gidtype";;
11897 gid_t) echo "gid_t found." ;;
11898 *) rp="What is the type for group ids returned by getgid()?"
11906 *_t) zzz="$gidtype" ;;
11909 echo "Checking the size of $zzz..." >&4
11911 #include <sys/types.h>
11914 printf("%d\n", (int)sizeof($gidtype));
11919 if eval $compile_ok; then
11923 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11926 echo "Your $zzz size is $gidsize bytes."
11931 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11937 *_t) zzz="$gidtype" ;;
11940 echo "Checking the sign of $zzz..." >&4
11942 #include <sys/types.h>
11953 if eval $compile; then
11957 echo "(I can't execute the test program--guessing unsigned.)" >&4
11961 1) echo "Your $zzz is unsigned." ;;
11962 -1) echo "Your $zzz is signed." ;;
11968 echo "(I can't compile the test program--guessing unsigned.)" >&4
11972 : check for length of character
11974 case "$charsize" in
11976 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11977 $cat >try.c <<'EOCP'
11981 printf("%d\n", (int)sizeof(char));
11986 if eval $compile_ok; then
11990 echo "(I can't seem to compile the test program. Guessing...)"
11997 rp="What is the size of a character (in bytes)?"
12004 $echo "Choosing the C types to be used for Perl's internal types..." >&4
12006 case "$use64bits:$d_quad:$quadtype" in
12009 uvtype="$uquadtype"
12014 uvtype="unsigned long"
12020 case "$uselongdouble:$d_longdbl" in
12022 nvtype="long double"
12023 nvsize=$longdblsize
12030 echo "(IV will be "$ivtype", $ivsize bytes)"
12031 echo "(UV will be "$uvtype", $uvsize bytes)"
12032 echo "(NV will be "$nvtype", $nvsize bytes)"
12035 #$i_inttypes I_INTTYPES
12037 #include <inttypes.h>
12042 int8_t i = INT8_MAX;
12043 uint8_t u = UINT8_MAX;
12044 printf("int8_t\n");
12047 int16_t i = INT16_MAX;
12048 uint16_t i = UINT16_MAX;
12049 printf("int16_t\n");
12052 int32_t i = INT32_MAX;
12053 uint32_t u = UINT32_MAX;
12054 printf("int32_t\n");
12060 '') case "$charsize" in
12062 u8type="unsigned char"
12071 if eval $compile; then
12072 case "`./try$exe_ext`" in
12073 int8_t) i8type=int8_t
12083 '') if $test $charsize -ge 1; then
12085 u8type="unsigned char"
12093 '') case "$shortsize" in
12095 u16type="unsigned short"
12103 '') set try -DINT16
12104 if eval $compile; then
12105 case "`./try$exe_ext`" in
12117 '') if $test $shortsize -ge 2; then
12119 u16type="unsigned short"
12127 '') case "$longsize" in
12129 u32type="unsigned long"
12133 *) case "$intsize" in
12135 u32type="unsigned int"
12145 '') set try -DINT32
12146 if eval $compile; then
12147 case "`./try$exe_ext`" in
12159 '') if $test $intsize -ge 4; then
12161 u32type="unsigned int"
12169 '') case "$d_quad:$quadtype" in
12171 i64type="$quadtype"
12172 u64type="$uquadtype"
12184 if $test X"$quadtype" != X; then
12186 echo "Checking how to print 64-bit integers..." >&4
12188 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12189 $cat >try.c <<'EOCP'
12190 #include <sys/types.h>
12193 int q = 12345678901;
12194 printf("%ld\n", q);
12198 if eval $compile; then
12199 yyy=`./try$exe_ext`
12202 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12203 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12204 echo "We will use %d."
12210 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12211 $cat >try.c <<'EOCP'
12212 #include <sys/types.h>
12215 long q = 12345678901;
12216 printf("%ld\n", q);
12220 if eval $compile; then
12221 yyy=`./try$exe_ext`
12224 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12225 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12226 echo "We will use %ld."
12232 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12233 $cat >try.c <<'EOCP'
12234 #include <sys/types.h>
12235 #include <inttypes.h>
12238 int64_t q = 12345678901;
12239 printf("%" PRId64 "\n", q);
12243 if eval $compile; then
12244 yyy=`./try$exe_ext`
12247 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12248 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12249 echo "We will use the C9X style."
12255 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12256 $cat >try.c <<'EOCP'
12257 #include <sys/types.h>
12260 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12261 printf("%lld\n", q);
12265 if eval $compile; then
12266 yyy=`./try$exe_ext`
12269 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12270 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12271 echo "We will use the %lld style."
12277 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12279 #include <sys/types.h>
12282 $quadtype q = 12345678901;
12283 printf("%Ld\n", q);
12287 if eval $compile; then
12288 yyy=`./try$exe_ext`
12291 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12292 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12293 echo "We will use %Ld."
12299 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12301 #include <sys/types.h>
12304 $quadtype q = 12345678901;
12305 printf("%qd\n", q);
12309 if eval $compile; then
12310 yyy=`./try$exe_ext`
12313 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12314 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12315 echo "We will use %qd."
12321 if $test X"$sPRId64" = X; then
12322 echo "Cannot figure out how to print 64-bit integers." >&4
12330 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12331 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12333 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12334 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12340 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12342 if $test X"$ivsize" = X8; then
12343 ivdformat="$sPRId64"
12344 uvuformat="$sPRIu64"
12345 uvoformat="$sPRIo64"
12346 uvxformat="$sPRIx64"
12348 if $test X"$ivsize" = X"$longsize"; then
12354 if $test X"$ivsize" = X"$intsize"; then
12361 if $test X"$ivsize" = X"$shortsize"; then
12371 case "$ivdformat" in
12372 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12379 $echo "Checking the format string to be used for gids..." >&4
12382 -1) if $test X"$gidsize" = X"$ivsize"; then
12383 gidformat="$ivdformat"
12385 if $test X"$gidsize" = X"$longsize"; then
12388 if $test X"$gidsize" = X"$intsize"; then
12391 if $test X"$gidsize" = X"$shortsize"; then
12398 *) if $test X"$gidsize" = X"$uvsize"; then
12399 gidformat="$uvuformat"
12401 if $test X"$gidsize" = X"$longsize"; then
12404 if $test X"$gidsize" = X"$intsize"; then
12407 if $test X"$gidsize" = X"$shortsize"; then
12416 : see if getgroups exists
12417 set getgroups d_getgrps
12420 : see if setgroups exists
12421 set setgroups d_setgrps
12425 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12427 case "$d_getgrps$d_setgrps" in
12429 case "$groupstype" in
12430 '') dflt="$gidtype" ;;
12431 *) dflt="$groupstype" ;;
12434 What type of pointer is the second argument to getgroups() and setgroups()?
12435 Usually this is the same as group ids, $gidtype, but not always.
12438 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12442 *) groupstype="$gidtype";;
12446 echo "Checking if your $make program sets \$(MAKE)..." >&4
12447 case "$make_set_make" in
12449 $sed 's/^X //' > testmake.mak << 'EOF'
12451 X @echo 'maketemp="$(MAKE)"'
12453 case "`$make -f testmake.mak 2>/dev/null`" in
12454 *maketemp=*) make_set_make='#' ;;
12455 *) make_set_make="MAKE=$make" ;;
12457 $rm -f testmake.mak
12460 case "$make_set_make" in
12461 '#') echo "Yup, it does.";;
12462 *) echo "Nope, it doesn't.";;
12465 : see what type is used for mode_t
12466 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12467 set mode_t modetype int stdio.h sys/types.h
12470 : define a fucntion to check prototypes
12471 $cat > protochk <<EOSH
12474 optimize="$optimize"
12476 prototype="$prototype"
12481 $cat >> protochk <<'EOSH'
12486 while test $# -ge 2; do
12488 $define) echo "#include <$2>" >> try.c ;;
12489 literal) echo "$2" >> try.c ;;
12493 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12494 cat >> try.c <<'EOCP'
12495 #ifdef CAN_PROTOTYPE
12496 #define _(args) args
12501 echo "$foo" >> try.c
12502 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12503 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12509 $eunicefix protochk
12511 : see what type is used for size_t
12512 rp="What is the type used for the length parameter for string functions?"
12513 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12516 : check for type of arguments to gethostbyaddr.
12517 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12518 case "$d_gethbyaddr" in
12522 Checking to see what type of arguments are accepted by gethostbyaddr().
12524 hdrs="$define sys/types.h
12525 $d_socket sys/socket.h
12526 $i_niin netinet/in.h
12528 $i_unistd unistd.h"
12529 : The first arg can 'char *' or 'void *'
12530 : The second arg is some of integral type
12531 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12532 for yyy in size_t long int; do
12533 case "$netdb_host_type" in
12534 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12535 if ./protochk "$try" $hdrs; then
12536 echo "Your system accepts $xxx for the first arg."
12537 echo "...and $yyy for the second arg."
12538 netdb_host_type="$xxx"
12539 netdb_hlen_type="$yyy"
12545 : In case none of those worked, prompt the user.
12546 case "$netdb_host_type" in
12547 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12550 netdb_host_type=$ans
12551 rp='What is the type for the 2nd argument to gethostbyaddr?'
12554 netdb_hlen_type=$ans
12558 *) : no gethostbyaddr, so pick harmless defaults
12559 netdb_host_type='char *'
12560 netdb_hlen_type="$sizetype"
12563 # Remove the "const" if needed. -- but then we'll have a
12565 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12568 : check for type of argument to gethostbyname.
12569 if test "X$netdb_name_type" = X ; then
12570 case "$d_gethbyname" in
12574 Checking to see what type of argument is accepted by gethostbyname().
12576 hdrs="$define sys/types.h
12577 $d_socket sys/socket.h
12578 $i_niin netinet/in.h
12580 $i_unistd unistd.h"
12581 for xxx in "const char *" "char *"; do
12582 case "$netdb_name_type" in
12583 '') try="extern struct hostent *gethostbyname($xxx);"
12584 if ./protochk "$try" $hdrs; then
12585 echo "Your system accepts $xxx."
12586 netdb_name_type="$xxx"
12591 : In case none of those worked, prompt the user.
12592 case "$netdb_name_type" in
12593 '') rp='What is the type for the 1st argument to gethostbyname?'
12596 netdb_name_type=$ans
12600 *) : no gethostbyname, so pick harmless default
12601 netdb_name_type='char *'
12606 : check for type of 1st argument to getnetbyaddr.
12607 if test "X$netdb_net_type" = X ; then
12608 case "$d_getnbyaddr" in
12612 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12614 hdrs="$define sys/types.h
12615 $d_socket sys/socket.h
12616 $i_niin netinet/in.h
12618 $i_unistd unistd.h"
12619 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12620 case "$netdb_net_type" in
12621 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12622 if ./protochk "$try" $hdrs; then
12623 echo "Your system accepts $xxx."
12624 netdb_net_type="$xxx"
12629 : In case none of those worked, prompt the user.
12630 case "$netdb_net_type" in
12631 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12634 netdb_net_type=$ans
12638 *) : no getnetbyaddr, so pick harmless default
12639 netdb_net_type='long'
12643 : locate the preferred pager for this system
12657 '') dflt=/usr/ucb/more;;
12664 rp='What pager is used on your system?'
12668 : see what type pids are declared as in the kernel
12669 rp="What is the type of process ids on this system?"
12670 set pid_t pidtype int stdio.h sys/types.h
12673 : Find earliest binary compatible site_perl subdirectory perl can use.
12674 case "$bincompat5005" in
12675 "$define") xs_apiversion='5.005' ;;
12676 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12678 : Find earliest pure perl site_perl subdirectory perl can use.
12679 : The versioned directories started at 5.005.
12680 pm_apiversion='5.005'
12682 : check for length of pointer
12686 $echo $n "Checking to see how big your pointers are...$c" >&4
12687 if test "$voidflags" -gt 7; then
12688 echo '#define VOID_PTR char *' > try.c
12690 echo '#define VOID_PTR void *' > try.c
12692 $cat >>try.c <<'EOCP'
12696 printf("%d\n", (int)sizeof(VOID_PTR));
12701 if eval $compile_ok; then
12703 $echo " $ptrsize bytes." >&4
12706 echo "(I can't seem to compile the test program. Guessing...)" >&4
12707 rp="What is the size of a pointer (in bytes)?"
12715 : see if ar generates random libraries by itself
12717 echo "Checking how to generate random libraries on your machine..." >&4
12718 echo 'int bar1() { return bar2(); }' > bar1.c
12719 echo 'int bar2() { return 2; }' > bar2.c
12720 $cat > foo.c <<'EOP'
12721 int main() { printf("%d\n", bar1()); exit(0); }
12723 $cc $ccflags -c bar1.c >/dev/null 2>&1
12724 $cc $ccflags -c bar2.c >/dev/null 2>&1
12725 $cc $ccflags -c foo.c >/dev/null 2>&1
12726 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12727 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12728 ./foobar >/dev/null 2>&1; then
12729 echo "$ar appears to generate random libraries itself."
12732 elif $ar ts bar$_a >/dev/null 2>&1 &&
12733 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12734 ./foobar >/dev/null 2>&1; then
12735 echo "a table of contents needs to be added with '$ar ts'."
12742 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12743 $test -f $ranlib || ranlib=''
12746 if $test -n "$ranlib"; then
12747 echo "your system has '$ranlib'; we'll use that."
12750 echo "your system doesn't seem to support random libraries"
12751 echo "so we'll use lorder and tsort to order the libraries."
12758 : check for type of arguments to select.
12759 case "$selecttype" in
12760 '') case "$d_select" in
12763 Checking to see what type of arguments are accepted by select().
12765 hdrs="$define sys/types.h
12766 $i_systime sys/time.h
12767 $i_sysselct sys/select.h
12768 $d_socket sys/socket.h"
12769 : The first arg can be int, unsigned, or size_t
12770 : The last arg may or may not be 'const'
12772 : void pointer has been seen but using that
12773 : breaks the selectminbits test
12774 for xxx in 'fd_set *' 'int *'; do
12775 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12776 for tmo in 'struct timeval *' 'const struct timeval *'; do
12778 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12779 if ./protochk "$try" $hdrs; then
12780 echo "Your system accepts $xxx."
12789 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12790 case "$d_fd_set" in
12791 $define) dflt="fd_set *" ;;
12800 *) : no select, so pick a harmless default
12807 : check for the select 'width'
12808 case "$selectminbits" in
12809 '') case "$d_select" in
12813 Checking to see on how many bits at a time your select() operates...
12816 #include <sys/types.h>
12818 #$i_systime I_SYS_TIME
12819 #$i_systimek I_SYS_TIME_KERNEL
12824 # ifdef I_SYS_TIME_KERNEL
12827 # include <sys/time.h>
12828 # ifdef I_SYS_TIME_KERNEL
12832 #$i_sysselct I_SYS_SELECT
12833 #ifdef I_SYS_SELECT
12834 #include <sys/select.h>
12836 #$d_socket HAS_SOCKET
12838 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12842 #define S sizeof(*(b))
12844 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12845 #define NBITS (NBYTES * 8)
12854 fp = fopen("try.c", "r");
12860 b = ($selecttype)s;
12861 for (i = 0; i < NBITS; i++)
12865 select(fd + 1, b, 0, 0, &t);
12866 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12867 printf("%d\n", i + 1);
12872 if eval $compile_ok; then
12873 selectminbits=`./try`
12874 case "$selectminbits" in
12876 Cannot figure out on how many bits at a time your select() operates.
12877 I'll play safe and guess it is 32 bits.
12883 *) bits="$selectminbits bits" ;;
12885 echo "Your select() operates on $bits at a time." >&4
12887 rp='What is the minimum number of bits your select() operates on?'
12888 case "$byteorder" in
12889 1234|12345678) dflt=32 ;;
12894 selectminbits="$val"
12898 *) : no select, so pick a harmless default
12905 : Trace out the files included by signal.h, then look for SIGxxx names.
12906 : Remove SIGARRAYSIZE used by HPUX.
12907 : Remove SIGSTKSIZE used by Linux.
12908 : Remove SIGSTKSZ used by Posix.
12909 : Remove SIGTYP void lines used by OS2.
12910 : Some cpps, like os390, dont give the file name anywhere
12911 if [ "X$fieldn" = X ]; then
12912 : Just make some guesses. We check them later.
12913 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
12915 xxx=`echo '#include <signal.h>' |
12916 $cppstdin $cppminus $cppflags 2>/dev/null |
12917 $grep '^[ ]*#.*include' |
12918 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12920 : Check this list of files to be sure we have parsed the cpp output ok.
12921 : This will also avoid potentially non-existent files, such
12924 for xx in $xxx /dev/null ; do
12925 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12927 : If we have found no files, at least try signal.h
12928 case "$xxxfiles" in
12929 '') xxxfiles=`./findhdr signal.h` ;;
12932 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12933 print substr($2, 4, 20)
12935 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12936 print substr($3, 4, 20)
12938 : Append some common names just in case the awk scan failed.
12939 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
12940 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
12941 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
12942 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
12943 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
12945 : generate a few handy files for later
12946 $cat > signal.c <<'EOCP'
12947 #include <sys/types.h>
12948 #include <signal.h>
12952 /* Strange style to avoid deeply-nested #if/#else/#endif */
12955 # define NSIG (_NSIG)
12961 # define NSIG (SIGMAX+1)
12967 # define NSIG (SIG_MAX+1)
12973 # define NSIG (MAXSIG+1)
12979 # define NSIG (MAX_SIG+1)
12984 # ifdef SIGARRAYSIZE
12985 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12991 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12995 /* Default to some arbitrary number that's big enough to get most
12996 of the common signals.
13002 printf("NSIG %d\n", NSIG);
13008 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13010 printf "#ifdef SIG"; printf $1; printf "\n"
13011 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13012 printf $1; printf ");\n"
13016 printf "#endif /* JUST_NSIG */\n";
13017 printf "exit(0);\n}\n";
13020 $cat >signal.awk <<'EOP'
13021 BEGIN { ndups = 0 }
13022 $1 ~ /^NSIG$/ { nsig = $2 }
13023 ($1 !~ /^NSIG$/) && (NF == 2) {
13024 if ($2 > maxsig) { maxsig = $2 }
13025 if (sig_name[$2]) {
13026 dup_name[ndups] = $1
13027 dup_num[ndups] = $2
13039 printf("NSIG %d\n", nsig);
13040 for (n = 1; n < nsig; n++) {
13042 printf("%s %d\n", sig_name[n], sig_num[n])
13045 printf("NUM%d %d\n", n, n)
13048 for (n = 0; n < ndups; n++) {
13049 printf("%s %d\n", dup_name[n], dup_num[n])
13053 $cat >signal_cmd <<EOS
13055 if $test -s signal.lst; then
13056 echo "Using your existing signal.lst file"
13061 $cat >>signal_cmd <<'EOS'
13064 if eval $compile_ok; then
13065 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13067 echo "(I can't seem be able to compile the whole test program)" >&4
13068 echo "(I'll try it in little pieces.)" >&4
13069 set signal -DJUST_NSIG
13070 if eval $compile_ok; then
13071 ./signal$_exe > signal.nsg
13074 echo "I can't seem to figure out how many signals you have." >&4
13075 echo "Guessing 50." >&4
13076 echo 'NSIG 50' > signal.nsg
13078 : Now look at all the signal names, one at a time.
13079 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13080 $cat > signal.c <<EOCP
13081 #include <sys/types.h>
13082 #include <signal.h>
13085 printf("$xx %d\n", SIG${xx});
13090 if eval $compile; then
13091 echo "SIG${xx} found."
13092 ./signal$_exe >> signal.ls1
13094 echo "SIG${xx} NOT found."
13097 if $test -s signal.ls1; then
13098 $cat signal.nsg signal.ls1 |
13099 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13103 if $test -s signal.lst; then
13106 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13107 echo 'kill -l' >signal
13108 set X `csh -f <signal`
13112 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13114 echo $@ | $tr ' ' $trnl | \
13115 $awk '{ printf "%s %d\n", $1, ++s; }
13116 END { printf "NSIG %d\n", ++s }' >signal.lst
13118 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13120 chmod a+x signal_cmd
13121 $eunicefix signal_cmd
13123 : generate list of signal names
13125 case "$sig_name_init" in
13127 *) case "$sig_num_init" in
13128 ''|*,*) doinit=yes ;;
13133 echo "Generating a list of signal names and numbers..." >&4
13135 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13136 sig_name=`$awk 'BEGIN { printf "ZERO " }
13137 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13138 sig_num=`$awk 'BEGIN { printf "0 " }
13139 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13140 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13141 !/^NSIG/ { printf "\"%s\", ", $1 }
13142 END { printf "0\n" }' signal.lst`
13143 sig_num_init=`$awk 'BEGIN { printf "0, " }
13144 !/^NSIG/ { printf "%d, ", $2}
13145 END { printf "0\n"}' signal.lst`
13148 echo "The following $sig_count signals are available:"
13150 echo $sig_name | $awk \
13151 'BEGIN { linelen = 0 }
13153 for (i = 1; i <= NF; i++) {
13154 name = "SIG" $i " "
13155 linelen = linelen + length(name)
13156 if (linelen > 70) {
13158 linelen = length(name)
13164 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13166 : see what type is used for signed size_t
13167 set ssize_t ssizetype int stdio.h sys/types.h
13170 $cat > ssize.c <<EOM
13172 #include <sys/types.h>
13173 #define Size_t $sizetype
13174 #define SSize_t $dflt
13177 if (sizeof(Size_t) == sizeof(SSize_t))
13179 else if (sizeof(Size_t) == sizeof(int))
13188 if eval $compile_ok && ./ssize > /dev/null; then
13189 ssizetype=`./ssize`
13190 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13193 Help! I can't compile and run the ssize_t test program: please enlighten me!
13194 (This is probably a misconfiguration in your system or libraries, and
13195 you really ought to fix it. Still, I'll try anyway.)
13197 I need a type that is the same size as $sizetype, but is guaranteed to
13198 be signed. Common values are ssize_t, int and long.
13201 rp="What signed type is the same size as $sizetype?"
13205 $rm -f ssize ssize.*
13207 : see what type of char stdio uses.
13209 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13210 echo "Your stdio uses unsigned chars." >&4
13211 stdchar="unsigned char"
13213 echo "Your stdio uses signed chars." >&4
13217 : see if time exists
13219 if test "X$d_time" = X -o X"$timetype" = X; then
13220 if set time val -f d_time; eval $csym; $val; then
13221 echo 'time() found.' >&4
13223 rp="What is the type returned by time() on this system?"
13224 set time_t timetype long stdio.h sys/types.h
13227 echo 'time() not found, hope that will do.' >&4
13235 : see what type uids are declared as in the kernel
13237 echo "Looking for the type for user ids returned by getuid()."
13238 set uid_t uidtype xxx stdio.h sys/types.h
13242 xxx=`./findhdr sys/user.h`
13243 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13245 unsigned) dflt="$1 $2" ;;
13249 *) dflt="$uidtype";;
13252 uid_t) echo "uid_t found." ;;
13253 *) rp="What is the type for user ids returned by getuid()?"
13261 *_t) zzz="$uidtype" ;;
13264 echo "Checking the size of $zzz..." >&4
13266 #include <sys/types.h>
13269 printf("%d\n", (int)sizeof($uidtype));
13274 if eval $compile_ok; then
13278 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13281 echo "Your $zzz size is $uidsize bytes."
13286 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13291 *_t) zzz="$uidtype" ;;
13294 echo "Checking the sign of $zzz..." >&4
13296 #include <sys/types.h>
13307 if eval $compile; then
13311 echo "(I can't execute the test program--guessing unsigned.)" >&4
13315 1) echo "Your $zzz is unsigned." ;;
13316 -1) echo "Your $zzz is signed." ;;
13322 echo "(I can't compile the test program--guessing unsigned.)" >&4
13328 $echo "Checking the format string to be used for uids..." >&4
13331 -1) if $test X"$uidsize" = X"$ivsize"; then
13332 uidformat="$ivdformat"
13334 if $test X"$uidsize" = X"$longsize"; then
13337 if $test X"$uidsize" = X"$intsize"; then
13340 if $test X"$uidsize" = X"$shortsize"; then
13347 *) if $test X"$uidsize" = X"$uvsize"; then
13348 uidformat="$uvuformat"
13350 if $test X"$uidsize" = X"$longsize"; then
13353 if $test X"$uidsize" = X"$intsize"; then
13356 if $test X"$uidsize" = X"$shortsize"; then
13365 : see if dbm.h is available
13366 : see if dbmclose exists
13367 set dbmclose d_dbmclose
13370 case "$d_dbmclose" in
13380 *) set rpcsvc/dbm.h i_rpcsvcdbm
13385 *) echo "We won't be including <dbm.h>"
13395 : see if this is a sys/file.h system
13400 : do we need to include sys/file.h ?
13404 if $h_sysfile; then
13406 echo "We'll be including <sys/file.h>." >&4
13409 echo "We won't be including <sys/file.h>." >&4
13419 : see if fcntl.h is there
13424 : see if we can include fcntl.h
13430 echo "We'll be including <fcntl.h>." >&4
13433 if $h_sysfile; then
13434 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13436 echo "We won't be including <fcntl.h>." >&4
13448 : see if locale.h is available
13449 set locale.h i_locale
13452 : see if mach cthreads are available
13453 if test "X$usethreads" = "X$define"; then
13454 set mach/cthreads.h i_machcthr
13457 i_machcthr="$undef"
13462 : see if this is a math.h system
13466 : see if this is a mntent.h system
13467 set mntent.h i_mntent
13470 : see if ndbm.h is available
13475 : see if dbm_open exists
13476 set dbm_open d_dbm_open
13478 case "$d_dbm_open" in
13481 echo "We won't be including <ndbm.h>"
13490 : see if net/errno.h is available
13492 set net/errno.h val
13495 : Unfortunately, it causes problems on some systems. Arrgh.
13498 cat > try.c <<'EOM'
13501 #include <net/errno.h>
13507 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13508 echo "We'll be including <net/errno.h>." >&4
13510 echo "We won't be including <net/errno.h>." >&4
13519 : see if netinet/tcp.h is available
13520 set netinet/tcp.h i_netinettcp
13523 : see if this is a poll.h system
13527 : get C preprocessor symbols handy
13529 $echo $n "Hmm... $c"
13530 echo $al | $tr ' ' $trnl >Cppsym.know
13531 $cat <<EOSS >Cppsym
13539 case "\$list\$#" in
13542 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13544 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13547 unknown="\$unknown \$sym"
13557 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13559 exit 0; _ _ _ _\1\\ \1\\
13562 echo "exit 1; _ _ _" >>Cppsym\$\$
13563 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13565 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13571 $rm -f Cppsym\$\$ Cppsym2\$\$
13576 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13578 : now check the C compiler for additional symbols
13579 postprocess_cc_v=''
13581 aix) postprocess_cc_v="|$tr , ' '" ;;
13588 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13591 -D*) echo "\$i" | $sed 's/^-D//';;
13592 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13597 postprocess_cc_v=''
13600 ./ccsym > ccsym1.raw
13601 if $test -s ccsym1.raw; then
13602 $sort ccsym1.raw | $uniq >ccsym.raw
13604 mv ccsym1.raw ccsym.raw
13607 $awk '/\=/ { print $0; next }
13608 { print $0"=1" }' ccsym.raw >ccsym.list
13609 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13610 $comm -13 ccsym.true ccsym.list >ccsym.own
13611 $comm -12 ccsym.true ccsym.list >ccsym.com
13612 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13614 if $test -z ccsym.raw; then
13615 echo "Your C compiler doesn't seem to define any symbols!" >&4
13617 echo "However, your C preprocessor defines the following symbols:"
13620 cppsymbols=`$cat Cppsym.true`
13621 cppsymbols=`echo $cppsymbols`
13622 cppccsymbols="$cppsymbols"
13624 if $test -s ccsym.com; then
13625 echo "Your C compiler and pre-processor define these symbols:"
13626 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13629 cppccsymbols=`$cat ccsym.com`
13630 cppccsymbols=`echo $cppccsymbols`
13631 $test "$silent" || sleep 1
13633 if $test -s ccsym.cpp; then
13634 $test "$also" && echo " "
13635 echo "Your C pre-processor ${also}defines the following symbols:"
13636 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13638 cppsymbols=`$cat ccsym.cpp`
13639 cppsymbols=`echo $cppsymbols`
13640 $test "$silent" || sleep 1
13642 if $test -s ccsym.own; then
13643 $test "$also" && echo " "
13644 echo "Your C compiler ${also}defines the following cpp symbols:"
13645 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13646 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13647 ccsymbols=`$cat ccsym.own`
13648 ccsymbols=`echo $ccsymbols`
13649 $test "$silent" || sleep 1
13654 : see if this is a termio system
13658 if $test `./findhdr termios.h`; then
13659 set tcsetattr i_termios
13665 "$define") echo "You have POSIX termios.h... good!" >&4;;
13666 *) if ./Cppsym pyr; then
13667 case "`/bin/universe`" in
13668 ucb) if $test `./findhdr sgtty.h`; then
13670 echo "<sgtty.h> found." >&4
13672 echo "System is pyramid with BSD universe."
13673 echo "<sgtty.h> not found--you could have problems." >&4
13675 *) if $test `./findhdr termio.h`; then
13677 echo "<termio.h> found." >&4
13679 echo "System is pyramid with USG universe."
13680 echo "<termio.h> not found--you could have problems." >&4
13684 if $test `./findhdr termio.h`; then
13685 echo "<termio.h> found." >&4
13687 elif $test `./findhdr sgtty.h`; then
13688 echo "<sgtty.h> found." >&4
13691 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13694 if $test `./findhdr sgtty.h`; then
13695 echo "<sgtty.h> found." >&4
13697 elif $test `./findhdr termio.h`; then
13698 echo "<termio.h> found." >&4
13701 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13705 set i_termio; eval $setvar
13706 val=$val2; set i_sgtty; eval $setvar
13707 val=$val3; set i_termios; eval $setvar
13709 : see if this is a shadow.h system
13710 set shadow.h i_shadow
13713 : see if this is a socks.h system
13714 set socks.h i_socks
13717 : see if stdarg is available
13719 if $test `./findhdr stdarg.h`; then
13720 echo "<stdarg.h> found." >&4
13723 echo "<stdarg.h> NOT found." >&4
13727 : see if varags is available
13729 if $test `./findhdr varargs.h`; then
13730 echo "<varargs.h> found." >&4
13732 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13735 : set up the varargs testing programs
13736 $cat > varargs.c <<EOP
13738 #include <stdarg.h>
13741 #include <varargs.h>
13745 int f(char *p, ...)
13759 p = va_arg(ap, char *);
13764 $cat > varargs <<EOP
13766 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13775 : now check which varargs header should be included
13780 if `./varargs I_STDARG`; then
13782 elif `./varargs I_VARARGS`; then
13787 if `./varargs I_VARARGS`; then
13794 echo "I could not find the definition for va_dcl... You have problems..." >&4
13795 val="$undef"; set i_stdarg; eval $setvar
13796 val="$undef"; set i_varargs; eval $setvar
13801 case "$i_varhdr" in
13803 val="$define"; set i_stdarg; eval $setvar
13804 val="$undef"; set i_varargs; eval $setvar
13807 val="$undef"; set i_stdarg; eval $setvar
13808 val="$define"; set i_varargs; eval $setvar
13811 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13815 : see if stddef is available
13816 set stddef.h i_stddef
13819 : see if sys/access.h is available
13820 set sys/access.h i_sysaccess
13823 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13824 set sys/filio.h i_sysfilio
13827 if $test `./findhdr sys/ioctl.h`; then
13829 echo '<sys/ioctl.h> found.' >&4
13832 if $test $i_sysfilio = "$define"; then
13833 echo '<sys/ioctl.h> NOT found.' >&4
13835 $test $i_sgtty = "$define" && xxx="sgtty.h"
13836 $test $i_termio = "$define" && xxx="termio.h"
13837 $test $i_termios = "$define" && xxx="termios.h"
13838 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13844 : see if sys/resource.h has to be included
13845 set sys/resource.h i_sysresrc
13848 : see if sys/security.h is available
13849 set sys/security.h i_syssecrt
13852 : see if this is a sys/statvfs.h system
13853 set sys/statvfs.h i_sysstatvfs
13856 : see if this is a sys/uio.h system
13857 set sys/uio.h i_sysuio
13860 : see if this is a sys/un.h system
13861 set sys/un.h i_sysun
13864 : see if this is a syswait system
13865 set sys/wait.h i_syswait
13868 : see if this is a ustat.h system
13869 set ustat.h i_ustat
13872 : see if this is an utime system
13873 set utime.h i_utime
13876 : see if this is a values.h system
13877 set values.h i_values
13880 : see if this is a vfork system
13883 set vfork.h i_vfork
13891 : see if gdbm.h is available
13896 : see if gdbm_open exists
13897 set gdbm_open d_gdbm_open
13899 case "$d_gdbm_open" in
13902 echo "We won't be including <gdbm.h>"
13912 echo "Looking for extensions..." >&4
13913 : If we are using the old config.sh, known_extensions may contain
13914 : old or inaccurate or duplicate values.
13915 known_extensions=''
13916 nonxs_extensions=''
13917 : We do not use find because it might not be available.
13918 : We do not just use MANIFEST because the user may have dropped
13919 : some additional extensions into the source tree and expect them
13922 : Function to recursively find available extensions, ignoring DynaLoader
13923 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13927 DynaLoader|dynaload) ;;
13929 if $test -f $xxx/$xxx.xs; then
13930 known_extensions="$known_extensions $1$xxx";
13931 elif $test -f $xxx/Makefile.PL; then
13932 nonxs_extensions="$nonxs_extensions $1$xxx";
13934 if $test -d $xxx -a $# -lt 10; then
13937 eval $find_extensions;
13949 eval $find_extensions
13950 set X $nonxs_extensions
13952 nonxs_extensions="$*"
13953 set X $known_extensions
13955 known_extensions="$*"
13958 : Now see which are supported on this system.
13960 for xxx in $known_extensions ; do
13964 $define) avail_ext="$avail_ext $xxx" ;;
13967 GDBM_File|gdbm_fil)
13969 $define) avail_ext="$avail_ext $xxx" ;;
13972 NDBM_File|ndbm_fil)
13974 $define) avail_ext="$avail_ext $xxx" ;;
13977 ODBM_File|odbm_fil)
13978 case "${i_dbm}${i_rpcsvcdbm}" in
13979 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13983 case "$useposix" in
13984 true|define|y) avail_ext="$avail_ext $xxx" ;;
13988 case "$useopcode" in
13989 true|define|y) avail_ext="$avail_ext $xxx" ;;
13993 case "$d_socket" in
13994 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13998 case "$usethreads" in
13999 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14003 : XXX Do we need a useipcsysv variable here
14004 case "${d_msg}${d_sem}${d_shm}" in
14005 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14008 *) avail_ext="$avail_ext $xxx"
14017 : Now see which nonxs extensions are supported on this system.
14018 : For now assume all are.
14020 for xxx in $nonxs_extensions ; do
14022 *) nonxs_ext="$nonxs_ext $xxx"
14034 A number of extensions are supplied with $package. You may choose to
14035 compile these extensions for dynamic loading (the default), compile
14036 them into the $package executable (static loading), or not include
14037 them at all. Answer "none" to include no extensions.
14038 Note that DynaLoader is always built and need not be mentioned here.
14041 case "$dynamic_ext" in
14042 '') dflt="$avail_ext" ;;
14043 *) dflt="$dynamic_ext"
14044 # Perhaps we are reusing an old out-of-date config.sh.
14047 if test X"$dynamic_ext" != X"$avail_ext"; then
14049 NOTICE: Your previous config.sh list may be incorrect.
14050 The extensions now available to you are
14052 but the default list from your previous config.sh is
14064 rp="What extensions do you wish to load dynamically?"
14067 none) dynamic_ext=' ' ;;
14068 *) dynamic_ext="$ans" ;;
14071 case "$static_ext" in
14073 : Exclude those already listed in dynamic linking
14075 for xxx in $avail_ext; do
14076 case " $dynamic_ext " in
14078 *) dflt="$dflt $xxx" ;;
14085 *) dflt="$static_ext"
14092 rp="What extensions do you wish to load statically?"
14095 none) static_ext=' ' ;;
14096 *) static_ext="$ans" ;;
14101 A number of extensions are supplied with $package. Answer "none"
14102 to include no extensions.
14103 Note that DynaLoader is always built and need not be mentioned here.
14106 case "$static_ext" in
14107 '') dflt="$avail_ext" ;;
14108 *) dflt="$static_ext"
14109 # Perhaps we are reusing an old out-of-date config.sh.
14112 if test X"$static_ext" != X"$avail_ext"; then
14114 NOTICE: Your previous config.sh list may be incorrect.
14115 The extensions now available to you are
14117 but the default list from your previous config.sh is
14126 : Exclude those that are not xs extensions
14130 rp="What extensions do you wish to include?"
14133 none) static_ext=' ' ;;
14134 *) static_ext="$ans" ;;
14139 set X $dynamic_ext $static_ext $nonxs_ext
14143 : Remove build directory name from cppstdin so it can be used from
14144 : either the present location or the final installed location.
14146 : Get out of the UU directory to get correct path name.
14148 case "$cppstdin" in
14150 echo "Stripping down cppstdin path name"
14156 : end of configuration questions
14158 echo "End of configuration questions."
14161 : back to where it started
14162 if test -d ../UU; then
14166 : configuration may be patched via a 'config.over' file
14167 if $test -f config.over; then
14170 rp='I see a config.over file. Do you wish to load it?'
14173 n*) echo "OK, I'll ignore it.";;
14175 echo "Configuration override changes have been loaded."
14180 : in case they want portability, strip down executable paths
14181 case "$d_portable" in
14184 echo "Stripping down executable paths..." >&4
14185 for file in $loclist $trylist; do
14187 eval $file=`basename $temp`
14192 : create config.sh file
14194 echo "Creating config.sh..." >&4
14195 $spitshell <<EOT >config.sh
14198 # This file was produced by running the Configure script. It holds all the
14199 # definitions figured out by Configure. Should you modify one of these values,
14200 # do not forget to propagate your changes by running "Configure -der". You may
14201 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14204 # Package name : $package
14205 # Source directory : $src
14206 # Configuration time: $cf_time
14207 # Configured by : $cf_by
14208 # Target system : $myuname
14218 Revision='$Revision'
14225 alignbytes='$alignbytes'
14226 ansi2knr='$ansi2knr'
14227 aphostname='$aphostname'
14228 apiversion='$apiversion'
14231 archlibexp='$archlibexp'
14232 archname64='$archname64'
14233 archname='$archname'
14234 archobjs='$archobjs'
14239 bincompat5005='$bincompat5005'
14243 byteorder='$byteorder'
14245 castflags='$castflags'
14248 cccdlflags='$cccdlflags'
14249 ccdlflags='$ccdlflags'
14251 ccsymbols='$ccsymbols'
14253 cf_email='$cf_email'
14255 charsize='$charsize'
14259 clocktype='$clocktype'
14261 compress='$compress'
14262 contains='$contains'
14266 cpp_stuff='$cpp_stuff'
14267 cppccsymbols='$cppccsymbols'
14268 cppflags='$cppflags'
14270 cppminus='$cppminus'
14272 cppstdin='$cppstdin'
14273 cppsymbols='$cppsymbols'
14274 crosscompile='$crosscompile'
14275 cryptlib='$cryptlib'
14277 d_Gconvert='$d_Gconvert'
14278 d_PRIEldbl='$d_PRIEldbl'
14279 d_PRIFldbl='$d_PRIFldbl'
14280 d_PRIGldbl='$d_PRIGldbl'
14281 d_PRIX64='$d_PRIX64'
14282 d_PRId64='$d_PRId64'
14283 d_PRIeldbl='$d_PRIeldbl'
14284 d_PRIfldbl='$d_PRIfldbl'
14285 d_PRIgldbl='$d_PRIgldbl'
14286 d_PRIi64='$d_PRIi64'
14287 d_PRIo64='$d_PRIo64'
14288 d_PRIu64='$d_PRIu64'
14289 d_PRIx64='$d_PRIx64'
14290 d_access='$d_access'
14291 d_accessx='$d_accessx'
14293 d_archlib='$d_archlib'
14296 d_attribut='$d_attribut'
14299 d_bincompat5005='$d_bincompat5005'
14301 d_bsdgetpgrp='$d_bsdgetpgrp'
14302 d_bsdsetpgrp='$d_bsdsetpgrp'
14304 d_casti32='$d_casti32'
14305 d_castneg='$d_castneg'
14306 d_charvspr='$d_charvspr'
14308 d_chroot='$d_chroot'
14309 d_chsize='$d_chsize'
14310 d_closedir='$d_closedir'
14314 d_cuserid='$d_cuserid'
14315 d_dbl_dig='$d_dbl_dig'
14316 d_difftime='$d_difftime'
14317 d_dirnamlen='$d_dirnamlen'
14318 d_dlerror='$d_dlerror'
14319 d_dlopen='$d_dlopen'
14320 d_dlsymun='$d_dlsymun'
14321 d_dosuid='$d_dosuid'
14322 d_drand48proto='$d_drand48proto'
14324 d_eaccess='$d_eaccess'
14325 d_endgrent='$d_endgrent'
14326 d_endhent='$d_endhent'
14327 d_endnent='$d_endnent'
14328 d_endpent='$d_endpent'
14329 d_endpwent='$d_endpwent'
14330 d_endsent='$d_endsent'
14331 d_endspent='$d_endspent'
14332 d_eofnblk='$d_eofnblk'
14333 d_eunice='$d_eunice'
14334 d_fchmod='$d_fchmod'
14335 d_fchown='$d_fchown'
14337 d_fd_macros='$d_fd_macros'
14338 d_fd_set='$d_fd_set'
14339 d_fds_bits='$d_fds_bits'
14340 d_fgetpos='$d_fgetpos'
14341 d_flexfnam='$d_flexfnam'
14344 d_fpathconf='$d_fpathconf'
14345 d_fpos64_t='$d_fpos64_t'
14346 d_fs_data_s='$d_fs_data_s'
14347 d_fseeko='$d_fseeko'
14348 d_fsetpos='$d_fsetpos'
14349 d_fstatfs='$d_fstatfs'
14350 d_fstatvfs='$d_fstatvfs'
14351 d_ftello='$d_ftello'
14353 d_getgrent='$d_getgrent'
14354 d_getgrps='$d_getgrps'
14355 d_gethbyaddr='$d_gethbyaddr'
14356 d_gethbyname='$d_gethbyname'
14357 d_gethent='$d_gethent'
14358 d_gethname='$d_gethname'
14359 d_gethostprotos='$d_gethostprotos'
14360 d_getlogin='$d_getlogin'
14361 d_getmnt='$d_getmnt'
14362 d_getmntent='$d_getmntent'
14363 d_getnbyaddr='$d_getnbyaddr'
14364 d_getnbyname='$d_getnbyname'
14365 d_getnent='$d_getnent'
14366 d_getnetprotos='$d_getnetprotos'
14367 d_getpbyname='$d_getpbyname'
14368 d_getpbynumber='$d_getpbynumber'
14369 d_getpent='$d_getpent'
14370 d_getpgid='$d_getpgid'
14371 d_getpgrp2='$d_getpgrp2'
14372 d_getpgrp='$d_getpgrp'
14373 d_getppid='$d_getppid'
14374 d_getprior='$d_getprior'
14375 d_getprotoprotos='$d_getprotoprotos'
14376 d_getpwent='$d_getpwent'
14377 d_getsbyname='$d_getsbyname'
14378 d_getsbyport='$d_getsbyport'
14379 d_getsent='$d_getsent'
14380 d_getservprotos='$d_getservprotos'
14381 d_getspent='$d_getspent'
14382 d_getspnam='$d_getspnam'
14383 d_gettimeod='$d_gettimeod'
14384 d_gnulibc='$d_gnulibc'
14385 d_grpasswd='$d_grpasswd'
14386 d_hasmntopt='$d_hasmntopt'
14389 d_inetaton='$d_inetaton'
14390 d_int64t='$d_int64t'
14391 d_isascii='$d_isascii'
14392 d_killpg='$d_killpg'
14393 d_lchown='$d_lchown'
14394 d_ldbl_dig='$d_ldbl_dig'
14396 d_locconv='$d_locconv'
14398 d_longdbl='$d_longdbl'
14399 d_longlong='$d_longlong'
14402 d_mbstowcs='$d_mbstowcs'
14403 d_mbtowc='$d_mbtowc'
14404 d_memchr='$d_memchr'
14405 d_memcmp='$d_memcmp'
14406 d_memcpy='$d_memcpy'
14407 d_memmove='$d_memmove'
14408 d_memset='$d_memset'
14410 d_mkfifo='$d_mkfifo'
14411 d_mktime='$d_mktime'
14413 d_msg_ctrunc='$d_msg_ctrunc'
14414 d_msg_dontroute='$d_msg_dontroute'
14415 d_msg_oob='$d_msg_oob'
14416 d_msg_peek='$d_msg_peek'
14417 d_msg_proxy='$d_msg_proxy'
14418 d_msgctl='$d_msgctl'
14419 d_msgget='$d_msgget'
14420 d_msgrcv='$d_msgrcv'
14421 d_msgsnd='$d_msgsnd'
14422 d_mymalloc='$d_mymalloc'
14424 d_off64_t='$d_off64_t'
14425 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14426 d_oldpthreads='$d_oldpthreads'
14427 d_oldsock='$d_oldsock'
14429 d_pathconf='$d_pathconf'
14431 d_phostname='$d_phostname'
14434 d_portable='$d_portable'
14435 d_pthread_yield='$d_pthread_yield'
14437 d_pwchange='$d_pwchange'
14438 d_pwclass='$d_pwclass'
14439 d_pwcomment='$d_pwcomment'
14440 d_pwexpire='$d_pwexpire'
14441 d_pwgecos='$d_pwgecos'
14442 d_pwpasswd='$d_pwpasswd'
14443 d_pwquota='$d_pwquota'
14445 d_readdir='$d_readdir'
14446 d_readlink='$d_readlink'
14447 d_rename='$d_rename'
14448 d_rewinddir='$d_rewinddir'
14450 d_safebcpy='$d_safebcpy'
14451 d_safemcpy='$d_safemcpy'
14452 d_sanemcmp='$d_sanemcmp'
14453 d_sched_yield='$d_sched_yield'
14454 d_scm_rights='$d_scm_rights'
14455 d_seekdir='$d_seekdir'
14456 d_select='$d_select'
14458 d_semctl='$d_semctl'
14459 d_semctl_semid_ds='$d_semctl_semid_ds'
14460 d_semctl_semun='$d_semctl_semun'
14461 d_semget='$d_semget'
14463 d_setegid='$d_setegid'
14464 d_seteuid='$d_seteuid'
14465 d_setgrent='$d_setgrent'
14466 d_setgrps='$d_setgrps'
14467 d_sethent='$d_sethent'
14468 d_setlinebuf='$d_setlinebuf'
14469 d_setlocale='$d_setlocale'
14470 d_setnent='$d_setnent'
14471 d_setpent='$d_setpent'
14472 d_setpgid='$d_setpgid'
14473 d_setpgrp2='$d_setpgrp2'
14474 d_setpgrp='$d_setpgrp'
14475 d_setprior='$d_setprior'
14476 d_setpwent='$d_setpwent'
14477 d_setregid='$d_setregid'
14478 d_setresgid='$d_setresgid'
14479 d_setresuid='$d_setresuid'
14480 d_setreuid='$d_setreuid'
14481 d_setrgid='$d_setrgid'
14482 d_setruid='$d_setruid'
14483 d_setsent='$d_setsent'
14484 d_setsid='$d_setsid'
14485 d_setspent='$d_setspent'
14486 d_setvbuf='$d_setvbuf'
14490 d_shmatprototype='$d_shmatprototype'
14491 d_shmctl='$d_shmctl'
14493 d_shmget='$d_shmget'
14494 d_sigaction='$d_sigaction'
14495 d_sigsetjmp='$d_sigsetjmp'
14496 d_socket='$d_socket'
14497 d_sockpair='$d_sockpair'
14499 d_statblks='$d_statblks'
14500 d_statfs_f_flags='$d_statfs_f_flags'
14501 d_statfs_s='$d_statfs_s'
14502 d_statvfs='$d_statvfs'
14503 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14504 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14505 d_stdio_stream_array='$d_stdio_stream_array'
14506 d_stdiobase='$d_stdiobase'
14507 d_stdstdio='$d_stdstdio'
14508 d_strchr='$d_strchr'
14509 d_strcoll='$d_strcoll'
14510 d_strctcpy='$d_strctcpy'
14511 d_strerrm='$d_strerrm'
14512 d_strerror='$d_strerror'
14513 d_strtod='$d_strtod'
14514 d_strtol='$d_strtol'
14515 d_strtoul='$d_strtoul'
14516 d_strtoull='$d_strtoull'
14517 d_strxfrm='$d_strxfrm'
14518 d_suidsafe='$d_suidsafe'
14519 d_symlink='$d_symlink'
14520 d_syscall='$d_syscall'
14521 d_sysconf='$d_sysconf'
14522 d_sysernlst='$d_sysernlst'
14523 d_syserrlst='$d_syserrlst'
14524 d_system='$d_system'
14525 d_tcgetpgrp='$d_tcgetpgrp'
14526 d_tcsetpgrp='$d_tcsetpgrp'
14527 d_telldir='$d_telldir'
14528 d_telldirproto='$d_telldirproto'
14531 d_truncate='$d_truncate'
14532 d_tzname='$d_tzname'
14535 d_union_semun='$d_union_semun'
14537 d_vendorbin='$d_vendorbin'
14538 d_vendorlib='$d_vendorlib'
14540 d_void_closedir='$d_void_closedir'
14541 d_voidsig='$d_voidsig'
14542 d_voidtty='$d_voidtty'
14543 d_volatile='$d_volatile'
14544 d_vprintf='$d_vprintf'
14546 d_waitpid='$d_waitpid'
14547 d_wcstombs='$d_wcstombs'
14548 d_wctomb='$d_wctomb'
14551 db_hashtype='$db_hashtype'
14552 db_prefixtype='$db_prefixtype'
14553 defvoidused='$defvoidused'
14554 direntrytype='$direntrytype'
14557 doublesize='$doublesize'
14559 dynamic_ext='$dynamic_ext'
14565 eunicefix='$eunicefix'
14568 extensions='$extensions'
14569 fflushNULL='$fflushNULL'
14570 fflushall='$fflushall'
14572 firstmakefile='$firstmakefile'
14574 fpossize='$fpossize'
14575 fpostype='$fpostype'
14576 freetype='$freetype'
14578 full_csh='$full_csh'
14579 full_sed='$full_sed'
14580 gccversion='$gccversion'
14581 gidformat='$gidformat'
14587 groupcat='$groupcat'
14588 groupstype='$groupstype'
14591 h_sysfile='$h_sysfile'
14603 i_arpainet='$i_arpainet'
14604 i_bsdioctl='$i_bsdioctl'
14607 i_dirent='$i_dirent'
14614 i_inttypes='$i_inttypes'
14615 i_limits='$i_limits'
14616 i_locale='$i_locale'
14617 i_machcthr='$i_machcthr'
14618 i_malloc='$i_malloc'
14620 i_memory='$i_memory'
14621 i_mntent='$i_mntent'
14624 i_neterrno='$i_neterrno'
14625 i_netinettcp='$i_netinettcp'
14628 i_pthread='$i_pthread'
14630 i_rpcsvcdbm='$i_rpcsvcdbm'
14633 i_shadow='$i_shadow'
14635 i_stdarg='$i_stdarg'
14636 i_stddef='$i_stddef'
14637 i_stdlib='$i_stdlib'
14638 i_string='$i_string'
14639 i_sysaccess='$i_sysaccess'
14640 i_sysdir='$i_sysdir'
14641 i_sysfile='$i_sysfile'
14642 i_sysfilio='$i_sysfilio'
14644 i_sysioctl='$i_sysioctl'
14645 i_sysmount='$i_sysmount'
14646 i_sysndir='$i_sysndir'
14647 i_sysparam='$i_sysparam'
14648 i_sysresrc='$i_sysresrc'
14649 i_syssecrt='$i_syssecrt'
14650 i_sysselct='$i_sysselct'
14651 i_syssockio='$i_syssockio'
14652 i_sysstat='$i_sysstat'
14653 i_sysstatfs='$i_sysstatfs'
14654 i_sysstatvfs='$i_sysstatvfs'
14655 i_systime='$i_systime'
14656 i_systimek='$i_systimek'
14657 i_systimes='$i_systimes'
14658 i_systypes='$i_systypes'
14659 i_sysuio='$i_sysuio'
14661 i_sysvfs='$i_sysvfs'
14662 i_syswait='$i_syswait'
14663 i_termio='$i_termio'
14664 i_termios='$i_termios'
14666 i_unistd='$i_unistd'
14669 i_values='$i_values'
14670 i_varargs='$i_varargs'
14671 i_varhdr='$i_varhdr'
14673 ignore_versioned_solibs='$ignore_versioned_solibs'
14676 installarchlib='$installarchlib'
14677 installbin='$installbin'
14678 installman1dir='$installman1dir'
14679 installman3dir='$installman3dir'
14680 installprefix='$installprefix'
14681 installprefixexp='$installprefixexp'
14682 installprivlib='$installprivlib'
14683 installscript='$installscript'
14684 installsitearch='$installsitearch'
14685 installsitebin='$installsitebin'
14686 installsitelib='$installsitelib'
14687 installstyle='$installstyle'
14688 installusrbinperl='$installusrbinperl'
14689 installvendorbin='$installvendorbin'
14690 installvendorlib='$installvendorlib'
14692 ivdformat='$ivdformat'
14695 known_extensions='$known_extensions'
14699 lddlflags='$lddlflags'
14701 ldlibpthname='$ldlibpthname'
14708 libswanted='$libswanted'
14714 locincpth='$locincpth'
14715 loclibpth='$loclibpth'
14716 longdblsize='$longdblsize'
14717 longlongsize='$longlongsize'
14718 longsize='$longsize'
14722 lseeksize='$lseeksize'
14723 lseektype='$lseektype'
14727 make_set_make='$make_set_make'
14728 mallocobj='$mallocobj'
14729 mallocsrc='$mallocsrc'
14730 malloctype='$malloctype'
14732 man1direxp='$man1direxp'
14735 man3direxp='$man3direxp'
14738 mips_type='$mips_type'
14741 modetype='$modetype'
14743 multiarch='$multiarch'
14745 myarchname='$myarchname'
14746 mydomain='$mydomain'
14747 myhostname='$myhostname'
14750 netdb_hlen_type='$netdb_hlen_type'
14751 netdb_host_type='$netdb_host_type'
14752 netdb_name_type='$netdb_name_type'
14753 netdb_net_type='$netdb_net_type'
14756 nm_so_opt='$nm_so_opt'
14757 nonxs_ext='$nonxs_ext'
14761 o_nonblock='$o_nonblock'
14763 old_pthread_create_joinable='$old_pthread_create_joinable'
14764 optimize='$optimize'
14765 orderlib='$orderlib'
14771 patchlevel='$patchlevel'
14772 path_sep='$path_sep'
14774 perladmin='$perladmin'
14775 perlpath='$perlpath'
14777 phostname='$phostname'
14780 pm_apiversion='$pm_apiversion'
14784 prefixexp='$prefixexp'
14786 privlibexp='$privlibexp'
14787 prototype='$prototype'
14789 quadkind='$quadkind'
14790 quadtype='$quadtype'
14791 randbits='$randbits'
14792 randfunc='$randfunc'
14793 randseedtype='$randseedtype'
14795 rd_nodata='$rd_nodata'
14799 sPRIEldbl='$sPRIEldbl'
14800 sPRIFldbl='$sPRIFldbl'
14801 sPRIGldbl='$sPRIGldbl'
14804 sPRIeldbl='$sPRIeldbl'
14805 sPRIfldbl='$sPRIfldbl'
14806 sPRIgldbl='$sPRIgldbl'
14811 sched_yield='$sched_yield'
14812 scriptdir='$scriptdir'
14813 scriptdirexp='$scriptdirexp'
14815 seedfunc='$seedfunc'
14816 selectminbits='$selectminbits'
14817 selecttype='$selecttype'
14818 sendmail='$sendmail'
14821 sharpbang='$sharpbang'
14822 shmattype='$shmattype'
14823 shortsize='$shortsize'
14826 sig_count='$sig_count'
14827 sig_name='$sig_name'
14828 sig_name_init='$sig_name_init'
14830 sig_num_init='$sig_num_init'
14831 signal_t='$signal_t'
14832 sitearch='$sitearch'
14833 sitearchexp='$sitearchexp'
14835 sitebinexp='$sitebinexp'
14837 sitelibexp='$sitelibexp'
14838 siteprefix='$siteprefix'
14839 siteprefixexp='$siteprefixexp'
14840 sizetype='$sizetype'
14845 sockethdr='$sockethdr'
14846 socketlib='$socketlib'
14848 spackage='$spackage'
14849 spitshell='$spitshell'
14852 ssizetype='$ssizetype'
14853 startperl='$startperl'
14855 static_ext='$static_ext'
14857 stdio_base='$stdio_base'
14858 stdio_bufsiz='$stdio_bufsiz'
14859 stdio_cnt='$stdio_cnt'
14860 stdio_filbuf='$stdio_filbuf'
14861 stdio_ptr='$stdio_ptr'
14862 stdio_stream_array='$stdio_stream_array'
14865 subversion='$subversion'
14872 timeincl='$timeincl'
14873 timetype='$timetype'
14886 uidformat='$uidformat'
14892 uquadtype='$uquadtype'
14893 use5005threads='$use5005threads'
14894 use64bits='$use64bits'
14896 useithreads='$useithreads'
14897 uselargefiles='$uselargefiles'
14898 uselongdouble='$uselongdouble'
14899 uselonglong='$uselonglong'
14900 usemorebits='$usemorebits'
14901 usemultiplicity='$usemultiplicity'
14902 usemymalloc='$usemymalloc'
14904 useopcode='$useopcode'
14905 useperlio='$useperlio'
14906 useposix='$useposix'
14908 useshrplib='$useshrplib'
14909 usesocks='$usesocks'
14910 usethreads='$usethreads'
14911 usevendorprefix='$usevendorprefix'
14912 usevfork='$usevfork'
14915 uvoformat='$uvoformat'
14918 uvuformat='$uvuformat'
14919 uvxformat='$uvxformat'
14920 vendorbin='$vendorbin'
14921 vendorbinexp='$vendorbinexp'
14922 vendorlib='$vendorlib'
14923 vendorlibexp='$vendorlibexp'
14924 vendorprefix='$vendorprefix'
14925 vendorprefixexp='$vendorprefixexp'
14928 voidflags='$voidflags'
14930 xs_apiversion='$xs_apiversion'
14935 : Add in command line options if available
14936 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14938 : add special variables
14939 $test -f $src/patchlevel.h && \
14940 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14941 echo "CONFIGDOTSH=true" >>config.sh
14943 : propagate old symbols
14944 if $test -f UU/config.sh; then
14945 <UU/config.sh sort | uniq >UU/oldconfig.sh
14946 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14947 sort | uniq -u >UU/oldsyms
14948 set X `cat UU/oldsyms`
14954 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14956 echo "# Variables propagated from previous config.sh file." >>config.sh
14957 for sym in `cat UU/oldsyms`; do
14958 echo " Propagating $hint variable "'$'"$sym..."
14959 eval 'tmp="$'"${sym}"'"'
14961 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14967 : Finish up by extracting the .SH files
14981 If you'd like to make any changes to the config.sh file before I begin
14982 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14985 rp="Press return or use a shell escape to edit config.sh:"
14990 *) : in case they cannot read
14991 sh 1>&4 -c "$ans";;
14996 : if this fails, just run all the .SH files by hand
15003 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15010 Now you need to generate make dependencies by running "$make depend".
15011 You might prefer to run it in background: "$make depend > makedepend.out &"
15012 It can take a while, so you might not want to run it right now.
15017 rp="Run $make depend now?"
15021 $make depend && echo "Now you must run a $make."
15024 echo "You must run '$make depend' then '$make'."
15027 elif test -f [Mm]akefile; then
15029 echo "Now you must run a $make."
15034 if $test -f Policy.sh; then
15037 If you compile $package on a different machine or from a different object
15038 directory, copy the Policy.sh file from this object directory to the
15039 new one before you run Configure -- this will help you with most of
15040 the policy defaults.
15044 if $test -f config.msg; then
15045 echo "Hmm. I also noted the following information while running:"
15047 $cat config.msg >&4
15050 $rm -f kit*isdone ark*isdone