3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Sun Nov 14 17:26:56 EET 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
888 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
891 : We must find out about Eunice early
893 if test -f /etc/unixtovms; then
894 eunicefix=/etc/unixtovms
896 if test -f /etc/unixtovms.exe; then
897 eunicefix=/etc/unixtovms.exe
901 : Possible local include directories to search.
902 : Set locincpth to "" in a hint file to defeat local include searches.
903 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
904 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
906 : no include file wanted by default
909 : list of known cpp symbols, sorted alphabetically
910 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
911 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
912 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
913 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
914 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
915 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
916 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
917 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
918 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
919 al="$al VMS Xenix286"
920 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
921 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
922 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
923 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
924 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
925 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
926 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
927 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
928 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
929 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
930 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
931 al="$al __SVR4_2__ __UMAXV__"
932 al="$al ____386BSD____ __alpha __alpha__ __amiga"
933 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
934 al="$al __host_mips__"
935 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
936 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
937 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
938 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
939 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
940 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
941 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
942 al="$al __mc88100 __mc88100__ __mips __mips__"
943 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
944 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
945 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
946 al="$al _host_mips _mips _unix"
947 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
948 al="$al apollo ardent att386 att3b"
949 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
950 al="$al cadmus clipper concurrent convex cray ctix"
951 al="$al dmert encore gcos gcx gimpel gould"
952 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
953 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
954 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
955 al="$al i186 i286 i386 i486 i8086"
956 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
957 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
958 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
959 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
960 al="$al mc88000 mc88100 merlin mert mips mvs n16"
961 al="$al ncl_el ncl_mr"
962 al="$al news1500 news1700 news1800 news1900 news3700"
963 al="$al news700 news800 news900 ns16000 ns32000"
964 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
965 al="$al parisc pc532 pdp11 plexus posix pyr"
966 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
967 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
968 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
969 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
970 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
971 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
974 : Trailing extension. Override this in a hint file, if needed.
976 : Extra object files, if any, needed on this platform.
979 : change the next line if compiling for Xenix/286 on Xenix/386
980 xlibpth='/usr/lib/386 /lib/386'
982 : Possible local library directories to search.
983 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
984 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
986 : general looking path for locating libraries
987 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
988 glibpth="$glibpth /lib /usr/lib $xlibpth"
989 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
990 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
992 : Private path used by Configure to find libraries. Its value
993 : is prepended to libpth. This variable takes care of special
994 : machines, like the mips. Usually, it should be empty.
997 : default library list
999 : some systems want to use only the non-versioned libso:s
1000 ignore_versioned_solibs=''
1001 : full support for void wanted by default
1004 : set useposix=false in your hint file to disable the POSIX extension.
1006 : set useopcode=false in your hint file to disable the Opcode extension.
1008 : set usemultiplicity on the Configure command line to enable multiplicity.
1009 : set usesocks on the Configure command line to enable socks.
1010 : set usethreads on the Configure command line to enable threads.
1011 : List of libraries we want.
1012 : If anyone needs -lnet, put it in a hint file.
1013 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1014 libswanted="$libswanted dld ld sun m c cposix posix"
1015 libswanted="$libswanted ndir dir crypt sec"
1016 libswanted="$libswanted ucb bsd BSD PW x"
1017 : We probably want to search /usr/shlib before most other libraries.
1018 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1019 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1020 glibpth="/usr/shlib $glibpth"
1021 : Do not use vfork unless overridden by a hint file.
1024 : Find the basic shell for Bourne shell scripts
1028 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1031 if test -f "$xxx"; then
1034 : Build up a list and do a single loop so we can 'break' out.
1035 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1036 for xxx in sh bash ksh pdksh ash; do
1038 try="$try ${p}/${xxx}"
1042 if test -f "$xxx"; then
1045 elif test -f "$xxx.exe"; then
1056 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1058 Usually it's in /bin/sh. How did you even get this far?
1059 Please contact me (Perl Maintainers) at perlbug@perl.com and
1060 we'll try to straighten this all out.
1066 : see if sh knows # comments
1067 if `$sh -c '#' >/dev/null 2>&1`; then
1071 test -f $xcat || xcat=/usr/bin/cat
1076 if test -s today; then
1079 echo "#! $xcat" > try
1083 if test -s today; then
1091 echo "Your $sh doesn't grok # comments--I will strip them later on."
1094 echo "exec grep -v '^[ ]*#'" >spitshell
1096 $eunicefix spitshell
1097 spitshell=`pwd`/spitshell
1099 echo "I presume that if # doesn't work, #! won't work either!"
1104 : figure out how to guarantee sh startup
1106 '') startsh=${sharpbang}${sh} ;;
1118 : echo "Yup, it does."
1120 echo "Hmm... '$startsh' does not guarantee sh startup..."
1121 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1126 : Save command line options in file UU/cmdline.opt for later use in
1127 : generating config.sh.
1128 cat > cmdline.opt <<EOSH
1129 # Configure command line arguments.
1136 cat >>cmdline.opt <<EOSH
1137 config_arg$argn='$arg'
1139 argn=`expr $argn + 1`
1142 : produce awk script to parse command line options
1143 cat >options.awk <<'EOF'
1145 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1147 len = length(optstr);
1148 for (i = 1; i <= len; i++) {
1149 c = substr(optstr, i, 1);
1150 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1161 if (substr(str, 1, 1) != "-") {
1162 printf("'%s'\n", str);
1166 for (i = 2; i <= len; i++) {
1167 c = substr(str, i, 1);
1169 printf("-%s\n", substr(str, i));
1175 printf("'%s'\n", substr(str, i + 1));
1188 : process the command line options
1189 set X `for arg in "$@"; do echo "X$arg"; done |
1190 sed -e s/X// | awk -f options.awk`
1195 : set up default values
1205 rm -f optdef.sh posthint.sh
1206 cat >optdef.sh <<EOS
1212 while test $# -gt 0; do
1214 -d) shift; fastread=yes;;
1215 -e) shift; alldone=cont;;
1219 if test -r "$1"; then
1222 echo "$me: cannot read config file $1." >&2
1227 -h) shift; error=true;;
1228 -r) shift; reuseval=true;;
1229 -s) shift; silent=true; realsilent=true;;
1230 -E) shift; alldone=exit;;
1231 -K) shift; knowitall=true;;
1232 -O) shift; override=true;;
1233 -S) shift; silent=true; extractsh=true;;
1238 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1239 echo "$me: ignoring -D $1" >&2
1242 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1243 *) echo "$1='define'" >> optdef.sh;;
1250 *=) echo "$1" >> optdef.sh;;
1252 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1253 echo "$me: ignoring -U $1" >&2
1255 *) echo "$1='undef'" >> optdef.sh;;
1266 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1270 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1271 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1277 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1278 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1279 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1281 *) xxx=`echo $yyy|sed 's!:.*!!'`
1282 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1288 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1290 echo "$yyy=''" >> posthint.sh ;;
1295 echo "$yyy='$zzz'" >> posthint.sh ;;
1297 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1304 echo "$yyy=$zzz" >> posthint.sh ;;
1305 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1308 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1311 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1319 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1320 [-U symbol] [-U symbol=] [-A command:symbol...]
1321 -d : use defaults for all answers.
1322 -e : go on without questioning past the production of config.sh.
1323 -f : specify an alternate default configuration file.
1324 -h : print this help message and exit (with an error status).
1325 -r : reuse C symbols value if possible (skips costly nm extraction).
1326 -s : silent mode, only echoes questions and essential information.
1327 -D : define symbol to have some value:
1328 -D symbol symbol gets the value 'define'
1329 -D symbol=value symbol gets the value 'value'
1330 -E : stop at the end of questions, after having produced config.sh.
1331 -K : do not use unless you know what you are doing.
1332 -O : let -D and -U override definitions from loaded configuration file.
1333 -S : perform variable substitutions on all .SH files (can mix with -f)
1334 -U : undefine symbol:
1335 -U symbol symbol gets the value 'undef'
1336 -U symbol= symbol gets completely empty
1337 -A : manipulate symbol after the platform specific hints have been applied:
1338 -A symbol=value append " "value to symbol
1339 -A append:symbol=value append value to symbol
1340 -A define:symbol=value define symbol to have value
1341 -A clear:symbol define symbol to be ''
1342 -A define:symbol define symbol to be 'define'
1343 -A eval:symbol=value define symbol to be eval of value
1344 -A prepend:symbol=value prepend value to symbol
1345 -A undef:symbol define symbol to be 'undef'
1346 -A undef:symbol= define symbol to be ''
1347 -V : print version number and exit (with a zero status).
1354 case "$fastread$alldone" in
1357 if test ! -t 0; then
1358 echo "Say 'sh Configure', not 'sh <Configure'"
1366 true) exec 1>/dev/null;;
1369 : run the defines and the undefines, if any, but leave the file out there...
1372 : create the posthint manipulation script and leave the file out there...
1377 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1378 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1379 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1380 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1381 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1384 : Some greps do not return status, grrr.
1385 echo "grimblepritz" >grimble
1386 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1388 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1394 : the following should work in any shell
1398 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1399 cat >contains <<'EOSS'
1400 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1405 : Find the path to the source tree
1408 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1411 *) src=`cd ../$src && pwd` ;;
1424 if test -f $rsrc/Configure && \
1425 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1427 : found it, so we are ok.
1430 for src in . .. ../.. ../../.. ../../../..; do
1431 if test -f ../$src/Configure && \
1432 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1443 Sorry, I can't seem to locate the source dir for $package. Please start
1444 Configure with an explicit path -- i.e. /some/path/Configure.
1452 echo "Sources for $package found in \"$src\"." >&4
1456 : script used to extract .SH files with variable substitutions
1457 cat >extract <<'EOS'
1459 echo "Doing variable substitutions on .SH files..."
1460 if test -f $src/MANIFEST; then
1461 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1463 echo "(Looking for .SH files under the source directory.)"
1464 set x `(cd $src; find . -name "*.SH" -print)`
1468 0) set x `(cd $src; echo *.SH)`; shift;;
1470 if test ! -f $src/$1; then
1476 while test $name; do
1477 if test ! -d "$name"; then
1478 create="$name $create";
1479 name=`echo $name | sed -e "s|^[^/]*$||"`;
1480 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1485 for file in $create; do
1494 dir=`expr X$file : 'X\(.*\)/'`
1495 file=`expr X$file : 'X.*/\(.*\)'`
1496 (cd $dir && . ./$file)
1506 dir=`expr X$file : 'X\(.*\)/'`
1507 file=`expr X$file : 'X.*/\(.*\)'`
1508 (set x $dir; shift; eval $mkdir_p)
1518 if test -f $src/config_h.SH; then
1519 if test ! -f config.h; then
1520 : oops, they left it out of MANIFEST, probably, so do it anyway.
1526 : extract files and exit if asked to do so
1527 case "$extractsh" in
1529 case "$realsilent" in
1533 case "$config_sh" in
1534 '') config_sh='config.sh';;
1537 echo "Fetching answers from $config_sh..."
1540 test "$override" && . ./optdef.sh
1549 : Eunice requires " " instead of "", can you believe it
1552 echo "Beginning of configuration questions for $package."
1554 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1556 : first determine how to suppress newline on echo command
1558 echo "Checking echo to see how to suppress newlines..."
1559 (echo "hi there\c" ; echo " ") >.echotmp
1560 if $contains c .echotmp >/dev/null 2>&1 ; then
1571 echo $n "The star should be here-->$c"
1575 : Now test for existence of everything in MANIFEST
1577 if test -f $rsrc/MANIFEST; then
1578 echo "First let's make sure your kit is complete. Checking..." >&4
1579 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1582 for filelist in x??; do
1583 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1585 if test -s missing; then
1589 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1591 You have the option of continuing the configuration process, despite the
1592 distinct possibility that your kit is damaged, by typing 'y'es. If you
1593 do, don't blame me if something goes wrong. I advise you to type 'n'o
1594 and contact the author (perlbug@perl.com).
1597 echo $n "Continue? [n] $c" >&4
1601 echo "Continuing..." >&4
1605 echo "ABORTING..." >&4
1610 echo "Looks good..."
1613 echo "There is no MANIFEST file. I hope your kit is complete !"
1618 : Find the appropriate value for a newline for tr
1619 if test -n "$DJGPP"; then
1622 if test X"$trnl" = X; then
1623 case "`echo foo|tr '\n' x 2>/dev/null`" in
1627 if test X"$trnl" = X; then
1628 case "`echo foo|tr '\012' x 2>/dev/null`" in
1629 foox) trnl='\012' ;;
1632 if test X"$trnl" = X; then
1635 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1641 : compute the number of columns on the terminal for proper question formatting
1646 : set up the echo used in my read
1647 myecho="case \"\$xxxm\" in
1648 '') echo $n \"\$rp $c\" >&4;;
1650 '') echo $n \"[\$xxxm] $c\";;
1652 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1654 echo $n \"[\$xxxm] $c\" >&4
1656 echo $n \"\$rp [\$xxxm] $c\" >&4
1662 : now set up to do reads with possible shell escape and default assignment
1668 case "\$fastread" in
1669 yes) case "\$dflt" in
1672 case "\$silent-\$rp" in
1677 *) case "\$silent" in
1678 true) case "\$rp" in
1683 while expr "X\$ans" : "X!" >/dev/null; do
1687 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1695 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1704 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1709 echo "(OK, I'll run with -d after this question.)" >&4
1712 echo "*** Sorry, \$1 not supported yet." >&4
1722 echo "*** Substitution done -- please confirm."
1724 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1729 echo "*** Error -- try again."
1736 case "\$ans\$xxxm\$nostick" in
1748 : create .config dir to save info across Configure sessions
1749 test -d ../.config || mkdir ../.config
1750 cat >../.config/README <<EOF
1751 This directory created by Configure to save information that should
1752 persist across sessions for $package.
1754 You may safely delete it if you wish.
1757 : general instructions
1760 user=`(logname) 2>/dev/null`
1762 '') user=`whoami 2>&1`;;
1764 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1767 rp='Would you like to see the instructions?'
1778 This installation shell script will examine your system and ask you questions
1779 to determine how the perl5 package should be installed. If you get
1780 stuck on a question, you may use a ! shell escape to start a subshell or
1781 execute a command. Many of the questions will have default answers in square
1782 brackets; typing carriage return will give you the default.
1784 On some of the questions which ask for file or directory names you are allowed
1785 to use the ~name construct to specify the login directory belonging to "name",
1786 even if you don't have a shell which knows about that. Questions where this is
1787 allowed will be marked "(~name ok)".
1791 dflt='Type carriage return to continue'
1795 The prompter used in this script allows you to use shell variables and
1796 backticks in your answers. You may use $1, $2, etc... to refer to the words
1797 in the default answer, as if the default line was a set of arguments given to a
1798 script shell. This means you may also use $* to repeat the whole default line,
1799 so you do not have to re-type everything to add something to the default.
1801 Everytime there is a substitution, you will have to confirm. If there is an
1802 error (e.g. an unmatched backtick), the default answer will remain unchanged
1803 and you will be prompted again.
1805 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1806 the questions and use the computed defaults (or the previous answers if there
1807 was already a config.sh file). Type 'Configure -h' for a list of options.
1808 You may also start interactively and then answer '& -d' at any prompt to turn
1809 on the non-interactive behaviour for the remainder of the execution.
1815 Much effort has been expended to ensure that this shell script will run on any
1816 Unix system. If despite that it blows up on yours, your best bet is to edit
1817 Configure and run it again. If you can't run Configure for some reason,
1818 you'll have to generate a config.sh file by hand. Whatever problems you
1819 have, let me (perlbug@perl.com) know how I blew it.
1821 This installation script affects things in two ways:
1823 1) it may do direct variable substitutions on some of the files included
1825 2) it builds a config.h file for inclusion in C programs. You may edit
1826 any of these files as the need arises after running this script.
1828 If you make a mistake on a question, there is no easy way to back up to it
1829 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1830 files. Configure will offer to let you do this before it runs the SH files.
1833 dflt='Type carriage return to continue'
1835 case "$firsttime" in
1836 true) echo $user >>../.config/instruct;;
1840 : find out where common programs are
1842 echo "Locating common programs..." >&4
1855 if test -d \$dir/\$thing; then
1861 for thisthing in \$dir/\$thing; do
1862 : just loop through to pick last item
1864 if test -f \$thisthing; then
1867 elif test -f \$dir/\$thing.exe; then
1868 if test -n "$DJGPP"; then
1869 echo \$dir/\$thing.exe
1871 : on Eunice apparently
1921 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1922 pth="$pth /lib /usr/lib"
1923 for file in $loclist; do
1927 if test -f "$xxx"; then
1930 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1931 xxx=`./loc $file $file $pth`
1934 '') xxx=`./loc $file $file $pth`;;
1935 *) xxx=`./loc $xxx $xxx $pth`;;
1941 echo $file is in $xxx.
1944 echo $file is in $xxx.
1947 echo "I don't know where '$file' is, and my life depends on it." >&4
1948 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1954 echo "Don't worry if any of the following aren't found..."
1956 for file in $trylist; do
1960 if test -f "$xxx"; then
1963 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1964 xxx=`./loc $file $file $pth`
1967 '') xxx=`./loc $file $file $pth`;;
1968 *) xxx=`./loc $xxx $xxx $pth`;;
1974 echo $file is in $xxx.
1977 echo $file is in $xxx.
1980 echo "I don't see $file out there, $say."
1987 echo "Substituting grep for egrep."
1993 echo "Substituting cp for ln."
1999 echo "Hopefully test is built into your sh."
2002 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2003 echo "Using the test built into your sh."
2011 echo "Hopefully echo is built into your sh."
2016 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2017 $echo $n "hi there$c" >foo1
2018 echo $n "hi there$c" >foo2
2019 if cmp foo1 foo2 >/dev/null 2>&1; then
2020 echo "They are compatible. In fact, they may be identical."
2027 They are not compatible! You are probably running ksh on a non-USG system.
2028 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2029 have echo built in and we may have to run some Bourne shell scripts. That
2030 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2033 $echo $n "The star should be here-->$c"
2040 : determine whether symbolic links are supported
2043 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2044 echo "Symbolic links are supported." >&4
2047 echo "Symbolic links are NOT supported." >&4
2052 : see whether [:lower:] and [:upper:] are supported character classes
2054 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2056 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2060 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2061 # (0xc9 and 0xd1), therefore that is a nice testing point.
2062 if test "X$up" = X -o "X$low" = X; then
2063 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2069 if test "X$up" = X -o "X$low" = X; then
2070 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2076 if test "X$up" = X -o "X$low" = X; then
2077 case "`echo IJ | od -x 2>/dev/null`" in
2079 echo "Hey, this might be EBCDIC." >&4
2080 if test "X$up" = X -o "X$low" = X; then
2081 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2082 ij) up='[A-IJ-RS-Z]'
2087 if test "X$up" = X -o "X$low" = X; then
2088 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2098 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2100 echo "Using $up and $low to convert case." >&4
2103 echo "I don't know how to translate letters from upper to lower case." >&4
2104 echo "Your tr is not acting any way I know of." >&4
2108 : set up the translation script tr, must be called with ./tr of course
2112 '[A-Z][a-z]') exec $tr '$up' '$low';;
2113 '[a-z][A-Z]') exec $tr '$low' '$up';;
2120 : Try to determine whether config.sh was made on this system
2121 case "$config_sh" in
2123 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2124 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2125 # because the A-Z/a-z are not consecutive.
2126 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2127 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2128 newmyuname="$myuname"
2130 case "$knowitall" in
2132 if test -f ../config.sh; then
2133 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2134 eval "`grep myuname= ../config.sh`"
2136 if test "X$myuname" = "X$newmyuname"; then
2144 : Get old answers from old config file if Configure was run on the
2145 : same system, otherwise use the hints.
2148 if test -f config.sh; then
2150 rp="I see a config.sh file. Shall I use it to set the defaults?"
2153 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2154 *) echo "Fetching default answers from your old config.sh file..." >&4
2162 : Older versions did not always set $sh. Catch re-use of such
2171 if test ! -f config.sh; then
2174 First time through, eh? I have some defaults handy for some systems
2175 that need some extra help getting the Configure answers right:
2178 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2180 : Half the following guesses are probably wrong... If you have better
2181 : tests or hints, please send them to perlbug@perl.com
2182 : The metaconfig authors would also appreciate a copy...
2183 $test -f /irix && osname=irix
2184 $test -f /xenix && osname=sco_xenix
2185 $test -f /dynix && osname=dynix
2186 $test -f /dnix && osname=dnix
2187 $test -f /lynx.os && osname=lynxos
2188 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2189 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2190 $test -f /bin/mips && /bin/mips && osname=mips
2191 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2192 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2193 $test -d /usr/apollo/bin && osname=apollo
2194 $test -f /etc/saf/_sactab && osname=svr4
2195 $test -d /usr/include/minix && osname=minix
2196 if $test -d /MachTen -o -d /MachTen_Folder; then
2198 if $test -x /sbin/version; then
2199 osvers=`/sbin/version | $awk '{print $2}' |
2200 $sed -e 's/[A-Za-z]$//'`
2201 elif $test -x /usr/etc/version; then
2202 osvers=`/usr/etc/version | $awk '{print $2}' |
2203 $sed -e 's/[A-Za-z]$//'`
2208 $test -f /sys/posix.dll &&
2209 $test -f /usr/bin/what &&
2210 set X `/usr/bin/what /sys/posix.dll` &&
2211 $test "$3" = UWIN &&
2214 if $test -f $uname; then
2222 umips) osname=umips ;;
2225 [23]100) osname=mips ;;
2226 next*) osname=next ;;
2228 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2229 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2232 elif $test -f /etc/kconfig; then
2234 if test "$lns" = "$ln -s"; then
2236 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2238 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2245 if test -n "$DJGPP"; then
2254 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2256 'not found') osvers="$4"."$3" ;;
2257 '<3240'|'<>3240') osvers=3.2.0 ;;
2258 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2259 '=3250'|'>3250') osvers=3.2.5 ;;
2263 *dc.osx) osname=dcosx
2269 domainos) osname=apollo
2275 dynixptx*) osname=dynixptx
2276 osvers=`echo "$4"|sed 's/^v//'`
2278 freebsd) osname=freebsd
2280 genix) osname=genix ;;
2282 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2298 netbsd*) osname=netbsd
2301 news-os) osvers="$3"
2303 4*) osname=newsos4 ;;
2307 bsd386) osname=bsd386
2310 POSIX-BC | posix-bc ) osname=posix-bc
2313 powerux | power_ux | powermax_os | powermaxos | \
2314 powerunix | power_unix) osname=powerux
2317 next*) osname=next ;;
2318 solaris) osname=solaris
2320 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2327 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2331 titanos) osname=titanos
2340 ultrix) osname=ultrix
2343 osf1|mls+) case "$5" in
2346 osvers=`echo "$3" | sed 's/^[xvt]//'`
2348 hp*) osname=hp_osf1 ;;
2349 mips) osname=mips_osf1 ;;
2352 unixware) osname=svr5
2361 $2) case "$osname" in
2365 : svr4.x or possibly later
2375 if test -f /stand/boot ; then
2376 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2377 if test -n "$INITPROG" -a -f "$INITPROG"; then
2378 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2379 if test -n "$isesix"; then
2387 *) if test -f /etc/systemid; then
2389 set `echo $3 | $sed 's/\./ /g'` $4
2390 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2392 elif $test -f $src/hints/sco_$1_$2.sh; then
2394 elif $test -f $src/hints/sco_$1.sh; then
2399 '') : Still unknown. Probably a generic Sys V.
2408 *) case "$osname" in
2409 '') : Still unknown. Probably a generic BSD.
2417 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2418 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2419 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2422 $rm -f UU/kernel.what
2423 elif test -d c:/.; then
2430 : Now look for a hint file osname_osvers, unless one has been
2431 : specified already.
2434 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2435 : Also try without trailing minor version numbers.
2436 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2437 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2438 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2439 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2442 *) case "$osvers" in
2445 *) if $test -f $src/hints/$file.sh ; then
2447 elif $test -f $src/hints/$xfile.sh ; then
2449 elif $test -f $src/hints/$xxfile.sh ; then
2451 elif $test -f $src/hints/$xxxfile.sh ; then
2453 elif $test -f $src/hints/$xxxxfile.sh ; then
2455 elif $test -f "$src/hints/${osname}.sh" ; then
2464 if $test -f Policy.sh ; then
2467 none) dflt="Policy" ;;
2468 *) dflt="Policy $dflt" ;;
2473 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2477 if $test -f Policy.sh ; then
2480 There's also a Policy hint file available, which should make the
2481 site-specific (policy) questions easier to answer.
2488 You may give one or more space-separated answers, or "none" if appropriate.
2489 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2490 is a good thing. DO NOT give a wrong version or a wrong OS.
2494 rp="Which of these apply, if any?"
2497 for file in $tans; do
2498 if $test X$file = XPolicy -a -f Policy.sh; then
2500 $cat Policy.sh >> UU/config.sh
2501 elif $test -f $src/hints/$file.sh; then
2502 . $src/hints/$file.sh
2503 $cat $src/hints/$file.sh >> UU/config.sh
2504 elif $test X$tans = X -o X$tans = Xnone ; then
2507 : Give one chance to correct a possible typo.
2508 echo "$file.sh does not exist"
2510 rp="hint to use instead?"
2512 for file in $ans; do
2513 if $test -f "$src/hints/$file.sh"; then
2514 . $src/hints/$file.sh
2515 $cat $src/hints/$file.sh >> UU/config.sh
2516 elif $test X$ans = X -o X$ans = Xnone ; then
2519 echo "$file.sh does not exist -- ignored."
2526 : Remember our hint file for later.
2527 if $test -f "$src/hints/$file.sh" ; then
2537 echo "Fetching default answers from $config_sh..." >&4
2541 cp $config_sh config.sh 2>/dev/null
2551 test "$override" && . ./optdef.sh
2552 myuname="$newmyuname"
2554 : Restore computed paths
2555 for file in $loclist $trylist; do
2556 eval $file="\$_$file"
2561 Configure uses the operating system name and version to set some defaults.
2562 The default value is probably right if the name rings a bell. Otherwise,
2563 since spelling matters for me, either accept the default or answer "none"
2570 ''|' '|none) dflt=none ;;
2571 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2574 *) dflt="$osname" ;;
2576 rp="Operating system name?"
2580 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2586 ''|' '|none) dflt=none ;;
2587 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2588 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2590 ''|' ') dflt=none ;;
2595 *) dflt="$osvers" ;;
2597 rp="Operating system version?"
2607 : who configured the system
2608 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2609 cf_by=`(logname) 2>/dev/null`
2612 cf_by=`(whoami) 2>/dev/null`
2614 "") cf_by=unknown ;;
2618 : set up the script used to warn in case of inconsistency
2625 echo "*** WHOA THERE!!! ***" >&4
2626 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2627 rp=" Keep the $hint value?"
2630 y) td=$was; tu=$was;;
2634 : function used to set $1 to $val
2635 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2637 $define$undef) . ./whoa; eval "$var=\$td";;
2638 $undef$define) . ./whoa; eval "$var=\$tu";;
2639 *) eval "$var=$val";;
2644 Perl can be built to take advantage of threads, on some systems.
2645 To do so, Configure must be run with -Dusethreads.
2647 Note that threading is a highly experimental feature, and
2648 some known race conditions still remain. If you choose to try
2649 it, be very sure to not actually deploy it for production
2650 purposes. README.threads has more details, and is required
2651 reading if you enable threads.
2653 case "$usethreads" in
2654 $define|true|[yY]*) dflt='y';;
2657 rp='Build a threading Perl?'
2660 y|Y) val="$define" ;;
2666 case "$d_oldpthreads" in
2667 '') : Configure tests would be welcome here. For now, assume undef.
2669 *) val="$d_oldpthreads" ;;
2675 case "$usethreads" in
2676 "$define"|true|[yY]*)
2677 : Look for a hint-file generated 'call-back-unit'. If the
2678 : user has specified that a threading perl is to be built,
2679 : we may need to set or change some other defaults.
2680 if $test -f usethreads.cbu; then
2681 echo "Your platform has some specific hints for threaded builds, using them..."
2685 (Your platform doesn't have any specific hints for threaded builds.
2686 Assuming POSIX threads, then.)
2694 Perl can be built so that multiple Perl interpreters can coexist
2695 within the same Perl executable. To do so, Configure must be run with
2698 Normally you do not need this and you should answer no.
2701 case "$usemultiplicity" in
2702 $define|true|[yY]*) dflt='y';;
2705 rp='Build Perl for multiplicity?'
2708 y|Y) val="$define" ;;
2714 : determine where manual pages are on this system
2718 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2719 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2720 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2721 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2722 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2723 sysman=`./loc . /usr/man/man1 $syspath`
2726 if $test -d "$sysman"; then
2727 echo "System manual is in $sysman." >&4
2729 echo "Could not find manual pages in source form." >&4
2732 : see what memory models we can support
2735 $cat >pdp11.c <<'EOP'
2744 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2745 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2746 dflt='unsplit split'
2748 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2751 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2756 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2759 if $test -d /lib/large || $test -d /usr/lib/large; then
2762 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2771 Some systems have different model sizes. On most systems they are called
2772 small, medium, large, and huge. On the PDP11 they are called unsplit and
2773 split. If your system doesn't support different memory models, say "none".
2774 If you wish to force everything to one memory model, say "none" here and
2775 put the appropriate flags later when it asks you for other cc and ld flags.
2776 Venix systems may wish to put "none" and let the compiler figure things out.
2777 (In the following question multiple model names should be space separated.)
2779 The default for most systems is "none".
2782 rp="Which memory models are supported?"
2797 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2798 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2805 rp="What flag indicates separate I and D space?"
2813 *large*|*small*|*medium*|*huge*)
2820 rp="What flag indicates large model?"
2830 *huge*) case "$huge" in
2834 rp="What flag indicates huge model?"
2844 *medium*) case "$medium" in
2848 rp="What flag indicates medium model?"
2855 *) medium="$large";;
2858 *small*) case "$small" in
2862 rp="What flag indicates small model?"
2873 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2876 $rm -f pdp11.* pdp11
2878 : make some quick guesses about what we are up against
2880 $echo $n "Hmm... $c"
2890 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2891 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2893 echo "Looks kind of like an OSF/1 system, but we'll see..."
2895 elif test `echo abc | tr a-z A-Z` = Abc ; then
2896 xxx=`./loc addbib blurfl $pth`
2897 if $test -f $xxx; then
2898 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2902 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2903 echo "Looks kind of like an extended USG system, but we'll see..."
2905 echo "Looks kind of like a USG system, but we'll see..."
2909 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2910 echo "Looks kind of like a BSD system, but we'll see..."
2914 echo "Looks kind of like a Version 7 system, but we'll see..."
2917 case "$eunicefix" in
2920 There is, however, a strange, musty smell in the air that reminds me of
2921 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2925 : it so happens the Eunice I know will not run shell scripts in Unix format
2929 echo "Congratulations. You aren't running Eunice."
2933 : Detect OS2. The p_ variable is set above in the Head.U unit.
2938 I have the feeling something is not exactly right, however...don't tell me...
2939 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2944 if test -f /xenix; then
2945 echo "Actually, this looks more like a XENIX system..."
2950 echo "It's not Xenix..."
2955 if test -f /venix; then
2956 echo "Actually, this looks more like a VENIX system..."
2963 echo "Nor is it Venix..."
2966 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2967 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2970 : see if we need a special compiler
2978 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2979 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2993 On some older systems the default C compiler will not resolve multiple global
2994 references that happen to have the same name. On some such systems the "Mcc"
2995 command may be used to force these to be resolved. On other systems a "cc -M"
2996 command is required. (Note that the -M flag on other systems indicates a
2997 memory model to use!) If you have the Gnu C compiler, you might wish to use
3003 rp="Use which C compiler?"
3011 rp="Use which C compiler?"
3015 : Look for a hint-file generated 'call-back-unit'. Now that the
3016 : user has specified the compiler, we may need to set or change some
3018 if $test -f cc.cbu; then
3022 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3023 $cat >gccvers.c <<EOM
3028 printf("%s\n", __VERSION__);
3030 printf("%s\n", "1");
3036 if $cc -o gccvers gccvers.c; then
3037 gccversion=`./gccvers`
3038 case "$gccversion" in
3039 '') echo "You are not using GNU cc." ;;
3040 *) echo "You are using GNU cc $gccversion." ;;
3044 echo "*** WHOA THERE!!! ***" >&4
3045 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3046 case "$knowitall" in
3048 echo " You'd better start hunting for one and let me know about it." >&4
3054 case "$gccversion" in
3055 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3058 : see how we invoke the C preprocessor
3060 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3061 cat <<'EOT' >testcpp.c
3067 if test ! -f cppstdin; then
3068 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3069 # AIX cc -E doesn't show the absolute headerfile
3070 # locations but we'll cheat by using the -M flag.
3071 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
3073 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3076 echo "Keeping your $hint cppstdin wrapper."
3079 wrapper=`pwd`/cppstdin
3083 if $test "X$cppstdin" != "X" && \
3084 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3085 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3087 echo "You used to use $cppstdin $cppminus so we'll use that again."
3089 '') echo "But let's see if we can live without a wrapper..." ;;
3091 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3092 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3094 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3097 echo "(However, $cpprun $cpplast does not work, let's see...)"
3105 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3112 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3113 $cc -E <testcpp.c >testcpp.out 2>&1; \
3114 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3115 echo "Yup, it does."
3118 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3119 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3120 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3121 echo "Yup, it does."
3124 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3125 $cc -P <testcpp.c >testcpp.out 2>&1; \
3126 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3127 echo "Yipee, that works!"
3130 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3131 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3132 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3133 echo "At long last!"
3136 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3137 $cpp <testcpp.c >testcpp.out 2>&1; \
3138 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3142 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3143 $cpp - <testcpp.c >testcpp.out 2>&1; \
3144 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3145 echo "Hooray, it works! I was beginning to wonder."
3148 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3149 $wrapper <testcpp.c >testcpp.out 2>&1; \
3150 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3156 rp="No dice. I can't find a C preprocessor. Name one:"
3160 $x_cpp <testcpp.c >testcpp.out 2>&1
3161 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3162 echo "OK, that will do." >&4
3164 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3179 echo "Perhaps can we force $cc -E using a wrapper..."
3180 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3181 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3187 echo "Nope, we'll have to live without it..."
3201 "$wrapper"|'cppstdin') ;;
3202 *) $rm -f $wrapper;;
3204 $rm -f testcpp.c testcpp.out
3206 : decide how portable to be. Allow command line overrides.
3207 case "$d_portable" in
3209 *) d_portable="$define" ;;
3212 : set up shell script to do ~ expansion
3218 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3221 if $test -f /bin/csh; then
3222 /bin/csh -f -c "glob \$1"
3227 name=\`$expr x\$1 : '..\([^/]*\)'\`
3228 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3229 if $test ! -d "\$dir"; then
3231 echo "\$me: can't locate home directory for: \$name" >&2
3236 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3252 : now set up to get a file name
3256 cat <<'EOSC' >>getfile
3272 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3273 fn=`echo $fn | sed 's/(.*)//'`
3279 loc_file=`expr $fn : '.*:\(.*\)'`
3280 fn=`expr $fn : '\(.*\):.*'`
3288 */*) fullpath=true;;
3297 *e*) exp_file=true;;
3300 *p*) nopath_ok=true;;
3305 *d*) type='Directory';;
3306 *l*) type='Locate';;
3311 Locate) what='File';;
3316 case "$d_portable" in
3324 while test "$type"; do
3329 true) rp="$rp (~name ok)";;
3332 if test -f UU/getfile.ok && \
3333 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3352 value=`UU/filexp $ans`
3355 if test "$ans" != "$value"; then
3356 echo "(That expands to $value on this system.)"
3370 /*) value="$ansexp" ;;
3375 echo "I shall only accept a full path name, as in /bin/ls." >&4
3376 echo "Use a ! shell escape if you wish to check pathnames." >&4
3379 echo "Please give a full path name, starting with slash." >&4
3382 echo "Note that using ~name is ok provided it expands well." >&4
3395 for fp in $gfpth; do
3396 if test "X$fp" = X.; then
3401 if test -f "$pf"; then
3403 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3405 echo "($value is not a plain file, but that's ok.)"
3408 if test X"$type" = X; then
3415 for fp in $gfpth; do
3416 if test "X$fp" = X.; then
3421 if test -d "$pf"; then
3429 if test -d "$ansexp"; then
3430 echo "(Looking for $loc_file in directory $value.)"
3431 value="$value/$loc_file"
3432 ansexp="$ansexp/$loc_file"
3434 if test -f "$ansexp"; then
3437 case "$nopath_ok" in
3438 true) case "$value" in
3440 *) echo "Assuming $value will be in people's path."
3456 if test "$fastread" = yes; then
3461 rp="$what $value doesn't exist. Use that name anyway?"
3480 test "X$gfpthkeep" != Xy && gfpth=""
3483 : What should the include directory be ?
3485 $echo $n "Hmm... $c"
3489 if $test -f /bin/mips && /bin/mips; then
3490 echo "Looks like a MIPS system..."
3491 $cat >usr.c <<'EOCP'
3492 #ifdef SYSTYPE_BSD43
3496 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3497 dflt='/bsd43/usr/include'
3501 mips_type='System V'
3503 $rm -f usr.c usr.out
3504 echo "and you're compiling with the $mips_type compiler and libraries."
3508 echo "Doesn't look like a MIPS system."
3518 case "$xxx_prompt" in
3521 rp='Where are the include files you want to use?'
3529 : Set private lib path
3532 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3537 '') dlist="$loclibpth $plibpth $glibpth";;
3538 *) dlist="$libpth";;
3541 : Now check and see which directories actually exist, avoiding duplicates
3545 if $test -d $xxx; then
3548 *) libpth="$libpth $xxx";;
3554 Some systems have incompatible or broken versions of libraries. Among
3555 the directories listed in the question below, please remove any you
3556 know not to be holding relevant libraries, and add any that are needed.
3557 Say "none" for none.
3568 rp="Directories to use for library searches?"
3575 : compute shared library extension
3578 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3588 On some systems, shared libraries may be available. Answer 'none' if
3589 you want to suppress searching of shared libraries for the remaining
3590 of this configuration.
3593 rp='What is the file extension used for shared libraries?'
3597 : Define several unixisms.
3598 : Hints files or command line option can be used to override them.
3599 : The convoluted testing is in case hints files set either the old
3602 '') case "$exe_ext" in
3604 *) _exe="$exe_ext" ;;
3609 '') case "$lib_ext" in
3616 '') case "$obj_ext" in
3623 '') case "$path_sep" in
3634 : Which makefile gets called first. This is used by make depend.
3635 case "$firstmakefile" in
3636 '') firstmakefile='makefile';;
3641 Perl can be built to use the SOCKS proxy protocol library. To do so,
3642 Configure must be run with -Dusesocks.
3644 Normally you do not need this and you should answer no.
3648 $define|true|[yY]*) dflt='y';;
3651 rp='Build Perl for SOCKS?'
3654 y|Y) val="$define" ;;
3660 : Looking for optional libraries
3662 echo "Checking for optional libraries..." >&4
3667 case "$libswanted" in
3668 '') libswanted='c_s';;
3672 libswanted="$libswanted socks5 socks5_sh"
3675 for thislib in $libswanted; do
3677 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3678 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3679 echo "Found -l$thislib (shared)."
3682 *) dflt="$dflt -l$thislib";;
3684 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3685 echo "Found -l$thislib (shared)."
3688 *) dflt="$dflt -l$thislib";;
3690 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3691 echo "Found -l$thislib."
3694 *) dflt="$dflt -l$thislib";;
3696 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3697 echo "Found -l$thislib."
3700 *) dflt="$dflt -l$thislib";;
3702 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3703 echo "Found -l${thislib}_s."
3706 *) dflt="$dflt -l${thislib}_s";;
3708 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3709 echo "Found -l$thislib."
3712 *) dflt="$dflt -l$thislib";;
3715 echo "No -l$thislib."
3726 ' '|'') dflt='none';;
3731 In order to compile $package on your machine, a number of libraries
3732 are usually needed. Include any other special libraries here as well.
3733 Say "none" for none. The default list is almost always right.
3737 rp="What libraries to use?"
3744 : determine optimization, if desired, or use for debug flag also
3746 ' '|$undef) dflt='none';;
3748 *) dflt="$optimize";;
3752 By default, $package compiles with the -O flag to use the optimizer.
3753 Alternately, you might want to use the symbolic debugger, which uses
3754 the -g flag (on traditional Unix systems). Either flag can be
3755 specified here. To use neither flag, specify the word "none".
3758 rp="What optimizer/debugger flag should be used?"
3762 'none') optimize=" ";;
3766 : We will not override a previous value, but we might want to
3767 : augment a hint file
3769 default|recommended)
3770 case "$gccversion" in
3771 1*) dflt='-fpcc-struct-return' ;;
3774 *-g*) dflt="$dflt -DDEBUGGING";;
3776 case "$gccversion" in
3777 2*) if test -d /etc/conf/kconfig.d &&
3778 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3784 case "$gccversion" in
3788 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3789 echo 'int main(void) { return 0; }' > gcctest.c
3790 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3791 echo "Yes, it does." 2>&1
3794 echo "Leaving current flags $ccflags alone." 2>&1
3796 *) dflt="$dflt -fno-strict-aliasing" ;;
3799 echo "Nope, it doesn't, but that's ok." 2>&1
3806 case "$mips_type" in
3807 *BSD*|'') inclwanted="$locincpth $usrinc";;
3808 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3810 for thisincl in $inclwanted; do
3811 if $test -d $thisincl; then
3812 if $test x$thisincl != x$usrinc; then
3815 *) dflt="$dflt -I$thisincl";;
3821 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3823 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3831 *) dflt="$dflt -D$2";;
3835 set signal.h LANGUAGE_C; eval $inctest
3839 ccflags="$ccflags -DSOCKS"
3844 default|recommended) dflt="$ccflags $dflt" ;;
3845 *) dflt="$ccflags";;
3853 Your C compiler may want other flags. For this question you should include
3854 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3855 but you should NOT include libraries or ld flags like -lwhatever. If you
3856 want $package to honor its debug switch, you should include -DDEBUGGING here.
3857 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3859 To use no flags, specify the word "none".
3865 rp="Any additional cc flags?"
3872 : the following weeds options from ccflags that are of no interest to cpp
3874 case "$gccversion" in
3875 1*) cppflags="$cppflags -D__GNUC__"
3877 case "$mips_type" in
3879 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3885 echo "Let me guess what the preprocessor flags are..." >&4
3899 *) ftry="$previous $flag";;
3901 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3902 >cpp1.out 2>/dev/null && \
3903 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3904 >cpp2.out 2>/dev/null && \
3905 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3906 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3908 cppflags="$cppflags $ftry"
3918 *-*) echo "They appear to be: $cppflags";;
3920 $rm -f cpp.c cpp?.out
3924 : flags used in final linking phase
3926 '') if ./venix; then
3932 *-posix*) dflt="$dflt -posix" ;;
3935 *) dflt="$ldflags";;
3938 : Try to guess additional flags to pick up local libraries.
3939 for thislibdir in $libpth; do
3940 case " $loclibpth " in
3943 *"-L$thislibdir "*) ;;
3944 *) dflt="$dflt -L$thislibdir" ;;
3956 Your C linker may need flags. For this question you should
3957 include -L/whatever and any other flags used by the C linker, but you
3958 should NOT include libraries like -lwhatever.
3960 Make sure you include the appropriate -L/path flags if your C linker
3961 does not normally search all of the directories you specified above,
3964 To use no flags, specify the word "none".
3968 rp="Any additional ld flags (NOT including libraries)?"
3974 rmlist="$rmlist pdp11"
3978 echo "Checking your choice of C compiler and flags for coherency..." >&4
3979 $cat > try.c <<'EOF'
3981 int main() { printf("Ok\n"); exit(0); }
3983 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3985 $cat >try.msg <<'EOM'
3986 I've tried to compile and run the following simple program:
3989 $cat try.c >> try.msg
3991 $cat >> try.msg <<EOM
3998 and I got the following output:
4002 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4003 if sh -c './try' >>try.msg 2>&1; then
4007 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4010 cat >> try.msg <<'EOQS'
4011 If $libs contains -lsfio, and sfio is mis-configured, then it
4012 sometimes (apparently) runs and exits with a 0 status, but with no
4013 output! It may have to do with sfio's use of _exit vs. exit.
4016 rp="You have a big problem. Shall I abort Configure"
4023 echo "The program compiled OK, but exited with status $?." >>try.msg
4024 rp="You have a problem. Shall I abort Configure"
4028 echo "I can't compile the test program." >>try.msg
4029 rp="You have a BIG problem. Shall I abort Configure"
4035 case "$knowitall" in
4037 echo "(The supplied flags or libraries might be incorrect.)"
4045 *) echo "Ok. Stopping Configure." >&4
4050 n) echo "OK, that should do.";;
4052 $rm -f try try.* core
4054 : define an is-a-typedef? function
4055 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4057 "") inclist="sys/types.h";;
4059 eval "varval=\$$var";
4063 for inc in $inclist; do
4064 echo "#include <$inc>" >>temp.c;
4066 echo "#ifdef $type" >> temp.c;
4067 echo "printf(\"We have $type\");" >> temp.c;
4068 echo "#endif" >> temp.c;
4069 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4070 if $contains $type temp.E >/dev/null 2>&1; then
4076 *) eval "$var=\$varval";;
4079 : define an is-a-typedef? function that prompts if the type is not available.
4080 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4082 "") inclist="sys/types.h";;
4084 eval "varval=\$$var";
4088 for inc in $inclist; do
4089 echo "#include <$inc>" >>temp.c;
4091 echo "#ifdef $type" >> temp.c;
4092 echo "printf(\"We have $type\");" >> temp.c;
4093 echo "#endif" >> temp.c;
4094 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4096 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4097 if $contains $type temp.E >/dev/null 2>&1; then
4098 echo "$type found." >&4;
4101 echo "$type NOT found." >&4;
4107 *) eval "$var=\$varval";;
4110 : define a shorthand compile call
4114 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4115 : define a shorthand compile call for compilations that should be ok.
4119 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4121 : check for lengths of integral types
4125 echo "Checking to see how big your integers are..." >&4
4126 $cat >intsize.c <<'EOCP'
4130 printf("intsize=%d;\n", (int)sizeof(int));
4131 printf("longsize=%d;\n", (int)sizeof(long));
4132 printf("shortsize=%d;\n", (int)sizeof(short));
4137 if eval $compile_ok && ./intsize > /dev/null; then
4139 echo "Your integers are $intsize bytes long."
4140 echo "Your long integers are $longsize bytes long."
4141 echo "Your short integers are $shortsize bytes long."
4145 Help! I can't compile and run the intsize test program: please enlighten me!
4146 (This is probably a misconfiguration in your system or libraries, and
4147 you really ought to fix it. Still, I'll try anyway.)
4151 rp="What is the size of an integer (in bytes)?"
4155 rp="What is the size of a long integer (in bytes)?"
4159 rp="What is the size of a short integer (in bytes)?"
4165 $rm -f intsize intsize.*
4167 : see what type lseek is declared as in the kernel
4168 rp="What is the type used for lseek's offset on this system?"
4169 set off_t lseektype long stdio.h sys/types.h
4173 $echo $n "Checking to see how big your file offsets are...$c" >&4
4175 #include <sys/types.h>
4179 printf("%d\n", (int)sizeof($lseektype));
4184 if eval $compile_ok; then
4186 $echo " $lseeksize bytes." >&4
4190 echo "(I can't seem to compile the test program. Guessing...)"
4191 rp="What is the size of your file offsets (in bytes)?"
4197 : see what type file positions are declared as in the library
4198 rp="What is the type for file position used by fsetpos()?"
4199 set fpos_t fpostype long stdio.h sys/types.h
4204 *_t) zzz="$fpostype" ;;
4207 $echo $n "Checking the size of $zzz...$c" >&4
4209 #include <sys/types.h>
4212 printf("%d\n", (int)sizeof($fpostype));
4217 if eval $compile_ok; then
4222 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4225 echo " $fpossize bytes."
4231 echo "(I can't compile the test program. Guessing...)" >&4
4232 rp="What is the size of your file positions (in bytes)?"
4239 case "$lseeksize:$fpossize" in
4242 You can have files larger than 2 gigabytes.
4247 Perl can be built to understand large files (files larger than 2 gigabytes)
4248 on some systems. To do so, Configure must be run with -Duselargefiles.
4250 If this doesn't make any sense to you, just accept the default 'y'.
4252 case "$uselargefiles" in
4253 "$undef"|false|[nN]*) dflt='n' ;;
4256 rp='Try to understand large files, if available?'
4259 y|Y) val="$define" ;;
4266 case "$uselargefiles" in
4268 : Look for a hint-file generated 'call-back-unit'. If the
4269 : user has specified that a large files perl is to be built,
4270 : we may need to set or change some other defaults.
4271 if $test -f uselfs.cbu; then
4272 echo "Your platform has some specific hints for large file builds, using them..."
4275 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4277 #include <sys/types.h>
4281 printf("%d\n", (int)sizeof($lseektype));
4286 if eval $compile_ok; then
4288 $echo " $lseeksize bytes." >&4
4292 echo "(I can't seem to compile the test program. Guessing...)"
4293 rp="What is the size of your file offsets (in bytes)?"
4298 *_t) zzz="$fpostype" ;;
4301 $echo $n "Rechecking the size of $zzz...$c" >&4
4303 #include <sys/types.h>
4306 printf("%d\n", (int)sizeof($fpostype));
4311 if eval $compile_ok; then
4316 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4319 echo " $fpossize bytes."
4325 echo "(I can't compile the test program. Guessing...)" >&4
4326 rp="What is the size of your file positions (in bytes)?"
4336 case "$usemorebits" in
4337 "$define"|true|[yY]*)
4339 uselongdouble="$define"
4340 usemorebits="$define"
4342 *) usemorebits="$undef"
4347 case "$intsize:$longsize" in
4350 You have natively 64-bit integers.
4355 Perl can be built to take advantage of 64-bit integer types
4356 on some systems. To do so, Configure must be run with -Duse64bits.
4358 If this doesn't make any sense to you, just accept the default.
4360 case "$use64bits" in
4361 $define|true|[yY]*) dflt='y';;
4364 rp='Try to use 64-bit integers, if available?'
4367 y|Y) val="$define" ;;
4375 case "$archname64" in
4376 '') archname64='' ;; # not a typo
4379 case "$use64bits" in
4380 "$define"|true|[yY]*)
4381 : Look for a hint-file generated 'call-back-unit'. If the
4382 : user has specified that a 64-bit perl is to be built,
4383 : we may need to set or change some other defaults.
4384 if $test -f use64bits.cbu; then
4385 echo "Your platform has some specific hints for 64-bit builds, using them..."
4389 (Your platform doesn't have any specific hints for 64-bit builds.)
4391 case "$intsize:$longsize" in
4393 (This is probably okay, as your system is a natively 64-bit system.)
4397 case "$gccversion" in
4399 *) case "$ccflags" in
4400 *-DUSE_LONG_LONG*) ;;
4402 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4403 to the compilation flags.
4405 ccflags="$ccflags -DUSE_LONG_LONG"
4414 : determine the architecture name
4416 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4417 tarch=`arch`"-$osname"
4418 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4419 if uname -m > tmparch 2>&1 ; then
4420 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4421 -e 's/$/'"-$osname/" tmparch`
4429 case "$myarchname" in
4432 echo "(Your architecture name used to be $myarchname.)"
4439 *) dflt="$archname";;
4441 rp='What is your architecture name'
4444 case "$usethreads" in
4446 echo "Threads selected." >&4
4448 *-thread*) echo "...and architecture name already has -thread." >&4
4450 *) archname="$archname-thread"
4451 echo "...setting architecture name to $archname." >&4
4456 case "$usemultiplicity" in
4458 echo "Multiplicity selected." >&4
4460 *-multi*) echo "...and architecture name already has -multi." >&4
4462 *) archname="$archname-multi"
4463 echo "...setting architecture name to $archname." >&4
4468 case "$use64bits" in
4470 case "$archname64" in
4475 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4477 *) archname="$archname-$archname64"
4478 echo "...setting architecture name to $archname." >&4
4485 : determine root of directory hierarchy where package will be installed.
4488 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4496 By default, $package will be installed in $dflt/bin, manual pages
4497 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4498 installation directories. Typically this is something like /usr/local.
4499 If you wish to have binaries under /usr/bin but other parts of the
4500 installation under /usr/local, that's ok: you will be prompted
4501 separately for each of the installation directories, the prefix being
4502 only used to set the defaults.
4506 rp='Installation prefix to use?'
4514 *) oldprefix="$prefix";;
4524 $define|true) afs=true ;;
4525 $undef|false) afs=false ;;
4526 *) if test -d /afs; then
4534 echo "AFS may be running... I'll be extra cautious then..." >&4
4536 echo "AFS does not seem to be running..." >&4
4539 : determine installation prefix for where package is to be installed.
4543 Since you are running AFS, I need to distinguish the directory in which
4544 files will reside from the directory in which they are installed (and from
4545 which they are presumably copied to the former directory by occult means).
4548 case "$installprefix" in
4549 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4550 *) dflt="$installprefix";;
4555 In some special cases, particularly when building $package for distribution,
4556 it is convenient to distinguish between the directory in which files should
4557 be installed from the directory ($prefix) in which they
4558 will eventually reside. For most users, these two directories are the same.
4561 case "$installprefix" in
4563 *) dflt=$installprefix;;
4567 rp='What installation prefix should I use for installing files?'
4569 installprefix="$ans"
4570 installprefixexp="$ansexp"
4572 : set the prefixit variable, to compute a suitable default value
4573 prefixit='case "$3" in
4575 case "$oldprefix" in
4576 "") eval "$1=\"\$$2\"";;
4583 ""|" ") eval "$1=\"\$$2\"";;
4589 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4591 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4592 /*-$oldprefix/*|\~*-$oldprefix/*)
4593 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4594 *) eval "$1=\"\$$2\"";;
4598 : set the base revision
4601 : get the patchlevel
4603 echo "Getting the current patchlevel..." >&4
4604 if $test -r $rsrc/patchlevel.h;then
4605 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4606 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4607 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
4613 $echo $n "(You have $package" $c
4616 *) $echo $n " $baserev" $c ;;
4618 $echo $n " patchlevel $patchlevel" $c
4619 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4622 if test 0 -eq "$subversion"; then
4623 version=`LC_ALL=C; export LC_ALL; \
4624 echo $baserev $patchlevel | \
4625 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
4627 version=`LC_ALL=C; export LC_ALL; \
4628 echo $baserev $patchlevel $subversion | \
4629 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
4632 : determine installation style
4633 : For now, try to deduce it from prefix unless it is already set.
4634 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4635 case "$installstyle" in
4636 '') case "$prefix" in
4637 *perl*) dflt='lib';;
4638 *) dflt='lib/perl5' ;;
4641 *) dflt='lib/perl5' ;;
4643 : Probably not worth prompting for this since we prompt for all
4644 : the directories individually, and the prompt would be too long and
4648 : determine where private library files go
4649 : Usual default is /usr/local/lib/perl5/$version.
4650 : Also allow things like /opt/perl/lib/$version, since
4651 : /opt/perl/lib/perl5... would be redundant.
4652 : The default "style" setting is made in installstyle.U
4653 case "$installstyle" in
4654 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4655 *) set dflt privlib lib/$version ;;
4660 There are some auxiliary files for $package that need to be put into a
4661 private library directory that is accessible by everyone.
4665 rp='Pathname where the private library files will reside?'
4668 privlibexp="$ansexp"
4669 : Change installation prefix, if necessary.
4670 if $test X"$prefix" != X"$installprefix"; then
4671 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4673 installprivlib="$privlibexp"
4676 : set the prefixup variable, to restore leading tilda escape
4677 prefixup='case "$prefixexp" in
4679 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4682 : determine where public architecture dependent libraries go
4685 : privlib default is /usr/local/lib/$package/$version
4686 : archlib default is /usr/local/lib/$package/$version/$archname
4687 : privlib may have an optional trailing /share.
4688 tdflt=`echo $privlib | $sed 's,/share$,,'`
4689 tdflt=$tdflt/$archname
4698 $spackage contains architecture-dependent library files. If you are
4699 sharing libraries in a heterogeneous environment, you might store
4700 these files in a separate location. Otherwise, you can just include
4701 them with the rest of the public library files.
4705 rp='Where do you want to put the public architecture-dependent libraries?'
4708 archlibexp="$ansexp"
4709 if $test X"$archlib" = X"$privlib"; then
4714 : Change installation prefix, if necessary.
4715 if $test X"$prefix" != X"$installprefix"; then
4716 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4718 installarchlib="$archlibexp"
4722 : Binary compatibility with 5.005 is not possible for builds
4723 : with advanced features
4724 case "$usethreads$usemultiplicity" in
4726 bincompat5005="$undef"
4727 d_bincompat5005="$undef"
4731 Perl 5.006 can be compiled for binary compatibility with 5.005.
4732 If you decide to do so, you will be able to continue using most
4733 of the extensions that were compiled for Perl 5.005.
4736 case "$bincompat5005$d_bincompat5005" in
4737 *"$undef"*) dflt=n ;;
4740 rp='Binary compatibility with Perl 5.005?'
4743 y*) val="$define" ;;
4748 case "$d_bincompat5005" in
4750 bincompat5005="$define"
4752 *) bincompat5005="$undef"
4753 d_bincompat5005="$undef"
4760 : see if setuid scripts can be secure
4763 Some kernels have a bug that prevents setuid #! scripts from being
4764 secure. Some sites have disabled setuid #! scripts because of this.
4766 First let's decide if your kernel supports secure setuid #! scripts.
4767 (If setuid #! scripts would be secure but have been disabled anyway,
4768 don't say that they are secure if asked.)
4773 if $test -d /dev/fd; then
4774 echo "#!$ls" >reflect
4775 chmod +x,u+s reflect
4776 ./reflect >flect 2>&1
4777 if $contains "/dev/fd" flect >/dev/null; then
4778 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4782 If you are not sure if they are secure, I can check but I'll need a
4783 username and password different from the one you are using right now.
4784 If you don't have such a username or don't want me to test, simply
4788 rp='Other username to test security of setuid scripts with?'
4793 case "$d_suidsafe" in
4794 '') echo "I'll assume setuid scripts are *not* secure." >&4
4797 echo "Well, the $hint value is *not* secure." >&4
4799 *) echo "Well, the $hint value *is* secure." >&4
4804 $rm -f reflect flect
4805 echo "#!$ls" >reflect
4806 chmod +x,u+s reflect
4809 echo '"su" will (probably) prompt you for '"$ans's password."
4810 su $ans -c './reflect >flect'
4811 if $contains "/dev/fd" flect >/dev/null; then
4812 echo "Okay, it looks like setuid scripts are secure." >&4
4815 echo "I don't think setuid scripts are secure." >&4
4820 rp='Does your kernel have *secure* setuid scripts?'
4823 [yY]*) val="$define";;
4828 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4829 echo "(That's for file descriptors, not floppy disks.)"
4835 $rm -f reflect flect
4837 : now see if they want to do setuid emulation
4840 case "$d_suidsafe" in
4843 echo "No need to emulate SUID scripts since they are secure here." >& 4
4847 Some systems have disabled setuid scripts, especially systems where
4848 setuid scripts cannot be secure. On systems where setuid scripts have
4849 been disabled, the setuid/setgid bits on scripts are currently
4850 useless. It is possible for $package to detect those bits and emulate
4851 setuid/setgid in a secure fashion. This emulation will only work if
4852 setuid scripts have been disabled in your kernel.
4856 "$define") dflt=y ;;
4859 rp="Do you want to do setuid/setgid emulation?"
4862 [yY]*) val="$define";;
4870 : determine filename position in cpp output
4872 echo "Computing filename position in cpp output for #include directives..." >&4
4873 echo '#include <stdio.h>' > foo.c
4876 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4877 $grep '^[ ]*#.*stdio\.h' | \
4878 while read cline; do
4881 while $test \$# -gt 0; do
4882 if $test -r \`echo \$1 | $tr -d '"'\`; then
4887 pos=\`expr \$pos + 1\`
4899 *) pos="${fieldn}th";;
4901 echo "Your cpp writes the filename in the $pos field of the line."
4903 : locate header file
4908 for usrincdir in $usrinc
4910 if test -f \$usrincdir/\$wanted; then
4911 echo "\$usrincdir/\$wanted"
4915 awkprg='{ print \$$fieldn }'
4916 echo "#include <\$wanted>" > foo\$\$.c
4917 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4918 $grep "^[ ]*#.*\$wanted" | \
4919 while read cline; do
4920 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4922 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4923 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4928 # status = 0: grep returned 0 lines, case statement not executed
4929 # status = 1: headerfile found
4930 # status = 2: while loop executed, no headerfile found
4934 if test \$status -eq 1; then
4941 : define an alternate in-header-list? function
4942 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4943 cont=true; xxf="echo \"<\$1> found.\" >&4";
4944 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4945 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4947 case $# in 4) instead=instead;; *) instead="at last";; esac;
4948 while $test "$cont"; do
4950 var=$2; eval "was=\$$2";
4951 if $test "$xxx" && $test -r "$xxx";
4953 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4956 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4957 set $yyy; shift; shift; yyy=$@;
4958 case $# in 0) cont="";;
4959 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4960 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4961 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4962 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4966 do set $yyy; var=$2; eval "was=\$$2";
4967 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4968 set $yyy; shift; shift; yyy=$@;
4971 : see if this is a malloc.h system
4972 set malloc.h i_malloc
4975 : see if stdlib is available
4976 set stdlib.h i_stdlib
4979 : determine which malloc to compile in
4981 case "$usemymalloc" in
4982 ''|[yY]*|true|$define) dflt='y' ;;
4985 rp="Do you wish to attempt to use the malloc that comes with $package?"
4991 mallocsrc='malloc.c'
4992 mallocobj="malloc$_o"
4993 d_mymalloc="$define"
4996 : Remove malloc from list of libraries to use
4997 echo "Removing unneeded -lmalloc from library list" >&4
4998 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5001 echo "libs = $libs" >&4
5013 : compute the return types of malloc and free
5015 $cat >malloc.c <<END
5019 #include <sys/types.h>
5033 case "$malloctype" in
5035 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5042 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5046 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5053 echo "Your system uses $freetype free(), it would seem." >&4
5057 The installation process will also create a directory for
5058 vendor-supplied add-ons. Vendors who supply perl with their system
5059 may find it convenient to place all vendor-supplied files in this
5060 directory rather than in the main distribution directory. This will
5061 ease upgrades between binary-compatible maintenance versions of perl.
5063 Of course you may also use these directories in whatever way you see
5064 fit. For example, you might use them to access modules shared over a
5065 company-wide network.
5067 The default answer should be fine for most people.
5068 This causes further questions about vendor add-ons to be skipped
5069 and no vendor-specific directories will be configured for perl.
5072 rp='Do you want to configure vendor-specific add-on directories?'
5073 case "$usevendorprefix" in
5074 define|true|[yY]*) dflt=y ;;
5080 rp='Installation prefix to use for vendor-supplied add-ons?'
5081 case "$vendorprefix" in
5083 *) dflt=$vendorprefix ;;
5087 case "$vendorprefix" in
5091 *) oldvendorprefix="$prefix";;
5095 usevendorprefix="$define"
5097 vendorprefixexp="$ansexp"
5099 *) usevendorprefix="$undef"
5105 case "$vendorprefix" in
5106 '') d_vendorlib="$undef"
5110 *) d_vendorlib="$define"
5111 : determine where vendor-supplied modules go.
5112 : Usual default is /usr/local/lib/perl5/vendor_perl
5113 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5114 case "$installstyle" in
5115 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
5116 *) dflt=$vendorprefix/lib/vendor_$prog ;;
5119 rp='Pathname for the vendor-supplied library files?'
5122 vendorlibexp="$ansexp"
5123 : Change installation prefix, if necessary.
5124 if $test X"$prefix" != X"$installprefix"; then
5125 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5127 installvendorlib="$vendorlibexp"
5132 : Cruising for prototypes
5134 echo "Checking out function prototypes..." >&4
5135 $cat >prototype.c <<'EOCP'
5136 int main(int argc, char *argv[]) {
5139 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5140 echo "Your C compiler appears to support function prototypes."
5143 echo "Your C compiler doesn't seem to understand function prototypes."
5150 case "$prototype" in
5152 *) ansi2knr='ansi2knr'
5157 This version of $package can only be compiled by a compiler that
5158 understands function prototypes. Unfortunately, your C compiler
5160 doesn't seem to understand them. Sorry about that.
5162 If GNU cc is available for your system, perhaps you could try that instead.
5164 Eventually, we hope to support building Perl with pre-ANSI compilers.
5165 If you would like to help in that effort, please contact <perlbug@perl.org>.
5167 Aborting Configure now.
5173 : determine where public executables go
5178 rp='Pathname where the public executables will reside?'
5180 if $test "X$ansexp" != "X$binexp"; then
5185 : Change installation prefix, if necessary.
5186 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5187 if $test X"$prefix" != X"$installprefix"; then
5188 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5190 installbin="$binexp"
5193 : determine whether to install perl also as /usr/bin/perl
5196 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5198 Many scripts expect to perl to be installed as /usr/bin/perl.
5199 I can install the perl you are about to compile also as /usr/bin/perl
5200 (in addition to $installbin/perl).
5202 case "$installusrbinperl" in
5203 "$undef"|[nN]*) dflt='n';;
5206 rp="Do you want to install perl as /usr/bin/perl?"
5209 [yY]*) val="$define";;
5215 set installusrbinperl
5219 echo "Checking for GNU C Library..." >&4
5220 cat >gnulibc.c <<EOM
5232 if eval $compile_ok && ./gnulibc; then
5234 echo "You are using the GNU C Library"
5237 echo "You are not using the GNU C Library"
5243 : see if nm is to be used to determine whether a symbol is defined or not
5247 case "$d_gnulibc" in
5250 echo "nm probably won't work on the GNU C Library." >&4
5256 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5258 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5259 echo "'nm' won't be sufficient on this sytem." >&4
5265 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5266 if $test $dflt -gt 20; then
5276 true|$define) dflt=y;;
5283 I can use $nm to extract the symbols from your C libraries. This
5284 is a time consuming task which may generate huge output on the disk (up
5285 to 3 megabytes) but that should make the symbols extraction faster. The
5286 alternative is to skip the 'nm' extraction part and to compile a small
5287 test program instead to determine whether each symbol is present. If
5288 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5289 this may be the best solution.
5291 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5294 rp="Shall I use $nm to extract C symbols from the libraries?"
5297 [Nn]*) usenm=false;;
5306 : nm options which may be necessary
5308 '') if $test -f /mach_boot; then
5310 elif $test -d /usr/ccs/lib; then
5311 nm_opt='-p' # Solaris (and SunOS?)
5312 elif $test -f /dgux; then
5314 elif $test -f /lib64/rld; then
5315 nm_opt='-p' # 64-bit Irix
5321 : nm options which may be necessary for shared libraries but illegal
5322 : for archive libraries. Thank you, Linux.
5323 case "$nm_so_opt" in
5324 '') case "$myuname" in
5326 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5327 nm_so_opt='--dynamic'
5336 : get list of predefined functions in a handy place
5341 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5348 *) for thislib in $libs; do
5351 : Handle C library specially below.
5354 thislib=`echo $thislib | $sed -e 's/^-l//'`
5355 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5357 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5359 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5361 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5363 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5365 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5367 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5372 libnames="$libnames $try"
5374 *) libnames="$libnames $thislib" ;;
5383 for xxx in $libpth; do
5384 $test -r $1 || set $xxx/libc.$so
5385 : The messy sed command sorts on library version numbers.
5387 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5388 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5390 s/[0-9][0-9]*/0000&/g
5391 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5394 sort | $sed -e 's/^.* //'`
5397 $test -r $1 || set /usr/ccs/lib/libc.$so
5398 $test -r $1 || set /lib/libsys_s$_a
5404 if $test -r "$1"; then
5405 echo "Your (shared) C library seems to be in $1."
5407 elif $test -r /lib/libc && $test -r /lib/clib; then
5408 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5410 libc='/lib/clib /lib/libc'
5411 if $test -r /lib/syslib; then
5412 echo "(Your math library is in /lib/syslib.)"
5413 libc="$libc /lib/syslib"
5415 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5416 echo "Your C library seems to be in $libc, as you said before."
5417 elif $test -r $incpath/usr/lib/libc$_a; then
5418 libc=$incpath/usr/lib/libc$_a;
5419 echo "Your C library seems to be in $libc. That's fine."
5420 elif $test -r /lib/libc$_a; then
5422 echo "Your C library seems to be in $libc. You're normal."
5424 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5426 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5427 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5428 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5430 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5432 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5435 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5437 if $test -r "$tans"; then
5438 echo "Your C library seems to be in $tans, of all places."
5444 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5448 If the guess above is wrong (which it might be if you're using a strange
5449 compiler, or your machine supports multiple models), you can override it here.
5454 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5456 I can't seem to find your C library. I've looked in the following places:
5459 $sed 's/^/ /' libpath
5462 None of these seems to contain your C library. I need to get its name...
5467 rp='Where is your C library?'
5472 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5473 set X `cat libnames`
5476 case $# in 1) xxx=file; esac
5477 echo "Extracting names from the following $xxx for later perusal:" >&4
5479 $sed 's/^/ /' libnames >&4
5481 $echo $n "This may take a while...$c" >&4
5485 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5486 *) $nm $nm_opt $file 2>/dev/null;;
5491 $grep fprintf libc.tmp > libc.ptf
5492 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5493 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5495 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5497 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5499 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5501 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5503 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5505 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5507 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5509 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5511 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5513 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5515 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5517 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5519 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5520 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5522 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5524 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5526 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5528 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5530 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5532 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5534 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5536 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5538 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5540 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5542 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5544 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5546 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5548 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5550 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5553 $nm -p $* 2>/dev/null >libc.tmp
5554 $grep fprintf libc.tmp > libc.ptf
5555 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5556 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5562 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5564 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5565 for thisname in $libnames $libc; do
5566 $ar t $thisname >>libc.tmp
5568 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5570 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5571 # Repeat libc to extract forwarders to DLL entries too
5572 for thisname in $libnames $libc; do
5573 $ar tv $thisname >>libc.tmp
5574 # Revision 50 of EMX has bug in $ar.
5575 # it will not extract forwarders to DLL entries
5576 # Use emximp which will extract exactly them.
5577 emximp -o tmp.imp $thisname \
5579 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5580 < tmp.imp >>libc.tmp
5583 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5586 echo "$ar didn't seem to work right." >&4
5587 echo "Maybe this is a Cray...trying bld instead..." >&4
5588 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5590 for thisname in $libnames; do
5592 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5593 $ar t $thisname >>libc.tmp
5597 echo "That didn't work either. Giving up." >&4
5604 if $test -f /lib/syscalls.exp; then
5606 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5607 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5611 $rm -f libnames libpath
5613 : see if dld is available
5617 : is a C symbol defined?
5620 -v) tf=libc.tmp; tc=""; tdc="";;
5621 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5622 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5625 case "$reuseval-$4" in
5627 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5633 if $contains $tlook $tf >/dev/null 2>&1;
5638 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5639 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5647 $define) tval=true;;
5653 : define an is-in-libc? function
5654 inlibc='echo " "; td=$define; tu=$undef;
5655 sym=$1; var=$2; eval "was=\$$2";
5657 case "$reuseval$was" in
5667 echo "$sym() found." >&4;
5668 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5670 echo "$sym() NOT found." >&4;
5671 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5675 $define) echo "$sym() found." >&4;;
5676 *) echo "$sym() NOT found." >&4;;
5680 : see if dlopen exists
5687 : determine which dynamic loading, if any, to compile in
5689 dldir="ext/DynaLoader"
5702 $define) dflt='y' ;;
5705 $define) dflt='y' ;;
5707 : Does a dl_xxx.xs file exist for this operating system
5708 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5711 rp="Do you wish to use dynamic loading?"
5718 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5719 dflt="$dldir/dl_${osname}.xs"
5720 elif $test "$d_dlopen" = "$define" ; then
5721 dflt="$dldir/dl_dlopen.xs"
5722 elif $test "$i_dld" = "$define" ; then
5723 dflt="$dldir/dl_dld.xs"
5728 *) dflt="$dldir/$dlsrc"
5731 echo "The following dynamic loading files are available:"
5732 : Can not go over to $dldir because getfile has path hard-coded in.
5733 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5734 rp="Source file to use for dynamic loading"
5740 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5744 Some systems may require passing special flags to $cc -c to
5745 compile modules that will be used to create a shared library.
5746 To use no flags, say "none".
5749 case "$cccdlflags" in
5750 '') case "$gccversion" in
5751 '') case "$osname" in
5753 next) dflt='none' ;;
5754 irix*) dflt='-KPIC' ;;
5755 svr4*|esix*|solaris) dflt='-KPIC' ;;
5756 sunos) dflt='-pic' ;;
5760 *) case "$osname" in
5761 svr4*|esix*|solaris) dflt='-fPIC' ;;
5766 *) dflt="$cccdlflags" ;;
5768 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5771 none) cccdlflags=' ' ;;
5772 *) cccdlflags="$ans" ;;
5777 Some systems use ld to create libraries that can be dynamically loaded,
5778 while other systems (such as those using ELF) use $cc.
5782 '') $cat >try.c <<'EOM'
5783 /* Test for whether ELF binaries are produced */
5788 int i = open("a.out",O_RDONLY);
5791 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5792 exit(0); /* succeed (yes, it's ELF) */
5797 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5799 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5803 echo "I'll use ld to build dynamic libraries."
5812 rp="What command should be used to create dynamic libraries?"
5818 Some systems may require passing special flags to $ld to create a
5819 library that can be dynamically loaded. If your ld flags include
5820 -L/other/path options to locate libraries outside your loader's normal
5821 search path, you may need to specify those -L options here as well. To
5822 use no flags, say "none".
5825 case "$lddlflags" in
5826 '') case "$osname" in
5827 beos) dflt='-nostart' ;;
5829 linux|irix*) dflt='-shared' ;;
5830 next) dflt='none' ;;
5831 solaris) dflt='-G' ;;
5832 sunos) dflt='-assert nodefinitions' ;;
5833 svr4*|esix*) dflt="-G $ldflags" ;;
5837 *) dflt="$lddlflags" ;;
5840 : Try to guess additional flags to pick up local libraries.
5841 : Be careful not to append to a plain 'none'
5845 for thisflag in $ldflags; do
5850 *) dflt="$dflt $thisflag" ;;
5857 ''|' ') dflt='none' ;;
5860 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5863 none) lddlflags=' ' ;;
5864 *) lddlflags="$ans" ;;
5869 Some systems may require passing special flags to $cc to indicate that
5870 the resulting executable will use dynamic linking. To use no flags,
5874 case "$ccdlflags" in
5875 '') case "$osname" in
5876 hpux) dflt='-Wl,-E' ;;
5877 linux) dflt='-rdynamic' ;;
5878 next) dflt='none' ;;
5879 sunos) dflt='none' ;;
5883 *) dflt="$ccdlflags" ;;
5885 rp="Any special flags to pass to $cc to use dynamic loading?"
5888 none) ccdlflags=' ' ;;
5889 *) ccdlflags="$ans" ;;
5903 # No dynamic loading being used, so don't bother even to prompt.
5906 *) case "$useshrplib" in
5907 '') case "$osname" in
5908 svr4*|dgux|dynixptx|esix|powerux|beos)
5910 also='Building a shared libperl is required for dynamic loading to work on your system.'
5915 also='Building a shared libperl is needed for MAB support.'
5933 The perl executable is normally obtained by linking perlmain.c with
5934 libperl${_a}, any static extensions (usually just DynaLoader), and
5935 any other libraries needed on this system (such as -lm, etc.). Since
5936 your system supports dynamic loading, it is probably possible to build
5937 a shared libperl.$so. If you will have more than one executable linked
5938 to libperl.$so, this will significantly reduce the size of each
5939 executable, but it may have a noticeable affect on performance. The
5940 default is probably sensible for your system.
5944 rp="Build a shared libperl.$so (y/n)"
5948 useshrplib='true' ;;
5949 *) useshrplib='false' ;;
5954 case "$useshrplib" in
5958 # Figure out a good name for libperl.so. Since it gets stored in
5959 # a version-specific architecture-dependent library, the version
5960 # number isn't really that important, except for making cc/ld happy.
5962 # A name such as libperl.so.3.1
5963 majmin="libperl.$so.$patchlevel.$subversion"
5964 # A name such as libperl.so.301
5965 majonly=`echo $patchlevel $subversion |
5966 $awk '{printf "%d%02d", $1, $2}'`
5967 majonly=libperl.$so.$majonly
5968 # I'd prefer to keep the os-specific stuff here to a minimum, and
5969 # rely on figuring it out from the naming of libc.
5970 case "${osname}${osvers}" in
5973 # XXX How handle the --version stuff for MAB?
5975 linux*) # ld won't link with a bare -lperl otherwise.
5978 *) # Try to guess based on whether libc has major.minor.
5980 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5981 *libc.$so.[0-9]*) dflt=$majonly ;;
5982 *) dflt=libperl.$so ;;
5992 I need to select a good name for the shared libperl. If your system uses
5993 library names with major and minor numbers, then you might want something
5994 like $majmin. Alternatively, if your system uses a single version
5995 number for shared libraries, then you might want to use $majonly.
5996 Or, your system might be quite happy with a simple libperl.$so.
5998 Since the shared libperl will get installed into a version-specific
5999 architecture-dependent directory, the version number of the shared perl
6000 library probably isn't important, so the default should be o.k.
6003 rp='What name do you want to give to the shared libperl?'
6006 echo "Ok, I'll use $libperl"
6009 libperl="libperl${_a}"
6013 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6017 WARNING: Use of the shrpdir variable for the installation location of
6018 the shared $libperl is not supported. It was never documented and
6019 will not work in this version. Let me (perlbug@perl.com)
6020 know of any problems this may cause.
6026 But your current setting of $shrpdir is
6027 the default anyway, so it's harmless.
6032 Further, your current attempted setting of $shrpdir
6033 conflicts with the value of $archlibexp/CORE
6034 that installperl will use.
6041 # How will the perl executable find the installed shared $libperl?
6042 # Add $xxx to ccdlflags.
6043 # If we can't figure out a command-line option, use $shrpenv to
6044 # set env LD_RUN_PATH. The main perl makefile uses this.
6045 shrpdir=$archlibexp/CORE
6048 if "$useshrplib"; then
6051 # We'll set it in Makefile.SH...
6057 xxx="-Wl,-R$shrpdir"
6059 linux|irix*|dec_osf)
6060 xxx="-Wl,-rpath,$shrpdir"
6063 # next doesn't like the default...
6066 # beos doesn't like the default, either.
6069 # hpux doesn't like the default, either.
6070 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6073 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6079 # Only add $xxx if it isn't already in ccdlflags.
6080 case " $ccdlflags " in
6082 *) ccdlflags="$ccdlflags $xxx"
6085 Adding $xxx to the flags
6086 passed to $ld so that the perl executable will find the
6087 installed shared $libperl.
6095 # Fix ccdlflags in AIX for building external extensions.
6096 # (For building Perl itself bare -bE:perl.exp is needed,
6097 # Makefile.SH takes care of this.)
6099 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6101 # Respect a hint or command-line value.
6103 '') shrpenv="$tmp_shrpenv" ;;
6105 case "$ldlibpthname" in
6106 '') ldlibpthname=LD_LIBRARY_PATH ;;
6107 none) ldlibpthname='' ;;
6110 : determine where manual pages go
6111 set man1dir man1dir none
6115 $spackage has manual pages available in source form.
6119 echo "However, you don't have nroff, so they're probably useless to you."
6121 '') man1dir="none";;
6124 echo "If you don't want the manual sources installed, answer 'none'."
6129 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6130 lookpath="$lookpath $prefixexp/man/p_man/man1"
6131 lookpath="$lookpath $prefixexp/man/u_man/man1"
6132 lookpath="$lookpath $prefixexp/man/man.1"
6134 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6135 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6145 rp="Where do the main $spackage manual pages (source) go?"
6147 if $test "X$man1direxp" != "X$ansexp"; then
6151 man1direxp="$ansexp"
6157 : Change installation prefix, if necessary.
6158 if $test X"$prefix" != X"$installprefix"; then
6159 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6161 installman1dir="$man1direxp"
6164 : What suffix to use on installed man pages
6171 rp="What suffix should be used for the main $spackage man pages?"
6173 '') case "$man1dir" in
6187 *) dflt="$man1ext";;
6194 : see if we can have long filenames
6196 rmlist="$rmlist /tmp/cf$$"
6197 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6198 first=123456789abcdef
6199 second=/tmp/cf$$/$first
6200 $rm -f $first $second
6201 if (echo hi >$first) 2>/dev/null; then
6202 if $test -f 123456789abcde; then
6203 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6206 if (echo hi >$second) 2>/dev/null; then
6207 if $test -f /tmp/cf$$/123456789abcde; then
6209 That's peculiar... You can have filenames longer than 14 characters, but only
6210 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6211 I shall consider your system cannot support long filenames at all.
6215 echo 'You can have filenames longer than 14 characters.' >&4
6220 How confusing! Some of your filesystems are sane enough to allow filenames
6221 longer than 14 characters but some others like /tmp can't even think about them.
6222 So, for now on, I shall assume your kernel does not allow them at all.
6229 You can't have filenames longer than 14 chars. You can't even think about them!
6235 $rm -rf /tmp/cf$$ 123456789abcde*
6237 : determine where library module manual pages go
6238 set man3dir man3dir none
6242 $spackage has manual pages for many of the library modules.
6248 However, you don't have nroff, so they're probably useless to you.
6251 '') man3dir="none";;
6255 case "$d_flexfnam" in
6258 However, your system can't handle the long file names like File::Basename.3.
6261 '') man3dir="none";;
6265 echo "If you don't want the manual sources installed, answer 'none'."
6266 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6268 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6269 if $test -d "$privlib/man/man3"; then
6272 WARNING: Previous versions of perl installed man3 pages into
6273 $privlib/man/man3. This version will suggest a
6274 new default of $dflt.
6278 rp='Do you wish to preserve the old behavior?(y/n)'
6281 y*) dflt="$privlib/man/man3" ;;
6287 *) dflt="$man3dir" ;;
6291 rp="Where do the $package library man pages (source) go?"
6294 man3direxp="$ansexp"
6300 : Change installation prefix, if necessary.
6301 if $test X"$prefix" != X"$installprefix"; then
6302 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6304 installman3dir="$man3direxp"
6307 : What suffix to use on installed man pages
6313 rp="What suffix should be used for the $package library man pages?"
6315 '') case "$man3dir" in
6329 *) dflt="$man3ext";;
6336 : see if we have to deal with yellow pages, now NIS.
6337 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6338 if $test -f /usr/etc/nibindd; then
6340 echo "I'm fairly confident you're on a NeXT."
6342 rp='Do you get the hosts file via NetInfo?'
6351 y*) hostcat='nidump hosts .';;
6352 *) case "$hostcat" in
6353 nidump*) hostcat='';;
6363 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6371 rp='Are you getting the hosts file via yellow pages?'
6374 y*) hostcat='ypcat hosts';;
6375 *) hostcat='cat /etc/hosts';;
6381 '') hostcat='cat /etc/hosts';;
6384 '') groupcat='cat /etc/group';;
6387 '') passcat='cat /etc/passwd';;
6390 : now get the host name
6392 echo "Figuring out host name..." >&4
6393 case "$myhostname" in
6395 echo 'Maybe "hostname" will work...'
6396 if tans=`sh -c hostname 2>&1` ; then
6404 if $test "$cont"; then
6406 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6407 if tans=`cat /etc/systemid 2>&1` ; then
6409 phostname='cat /etc/systemid'
6410 echo "Whadyaknow. Xenix always was a bit strange..."
6413 elif $test -r /etc/systemid; then
6414 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6417 if $test "$cont"; then
6418 echo 'No, maybe "uuname -l" will work...'
6419 if tans=`sh -c 'uuname -l' 2>&1` ; then
6421 phostname='uuname -l'
6423 echo 'Strange. Maybe "uname -n" will work...'
6424 if tans=`sh -c 'uname -n' 2>&1` ; then
6426 phostname='uname -n'
6428 echo 'Oh well, maybe I can mine it out of whoami.h...'
6429 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6430 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6431 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6433 case "$myhostname" in
6434 '') echo "Does this machine have an identity crisis or something?"
6437 echo "Well, you said $myhostname before..."
6438 phostname='echo $myhostname';;
6444 : you do not want to know about this
6449 if $test "$myhostname" ; then
6451 rp='Your host name appears to be "'$myhostname'".'" Right?"
6459 : bad guess or no guess
6460 while $test "X$myhostname" = X ; do
6462 rp="Please type the (one word) name of your host:"
6467 : translate upper to lower if necessary
6468 case "$myhostname" in
6470 echo "(Normalizing case in your host name)"
6471 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6475 case "$myhostname" in
6477 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6478 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6479 echo "(Trimming domain name from host name--host name is now $myhostname)"
6481 *) case "$mydomain" in
6484 test "X$hostcat" = "Xypcat hosts" &&
6485 ypmatch "$myhostname" hosts 2>/dev/null |\
6486 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6489 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6490 /[ ]$myhostname[ . ]/p" > hosts
6493 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6494 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6495 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6496 hosts | $sort | $uniq | \
6497 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6498 case `$echo X$dflt` in
6499 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6502 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6507 tans=`./loc resolv.conf X /etc /usr/etc`
6508 if $test -f "$tans"; then
6509 echo "(Attempting domain name extraction from $tans)"
6510 dflt=.`$sed -n -e 's/ / /g' \
6511 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6512 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6514 .) dflt=.`$sed -n -e 's/ / /g' \
6515 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6516 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6523 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6524 dflt=.`sh -c domainname 2>/dev/null`
6527 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6532 .) echo "(Lost all hope -- silly guess then)"
6538 *) dflt="$mydomain";;
6542 rp="What is your domain name?"
6552 : translate upper to lower if necessary
6555 echo "(Normalizing case in your domain name)"
6556 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6560 : a little sanity check here
6561 case "$phostname" in
6564 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6565 $myhostname$mydomain|$myhostname) ;;
6567 case "$phostname" in
6569 echo "(That doesn't agree with your whoami.h file, by the way.)"
6572 echo "(That doesn't agree with your $phostname command, by the way.)"
6582 I need to get your e-mail address in Internet format if possible, i.e.
6583 something like user@host.domain. Please answer accurately since I have
6584 no easy means to double check it. The default value provided below
6585 is most probably close to the reality but may not be valid from outside
6586 your organization...
6590 while test "$cont"; do
6592 '') dflt="$cf_by@$myhostname$mydomain";;
6593 *) dflt="$cf_email";;
6595 rp='What is your e-mail address?'
6601 rp='Address does not look like an Internet one. Use it anyway?'
6617 If you or somebody else will be maintaining perl at your site, please
6618 fill in the correct e-mail address here so that they may be contacted
6619 if necessary. Currently, the "perlbug" program included with perl
6620 will send mail to this address in addition to perlbug@perl.com. You may
6621 enter "none" for no administrator.
6624 case "$perladmin" in
6625 '') dflt="$cf_email";;
6626 *) dflt="$perladmin";;
6628 rp='Perl administrator e-mail address'
6632 : figure out how to guarantee perl startup
6633 case "$startperl" in
6635 case "$sharpbang" in
6639 I can use the #! construct to start perl on your system. This will
6640 make startup of perl scripts faster, but may cause problems if you
6641 want to share those scripts and perl is not in a standard place
6642 ($binexp/perl) on all your platforms. The alternative is to force
6643 a shell by starting the script with a single ':' character.
6647 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6650 none) startperl=": # use perl";;
6651 *) startperl="#!$ans"
6652 if $test 30 -lt `echo "$ans" | wc -c`; then
6655 WARNING: Some systems limit the #! command to 32 characters.
6656 If you experience difficulty running Perl scripts with #!, try
6657 installing Perl in a directory with a shorter pathname.
6663 *) startperl=": # use perl"
6668 echo "I'll use $startperl to start perl scripts."
6670 : figure best path for perl in scripts
6673 perlpath="$binexp/perl"
6674 case "$startperl" in
6679 I will use the "eval 'exec'" idiom to start Perl on your system.
6680 I can use the full path of your Perl binary for this purpose, but
6681 doing so may cause problems if you want to share those scripts and
6682 Perl is not always in a standard place ($binexp/perl).
6686 rp="What path shall I use in \"eval 'exec'\"?"
6693 case "$startperl" in
6695 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6698 : determine where public executable scripts go
6699 set scriptdir scriptdir
6701 case "$scriptdir" in
6704 : guess some guesses
6705 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6706 $test -d /usr/share/bin && dflt=/usr/share/bin
6707 $test -d /usr/local/script && dflt=/usr/local/script
6708 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6709 $test -d $prefixexp/script && dflt=$prefixexp/script
6713 *) dflt="$scriptdir"
6718 Some installations have a separate directory just for executable scripts so
6719 that they can mount it across multiple architectures but keep the scripts in
6720 one spot. You might, for example, have a subdirectory of /usr/share for this.
6721 Or you might just lump your scripts in with all your other executables.
6725 rp='Where do you keep publicly executable scripts?'
6727 if $test "X$ansexp" != "X$scriptdirexp"; then
6731 scriptdirexp="$ansexp"
6732 : Change installation prefix, if necessary.
6733 if $test X"$prefix" != X"$installprefix"; then
6734 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6736 installscript="$scriptdirexp"
6741 After $package is installed, you may wish to install various
6742 add-on modules and utilities. Typically, these add-ons will
6743 be installed under $prefix with the rest
6744 of this package. However, you may wish to install such add-ons
6745 elsewhere under a different prefix.
6747 If you do not wish to put everything under a single prefix, that's
6748 ok. You will be prompted for the individual locations; this siteprefix
6749 is only used to suggest the defaults.
6751 The default should be fine for most people.
6755 rp='Installation prefix to use for add-on modules and utilities?'
6756 : XXX Here might be another good place for an installstyle setting.
6757 case "$siteprefix" in
6759 *) dflt=$siteprefix ;;
6763 case "$siteprefix" in
6768 *) oldsiteprefix="$prefix";;
6773 siteprefixexp="$ansexp"
6775 : determine where site specific libraries go.
6776 : Usual default is /usr/local/lib/perl5/site_perl
6777 : The default "style" setting is made in installstyle.U
6778 : XXX No longer works with Prefixit stuff.
6779 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6780 case "$installstyle" in
6781 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6782 *) dflt=$siteprefix/lib/site_$prog ;;
6786 The installation process will create a directory for
6787 site-specific extensions and modules. Most users find it convenient
6788 to place all site-specific files in this directory rather than in the
6789 main distribution directory.
6793 rp='Pathname for the site-specific library files?'
6796 sitelibexp="$ansexp"
6797 : Change installation prefix, if necessary.
6798 if $test X"$prefix" != X"$installprefix"; then
6799 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6801 installsitelib="$sitelibexp"
6804 : determine where site specific architecture-dependent libraries go.
6805 : sitelib default is /usr/local/lib/perl5/site_perl/
6806 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6807 : sitelib may have an optional trailing /share.
6808 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6809 tdflt="$tdflt/$apiversion/$archname"
6810 set sitearch sitearch none
6813 '') dflt="$tdflt" ;;
6814 *) dflt="$sitearch" ;;
6818 The installation process will also create a directory for
6819 architecture-dependent site-specific extensions and modules.
6823 rp='Pathname for the site-specific architecture-dependent library files?'
6826 sitearchexp="$ansexp"
6827 : Change installation prefix, if necessary.
6828 if $test X"$prefix" != X"$installprefix"; then
6829 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6831 installsitearch="$sitearchexp"
6834 : determine where add-on public executables go
6836 '') dflt=$siteprefix/bin ;;
6840 rp='Pathname where the add-on public executables should be installed?'
6843 sitebinexp="$ansexp"
6844 : Change installation prefix, if necessary.
6845 if $test X"$prefix" != X"$installprefix"; then
6846 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6848 installsitebin="$sitebinexp"
6853 Perl can be built to take advantage of long doubles which
6854 (if available) may give more accuracy and range for floating point numbers.
6856 If this doesn't make any sense to you, just accept the default 'n'.
6860 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6863 case "$uselongdouble" in
6864 $define|true|[yY]*) dflt='y';;
6867 rp='Try to use long doubles if available?'
6870 y|Y) val="$define" ;;
6876 case "$uselongdouble" in
6877 true|[yY]*) uselongdouble="$define" ;;
6880 case "$uselongdouble" in
6882 : Look for a hint-file generated 'call-back-unit'. If the
6883 : user has specified that long doubles should be used,
6884 : we may need to set or change some other defaults.
6885 if $test -f uselongdouble.cbu; then
6886 echo "Your platform has some specific hints for long doubles, using them..."
6887 . ./uselongdouble.cbu
6890 (Your platform doesn't have any specific hints for long doubles.)
6898 Perl can be built to take advantage of long longs which
6899 (if available) may give more range for integer numbers.
6901 If this doesn't make any sense to you, just accept the default 'n'.
6905 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6908 case "$uselonglong" in
6909 $define|true|[yY]*) dflt='y';;
6912 rp='Try to use long longs if available?'
6915 y|Y) val="$define" ;;
6921 case "$uselonglong" in
6922 true|[yY]*) uselonglong="$define" ;;
6925 case "$uselonglong" in
6927 : Look for a hint-file generated 'call-back-unit'. If the
6928 : user has specified that long longs should be used,
6929 : we may need to set or change some other defaults.
6930 if $test -f uselonglong.cbu; then
6931 echo "Your platform has some specific hints for long longs, using them..."
6935 (Your platform doesn't have any specific hints for long longs.)
6943 Previous version of $package used the standard IO mechanisms as defined
6944 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6945 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6946 the default. This abstraction layer can use AT&T's sfio (if you already
6947 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6948 problems with some extension modules. Using PerlIO with stdio is safe,
6949 but it is slower than plain stdio and therefore is not the default.
6951 If this doesn't make any sense to you, just accept the default 'n'.
6953 case "$useperlio" in
6954 $define|true|[yY]*) dflt='y';;
6957 rp='Use the experimental PerlIO abstraction layer?'
6964 echo "Ok, doing things the stdio way"
6971 case "$vendorprefix" in
6972 '') d_vendorbin="$undef"
6976 *) d_vendorbin="$define"
6977 : determine where vendor-supplied executables go.
6978 dflt=$vendorprefix/bin
6980 rp='Pathname for the vendor-supplied executables directory?'
6983 vendorbinexp="$ansexp"
6984 : Change installation prefix, if necessary.
6985 if $test X"$prefix" != X"$installprefix"; then
6986 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6988 installvendorbin="$vendorbinexp"
6993 : Check how to convert floats to strings.
6994 if test "X$d_Gconvert" = X; then
6996 echo "Checking for an efficient way to convert floats to strings."
6999 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7000 char *myname = "gconvert";
7003 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7004 char *myname = "gcvt";
7007 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7008 char *myname = "sprintf";
7014 checkit(expect, got)
7018 if (strcmp(expect, got)) {
7019 printf("%s oddity: Expected %s, got %s\n",
7020 myname, expect, got);
7030 /* This must be 1st test on (which?) platform */
7031 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7032 Gconvert(0.1, 8, 0, buf);
7033 checkit("0.1", buf);
7035 Gconvert(1.0, 8, 0, buf);
7038 Gconvert(0.0, 8, 0, buf);
7041 Gconvert(-1.0, 8, 0, buf);
7044 /* Some Linux gcvt's give 1.e+5 here. */
7045 Gconvert(100000.0, 8, 0, buf);
7046 checkit("100000", buf);
7048 /* Some Linux gcvt's give -1.e+5 here. */
7049 Gconvert(-100000.0, 8, 0, buf);
7050 checkit("-100000", buf);
7055 case "$d_Gconvert" in
7056 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7057 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7058 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7059 *) xxx_list='gconvert gcvt sprintf' ;;
7062 for xxx_convert in $xxx_list; do
7063 echo "Trying $xxx_convert"
7065 set try -DTRY_$xxx_convert
7066 if eval $compile; then
7067 echo "$xxx_convert" found. >&4
7069 echo "I'll use $xxx_convert to convert floats into a string." >&4
7072 echo "...But $xxx_convert didn't work as I expected."
7075 echo "$xxx_convert NOT found." >&4
7079 case "$xxx_convert" in
7080 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7081 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7082 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7086 : check for length of double
7088 case "$doublesize" in
7090 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7091 $cat >try.c <<'EOCP'
7095 printf("%d\n", (int)sizeof(double));
7100 if eval $compile_ok; then
7102 $echo " $doublesize bytes." >&4
7105 echo "(I can't seem to compile the test program. Guessing...)"
7106 rp="What is the size of a double precision number (in bytes)?"
7114 : check for long doubles
7116 $echo $n "Checking to see if your system supports long double..." $c >&4
7117 echo 'int main() { long double x = 7.0; }' > try.c
7119 if eval $compile; then
7121 echo " Yes, it does." >&4
7124 echo " No, it doesn't." >&4
7130 : check for length of long double
7131 case "${d_longdbl}${longdblsize}" in
7134 $echo $n "Checking to see how big your long doubles are..." $c >&4
7135 $cat >try.c <<'EOCP'
7139 printf("%d\n", sizeof(long double));
7144 if eval $compile; then
7145 longdblsize=`./try$exe_ext`
7146 $echo " $longdblsize bytes." >&4
7150 echo "(I can't seem to compile the test program. Guessing...)" >&4
7151 rp="What is the size of a long double (in bytes)?"
7155 if $test "X$doublesize" = "X$longdblsize"; then
7156 echo "(That isn't any different from an ordinary double.)"
7164 if $test X"$d_longdbl" = X"$define"; then
7166 echo "Checking how to print long doubles..." >&4
7168 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7169 $cat >try.c <<'EOCP'
7170 #include <sys/types.h>
7174 printf("%.3f\n", d);
7178 if eval $compile; then
7182 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7183 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7184 echo "We will use %f."
7190 if $test X"$sPRIfldbl" = X; then
7191 $cat >try.c <<'EOCP'
7192 #include <sys/types.h>
7195 long double d = 123.456;
7196 printf("%.3llf\n", d);
7200 if eval $compile; then
7204 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7205 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7206 echo "We will use %llf."
7212 if $test X"$sPRIfldbl" = X; then
7213 $cat >try.c <<'EOCP'
7214 #include <sys/types.h>
7217 long double d = 123.456;
7218 printf("%.3Lf\n", d);
7222 if eval $compile; then
7226 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7227 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7228 echo "We will use %Lf."
7234 if $test X"$sPRIfldbl" = X; then
7235 $cat >try.c <<'EOCP'
7236 #include <sys/types.h>
7239 long double d = 123.456;
7240 printf("%.3lf\n", d);
7244 if eval $compile; then
7248 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7249 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7250 echo "We will use %lf."
7256 if $test X"$sPRIfldbl" = X; then
7257 echo "Cannot figure out how to print long doubles." >&4
7264 case "$sPRIfldbl" in
7265 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7266 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7268 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7269 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7273 : Initialize h_fcntl
7276 : Initialize h_sysfile
7279 : access call always available on UNIX
7283 : locate the flags for 'access()'
7287 $cat >access.c <<'EOCP'
7288 #include <sys/types.h>
7293 #include <sys/file.h>
7302 : check sys/file.h first, no particular reason here
7303 if $test `./findhdr sys/file.h` && \
7304 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7306 echo "<sys/file.h> defines the *_OK access constants." >&4
7307 elif $test `./findhdr fcntl.h` && \
7308 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7310 echo "<fcntl.h> defines the *_OK access constants." >&4
7311 elif $test `./findhdr unistd.h` && \
7312 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7313 echo "<unistd.h> defines the *_OK access constants." >&4
7315 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7321 : see if accessx exists
7322 set accessx d_accessx
7325 : see if alarm exists
7329 : see if atolf exists
7333 : see if atoll exists
7337 : Look for GNU-cc style attribute checking
7339 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7340 $cat >attrib.c <<'EOCP'
7342 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7344 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7345 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7346 echo "Your C compiler doesn't fully support __attribute__."
7349 echo "Your C compiler supports __attribute__."
7353 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7360 : see if bcmp exists
7364 : see if bcopy exists
7368 : see if this is a unistd.h system
7369 set unistd.h i_unistd
7372 : see if getpgrp exists
7373 set getpgrp d_getpgrp
7376 case "$d_getpgrp" in
7379 echo "Checking to see which flavor of getpgrp is in use..."
7382 #include <sys/types.h>
7384 # include <unistd.h>
7388 if (getuid() == 0) {
7389 printf("(I see you are running Configure as super-user...)\n");
7393 if (getpgrp(1) == 0)
7402 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7403 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7405 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7406 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7409 echo "I can't seem to compile and run the test program."
7411 xxx="a USG one, i.e. you use getpgrp()."
7413 # SVR4 systems can appear rather BSD-ish.
7416 xxx="a BSD one, i.e. you use getpgrp(pid)."
7420 xxx="probably a USG one, i.e. you use getpgrp()."
7425 echo "Assuming your getpgrp is $xxx" >&4
7434 : see if setpgrp exists
7435 set setpgrp d_setpgrp
7438 case "$d_setpgrp" in
7441 echo "Checking to see which flavor of setpgrp is in use..."
7444 #include <sys/types.h>
7446 # include <unistd.h>
7450 if (getuid() == 0) {
7451 printf("(I see you are running Configure as super-user...)\n");
7455 if (-1 == setpgrp(1, 1))
7458 if (setpgrp() != -1)
7464 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7465 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7467 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7468 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7471 echo "(I can't seem to compile and run the test program.)"
7473 xxx="a USG one, i.e. you use setpgrp()."
7475 # SVR4 systems can appear rather BSD-ish.
7478 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7482 xxx="probably a USG one, i.e. you use setpgrp()."
7487 echo "Assuming your setpgrp is $xxx" >&4
7495 : see if bzero exists
7499 : see if signal is declared as pointer to function returning int or void
7501 xxx=`./findhdr signal.h`
7502 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7503 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7504 echo "You have int (*signal())() instead of void." >&4
7506 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7507 echo "You have void (*signal())()." >&4
7509 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7510 echo "You have int (*signal())() instead of void." >&4
7512 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7513 echo "You have void (*signal())()." >&4
7516 case "$d_voidsig" in
7518 echo "I can't determine whether signal handler returns void or int..." >&4
7520 rp="What type does your signal handler return?"
7527 echo "As you already told me, signal handler returns void." >&4
7530 *) echo "As you already told me, signal handler returns int." >&4
7537 case "$d_voidsig" in
7538 "$define") signal_t="void";;
7543 : check for ability to cast large floats to 32-bit ints.
7545 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7546 if $test "$intsize" -ge 4; then
7553 #include <sys/types.h>
7555 $signal_t blech(s) int s; { exit(3); }
7562 signal(SIGFPE, blech);
7564 /* Don't let compiler optimize the test away. Store the number
7565 in a writable string for gcc to pass to sscanf under HP/UX.
7567 sprintf(str, "2147483647");
7568 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7572 /* x86 processors will probably give 0x8000 0000, which is a
7573 sign change. We don't want that. We want to mimic SPARC
7574 behavior here, which is to preserve the sign and give
7577 if (i32 != ($xxx) f)
7583 if eval $compile_ok; then
7587 echo "(I can't seem to compile the test program--assuming it can't)"
7595 echo "Nope, it can't."
7602 : check for ability to cast negative floats to unsigned
7604 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7607 #include <sys/types.h>
7609 $signal_t blech(s) int s; { exit(7); }
7610 $signal_t blech_in_list(s) int s; { exit(4); }
7611 unsigned long dummy_long(p) unsigned long p; { return p; }
7612 unsigned int dummy_int(p) unsigned int p; { return p; }
7613 unsigned short dummy_short(p) unsigned short p; { return p; }
7617 unsigned long along;
7619 unsigned short ashort;
7623 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7624 a direct f = -123. assignment. gcc-2.8.0 reportedly
7625 optimized the whole file away
7627 /* Store the number in a writable string for gcc to pass to
7630 sprintf(str, "-123");
7631 sscanf(str, "%lf", &f); /* f = -123.; */
7633 signal(SIGFPE, blech);
7634 along = (unsigned long)f;
7635 aint = (unsigned int)f;
7636 ashort = (unsigned short)f;
7637 if (along != (unsigned long)-123)
7639 if (aint != (unsigned int)-123)
7641 if (ashort != (unsigned short)-123)
7643 sprintf(str, "1073741824.");
7644 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7647 along = (unsigned long)f;
7648 if (along != 0x80000000)
7652 along = (unsigned long)f;
7653 if (along != 0x7fffffff)
7657 along = (unsigned long)f;
7658 if (along != 0x80000001)
7662 signal(SIGFPE, blech_in_list);
7663 sprintf(str, "123.");
7664 sscanf(str, "%lf", &f); /* f = 123.; */
7665 along = dummy_long((unsigned long)f);
7666 aint = dummy_int((unsigned int)f);
7667 ashort = dummy_short((unsigned short)f);
7668 if (along != (unsigned long)123)
7670 if (aint != (unsigned int)123)
7672 if (ashort != (unsigned short)123)
7679 if eval $compile_ok; then
7683 echo "(I can't seem to compile the test program--assuming it can't)"
7686 case "$castflags" in
7691 echo "Nope, it can't."
7698 : see if vprintf exists
7700 if set vprintf val -f d_vprintf; eval $csym; $val; then
7701 echo 'vprintf() found.' >&4
7703 $cat >vprintf.c <<'EOF'
7704 #include <varargs.h>
7706 int main() { xxx("foo"); }
7715 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7719 if eval $compile && ./vprintf; then
7720 echo "Your vsprintf() returns (int)." >&4
7723 echo "Your vsprintf() returns (char*)." >&4
7727 echo 'vprintf() NOT found.' >&4
7737 : see if chown exists
7741 : see if chroot exists
7745 : see if chsize exists
7749 : check for const keyword
7751 echo 'Checking to see if your C compiler knows about "const"...' >&4
7752 $cat >const.c <<'EOCP'
7753 typedef struct spug { int drokk; } spug;
7760 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7762 echo "Yup, it does."
7765 echo "Nope, it doesn't."
7770 : see if crypt exists
7772 if set crypt val -f d_crypt; eval $csym; $val; then
7773 echo 'crypt() found.' >&4
7777 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7778 if $test -z "$cryptlib"; then
7779 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7783 if $test -z "$cryptlib"; then
7784 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7788 if $test -z "$cryptlib"; then
7789 cryptlib=`./loc libcrypt$_a "" $libpth`
7793 if $test -z "$cryptlib"; then
7794 echo 'crypt() NOT found.' >&4
7803 : get csh whereabouts
7805 'csh') val="$undef" ;;
7810 : Respect a hint or command line value for full_csh.
7812 '') full_csh=$csh ;;
7815 : see if cuserid exists
7816 set cuserid d_cuserid
7819 : see if this is a limits.h system
7820 set limits.h i_limits
7823 : see if this is a float.h system
7827 : See if number of significant digits in a double precision number is known
7829 $cat >dbl_dig.c <<EOM
7839 printf("Contains DBL_DIG");
7842 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7843 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7844 echo "DBL_DIG found." >&4
7847 echo "DBL_DIG NOT found." >&4
7854 : see if difftime exists
7855 set difftime d_difftime
7858 : see if this is a dirent system
7860 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7862 echo "<dirent.h> found." >&4
7865 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7866 echo "<sys/dir.h> found." >&4
7869 xinc=`./findhdr sys/ndir.h`
7871 echo "<dirent.h> NOT found." >&4
7876 : Look for type of directory structure.
7878 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7880 case "$direntrytype" in
7883 $define) guess1='struct dirent' ;;
7884 *) guess1='struct direct' ;;
7887 *) guess1="$direntrytype"
7892 'struct dirent') guess2='struct direct' ;;
7893 *) guess2='struct dirent' ;;
7896 if $contains "$guess1" try.c >/dev/null 2>&1; then
7897 direntrytype="$guess1"
7898 echo "Your directory entries are $direntrytype." >&4
7899 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7900 direntrytype="$guess2"
7901 echo "Your directory entries seem to be $direntrytype." >&4
7903 echo "I don't recognize your system's directory entries." >&4
7904 rp="What type is used for directory entries on this system?"
7912 : see if the directory entry stores field length
7914 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7915 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7916 echo "Good, your directory entry keeps length information in d_namlen." >&4
7919 echo "Your directory entry does not know about the d_namlen field." >&4
7926 : see if dlerror exists
7929 set dlerror d_dlerror
7933 : see if dlfcn is available
7941 On a few systems, the dynamically loaded modules that perl generates and uses
7942 will need a different extension than shared libs. The default will probably
7950 rp='What is the extension of dynamically loaded modules'
7959 : Check if dlsym need a leading underscore
7965 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7966 $cat >dyna.c <<'EOM'
7975 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7977 #include <sys/types.h>
7991 int mode = RTLD_LAZY ;
7993 handle = dlopen("./dyna.$dlext", mode) ;
7994 if (handle == NULL) {
7999 symbol = dlsym(handle, "fred") ;
8000 if (symbol == NULL) {
8001 /* try putting a leading underscore */
8002 symbol = dlsym(handle, "_fred") ;
8003 if (symbol == NULL) {
8016 : Call the object file tmp-dyna.o in case dlext=o.
8017 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8018 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8019 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8020 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8023 1) echo "Test program failed using dlopen." >&4
8024 echo "Perhaps you should not use dynamic loading." >&4;;
8025 2) echo "Test program failed using dlsym." >&4
8026 echo "Perhaps you should not use dynamic loading." >&4;;
8027 3) echo "dlsym needs a leading underscore" >&4
8029 4) echo "dlsym doesn't need a leading underscore." >&4;;
8032 echo "I can't compile and run the test program." >&4
8033 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8038 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8043 hasproto='varname=$1; func=$2; shift; shift;
8044 while $test $# -ge 2; do
8046 $define) echo "#include <$2>";;
8050 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8051 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8052 echo "$func() prototype found.";
8055 echo "$func() prototype NOT found.";
8060 $rm -f try.c tryout.c'
8062 : see if prototype for drand48 is available
8064 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8067 : see if dup2 exists
8071 : see if eaccess exists
8072 set eaccess d_eaccess
8075 : see if endgrent exists
8076 set endgrent d_endgrent
8079 : see if endhostent exists
8080 set endhostent d_endhent
8083 : see if endnetent exists
8084 set endnetent d_endnent
8087 : see if endprotoent exists
8088 set endprotoent d_endpent
8091 : see if endpwent exists
8092 set endpwent d_endpwent
8095 : see if endservent exists
8096 set endservent d_endsent
8099 : see if endspent exists
8100 set endspent d_endspent
8103 : Locate the flags for 'open()'
8105 $cat >open3.c <<'EOCP'
8106 #include <sys/types.h>
8111 #include <sys/file.h>
8122 : check sys/file.h first to get FREAD on Sun
8123 if $test `./findhdr sys/file.h` && \
8124 set open3 -DI_SYS_FILE && eval $compile; then
8126 echo "<sys/file.h> defines the O_* constants..." >&4
8128 echo "and you have the 3 argument form of open()." >&4
8131 echo "but not the 3 argument form of open(). Oh, well." >&4
8134 elif $test `./findhdr fcntl.h` && \
8135 set open3 -DI_FCNTL && eval $compile; then
8137 echo "<fcntl.h> defines the O_* constants..." >&4
8139 echo "and you have the 3 argument form of open()." >&4
8142 echo "but not the 3 argument form of open(). Oh, well." >&4
8147 echo "I can't find the O_* constant definitions! You got problems." >&4
8153 : see which of string.h or strings.h is needed
8155 strings=`./findhdr string.h`
8156 if $test "$strings" && $test -r "$strings"; then
8157 echo "Using <string.h> instead of <strings.h>." >&4
8161 strings=`./findhdr strings.h`
8162 if $test "$strings" && $test -r "$strings"; then
8163 echo "Using <strings.h> instead of <string.h>." >&4
8165 echo "No string header found -- You'll surely have problems." >&4
8171 "$undef") strings=`./findhdr strings.h`;;
8172 *) strings=`./findhdr string.h`;;
8175 : check for non-blocking I/O stuff
8176 case "$h_sysfile" in
8177 true) echo "#include <sys/file.h>" > head.c;;
8180 true) echo "#include <fcntl.h>" > head.c;;
8181 *) echo "#include <sys/fcntl.h>" > head.c;;
8186 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8187 case "$o_nonblock" in
8190 $cat >>try.c <<'EOCP'
8194 printf("O_NONBLOCK\n");
8198 printf("O_NDELAY\n");
8202 printf("FNDELAY\n");
8209 if eval $compile_ok; then
8211 case "$o_nonblock" in
8212 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8213 *) echo "Seems like we can use $o_nonblock.";;
8216 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8219 *) echo "Using $hint value $o_nonblock.";;
8221 $rm -f try try.* .out core
8224 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8230 #include <sys/types.h>
8233 #define MY_O_NONBLOCK $o_nonblock
8234 #ifndef errno /* XXX need better Configure test */
8244 #include <strings.h>
8246 $signal_t blech(x) int x; { exit(3); }
8248 $cat >> try.c <<'EOCP'
8256 pipe(pd); /* Down: child -> parent */
8257 pipe(pu); /* Up: parent -> child */
8260 close(pd[1]); /* Parent reads from pd[0] */
8261 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8262 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8264 signal(SIGALRM, blech);
8266 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8268 sprintf(string, "%d\n", ret);
8269 write(2, string, strlen(string));
8272 if (errno == EAGAIN) {
8278 if (errno == EWOULDBLOCK)
8279 printf("EWOULDBLOCK\n");
8282 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8283 sleep(2); /* Give it time to close our pipe */
8285 ret = read(pd[0], buf, 1); /* Should read EOF */
8287 sprintf(string, "%d\n", ret);
8288 write(3, string, strlen(string));
8292 close(pd[0]); /* We write to pd[1] */
8293 close(pu[1]); /* We read from pu[0] */
8294 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8295 close(pd[1]); /* Pipe pd is now fully closed! */
8296 exit(0); /* Bye bye, thank you for playing! */
8300 if eval $compile_ok; then
8301 echo "$startsh" >mtry
8302 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8304 ./mtry >/dev/null 2>&1
8306 0) eagain=`$cat try.out`;;
8307 1) echo "Could not perform non-blocking setting!";;
8308 2) echo "I did a successful read() for something that was not there!";;
8309 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8310 *) echo "Something terribly wrong happened during testing.";;
8312 rd_nodata=`$cat try.ret`
8313 echo "A read() system call with no data present returns $rd_nodata."
8314 case "$rd_nodata" in
8317 echo "(That's peculiar, fixing that to be -1.)"
8323 echo "Forcing errno EAGAIN on read() with no data available."
8327 echo "Your read() sets errno to $eagain when no data is available."
8330 status=`$cat try.err`
8332 0) echo "And it correctly returns 0 to signal EOF.";;
8333 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8334 *) echo "However, your read() returns '$status' on EOF??";;
8337 if test "$status" = "$rd_nodata"; then
8338 echo "WARNING: you can't distinguish between EOF and no data!"
8342 echo "I can't compile the test program--assuming errno EAGAIN will do."
8349 echo "Using $hint value $eagain."
8350 echo "Your read() returns $rd_nodata when no data is present."
8351 case "$d_eofnblk" in
8352 "$define") echo "And you can see EOF because read() returns 0.";;
8353 "$undef") echo "But you can't see EOF status from read() returned value.";;
8355 echo "(Assuming you can't see EOF status from read anyway.)"
8361 $rm -f try try.* .out core head.c mtry
8363 : see if fchmod exists
8367 : see if fchown exists
8371 : see if this is an fcntl system
8375 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8376 while $test $# -ge 2; do
8378 $define) echo "#include <$2>";;
8382 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8384 if eval $compile; then
8395 : see whether socket exists
8397 $echo $n "Hmm... $c" >&4
8398 if set socket val -f d_socket; eval $csym; $val; then
8399 echo "Looks like you have Berkeley networking support." >&4
8401 if set setsockopt val -f; eval $csym; $val; then
8404 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8408 if $contains socklib libc.list >/dev/null 2>&1; then
8409 echo "Looks like you have Berkeley networking support." >&4
8411 : we will have to assume that it supports the 4.2 BSD interface
8414 echo "You don't have Berkeley networking in libc$_a..." >&4
8415 if test "X$d_socket" = "X$define"; then
8416 echo "...but you seem to believe that you have sockets." >&4
8418 for net in net socket
8420 if test -f /usr/lib/lib$net$_a; then
8421 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8422 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8423 if $contains socket libc.list >/dev/null 2>&1; then
8428 echo "...but the Wollongong group seems to have hacked it in." >&4
8429 sockethdr="-I/usr/netinclude"
8432 echo "Found Berkeley sockets interface in lib$net." >& 4
8433 if $contains setsockopt libc.list >/dev/null 2>&1; then
8436 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8443 if test "X$d_socket" != "X$define"; then
8444 echo "or anywhere else I see." >&4
8452 : see if socketpair exists
8453 set socketpair d_sockpair
8458 echo "Checking the availability of certain socket constants..." >& 4
8459 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8460 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8462 #include <sys/types.h>
8463 #include <sys/socket.h>
8469 set try; if eval $compile; then
8472 set d_${enum}; eval $setvar
8476 : see if sys/select.h has to be included
8477 set sys/select.h i_sysselct
8480 : see if we should include time.h, sys/time.h, or both
8482 if test "X$timeincl" = X; then
8483 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8484 $echo $n "I'm now running the test program...$c"
8485 $cat >try.c <<'EOCP'
8486 #include <sys/types.h>
8491 #ifdef SYSTIMEKERNEL
8494 #include <sys/time.h>
8497 #include <sys/select.h>
8506 struct timezone tzp;
8508 if (foo.tm_sec == foo.tm_sec)
8511 if (bar.tv_sec == bar.tv_sec)
8518 for s_timezone in '-DS_TIMEZONE' ''; do
8520 for s_timeval in '-DS_TIMEVAL' ''; do
8521 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8522 for i_time in '' '-DI_TIME'; do
8523 for i_systime in '-DI_SYSTIME' ''; do
8526 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8527 if eval $compile; then
8528 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8532 $echo $n "Succeeded with $flags$c"
8544 *SYSTIMEKERNEL*) i_systimek="$define"
8545 timeincl=`./findhdr sys/time.h`
8546 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8547 *) i_systimek="$undef";;
8550 *I_TIME*) i_time="$define"
8551 timeincl=`./findhdr time.h`" $timeincl"
8552 echo "We'll include <time.h>." >&4;;
8553 *) i_time="$undef";;
8556 *I_SYSTIME*) i_systime="$define"
8557 timeincl=`./findhdr sys/time.h`" $timeincl"
8558 echo "We'll include <sys/time.h>." >&4;;
8559 *) i_systime="$undef";;
8564 : check for fd_set items
8567 Checking to see how well your C compiler handles fd_set and friends ...
8569 $cat >fd_set.c <<EOCP
8570 #$i_systime I_SYS_TIME
8571 #$i_sysselct I_SYS_SELECT
8572 #$d_socket HAS_SOCKET
8573 #include <sys/types.h>
8575 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8578 #include <sys/time.h>
8581 #include <sys/select.h>
8590 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8597 set fd_set -DTRYBITS
8598 if eval $compile; then
8599 d_fds_bits="$define"
8601 echo "Well, your system knows about the normal fd_set typedef..." >&4
8603 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8604 d_fd_macros="$define"
8607 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8609 d_fd_macros="$undef"
8613 Hmm, your compiler has some difficulty with fd_set. Checking further...
8616 if eval $compile; then
8619 echo "Well, your system has some sort of fd_set available..." >&4
8621 echo "and you have the normal fd_set macros." >&4
8622 d_fd_macros="$define"
8625 but not the normal fd_set macros! Gross! More work for me...
8627 d_fd_macros="$undef"
8630 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8633 d_fd_macros="$undef"
8638 : see if fgetpos exists
8639 set fgetpos d_fgetpos
8642 : see if flock exists
8646 : see if fork exists
8650 : see if pathconf exists
8651 set pathconf d_pathconf
8654 : see if fpathconf exists
8655 set fpathconf d_fpathconf
8661 echo "Checking to see if your system supports off64_t..." >&4
8663 #include <sys/types.h>
8665 int main() { off64_t x = 7; }'
8668 if eval $compile; then
8670 echo "Yes, it does."
8673 echo "No, it doesn't."
8674 case "$lseeksize" in
8675 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8682 : check for fpos64_t
8684 echo "Checking to see if your system supports fpos64_t..." >&4
8686 #include <sys/stdio.h>
8687 int main() { fpos64_t x x = 7; }'
8690 if eval $compile; then
8692 echo "Yes, it does."
8695 echo "No, it doesn't."
8697 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8704 hasstruct='varname=$1; struct=$2; shift; shift;
8705 while $test $# -ge 2; do
8707 $define) echo "#include <$2>";;
8711 echo "int main () { struct $struct foo; }" >> try.c;
8713 if eval $compile; then
8722 : see if this is a sys/param system
8723 set sys/param.h i_sysparam
8726 : see if this is a sys/mount.h system
8727 set sys/mount.h i_sysmount
8730 : see if sys/types.h has to be included
8731 set sys/types.h i_systypes
8736 echo "Checking to see if your system supports struct fs_data..." >&4
8737 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8739 case "$d_fs_data_s" in
8740 "$define") echo "Yes, it does." ;;
8741 *) echo "No, it doesn't." ;;
8744 : see if fseeko exists
8748 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8751 : see if fsetpos exists
8752 set fsetpos d_fsetpos
8756 : see if fstatfs exists
8757 set fstatfs d_fstatfs
8761 : see if statvfs exists
8762 set statvfs d_statvfs
8765 : see if fstatvfs exists
8766 set fstatvfs d_fstatvfs
8770 : see if ftello exists
8774 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8777 : see if getgrent exists
8778 set getgrent d_getgrent
8781 : see if gethostbyaddr exists
8782 set gethostbyaddr d_gethbyaddr
8785 : see if gethostbyname exists
8786 set gethostbyname d_gethbyname
8789 : see if gethostent exists
8790 set gethostent d_gethent
8793 : see how we will look up host name
8796 if set gethostname val -f d_gethname; eval $csym; $val; then
8797 echo 'gethostname() found.' >&4
8798 d_gethname="$define"
8801 if set uname val -f d_uname; eval $csym; $val; then
8804 uname() was found, but you're running xenix, and older versions of xenix
8805 have a broken uname(). If you don't really know whether your xenix is old
8806 enough to have a broken system call, use the default answer.
8813 rp='Is your uname() broken?'
8816 n*) d_uname="$define"; call=uname;;
8819 echo 'uname() found.' >&4
8826 case "$d_gethname" in
8827 '') d_gethname="$undef";;
8830 '') d_uname="$undef";;
8832 case "$d_uname$d_gethname" in
8837 Every now and then someone has a $call() that lies about the hostname
8838 but can't be fixed for political or economic reasons. If you wish, I can
8839 pretend $call() isn't there and maybe compute hostname at run-time
8840 thanks to the '$phostname' command.
8843 rp="Shall I ignore $call() from now on?"
8846 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8849 case "$phostname" in
8851 *) case "$aphostname" in
8857 file=`./loc $file $file $pth`
8858 aphostname=`echo $file $*`
8863 case "$d_uname$d_gethname" in
8866 case "$phostname" in
8868 echo "There will be no way for $package to get your hostname." >&4;;
8870 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8874 case "$d_phostname" in
8875 '') d_phostname="$undef";;
8878 : see if this is a netdb.h system
8882 : see if prototypes for various gethostxxx netdb.h functions are available
8884 set d_gethostprotos gethostent $i_netdb netdb.h
8887 : see if getlogin exists
8888 set getlogin d_getlogin
8891 : see if getmnt exists
8895 : see if getmntent exists
8896 set getmntent d_getmntent
8899 : see if getnetbyaddr exists
8900 set getnetbyaddr d_getnbyaddr
8903 : see if getnetbyname exists
8904 set getnetbyname d_getnbyname
8907 : see if getnetent exists
8908 set getnetent d_getnent
8911 : see if prototypes for various getnetxxx netdb.h functions are available
8913 set d_getnetprotos getnetent $i_netdb netdb.h
8917 : see if getprotobyname exists
8918 set getprotobyname d_getpbyname
8921 : see if getprotobynumber exists
8922 set getprotobynumber d_getpbynumber
8925 : see if getprotoent exists
8926 set getprotoent d_getpent
8929 : see if getpgid exists
8930 set getpgid d_getpgid
8933 : see if getpgrp2 exists
8934 set getpgrp2 d_getpgrp2
8937 : see if getppid exists
8938 set getppid d_getppid
8941 : see if getpriority exists
8942 set getpriority d_getprior
8945 : see if prototypes for various getprotoxxx netdb.h functions are available
8947 set d_getprotoprotos getprotoent $i_netdb netdb.h
8950 : see if getpwent exists
8951 set getpwent d_getpwent
8955 : see if getservbyname exists
8956 set getservbyname d_getsbyname
8959 : see if getservbyport exists
8960 set getservbyport d_getsbyport
8963 : see if getservent exists
8964 set getservent d_getsent
8967 : see if prototypes for various getservxxx netdb.h functions are available
8969 set d_getservprotos getservent $i_netdb netdb.h
8972 : see if getspent exists
8973 set getspent d_getspent
8976 : see if getspnam exists
8977 set getspnam d_getspnam
8980 : see if gettimeofday or ftime exists
8981 set gettimeofday d_gettimeod
8983 case "$d_gettimeod" in
8989 val="$undef"; set d_ftime; eval $setvar
8992 case "$d_gettimeod$d_ftime" in
8995 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8999 : see if this is an grp system
9005 xxx=`./findhdr grp.h`
9006 $cppstdin $cppflags $cppminus < $xxx >$$.h
9008 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9020 set d_grpasswd; eval $setvar
9024 : see if hasmntopt exists
9025 set hasmntopt d_hasmntopt
9028 : see if this is a netinet/in.h or sys/in.h system
9029 set netinet/in.h i_niin sys/in.h i_sysin
9032 : see if arpa/inet.h has to be included
9033 set arpa/inet.h i_arpainet
9036 : see if htonl --and friends-- exists
9041 : Maybe they are macros.
9046 #include <sys/types.h>
9047 #$i_niin I_NETINET_IN
9049 #$i_arpainet I_ARPA_INET
9051 #include <netinet/in.h>
9057 #include <arpa/inet.h>
9060 printf("Defined as a macro.");
9063 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9064 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9066 echo "But it seems to be defined as a macro." >&4
9076 if set index val -f; eval $csym; $val; then
9077 if set strchr val -f d_strchr; eval $csym; $val; then
9078 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9081 echo "strchr() found." >&4
9085 echo "index() found." >&4
9090 echo "index() found." >&4
9093 if set strchr val -f d_strchr; eval $csym; $val; then
9096 echo "strchr() found." >&4
9098 echo "No index() or strchr() found!" >&4
9103 set d_strchr; eval $setvar
9105 set d_index; eval $setvar
9107 : check whether inet_aton exists
9108 set inet_aton d_inetaton
9111 : see if inttypes.h is available
9112 : we want a real compile instead of Inhdr because some systems
9113 : have an inttypes.h which includes non-existent headers
9116 #include <inttypes.h>
9118 static int32_t foo32 = 0x12345678;
9122 if eval $compile; then
9123 echo "<inttypes.h> found." >&4
9126 echo "<inttypes.h> NOT found." >&4
9135 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9137 #include <sys/types.h>
9138 #$i_inttypes I_INTTYPES
9140 #include <inttypes.h>
9142 int main() { int64_t x = 7; }
9145 if eval $compile; then
9147 echo " Yes, it does." >&4
9150 echo " No, it doesn't." >&4
9158 $cat >isascii.c <<'EOCP'
9170 if eval $compile; then
9171 echo "isascii() found." >&4
9174 echo "isascii() NOT found." >&4
9181 : see if killpg exists
9185 : see if lchown exists
9187 $cat > try.c <<'EOCP'
9188 /* System header to define __stub macros and hopefully few prototypes,
9189 which can conflict with char lchown(); below. */
9191 /* Override any gcc2 internal prototype to avoid an error. */
9192 /* We use char because int might match the return type of a gcc2
9193 builtin and then its argument prototype would still apply. */
9196 /* The GNU C library defines this for functions which it implements
9197 to always fail with ENOSYS. Some functions are actually named
9198 something starting with __ and the normal name is an alias. */
9199 #if defined (__stub_lchown) || defined (__stub___lchown)
9207 if eval $compile; then
9208 $echo "lchown() found." >&4
9211 $echo "lchown() NOT found." >&4
9217 : See if number of significant digits in a double precision number is known
9219 $cat >ldbl_dig.c <<EOM
9229 printf("Contains LDBL_DIG");
9232 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9233 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9234 echo "LDBL_DIG found." >&4
9237 echo "LDBL_DIG NOT found." >&4
9244 : see if link exists
9248 : see if localeconv exists
9249 set localeconv d_locconv
9252 : see if lockf exists
9256 : check for long long
9258 $echo $n "Checking to see if your system supports long long..." $c >&4
9259 echo 'int main() { long long x = 7; return 0; }' > try.c
9261 if eval $compile; then
9263 echo " Yes, it does." >&4
9266 echo " No, it doesn't." >&4
9272 : check for length of long long
9273 case "${d_longlong}${longlongsize}" in
9276 $echo $n "Checking to see how big your long longs are..." $c >&4
9277 $cat >try.c <<'EOCP'
9281 printf("%d\n", (int)sizeof(long long));
9286 if eval $compile_ok; then
9287 longlongsize=`./try$exe_ext`
9288 $echo " $longlongsize bytes." >&4
9292 echo "(I can't seem to compile the test program. Guessing...)"
9293 rp="What is the size of a long long (in bytes)?"
9297 if $test "X$longsize" = "X$longlongsize"; then
9298 echo "(That isn't any different from an ordinary long.)"
9304 : see if lstat exists
9308 : see if mblen exists
9312 : see if mbstowcs exists
9313 set mbstowcs d_mbstowcs
9316 : see if mbtowc exists
9320 : see if memchr exists
9324 : see if memcmp exists
9328 : see if memcpy exists
9332 : see if memmove exists
9333 set memmove d_memmove
9336 : see if memset exists
9340 : see if mkdir exists
9344 : see if mkfifo exists
9348 : see if mktime exists
9352 : see if msgctl exists
9356 : see if msgget exists
9360 : see if msgsnd exists
9364 : see if msgrcv exists
9368 : see how much of the 'msg*(2)' library is present.
9371 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9372 *"$undef"*) h_msg=false;;
9376 case "`ipcs 2>&1`" in
9377 "SVID messages"*"not configured"*)
9378 echo "Your $osname does not have the msg*(2) configured." >&4
9393 : we could also check for sys/ipc.h ...
9394 if $h_msg && $test `./findhdr sys/msg.h`; then
9395 echo "You have the full msg*(2) library." >&4
9398 echo "You don't have the full msg*(2) library." >&4
9404 : see if nice exists
9408 : see if POSIX threads are available
9409 set pthread.h i_pthread
9415 : how to create joinable pthreads
9416 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9418 echo "Checking what constant to use for creating joinable pthreads..." >&4
9419 $cat >try.c <<'EOCP'
9420 #include <pthread.h>
9422 int detachstate = JOINABLE;
9425 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9426 if eval $compile; then
9427 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9428 val="$undef" # Yes, undef.
9429 set d_old_pthread_create_joinable
9432 set old_pthread_create_joinable
9435 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9436 if eval $compile; then
9437 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9439 set d_old_pthread_create_joinable
9441 val=PTHREAD_CREATE_UNDETACHED
9442 set old_pthread_create_joinable
9445 set try -DJOINABLE=__UNDETACHED
9446 if eval $compile; then
9447 echo "You seem to use __UNDETACHED." >&4
9449 set d_old_pthread_create_joinable
9452 set old_pthread_create_joinable
9455 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9457 set d_old_pthread_create_joinable
9460 set old_pthread_create_joinable
9467 d_old_pthread_create_joinable="$undef"
9468 old_pthread_create_joinable=""
9471 : see if pause exists
9475 : see if pipe exists
9479 : see if poll exists
9484 : see whether the various POSIXish _yields exist
9486 #include <pthread.h>
9492 #ifdef PTHREAD_YIELD
9495 #ifdef PTHREAD_YIELD_NULL
9496 pthread_yield(NULL);
9502 : see if sched_yield exists
9503 set try -DSCHED_YIELD
9504 if eval $compile; then
9506 sched_yield='sched_yield()'
9510 case "$usethreads" in
9513 $define) echo 'sched_yield() found.' >&4 ;;
9514 *) echo 'sched_yield() NOT found.' >&4 ;;
9520 : see if pthread_yield exists
9521 set try -DPTHREAD_YIELD
9522 if eval $compile; then
9524 case "$sched_yield" in
9525 '') sched_yield='pthread_yield()' ;;
9528 set try -DPTHREAD_YIELD_NULL
9529 if eval $compile; then
9531 case "$sched_yield" in
9532 '') sched_yield='pthread_yield(NULL)' ;;
9538 case "$usethreads" in
9541 $define) echo 'pthread_yield() found.' >&4 ;;
9542 *) echo 'pthread_yield() NOT found.' >&4 ;;
9549 case "$sched_yield" in
9550 '') sched_yield=undef ;;
9555 : see if this is a pwd.h system
9561 xxx=`./findhdr pwd.h`
9562 $cppstdin $cppflags $cppminus < $xxx >$$.h
9564 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9572 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9580 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9588 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9596 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9604 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9612 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9620 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9632 set d_pwquota; eval $setvar
9633 set d_pwage; eval $setvar
9634 set d_pwchange; eval $setvar
9635 set d_pwclass; eval $setvar
9636 set d_pwexpire; eval $setvar
9637 set d_pwcomment; eval $setvar
9638 set d_pwgecos; eval $setvar
9639 set d_pwpasswd; eval $setvar
9645 echo "Checking which 64-bit integer type we could use..." >&4
9651 val='"unsigned int"'
9656 *) case "$longsize" in
9660 val='"unsigned long"'
9665 *) case "$uselonglong:$d_longlong:$longlongsize" in
9670 val='"unsigned long long"'
9675 *) case "$d_int64t" in
9694 '') case "$uselonglong:$d_longlong:$longlongsize" in
9696 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9697 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9701 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9706 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9711 : see if readdir and friends exist
9712 set readdir d_readdir
9714 set seekdir d_seekdir
9716 set telldir d_telldir
9718 set rewinddir d_rewinddir
9721 : see if readlink exists
9722 set readlink d_readlink
9725 : see if rename exists
9729 : see if rmdir exists
9733 : see if memory.h is available.
9738 : See if it conflicts with string.h
9744 $cppstdin $cppflags $cppminus < $strings > mem.h
9745 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9747 echo "We won't be including <memory.h>."
9757 : can bcopy handle overlapping blocks?
9762 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9769 $cat >>try.c <<'EOCP'
9772 # include <memory.h>
9775 # include <stdlib.h>
9778 # include <string.h>
9780 # include <strings.h>
9783 # include <unistd.h> /* Needed for NetBSD */
9787 char buf[128], abc[128];
9793 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9795 for (align = 7; align >= 0; align--) {
9796 for (len = 36; len; len--) {
9799 for (off = 1; off <= len; off++) {
9800 bcopy(b, b+off, len);
9801 bcopy(b+off, b, len);
9802 if (bcmp(b, abc, len))
9811 if eval $compile_ok; then
9812 if ./try 2>/dev/null; then
9816 echo "It can't, sorry."
9817 case "$d_memmove" in
9818 "$define") echo "But that's Ok since you have memmove()." ;;
9822 echo "(I can't compile the test program, so we'll assume not...)"
9823 case "$d_memmove" in
9824 "$define") echo "But that's Ok since you have memmove()." ;;
9829 $rm -f try.* try core
9833 : can memcpy handle overlapping blocks?
9838 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9845 $cat >>try.c <<'EOCP'
9848 # include <memory.h>
9851 # include <stdlib.h>
9854 # include <string.h>
9856 # include <strings.h>
9859 # include <unistd.h> /* Needed for NetBSD */
9863 char buf[128], abc[128];
9869 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9870 try to store the string in read-only memory. */
9871 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9873 for (align = 7; align >= 0; align--) {
9874 for (len = 36; len; len--) {
9876 memcpy(b, abc, len);
9877 for (off = 1; off <= len; off++) {
9878 memcpy(b+off, b, len);
9879 memcpy(b, b+off, len);
9880 if (memcmp(b, abc, len))
9889 if eval $compile_ok; then
9890 if ./try 2>/dev/null; then
9894 echo "It can't, sorry."
9895 case "$d_memmove" in
9896 "$define") echo "But that's Ok since you have memmove()." ;;
9900 echo "(I can't compile the test program, so we'll assume not...)"
9901 case "$d_memmove" in
9902 "$define") echo "But that's Ok since you have memmove()." ;;
9907 $rm -f try.* try core
9911 : can memcmp be trusted to compare relative magnitude?
9916 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9923 $cat >>try.c <<'EOCP'
9926 # include <memory.h>
9929 # include <stdlib.h>
9932 # include <string.h>
9934 # include <strings.h>
9937 # include <unistd.h> /* Needed for NetBSD */
9943 if ((a < b) && memcmp(&a, &b, 1) < 0)
9949 if eval $compile_ok; then
9950 if ./try 2>/dev/null; then
9954 echo "No, it can't (it uses signed chars)."
9957 echo "(I can't compile the test program, so we'll assume not...)"
9961 $rm -f try.* try core
9965 : see if select exists
9969 : see if semctl exists
9973 : see if semget exists
9977 : see if semop exists
9981 : see how much of the 'sem*(2)' library is present.
9984 case "$d_semctl$d_semget$d_semop" in
9985 *"$undef"*) h_sem=false;;
9989 case "`ipcs 2>&1`" in
9990 "SVID messages"*"not configured"*)
9991 echo "Your $osname does not have the sem*(2) configured." >&4
10004 : we could also check for sys/ipc.h ...
10005 if $h_sem && $test `./findhdr sys/sem.h`; then
10006 echo "You have the full sem*(2) library." >&4
10009 echo "You don't have the full sem*(2) library." >&4
10015 : see whether sys/sem.h defines union semun
10017 $cat > try.c <<'END'
10018 #include <sys/types.h>
10019 #include <sys/ipc.h>
10020 #include <sys/sem.h>
10021 int main () { union semun semun; semun.buf = 0; }
10024 if eval $compile; then
10025 echo "You have union semun in <sys/sem.h>." >&4
10028 echo "You do not have union semun in <sys/sem.h>." >&4
10031 $rm -f try try.c try.h
10035 : see how to do semctl IPC_STAT
10038 : see whether semctl IPC_STAT can use union semun
10043 # define S_IRUSR S_IREAD
10044 # define S_IWUSR S_IWRITE
10045 # define S_IXUSR S_IEXEC
10047 # define S_IRUSR 0400
10048 # define S_IWUSR 0200
10049 # define S_IXUSR 0100
10051 # define S_IRGRP (S_IRUSR>>3)
10052 # define S_IWGRP (S_IWUSR>>3)
10053 # define S_IXGRP (S_IXUSR>>3)
10054 # define S_IROTH (S_IRUSR>>6)
10055 # define S_IWOTH (S_IWUSR>>6)
10056 # define S_IXOTH (S_IXUSR>>6)
10059 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10060 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10061 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10066 #include <sys/types.h>
10067 #include <sys/ipc.h>
10068 #include <sys/sem.h>
10069 #include <sys/stat.h>
10076 #$d_union_semun HAS_UNION_SEMUN
10079 #ifndef HAS_UNION_SEMUN
10082 struct semid_ds *buf;
10083 unsigned short *array;
10089 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10090 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10092 struct semid_ds argbuf;
10095 st = semctl(sem, 0, IPC_STAT, arg);
10099 # endif /* IPC_STAT */
10100 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10102 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10103 # endif /* IPC_RMID */
10104 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10106 #endif /* IPC_PRIVATE && ... */
10107 printf("semget failed: errno = %d\n", errno);
10113 if eval $compile; then
10116 semun) val="$define" ;;
10122 case "$d_semctl_semun" in
10124 echo "You can use union semun for semctl IPC_STAT." >&4
10127 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10132 : see whether semctl IPC_STAT can use struct semid_ds pointer
10133 $cat > try.c <<'END'
10134 #include <sys/types.h>
10135 #include <sys/ipc.h>
10136 #include <sys/sem.h>
10137 #include <sys/stat.h>
10145 struct semid_ds arg;
10148 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10149 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10152 st = semctl(sem, 0, IPC_STAT, &arg);
10154 printf("semid_ds\n");
10156 # endif /* IPC_STAT */
10157 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10159 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10160 # endif /* IPC_RMID */
10161 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10163 #endif /* IPC_PRIVATE && ... */
10164 printf("semget failed: errno = %d\n", errno);
10171 if eval $compile; then
10174 semid_ds) val="$define" ;;
10178 set d_semctl_semid_ds
10180 case "$d_semctl_semid_ds" in
10182 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10184 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10191 # We do not have the full sem*(2) library, so assume we can not
10197 set d_semctl_semid_ds
10202 : see if setegid exists
10203 set setegid d_setegid
10206 : see if seteuid exists
10207 set seteuid d_seteuid
10210 : see if setgrent exists
10211 set setgrent d_setgrent
10214 : see if sethostent exists
10215 set sethostent d_sethent
10218 : see if setlinebuf exists
10219 set setlinebuf d_setlinebuf
10222 : see if setlocale exists
10223 set setlocale d_setlocale
10226 : see if setnetent exists
10227 set setnetent d_setnent
10230 : see if setprotoent exists
10231 set setprotoent d_setpent
10234 : see if setpgid exists
10235 set setpgid d_setpgid
10238 : see if setpgrp2 exists
10239 set setpgrp2 d_setpgrp2
10242 : see if setpriority exists
10243 set setpriority d_setprior
10246 : see if setpwent exists
10247 set setpwent d_setpwent
10250 : see if setregid exists
10251 set setregid d_setregid
10253 set setresgid d_setresgid
10256 : see if setreuid exists
10257 set setreuid d_setreuid
10259 set setresuid d_setresuid
10262 : see if setrgid exists
10263 set setrgid d_setrgid
10266 : see if setruid exists
10267 set setruid d_setruid
10270 : see if setservent exists
10271 set setservent d_setsent
10274 : see if setsid exists
10275 set setsid d_setsid
10278 : see if setspent exists
10279 set setspent d_setspent
10282 : see if setvbuf exists
10283 set setvbuf d_setvbuf
10286 : see if sfio.h is available
10291 : see if sfio library is available
10302 : Ok, but do we want to use it.
10306 true|$define|[yY]*) dflt='y';;
10309 echo "$package can use the sfio library, but it is experimental."
10310 rp="You seem to have sfio available, do you want to try using it?"
10314 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10316 : Remove sfio from list of libraries to use
10317 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10320 echo "libs = $libs" >&4
10324 *) case "$usesfio" in
10325 true|$define|[yY]*)
10326 echo "Sorry, cannot find sfio on this machine" >&4
10327 echo "Ignoring your setting of usesfio=$usesfio" >&4
10335 $define) usesfio='true';;
10336 *) usesfio='false';;
10339 : see if shmctl exists
10340 set shmctl d_shmctl
10343 : see if shmget exists
10344 set shmget d_shmget
10347 : see if shmat exists
10350 : see what shmat returns
10353 $cat >shmat.c <<'END'
10354 #include <sys/shm.h>
10357 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10362 echo "and it returns ($shmattype)." >&4
10363 : see if a prototype for shmat is available
10364 xxx=`./findhdr sys/shm.h`
10365 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10366 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10377 set d_shmatprototype
10380 : see if shmdt exists
10384 : see how much of the 'shm*(2)' library is present.
10387 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10388 *"$undef"*) h_shm=false;;
10392 case "`ipcs 2>&1`" in
10393 "SVID shared memory"*"not configured"*)
10394 echo "Your $osname does not have the shm*(2) configured." >&4
10397 set shmctl d_shmctl
10399 set shmget d_shmget
10409 : we could also check for sys/ipc.h ...
10410 if $h_shm && $test `./findhdr sys/shm.h`; then
10411 echo "You have the full shm*(2) library." >&4
10414 echo "You don't have the full shm*(2) library." >&4
10421 : see if we have sigaction
10422 if set sigaction val -f d_sigaction; eval $csym; $val; then
10423 echo 'sigaction() found.' >&4
10424 $cat > try.c <<'EOP'
10426 #include <sys/types.h>
10427 #include <signal.h>
10430 struct sigaction act, oact;
10432 oact.sa_handler = 0;
10433 /* so that act and oact are used */
10434 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10438 if eval $compile_ok; then
10441 echo "But you don't seem to have a useable struct sigaction." >&4
10445 echo 'sigaction NOT found.' >&4
10448 set d_sigaction; eval $setvar
10449 $rm -f try try$_o try.c
10451 : see if sigsetjmp exists
10453 case "$d_sigsetjmp" in
10455 $cat >try.c <<'EOP'
10456 #include <setjmp.h>
10461 if (sigsetjmp(env,1))
10464 siglongjmp(env, 1);
10469 if eval $compile; then
10470 if ./try >/dev/null 2>&1; then
10471 echo "POSIX sigsetjmp found." >&4
10475 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10481 echo "sigsetjmp not found." >&4
10485 *) val="$d_sigsetjmp"
10486 case "$d_sigsetjmp" in
10487 $define) echo "POSIX sigsetjmp found." >&4;;
10488 $undef) echo "sigsetjmp not found." >&4;;
10496 : see if sqrtl exists
10500 : see if sys/stat.h is available
10501 set sys/stat.h i_sysstat
10505 : see if stat knows about block sizes
10507 echo "Checking to see if your struct stat has st_blocks field..." >&4
10508 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10512 : see if this is a sys/vfs.h system
10513 set sys/vfs.h i_sysvfs
10517 : see if this is a sys/statfs.h system
10518 set sys/statfs.h i_sysstatfs
10523 echo "Checking to see if your system supports struct statfs..." >&4
10524 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
10526 case "$d_statfs_s" in
10527 "$define") echo "Yes, it does." ;;
10528 *) echo "No, it doesn't." ;;
10533 : see if struct statfs knows about f_flags
10534 case "$d_statfs_s" in
10537 echo "Checking to see if your struct statfs has f_flags field..." >&4
10538 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
10542 set d_statfs_f_flags
10546 case "$d_statfs_f_flags" in
10547 "$define") echo "Yes, it does." ;;
10548 *) echo "No, it doesn't." ;;
10551 : see if _ptr and _cnt from stdio act std
10553 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10554 echo "(Looks like you have stdio.h from Linux.)"
10555 case "$stdio_ptr" in
10556 '') stdio_ptr='((fp)->_IO_read_ptr)'
10559 *) ptr_lval=$d_stdio_ptr_lval;;
10561 case "$stdio_cnt" in
10562 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10565 *) cnt_lval=$d_stdio_cnt_lval;;
10567 case "$stdio_base" in
10568 '') stdio_base='((fp)->_IO_read_base)';;
10570 case "$stdio_bufsiz" in
10571 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10574 case "$stdio_ptr" in
10575 '') stdio_ptr='((fp)->_ptr)'
10578 *) ptr_lval=$d_stdio_ptr_lval;;
10580 case "$stdio_cnt" in
10581 '') stdio_cnt='((fp)->_cnt)'
10584 *) cnt_lval=$d_stdio_cnt_lval;;
10586 case "$stdio_base" in
10587 '') stdio_base='((fp)->_base)';;
10589 case "$stdio_bufsiz" in
10590 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10593 : test whether _ptr and _cnt really work
10594 echo "Checking how std your stdio is..." >&4
10597 #define FILE_ptr(fp) $stdio_ptr
10598 #define FILE_cnt(fp) $stdio_cnt
10600 FILE *fp = fopen("try.c", "r");
10603 18 <= FILE_cnt(fp) &&
10604 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10612 if eval $compile; then
10614 echo "Your stdio acts pretty std."
10617 echo "Your stdio isn't very std."
10620 echo "Your stdio doesn't appear very std."
10626 : Can _ptr be used as an lvalue?
10627 case "$d_stdstdio$ptr_lval" in
10628 $define$define) val=$define ;;
10631 set d_stdio_ptr_lval
10634 : Can _cnt be used as an lvalue?
10635 case "$d_stdstdio$cnt_lval" in
10636 $define$define) val=$define ;;
10639 set d_stdio_cnt_lval
10642 : see if _base is also standard
10644 case "$d_stdstdio" in
10648 #define FILE_base(fp) $stdio_base
10649 #define FILE_bufsiz(fp) $stdio_bufsiz
10651 FILE *fp = fopen("try.c", "r");
10654 19 <= FILE_bufsiz(fp) &&
10655 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10662 if eval $compile; then
10664 echo "And its _base field acts std."
10667 echo "But its _base field isn't std."
10670 echo "However, it seems to be lacking the _base field."
10679 Checking how to access stdio streams by file descriptor number...
10681 case "$stdio_stream_array" in
10682 '') $cat >try.c <<EOCP
10685 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10689 for s in _iob __iob __sF
10691 set try -DSTDIO_STREAM_ARRAY=$s
10692 if eval $compile; then
10693 case "`./try$exe_ext`" in
10694 yes) stdio_stream_array=$s; break ;;
10698 $rm -f try.* try$exe_ext
10700 case "$stdio_stream_array" in
10702 I can't figure out how to access stdio streams by file descriptor number.
10704 d_stdio_stream_array="$undef"
10707 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10709 d_stdio_stream_array="$define"
10713 : see if strcoll exists
10714 set strcoll d_strcoll
10717 : check for structure copying
10719 echo "Checking to see if your C compiler can copy structs..." >&4
10720 $cat >try.c <<'EOCP'
10730 if $cc -c try.c >/dev/null 2>&1 ; then
10732 echo "Yup, it can."
10735 echo "Nope, it can't."
10741 : see if strerror and/or sys_errlist[] exist
10743 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10744 if set strerror val -f d_strerror; eval $csym; $val; then
10745 echo 'strerror() found.' >&4
10746 d_strerror="$define"
10747 d_strerrm='strerror(e)'
10748 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10749 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10750 d_syserrlst="$define"
10752 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10753 d_syserrlst="$undef"
10755 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10756 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10757 echo 'strerror() found in string header.' >&4
10758 d_strerror="$define"
10759 d_strerrm='strerror(e)'
10760 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10761 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10762 d_syserrlst="$define"
10764 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10765 d_syserrlst="$undef"
10767 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10768 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10769 d_strerror="$undef"
10770 d_syserrlst="$define"
10771 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10773 echo 'strerror() and sys_errlist[] NOT found.' >&4
10774 d_strerror="$undef"
10775 d_syserrlst="$undef"
10776 d_strerrm='"unknown"'
10780 : see if strtod exists
10781 set strtod d_strtod
10784 : see if strtol exists
10785 set strtol d_strtol
10788 : see if strtoul exists
10789 set strtoul d_strtoul
10792 : see if strtoull exists
10793 set strtoull d_strtoull
10796 : see if strxfrm exists
10797 set strxfrm d_strxfrm
10800 : see if symlink exists
10801 set symlink d_symlink
10804 : see if syscall exists
10805 set syscall d_syscall
10808 : see if sysconf exists
10809 set sysconf d_sysconf
10812 : see if system exists
10813 set system d_system
10816 : see if tcgetpgrp exists
10817 set tcgetpgrp d_tcgetpgrp
10820 : see if tcsetpgrp exists
10821 set tcsetpgrp d_tcsetpgrp
10824 : see if prototype for telldir is available
10826 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10829 : see if this is a sys/times.h system
10830 set sys/times.h i_systimes
10833 : see if times exists
10835 if set times val -f d_times; eval $csym; $val; then
10836 echo 'times() found.' >&4
10839 case "$i_systimes" in
10840 "$define") inc='sys/times.h';;
10842 rp="What is the type returned by times() on this system?"
10843 set clock_t clocktype long stdio.h sys/types.h $inc
10846 echo 'times() NOT found, hope that will do.' >&4
10851 : see if truncate exists
10852 set truncate d_truncate
10855 : see if tzname[] exists
10857 if set tzname val -a d_tzname; eval $csym; $val; then
10859 echo 'tzname[] found.' >&4
10862 echo 'tzname[] NOT found.' >&4
10867 : see if umask exists
10871 : see if ustat exists
10875 : backward compatibility for d_hvfork
10876 if test X$d_hvfork != X; then
10877 d_vfork="$d_hvfork"
10880 : see if there is a vfork
10885 : Ok, but do we want to use it. vfork is reportedly unreliable in
10886 : perl on Solaris 2.x, and probably elsewhere.
10890 case "$usevfork" in
10896 Perl can only use a vfork() that doesn't suffer from strict
10897 restrictions on calling functions or modifying global data in
10898 the child. For example, glibc-2.1 contains such a vfork()
10899 that is unsuitable. If your system provides a proper fork()
10900 call, chances are that you do NOT want perl to use vfork().
10903 rp="Do you still want to use vfork()?"
10908 echo "Ok, we won't use vfork()."
10917 $define) usevfork='true';;
10918 *) usevfork='false';;
10921 : see if this is an sysdir system
10922 set sys/dir.h i_sysdir
10925 : see if this is an sysndir system
10926 set sys/ndir.h i_sysndir
10929 : see if closedir exists
10930 set closedir d_closedir
10933 case "$d_closedir" in
10936 echo "Checking whether closedir() returns a status..." >&4
10937 cat > closedir.c <<EOM
10938 #$i_dirent I_DIRENT /**/
10939 #$i_sysdir I_SYS_DIR /**/
10940 #$i_sysndir I_SYS_NDIR /**/
10941 #$i_systypes I_SYS_TYPES /**/
10943 #if defined(I_SYS_TYPES)
10944 #include <sys/types.h>
10946 #if defined(I_DIRENT)
10947 #include <dirent.h>
10948 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10949 #include <sys/dir.h>
10953 #include <sys/ndir.h>
10957 #include <ndir.h> /* may be wrong in the future */
10959 #include <sys/dir.h>
10964 int main() { return closedir(opendir(".")); }
10967 if eval $compile_ok; then
10968 if ./closedir > /dev/null 2>&1 ; then
10969 echo "Yes, it does."
10972 echo "No, it doesn't."
10976 echo "(I can't seem to compile the test program--assuming it doesn't)"
10984 set d_void_closedir
10987 : check for volatile keyword
10989 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10990 $cat >try.c <<'EOCP'
10993 typedef struct _goo_struct goo_struct;
10994 goo_struct * volatile goo = ((goo_struct *)0);
10995 struct _goo_struct {
11000 typedef unsigned short foo_t;
11001 char *volatile foo;
11003 volatile foo_t blech;
11007 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11009 echo "Yup, it does."
11012 echo "Nope, it doesn't."
11018 : see if there is a wait4
11022 : see if waitpid exists
11023 set waitpid d_waitpid
11026 : see if wcstombs exists
11027 set wcstombs d_wcstombs
11030 : see if wctomb exists
11031 set wctomb d_wctomb
11034 : preserve RCS keywords in files with variable substitution, grrr
11039 Revision='$Revision'
11041 case "$crosscompile" in
11042 ''|[nN]*) crosscompile="$undef" ;;
11046 next|rhapsody) multiarch="$define" ;;
11048 case "$multiarch" in
11049 ''|[nN]*) multiarch="$undef" ;;
11052 : check for alignment requirements
11054 case "$crosscompile$multiarch" in
11057 You seem to be either cross-compiling or doing a multiarchitecture build,
11058 skipping the memory alignment check.
11061 case "$alignbytes" in
11062 '') alignbytes=8 ;;
11066 case "$alignbytes" in
11067 '') echo "Checking alignment constraints..." >&4
11068 $cat >try.c <<'EOCP'
11076 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11081 if eval $compile_ok; then
11085 echo "(I can't seem to compile the test program...)"
11088 *) dflt="$alignbytes"
11091 rp="Doubles must be aligned on a how-many-byte boundary?"
11099 : check for ordering of bytes in a long
11101 case "$crosscompile$multiarch" in
11104 You seem to be either cross-compiling or doing a multiarchitecture build,
11105 skipping the byteorder check.
11111 case "$byteorder" in
11114 In the following, larger digits indicate more significance. A big-endian
11115 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11116 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11117 machines may have weird orders like 3412. A Cray will report 87654321,
11118 an Alpha will report 12345678. If the test program works the default is
11120 I'm now running the test program...
11122 $cat >try.c <<'EOCP'
11129 char c[sizeof(long)];
11132 if (sizeof(long) > 4)
11133 u.l = (0x08070605L << 32) | 0x04030201L;
11136 for (i = 0; i < sizeof(long); i++)
11137 printf("%c", u.c[i]+'0');
11144 if eval $compile && ./try > /dev/null; then
11147 [1-4][1-4][1-4][1-4]|12345678|87654321)
11148 echo "(The test program ran ok.)"
11149 echo "byteorder=$dflt"
11152 ????|????????) echo "(The test program ran ok.)" ;;
11153 *) echo "(The test program didn't run right for some reason.)" ;;
11158 (I can't seem to compile the test program. Guessing big-endian...)
11161 case "$xxx_prompt" in
11163 rp="What is the order of bytes in a long?"
11177 : how do we catenate cpp tokens here?
11179 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11180 $cat >cpp_stuff.c <<'EOCP'
11181 #define RCAT(a,b)a/**/b
11182 #define ACAT(a,b)a ## b
11186 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11187 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11188 echo "Oh! Smells like ANSI's been here." >&4
11189 echo "We can catify or stringify, separately or together!"
11191 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11192 echo "Ah, yes! The good old days!" >&4
11193 echo "However, in the good old days we don't know how to stringify and"
11194 echo "catify at the same time."
11198 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11199 to have to edit the values of CAT[2-5] in config.h...
11201 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11205 : see if this is a db.h system
11211 : Check db version.
11213 echo "Checking Berkeley DB version ..." >&4
11219 #include <sys/types.h>
11224 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11225 int Major, Minor, Patch ;
11226 unsigned long Version ;
11227 (void)db_version(&Major, &Minor, &Patch) ;
11228 printf("You have Berkeley DB Version 2 or greater\n");
11230 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11231 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11232 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11233 Major, Minor, Patch) ;
11235 /* check that db.h & libdb are compatible */
11236 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11237 printf("db.h and libdb are incompatible\n") ;
11241 printf("db.h and libdb are compatible\n") ;
11243 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11244 + DB_VERSION_PATCH ;
11246 /* needs to be >= 2.3.4 */
11247 if (Version < 2003004) {
11248 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11249 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11255 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11256 printf("You have Berkeley DB Version 1\n");
11257 exit(0); /* DB version < 2: the coast is clear. */
11259 exit(1); /* <db.h> not Berkeley DB? */
11265 if eval $compile && ./try; then
11266 echo 'Looks OK.' >&4
11268 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11272 : Remove db from list of libraries to use
11273 echo "Removing unusable -ldb from library list" >&4
11274 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11277 echo "libs = $libs" >&4
11287 : Check the return type needed for hash
11289 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11295 #include <sys/types.h>
11298 #ifndef DB_VERSION_MAJOR
11299 u_int32_t hash_cb (ptr, size)
11307 info.hash = hash_cb;
11311 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11312 if $contains warning try.out >>/dev/null 2>&1 ; then
11315 db_hashtype='u_int32_t'
11318 : XXX Maybe we should just give up here.
11319 db_hashtype=u_int32_t
11321 echo "Help: I can't seem to compile the db test program." >&4
11322 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11325 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11327 *) db_hashtype=u_int32_t
11332 : Check the return type needed for prefix
11334 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11340 #include <sys/types.h>
11343 #ifndef DB_VERSION_MAJOR
11344 size_t prefix_cb (key1, key2)
11352 info.prefix = prefix_cb;
11356 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11357 if $contains warning try.out >>/dev/null 2>&1 ; then
11358 db_prefixtype='int'
11360 db_prefixtype='size_t'
11363 db_prefixtype='size_t'
11364 : XXX Maybe we should just give up here.
11366 echo "Help: I can't seem to compile the db test program." >&4
11367 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11370 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11372 *) db_prefixtype='size_t'
11376 : check for void type
11378 echo "Checking to see how well your C compiler groks the void type..." >&4
11379 case "$voidflags" in
11381 $cat >try.c <<'EOCP'
11387 extern void moo(); /* function returning void */
11388 void (*goo)(); /* ptr to func returning void */
11390 void *hue; /* generic ptr */
11403 int main() { sub(); }
11405 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11406 voidflags=$defvoidused
11407 echo "Good. It appears to support void to the level $package wants.">&4
11408 if $contains warning .out >/dev/null 2>&1; then
11409 echo "However, you might get some warnings that look like this:"
11413 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11414 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11415 echo "It supports 1..."
11416 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11417 echo "It also supports 2..."
11418 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11420 echo "And it supports 4 but not 8 definitely."
11422 echo "It doesn't support 4..."
11423 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11425 echo "But it supports 8."
11428 echo "Neither does it support 8."
11432 echo "It does not support 2..."
11433 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11435 echo "But it supports 4 and 8."
11437 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11439 echo "And it supports 4 but has not heard about 8."
11441 echo "However it supports 8 but not 4."
11446 echo "There is no support at all for void."
11451 case "$voidflags" in
11453 *) $cat >&4 <<'EOM'
11454 Support flag bits are:
11455 1: basic void declarations.
11456 2: arrays of pointers to functions returning void.
11457 4: operations between pointers to and addresses of void functions.
11458 8: generic void pointers.
11461 rp="Your void support flags add up to what?"
11469 : How can we generate normalized random numbers ?
11471 echo "Looking for a random number function..." >&4
11472 case "$randfunc" in
11474 if set drand48 val -f; eval $csym; $val; then
11476 echo "Good, found drand48()." >&4
11477 elif set random val -f; eval $csym; $val; then
11479 echo "OK, found random()." >&4
11482 echo "Yick, looks like I have to use rand()." >&4
11493 *-Dmy_rand=*|*-Dmy_srand=*)
11494 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11495 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11496 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11497 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11501 while $test "$cont"; do
11502 rp="Use which function to generate random numbers?"
11504 if $test "$ans" = "$dflt"; then
11510 if set $ans val -f; eval $csym; $val; then
11514 rp="I cannot find function $ans. Use that name anyway?"
11523 case "$randfunc" in
11525 drand01="drand48()"
11531 case "$randbits" in
11533 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11535 #$i_unistd I_UNISTD
11536 #$i_stdlib I_STDLIB
11539 # include <unistd.h>
11542 # include <stdlib.h>
11547 register unsigned long tmp;
11548 register unsigned long max = 0L;
11550 for (i = 1000; i; i--) {
11551 tmp = (unsigned long) $randfunc();
11552 if (tmp > max) max = tmp;
11554 for (i = 0; max; i++)
11560 if eval $compile_ok; then
11564 echo "(I can't seem to compile the test program...)"
11571 rp="How many bits does your $randfunc() function produce?"
11575 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11576 seedfunc="s$randfunc"
11577 randseedtype=unsigned
11581 rp="How many bits does your $randfunc() function produce?"
11584 seedfunc="s$randfunc"
11585 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11586 if set $seedfunc val -f; eval $csym; $val; then
11587 echo "(Using $seedfunc() to seed random generator)"
11589 echo "(Warning: no $seedfunc() to seed random generator)"
11592 randseedtype=unsigned
11600 echo "Determining whether or not we are on an EBCDIC system..." >&4
11601 $cat >tebcdic.c <<'EOM'
11604 if ('M'==0xd4) return 0;
11611 if eval $compile_ok; then
11613 echo "You have EBCDIC." >&4
11616 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11619 echo "I'm unable to compile the test program." >&4
11620 echo "I'll assume ASCII or some ISO Latin." >&4
11622 $rm -f tebcdic.c tebcdic
11628 Checking how to flush all pending stdio output...
11630 # I only know how to find the first 32 possibly open files on SunOS.
11631 # See also hints/sunos_4_1.sh and util.c --AD
11633 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11635 $cat >>try.c <<EOCP
11637 #$i_unistd I_UNISTD
11639 # include <unistd.h>
11641 #$d_sysconf HAS_SYSCONF
11642 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11643 #ifdef HAS_STDIO_STREAM_ARRAY
11644 # define STDIO_STREAM_ARRAY $stdio_stream_array
11647 FILE* p = fopen("try.out", "w");
11651 # ifdef TRY_FPRINTF
11655 #ifdef TRY_FFLUSH_NULL
11658 #ifdef TRY_FFLUSH_ALL
11660 long open_max = -1;
11661 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11662 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11664 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11665 open_max = sysconf(_SC_OPEN_MAX);
11668 open_max = FOPEN_MAX;
11671 open_max = OPEN_MAX;
11680 # ifdef HAS_STDIO_STREAM_ARRAY
11681 if (open_max > 0) {
11683 for (i = 0; i < open_max; i++)
11684 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11685 STDIO_STREAM_ARRAY[i]._file < open_max &&
11686 STDIO_STREAM_ARRAY[i]._flag)
11687 fflush(&STDIO_STREAM_ARRAY[i]);
11695 : first we have to find out how _not_ to flush
11696 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11698 set try -DTRY_FPUTC
11699 if eval $compile; then
11701 ./try$exe_ext 2>/dev/null
11702 if $test ! -s try.out -a "X$?" = X42; then
11708 set try -DTRY_FPRINTF
11710 if eval $compile; then
11712 ./try$exe_ext 2>/dev/null
11713 if $test ! -s try.out -a "X$?" = X42; then
11714 output=-DTRY_FPRINTF
11720 : check for fflush NULL behaviour
11721 case "$fflushNULL" in
11722 '') set try -DTRY_FFLUSH_NULL $output
11723 if eval $compile; then
11725 ./try$exe_ext 2>/dev/null
11727 if $test -s try.out -a "X$code" = X42; then
11728 fflushNULL="`$cat try.out`"
11730 if $test "X$code" != X42; then
11732 (If this test failed, don't worry, we'll try another method shortly.)
11737 $rm -f core try.core core.try.*
11738 case "$fflushNULL" in
11740 Your fflush(NULL) works okay.
11742 fflushNULL="$define"
11745 Your fflush(NULL) isn't working (contrary to ANSI C).
11747 fflushNULL="$undef"
11750 Cannot figure out whether your fflush(NULL) works or not.
11751 I'm assuming it doesn't (contrary to ANSI C).
11753 fflushNULL="$undef"
11757 $define|true|[yY]*)
11758 fflushNULL="$define"
11761 fflushNULL="$undef"
11764 : check explicit looping only if NULL did not work
11765 case "$fflushNULL" in
11767 : check for fflush all behaviour
11768 case "$fflushall" in
11769 '') set try -DTRY_FFLUSH_ALL $output
11770 if eval $compile; then
11772 (Now testing the other method--but note that also this may fail.)
11775 ./try$exe_ext 2>/dev/null
11776 if $test -s try.out -a "X$?" = X42; then
11777 fflushall="`$cat try.out`"
11780 $rm -f core try.core core.try.*
11781 case "$fflushall" in
11783 Whew. Flushing explicitly all the stdio streams works.
11785 fflushall="$define"
11788 Sigh. Flushing explicitly all the stdio streams doesn't work.
11793 Cannot figure out whether flushing stdio streams explicitly works or not.
11794 I'm assuming it doesn't.
11800 "$define"|true|[yY]*)
11801 fflushall="$define"
11808 *) fflushall="$undef"
11811 case "$fflushNULL$fflushall" in
11814 I cannot figure out how to flush pending stdio output.
11818 $rm -f try.* try$exe_ext
11820 : Store the full pathname to the ar program for use in the C program
11821 : Respect a hint or command line value for full_ar.
11826 : Store the full pathname to the sed program for use in the C program
11829 : see what type gids are declared as in the kernel
11831 echo "Looking for the type for group ids returned by getgid()."
11832 set gid_t gidtype xxx stdio.h sys/types.h
11836 xxx=`./findhdr sys/user.h`
11837 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11839 unsigned) dflt="$1 $2" ;;
11843 *) dflt="$gidtype";;
11846 gid_t) echo "gid_t found." ;;
11847 *) rp="What is the type for group ids returned by getgid()?"
11855 *_t) zzz="$gidtype" ;;
11858 echo "Checking the size of $zzz..." >&4
11860 #include <sys/types.h>
11863 printf("%d\n", (int)sizeof($gidtype));
11868 if eval $compile_ok; then
11872 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11875 echo "Your $zzz size is $gidsize bytes."
11880 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11886 *_t) zzz="$gidtype" ;;
11889 echo "Checking the sign of $zzz..." >&4
11891 #include <sys/types.h>
11902 if eval $compile; then
11906 echo "(I can't execute the test program--guessing unsigned.)" >&4
11910 1) echo "Your $zzz is unsigned." ;;
11911 -1) echo "Your $zzz is signed." ;;
11917 echo "(I can't compile the test program--guessing unsigned.)" >&4
11921 : check for length of character
11923 case "$charsize" in
11925 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11926 $cat >try.c <<'EOCP'
11930 printf("%d\n", (int)sizeof(char));
11935 if eval $compile_ok; then
11939 echo "(I can't seem to compile the test program. Guessing...)"
11946 rp="What is the size of a character (in bytes)?"
11953 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11955 case "$use64bits:$d_quad:$quadtype" in
11958 uvtype="$uquadtype"
11963 uvtype="unsigned long"
11969 case "$uselongdouble:$d_longdbl" in
11971 nvtype="long double"
11972 nvsize=$longdblsize
11979 echo "(IV will be "$ivtype", $ivsize bytes)"
11980 echo "(UV will be "$uvtype", $uvsize bytes)"
11981 echo "(NV will be "$nvtype", $nvsize bytes)"
11984 #$i_inttypes I_INTTYPES
11986 #include <inttypes.h>
11991 int8_t i = INT8_MAX;
11992 uint8_t u = UINT8_MAX;
11993 printf("int8_t\n");
11996 int16_t i = INT16_MAX;
11997 uint16_t i = UINT16_MAX;
11998 printf("int16_t\n");
12001 int32_t i = INT32_MAX;
12002 uint32_t u = UINT32_MAX;
12003 printf("int32_t\n");
12009 '') case "$charsize" in
12011 u8type="unsigned char"
12020 if eval $compile; then
12021 case "`./try$exe_ext`" in
12022 int8_t) i8type=int8_t
12032 '') if $test $charsize -ge 1; then
12034 u8type="unsigned char"
12042 '') case "$shortsize" in
12044 u16type="unsigned short"
12052 '') set try -DINT16
12053 if eval $compile; then
12054 case "`./try$exe_ext`" in
12066 '') if $test $shortsize -ge 2; then
12068 u16type="unsigned short"
12076 '') case "$longsize" in
12078 u32type="unsigned long"
12082 *) case "$intsize" in
12084 u32type="unsigned int"
12094 '') set try -DINT32
12095 if eval $compile; then
12096 case "`./try$exe_ext`" in
12108 '') if $test $intsize -ge 4; then
12110 u32type="unsigned int"
12118 '') case "$d_quad:$quadtype" in
12120 i64type="$quadtype"
12121 u64type="$uquadtype"
12133 if $test X"$quadtype" != X; then
12135 echo "Checking how to print 64-bit integers..." >&4
12137 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12138 $cat >try.c <<'EOCP'
12139 #include <sys/types.h>
12142 int q = 12345678901;
12143 printf("%ld\n", q);
12147 if eval $compile; then
12148 yyy=`./try$exe_ext`
12151 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12152 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12153 echo "We will use %d."
12159 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12160 $cat >try.c <<'EOCP'
12161 #include <sys/types.h>
12164 long q = 12345678901;
12165 printf("%ld\n", q);
12169 if eval $compile; then
12170 yyy=`./try$exe_ext`
12173 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12174 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12175 echo "We will use %ld."
12181 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12182 $cat >try.c <<'EOCP'
12183 #include <sys/types.h>
12184 #include <inttypes.h>
12187 int64_t q = 12345678901;
12188 printf("%" PRId64 "\n", q);
12192 if eval $compile; then
12193 yyy=`./try$exe_ext`
12196 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12197 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12198 echo "We will use the C9X style."
12204 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12205 $cat >try.c <<'EOCP'
12206 #include <sys/types.h>
12209 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12210 printf("%lld\n", q);
12214 if eval $compile; then
12215 yyy=`./try$exe_ext`
12218 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12219 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12220 echo "We will use the %lld style."
12226 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12228 #include <sys/types.h>
12231 $quadtype q = 12345678901;
12232 printf("%Ld\n", q);
12236 if eval $compile; then
12237 yyy=`./try$exe_ext`
12240 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12241 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12242 echo "We will use %Ld."
12248 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12250 #include <sys/types.h>
12253 $quadtype q = 12345678901;
12254 printf("%qd\n", q);
12258 if eval $compile; then
12259 yyy=`./try$exe_ext`
12262 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12263 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12264 echo "We will use %qd."
12270 if $test X"$sPRId64" = X; then
12271 echo "Cannot figure out how to print 64-bit integers." >&4
12279 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12280 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12282 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12283 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12289 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12291 if $test X"$ivsize" = X8; then
12292 ivdformat="$sPRId64"
12293 uvuformat="$sPRIu64"
12294 uvoformat="$sPRIo64"
12295 uvxformat="$sPRIx64"
12297 if $test X"$ivsize" = X"$longsize"; then
12303 if $test X"$ivsize" = X"$intsize"; then
12310 if $test X"$ivsize" = X"$shortsize"; then
12320 case "$ivdformat" in
12321 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12328 $echo "Checking the format string to be used for gids..." >&4
12331 -1) if $test X"$gidsize" = X"$ivsize"; then
12332 gidformat="$ivdformat"
12334 if $test X"$gidsize" = X"$longsize"; then
12337 if $test X"$gidsize" = X"$intsize"; then
12340 if $test X"$gidsize" = X"$shortsize"; then
12347 *) if $test X"$gidsize" = X"$uvsize"; then
12348 gidformat="$uvuformat"
12350 if $test X"$gidsize" = X"$longsize"; then
12353 if $test X"$gidsize" = X"$intsize"; then
12356 if $test X"$gidsize" = X"$shortsize"; then
12365 : see if getgroups exists
12366 set getgroups d_getgrps
12369 : see if setgroups exists
12370 set setgroups d_setgrps
12374 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12376 case "$d_getgrps$d_setgrps" in
12378 case "$groupstype" in
12379 '') dflt="$gidtype" ;;
12380 *) dflt="$groupstype" ;;
12383 What type of pointer is the second argument to getgroups() and setgroups()?
12384 Usually this is the same as group ids, $gidtype, but not always.
12387 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12391 *) groupstype="$gidtype";;
12395 echo "Checking if your $make program sets \$(MAKE)..." >&4
12396 case "$make_set_make" in
12398 $sed 's/^X //' > testmake.mak << 'EOF'
12400 X @echo 'maketemp="$(MAKE)"'
12402 case "`$make -f testmake.mak 2>/dev/null`" in
12403 *maketemp=*) make_set_make='#' ;;
12404 *) make_set_make="MAKE=$make" ;;
12406 $rm -f testmake.mak
12409 case "$make_set_make" in
12410 '#') echo "Yup, it does.";;
12411 *) echo "Nope, it doesn't.";;
12414 : see what type is used for mode_t
12415 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12416 set mode_t modetype int stdio.h sys/types.h
12419 : define a fucntion to check prototypes
12420 $cat > protochk <<EOSH
12423 optimize="$optimize"
12425 prototype="$prototype"
12430 $cat >> protochk <<'EOSH'
12435 while test $# -ge 2; do
12437 $define) echo "#include <$2>" >> try.c ;;
12438 literal) echo "$2" >> try.c ;;
12442 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12443 cat >> try.c <<'EOCP'
12444 #ifdef CAN_PROTOTYPE
12445 #define _(args) args
12450 echo "$foo" >> try.c
12451 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12452 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12458 $eunicefix protochk
12460 : see what type is used for size_t
12461 rp="What is the type used for the length parameter for string functions?"
12462 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12465 : check for type of arguments to gethostbyaddr.
12466 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12467 case "$d_gethbyaddr" in
12471 Checking to see what type of arguments are accepted by gethostbyaddr().
12473 hdrs="$define sys/types.h
12474 $d_socket sys/socket.h
12475 $i_niin netinet/in.h
12477 $i_unistd unistd.h"
12478 : The first arg can 'char *' or 'void *'
12479 : The second arg is some of integral type
12480 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12481 for yyy in size_t long int; do
12482 case "$netdb_host_type" in
12483 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12484 if ./protochk "$try" $hdrs; then
12485 echo "Your system accepts $xxx for the first arg."
12486 echo "...and $yyy for the second arg."
12487 netdb_host_type="$xxx"
12488 netdb_hlen_type="$yyy"
12494 : In case none of those worked, prompt the user.
12495 case "$netdb_host_type" in
12496 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12499 netdb_host_type=$ans
12500 rp='What is the type for the 2nd argument to gethostbyaddr?'
12503 netdb_hlen_type=$ans
12507 *) : no gethostbyaddr, so pick harmless defaults
12508 netdb_host_type='char *'
12509 netdb_hlen_type="$sizetype"
12512 # Remove the "const" if needed. -- but then we'll have a
12514 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12517 : check for type of argument to gethostbyname.
12518 if test "X$netdb_name_type" = X ; then
12519 case "$d_gethbyname" in
12523 Checking to see what type of argument is accepted by gethostbyname().
12525 hdrs="$define sys/types.h
12526 $d_socket sys/socket.h
12527 $i_niin netinet/in.h
12529 $i_unistd unistd.h"
12530 for xxx in "const char *" "char *"; do
12531 case "$netdb_name_type" in
12532 '') try="extern struct hostent *gethostbyname($xxx);"
12533 if ./protochk "$try" $hdrs; then
12534 echo "Your system accepts $xxx."
12535 netdb_name_type="$xxx"
12540 : In case none of those worked, prompt the user.
12541 case "$netdb_name_type" in
12542 '') rp='What is the type for the 1st argument to gethostbyname?'
12545 netdb_name_type=$ans
12549 *) : no gethostbyname, so pick harmless default
12550 netdb_name_type='char *'
12555 : check for type of 1st argument to getnetbyaddr.
12556 if test "X$netdb_net_type" = X ; then
12557 case "$d_getnbyaddr" in
12561 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12563 hdrs="$define sys/types.h
12564 $d_socket sys/socket.h
12565 $i_niin netinet/in.h
12567 $i_unistd unistd.h"
12568 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12569 case "$netdb_net_type" in
12570 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12571 if ./protochk "$try" $hdrs; then
12572 echo "Your system accepts $xxx."
12573 netdb_net_type="$xxx"
12578 : In case none of those worked, prompt the user.
12579 case "$netdb_net_type" in
12580 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12583 netdb_net_type=$ans
12587 *) : no getnetbyaddr, so pick harmless default
12588 netdb_net_type='long'
12592 : locate the preferred pager for this system
12606 '') dflt=/usr/ucb/more;;
12613 rp='What pager is used on your system?'
12617 : see what type pids are declared as in the kernel
12618 rp="What is the type of process ids on this system?"
12619 set pid_t pidtype int stdio.h sys/types.h
12622 : Find earliest binary compatible site_perl subdirectory perl can use.
12623 case "$bincompat5005" in
12624 "$define") xs_apiversion='5.005' ;;
12625 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12627 : Find earliest pure perl site_perl subdirectory perl can use.
12628 : The versioned directories started at 5.005.
12629 pm_apiversion='5.005'
12631 : check for length of pointer
12635 $echo $n "Checking to see how big your pointers are...$c" >&4
12636 if test "$voidflags" -gt 7; then
12637 echo '#define VOID_PTR char *' > try.c
12639 echo '#define VOID_PTR void *' > try.c
12641 $cat >>try.c <<'EOCP'
12645 printf("%d\n", (int)sizeof(VOID_PTR));
12650 if eval $compile_ok; then
12652 $echo " $ptrsize bytes." >&4
12655 echo "(I can't seem to compile the test program. Guessing...)" >&4
12656 rp="What is the size of a pointer (in bytes)?"
12664 : see if ar generates random libraries by itself
12666 echo "Checking how to generate random libraries on your machine..." >&4
12667 echo 'int bar1() { return bar2(); }' > bar1.c
12668 echo 'int bar2() { return 2; }' > bar2.c
12669 $cat > foo.c <<'EOP'
12670 int main() { printf("%d\n", bar1()); exit(0); }
12672 $cc $ccflags -c bar1.c >/dev/null 2>&1
12673 $cc $ccflags -c bar2.c >/dev/null 2>&1
12674 $cc $ccflags -c foo.c >/dev/null 2>&1
12675 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12676 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12677 ./foobar >/dev/null 2>&1; then
12678 echo "$ar appears to generate random libraries itself."
12681 elif $ar ts bar$_a >/dev/null 2>&1 &&
12682 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12683 ./foobar >/dev/null 2>&1; then
12684 echo "a table of contents needs to be added with '$ar ts'."
12691 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12692 $test -f $ranlib || ranlib=''
12695 if $test -n "$ranlib"; then
12696 echo "your system has '$ranlib'; we'll use that."
12699 echo "your system doesn't seem to support random libraries"
12700 echo "so we'll use lorder and tsort to order the libraries."
12707 : check for type of arguments to select.
12708 case "$selecttype" in
12709 '') case "$d_select" in
12712 Checking to see what type of arguments are accepted by select().
12714 hdrs="$define sys/types.h
12715 $i_systime sys/time.h
12716 $i_sysselct sys/select.h
12717 $d_socket sys/socket.h"
12718 : The first arg can be int, unsigned, or size_t
12719 : The last arg may or may not be 'const'
12721 : void pointer has been seen but using that
12722 : breaks the selectminbits test
12723 for xxx in 'fd_set *' 'int *'; do
12724 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12725 for tmo in 'struct timeval *' 'const struct timeval *'; do
12727 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12728 if ./protochk "$try" $hdrs; then
12729 echo "Your system accepts $xxx."
12738 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12739 case "$d_fd_set" in
12740 $define) dflt="fd_set *" ;;
12749 *) : no select, so pick a harmless default
12756 : check for the select 'width'
12757 case "$selectminbits" in
12758 '') case "$d_select" in
12762 Checking to see on how many bits at a time your select() operates...
12765 #include <sys/types.h>
12767 #$i_systime I_SYS_TIME
12768 #$i_systimek I_SYS_TIME_KERNEL
12773 # ifdef I_SYS_TIME_KERNEL
12776 # include <sys/time.h>
12777 # ifdef I_SYS_TIME_KERNEL
12781 #$i_sysselct I_SYS_SELECT
12782 #ifdef I_SYS_SELECT
12783 #include <sys/select.h>
12785 #$d_socket HAS_SOCKET
12787 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12791 #define S sizeof(*(b))
12793 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12794 #define NBITS (NBYTES * 8)
12803 fp = fopen("try.c", "r");
12809 b = ($selecttype)s;
12810 for (i = 0; i < NBITS; i++)
12814 select(fd + 1, b, 0, 0, &t);
12815 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12816 printf("%d\n", i + 1);
12821 if eval $compile_ok; then
12822 selectminbits=`./try`
12823 case "$selectminbits" in
12825 Cannot figure out on how many bits at a time your select() operates.
12826 I'll play safe and guess it is 32 bits.
12832 *) bits="$selectminbits bits" ;;
12834 echo "Your select() operates on $bits at a time." >&4
12836 rp='What is the minimum number of bits your select() operates on?'
12837 case "$byteorder" in
12838 1234|12345678) dflt=32 ;;
12843 selectminbits="$val"
12847 *) : no select, so pick a harmless default
12854 : Trace out the files included by signal.h, then look for SIGxxx names.
12855 : Remove SIGARRAYSIZE used by HPUX.
12856 : Remove SIGSTKSIZE used by Linux.
12857 : Remove SIGSTKSZ used by Posix.
12858 : Remove SIGTYP void lines used by OS2.
12859 xxx=`echo '#include <signal.h>' |
12860 $cppstdin $cppminus $cppflags 2>/dev/null |
12861 $grep '^[ ]*#.*include' |
12862 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12863 : Check this list of files to be sure we have parsed the cpp output ok.
12864 : This will also avoid potentially non-existent files, such
12867 for xx in $xxx /dev/null ; do
12868 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12870 : If we have found no files, at least try signal.h
12871 case "$xxxfiles" in
12872 '') xxxfiles=`./findhdr signal.h` ;;
12875 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12876 print substr($2, 4, 20)
12878 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12879 print substr($3, 4, 20)
12881 : Append some common names just in case the awk scan failed.
12882 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12883 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12884 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12885 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12886 : generate a few handy files for later
12887 $cat > signal.c <<'EOCP'
12888 #include <sys/types.h>
12889 #include <signal.h>
12893 /* Strange style to avoid deeply-nested #if/#else/#endif */
12896 # define NSIG (_NSIG)
12902 # define NSIG (SIGMAX+1)
12908 # define NSIG (SIG_MAX+1)
12914 # define NSIG (MAXSIG+1)
12920 # define NSIG (MAX_SIG+1)
12925 # ifdef SIGARRAYSIZE
12926 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12932 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12936 /* Default to some arbitrary number that's big enough to get most
12937 of the common signals.
12943 printf("NSIG %d\n", NSIG);
12949 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12951 printf "#ifdef SIG"; printf $1; printf "\n"
12952 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12953 printf $1; printf ");\n"
12957 printf "#endif /* JUST_NSIG */\n";
12958 printf "exit(0);\n}\n";
12961 $cat >signal.awk <<'EOP'
12962 BEGIN { ndups = 0 }
12963 $1 ~ /^NSIG$/ { nsig = $2 }
12964 ($1 !~ /^NSIG$/) && (NF == 2) {
12965 if ($2 > maxsig) { maxsig = $2 }
12966 if (sig_name[$2]) {
12967 dup_name[ndups] = $1
12968 dup_num[ndups] = $2
12980 printf("NSIG %d\n", nsig);
12981 for (n = 1; n < nsig; n++) {
12983 printf("%s %d\n", sig_name[n], sig_num[n])
12986 printf("NUM%d %d\n", n, n)
12989 for (n = 0; n < ndups; n++) {
12990 printf("%s %d\n", dup_name[n], dup_num[n])
12994 $cat >signal_cmd <<EOS
12996 if $test -s signal.lst; then
12997 echo "Using your existing signal.lst file"
13002 $cat >>signal_cmd <<'EOS'
13005 if eval $compile_ok; then
13006 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13008 echo "(I can't seem be able to compile the whole test program)" >&4
13009 echo "(I'll try it in little pieces.)" >&4
13010 set signal -DJUST_NSIG
13011 if eval $compile_ok; then
13012 ./signal$_exe > signal.nsg
13015 echo "I can't seem to figure out how many signals you have." >&4
13016 echo "Guessing 50." >&4
13017 echo 'NSIG 50' > signal.nsg
13019 : Now look at all the signal names, one at a time.
13020 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13021 $cat > signal.c <<EOCP
13022 #include <sys/types.h>
13023 #include <signal.h>
13026 printf("$xx %d\n", SIG${xx});
13031 if eval $compile; then
13032 echo "SIG${xx} found."
13033 ./signal$_exe >> signal.ls1
13035 echo "SIG${xx} NOT found."
13038 if $test -s signal.ls1; then
13039 $cat signal.nsg signal.ls1 |
13040 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13044 if $test -s signal.lst; then
13047 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13048 echo 'kill -l' >signal
13049 set X `csh -f <signal`
13053 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13055 echo $@ | $tr ' ' $trnl | \
13056 $awk '{ printf "%s %d\n", $1, ++s; }
13057 END { printf "NSIG %d\n", ++s }' >signal.lst
13059 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13061 chmod a+x signal_cmd
13062 $eunicefix signal_cmd
13064 : generate list of signal names
13066 case "$sig_name_init" in
13068 *) case "$sig_num_init" in
13069 ''|*,*) doinit=yes ;;
13074 echo "Generating a list of signal names and numbers..." >&4
13076 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13077 sig_name=`$awk 'BEGIN { printf "ZERO " }
13078 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13079 sig_num=`$awk 'BEGIN { printf "0 " }
13080 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13081 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13082 !/^NSIG/ { printf "\"%s\", ", $1 }
13083 END { printf "0\n" }' signal.lst`
13084 sig_num_init=`$awk 'BEGIN { printf "0, " }
13085 !/^NSIG/ { printf "%d, ", $2}
13086 END { printf "0\n"}' signal.lst`
13089 echo "The following $sig_count signals are available:"
13091 echo $sig_name | $awk \
13092 'BEGIN { linelen = 0 }
13094 for (i = 1; i <= NF; i++) {
13095 name = "SIG" $i " "
13096 linelen = linelen + length(name)
13097 if (linelen > 70) {
13099 linelen = length(name)
13105 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13107 : see what type is used for signed size_t
13108 set ssize_t ssizetype int stdio.h sys/types.h
13111 $cat > ssize.c <<EOM
13113 #include <sys/types.h>
13114 #define Size_t $sizetype
13115 #define SSize_t $dflt
13118 if (sizeof(Size_t) == sizeof(SSize_t))
13120 else if (sizeof(Size_t) == sizeof(int))
13129 if eval $compile_ok && ./ssize > /dev/null; then
13130 ssizetype=`./ssize`
13131 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13134 Help! I can't compile and run the ssize_t test program: please enlighten me!
13135 (This is probably a misconfiguration in your system or libraries, and
13136 you really ought to fix it. Still, I'll try anyway.)
13138 I need a type that is the same size as $sizetype, but is guaranteed to
13139 be signed. Common values are ssize_t, int and long.
13142 rp="What signed type is the same size as $sizetype?"
13146 $rm -f ssize ssize.*
13148 : see what type of char stdio uses.
13150 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13151 echo "Your stdio uses unsigned chars." >&4
13152 stdchar="unsigned char"
13154 echo "Your stdio uses signed chars." >&4
13158 : see if time exists
13160 if test "X$d_time" = X -o X"$timetype" = X; then
13161 if set time val -f d_time; eval $csym; $val; then
13162 echo 'time() found.' >&4
13164 rp="What is the type returned by time() on this system?"
13165 set time_t timetype long stdio.h sys/types.h
13168 echo 'time() not found, hope that will do.' >&4
13176 : see what type uids are declared as in the kernel
13178 echo "Looking for the type for user ids returned by getuid()."
13179 set uid_t uidtype xxx stdio.h sys/types.h
13183 xxx=`./findhdr sys/user.h`
13184 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13186 unsigned) dflt="$1 $2" ;;
13190 *) dflt="$uidtype";;
13193 uid_t) echo "uid_t found." ;;
13194 *) rp="What is the type for user ids returned by getuid()?"
13202 *_t) zzz="$uidtype" ;;
13205 echo "Checking the size of $zzz..." >&4
13207 #include <sys/types.h>
13210 printf("%d\n", (int)sizeof($uidtype));
13215 if eval $compile_ok; then
13219 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13222 echo "Your $zzz size is $uidsize bytes."
13227 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13232 *_t) zzz="$uidtype" ;;
13235 echo "Checking the sign of $zzz..." >&4
13237 #include <sys/types.h>
13248 if eval $compile; then
13252 echo "(I can't execute the test program--guessing unsigned.)" >&4
13256 1) echo "Your $zzz is unsigned." ;;
13257 -1) echo "Your $zzz is signed." ;;
13263 echo "(I can't compile the test program--guessing unsigned.)" >&4
13269 $echo "Checking the format string to be used for uids..." >&4
13272 -1) if $test X"$uidsize" = X"$ivsize"; then
13273 uidformat="$ivdformat"
13275 if $test X"$uidsize" = X"$longsize"; then
13278 if $test X"$uidsize" = X"$intsize"; then
13281 if $test X"$uidsize" = X"$shortsize"; then
13288 *) if $test X"$uidsize" = X"$uvsize"; then
13289 uidformat="$uvuformat"
13291 if $test X"$uidsize" = X"$longsize"; then
13294 if $test X"$uidsize" = X"$intsize"; then
13297 if $test X"$uidsize" = X"$shortsize"; then
13306 : see if dbm.h is available
13307 : see if dbmclose exists
13308 set dbmclose d_dbmclose
13311 case "$d_dbmclose" in
13321 *) set rpcsvc/dbm.h i_rpcsvcdbm
13326 *) echo "We won't be including <dbm.h>"
13336 : see if this is a sys/file.h system
13341 : do we need to include sys/file.h ?
13345 if $h_sysfile; then
13347 echo "We'll be including <sys/file.h>." >&4
13350 echo "We won't be including <sys/file.h>." >&4
13360 : see if fcntl.h is there
13365 : see if we can include fcntl.h
13371 echo "We'll be including <fcntl.h>." >&4
13374 if $h_sysfile; then
13375 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13377 echo "We won't be including <fcntl.h>." >&4
13389 : see if locale.h is available
13390 set locale.h i_locale
13393 : see if mach cthreads are available
13394 if test "X$usethreads" = "X$define"; then
13395 set mach/cthreads.h i_machcthr
13398 i_machcthr="$undef"
13403 : see if this is a math.h system
13407 : see if this is a mntent.h system
13408 set mntent.h i_mntent
13411 : see if ndbm.h is available
13416 : see if dbm_open exists
13417 set dbm_open d_dbm_open
13419 case "$d_dbm_open" in
13422 echo "We won't be including <ndbm.h>"
13431 : see if net/errno.h is available
13433 set net/errno.h val
13436 : Unfortunately, it causes problems on some systems. Arrgh.
13439 cat > try.c <<'EOM'
13442 #include <net/errno.h>
13448 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13449 echo "We'll be including <net/errno.h>." >&4
13451 echo "We won't be including <net/errno.h>." >&4
13460 : see if netinet/tcp.h is available
13461 set netinet/tcp.h i_netinettcp
13464 : see if this is a poll.h system
13468 : get C preprocessor symbols handy
13470 $echo $n "Hmm... $c"
13471 echo $al | $tr ' ' $trnl >Cppsym.know
13472 $cat <<EOSS >Cppsym
13480 case "\$list\$#" in
13483 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13485 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13488 unknown="\$unknown \$sym"
13498 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13500 exit 0; _ _ _ _\1\\ \1\\
13503 echo "exit 1; _ _ _" >>Cppsym\$\$
13504 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13506 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13512 $rm -f Cppsym\$\$ Cppsym2\$\$
13517 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13519 : now check the C compiler for additional symbols
13520 postprocess_cc_v=''
13522 aix) postprocess_cc_v="|$tr , ' '" ;;
13529 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13532 -D*) echo "\$i" | $sed 's/^-D//';;
13533 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13538 postprocess_cc_v=''
13541 ./ccsym > ccsym1.raw
13542 if $test -s ccsym1.raw; then
13543 $sort ccsym1.raw | $uniq >ccsym.raw
13545 mv ccsym1.raw ccsym.raw
13548 $awk '/\=/ { print $0; next }
13549 { print $0"=1" }' ccsym.raw >ccsym.list
13550 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13551 $comm -13 ccsym.true ccsym.list >ccsym.own
13552 $comm -12 ccsym.true ccsym.list >ccsym.com
13553 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13555 if $test -z ccsym.raw; then
13556 echo "Your C compiler doesn't seem to define any symbols!" >&4
13558 echo "However, your C preprocessor defines the following symbols:"
13561 cppsymbols=`$cat Cppsym.true`
13562 cppsymbols=`echo $cppsymbols`
13563 cppccsymbols="$cppsymbols"
13565 if $test -s ccsym.com; then
13566 echo "Your C compiler and pre-processor define these symbols:"
13567 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13570 cppccsymbols=`$cat ccsym.com`
13571 cppccsymbols=`echo $cppccsymbols`
13572 $test "$silent" || sleep 1
13574 if $test -s ccsym.cpp; then
13575 $test "$also" && echo " "
13576 echo "Your C pre-processor ${also}defines the following symbols:"
13577 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13579 cppsymbols=`$cat ccsym.cpp`
13580 cppsymbols=`echo $cppsymbols`
13581 $test "$silent" || sleep 1
13583 if $test -s ccsym.own; then
13584 $test "$also" && echo " "
13585 echo "Your C compiler ${also}defines the following cpp symbols:"
13586 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13587 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13588 ccsymbols=`$cat ccsym.own`
13589 ccsymbols=`echo $ccsymbols`
13590 $test "$silent" || sleep 1
13595 : see if this is a termio system
13599 if $test `./findhdr termios.h`; then
13600 set tcsetattr i_termios
13606 "$define") echo "You have POSIX termios.h... good!" >&4;;
13607 *) if ./Cppsym pyr; then
13608 case "`/bin/universe`" in
13609 ucb) if $test `./findhdr sgtty.h`; then
13611 echo "<sgtty.h> found." >&4
13613 echo "System is pyramid with BSD universe."
13614 echo "<sgtty.h> not found--you could have problems." >&4
13616 *) if $test `./findhdr termio.h`; then
13618 echo "<termio.h> found." >&4
13620 echo "System is pyramid with USG universe."
13621 echo "<termio.h> not found--you could have problems." >&4
13625 if $test `./findhdr termio.h`; then
13626 echo "<termio.h> found." >&4
13628 elif $test `./findhdr sgtty.h`; then
13629 echo "<sgtty.h> found." >&4
13632 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13635 if $test `./findhdr sgtty.h`; then
13636 echo "<sgtty.h> found." >&4
13638 elif $test `./findhdr termio.h`; then
13639 echo "<termio.h> found." >&4
13642 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13646 set i_termio; eval $setvar
13647 val=$val2; set i_sgtty; eval $setvar
13648 val=$val3; set i_termios; eval $setvar
13650 : see if this is a shadow.h system
13651 set shadow.h i_shadow
13654 : see if this is a socks.h system
13655 set socks.h i_socks
13658 : see if stdarg is available
13660 if $test `./findhdr stdarg.h`; then
13661 echo "<stdarg.h> found." >&4
13664 echo "<stdarg.h> NOT found." >&4
13668 : see if varags is available
13670 if $test `./findhdr varargs.h`; then
13671 echo "<varargs.h> found." >&4
13673 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13676 : set up the varargs testing programs
13677 $cat > varargs.c <<EOP
13679 #include <stdarg.h>
13682 #include <varargs.h>
13686 int f(char *p, ...)
13700 p = va_arg(ap, char *);
13705 $cat > varargs <<EOP
13707 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13716 : now check which varargs header should be included
13721 if `./varargs I_STDARG`; then
13723 elif `./varargs I_VARARGS`; then
13728 if `./varargs I_VARARGS`; then
13735 echo "I could not find the definition for va_dcl... You have problems..." >&4
13736 val="$undef"; set i_stdarg; eval $setvar
13737 val="$undef"; set i_varargs; eval $setvar
13742 case "$i_varhdr" in
13744 val="$define"; set i_stdarg; eval $setvar
13745 val="$undef"; set i_varargs; eval $setvar
13748 val="$undef"; set i_stdarg; eval $setvar
13749 val="$define"; set i_varargs; eval $setvar
13752 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13756 : see if stddef is available
13757 set stddef.h i_stddef
13760 : see if sys/access.h is available
13761 set sys/access.h i_sysaccess
13764 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13765 set sys/filio.h i_sysfilio
13768 if $test `./findhdr sys/ioctl.h`; then
13770 echo '<sys/ioctl.h> found.' >&4
13773 if $test $i_sysfilio = "$define"; then
13774 echo '<sys/ioctl.h> NOT found.' >&4
13776 $test $i_sgtty = "$define" && xxx="sgtty.h"
13777 $test $i_termio = "$define" && xxx="termio.h"
13778 $test $i_termios = "$define" && xxx="termios.h"
13779 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13785 : see if sys/resource.h has to be included
13786 set sys/resource.h i_sysresrc
13789 : see if sys/security.h is available
13790 set sys/security.h i_syssecrt
13793 : see if this is a sys/statvfs.h system
13794 set sys/statvfs.h i_sysstatvfs
13797 : see if this is a sys/uio.h system
13798 set sys/uio.h i_sysuio
13801 : see if this is a sys/un.h system
13802 set sys/un.h i_sysun
13805 : see if this is a syswait system
13806 set sys/wait.h i_syswait
13809 : see if this is a ustat.h system
13810 set ustat.h i_ustat
13813 : see if this is an utime system
13814 set utime.h i_utime
13817 : see if this is a values.h system
13818 set values.h i_values
13821 : see if this is a vfork system
13824 set vfork.h i_vfork
13832 : see if gdbm.h is available
13837 : see if gdbm_open exists
13838 set gdbm_open d_gdbm_open
13840 case "$d_gdbm_open" in
13843 echo "We won't be including <gdbm.h>"
13853 echo "Looking for extensions..." >&4
13854 : If we are using the old config.sh, known_extensions may contain
13855 : old or inaccurate or duplicate values.
13856 known_extensions=''
13857 nonxs_extensions=''
13858 : We do not use find because it might not be available.
13859 : We do not just use MANIFEST because the user may have dropped
13860 : some additional extensions into the source tree and expect them
13863 : Function to recursively find available extensions, ignoring DynaLoader
13864 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13868 DynaLoader|dynaload) ;;
13870 if $test -f $xxx/$xxx.xs; then
13871 known_extensions="$known_extensions $1$xxx";
13872 elif $test -f $xxx/Makefile.PL; then
13873 nonxs_extensions="$nonxs_extensions $1$xxx";
13875 if $test -d $xxx -a $# -lt 10; then
13878 eval $find_extensions;
13890 eval $find_extensions
13891 set X $nonxs_extensions
13893 nonxs_extensions="$*"
13894 set X $known_extensions
13896 known_extensions="$*"
13899 : Now see which are supported on this system.
13901 for xxx in $known_extensions ; do
13905 $define) avail_ext="$avail_ext $xxx" ;;
13908 GDBM_File|gdbm_fil)
13910 $define) avail_ext="$avail_ext $xxx" ;;
13913 NDBM_File|ndbm_fil)
13915 $define) avail_ext="$avail_ext $xxx" ;;
13918 ODBM_File|odbm_fil)
13919 case "${i_dbm}${i_rpcsvcdbm}" in
13920 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13924 case "$useposix" in
13925 true|define|y) avail_ext="$avail_ext $xxx" ;;
13929 case "$useopcode" in
13930 true|define|y) avail_ext="$avail_ext $xxx" ;;
13934 case "$d_socket" in
13935 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13939 case "$usethreads" in
13940 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13944 : XXX Do we need a useipcsysv variable here
13945 case "${d_msg}${d_sem}${d_shm}" in
13946 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13949 *) avail_ext="$avail_ext $xxx"
13958 : Now see which nonxs extensions are supported on this system.
13959 : For now assume all are.
13961 for xxx in $nonxs_extensions ; do
13963 *) nonxs_ext="$nonxs_ext $xxx"
13975 A number of extensions are supplied with $package. You may choose to
13976 compile these extensions for dynamic loading (the default), compile
13977 them into the $package executable (static loading), or not include
13978 them at all. Answer "none" to include no extensions.
13979 Note that DynaLoader is always built and need not be mentioned here.
13982 case "$dynamic_ext" in
13983 '') dflt="$avail_ext" ;;
13984 *) dflt="$dynamic_ext"
13985 # Perhaps we are reusing an old out-of-date config.sh.
13988 if test X"$dynamic_ext" != X"$avail_ext"; then
13990 NOTICE: Your previous config.sh list may be incorrect.
13991 The extensions now available to you are
13993 but the default list from your previous config.sh is
14005 rp="What extensions do you wish to load dynamically?"
14008 none) dynamic_ext=' ' ;;
14009 *) dynamic_ext="$ans" ;;
14012 case "$static_ext" in
14014 : Exclude those already listed in dynamic linking
14016 for xxx in $avail_ext; do
14017 case " $dynamic_ext " in
14019 *) dflt="$dflt $xxx" ;;
14026 *) dflt="$static_ext"
14033 rp="What extensions do you wish to load statically?"
14036 none) static_ext=' ' ;;
14037 *) static_ext="$ans" ;;
14042 A number of extensions are supplied with $package. Answer "none"
14043 to include no extensions.
14044 Note that DynaLoader is always built and need not be mentioned here.
14047 case "$static_ext" in
14048 '') dflt="$avail_ext" ;;
14049 *) dflt="$static_ext"
14050 # Perhaps we are reusing an old out-of-date config.sh.
14053 if test X"$static_ext" != X"$avail_ext"; then
14055 NOTICE: Your previous config.sh list may be incorrect.
14056 The extensions now available to you are
14058 but the default list from your previous config.sh is
14067 : Exclude those that are not xs extensions
14071 rp="What extensions do you wish to include?"
14074 none) static_ext=' ' ;;
14075 *) static_ext="$ans" ;;
14080 set X $dynamic_ext $static_ext $nonxs_ext
14084 : Remove build directory name from cppstdin so it can be used from
14085 : either the present location or the final installed location.
14087 : Get out of the UU directory to get correct path name.
14089 case "$cppstdin" in
14091 echo "Stripping down cppstdin path name"
14097 : end of configuration questions
14099 echo "End of configuration questions."
14102 : back to where it started
14103 if test -d ../UU; then
14107 : configuration may be patched via a 'config.over' file
14108 if $test -f config.over; then
14111 rp='I see a config.over file. Do you wish to load it?'
14114 n*) echo "OK, I'll ignore it.";;
14116 echo "Configuration override changes have been loaded."
14121 : in case they want portability, strip down executable paths
14122 case "$d_portable" in
14125 echo "Stripping down executable paths..." >&4
14126 for file in $loclist $trylist; do
14128 eval $file=`basename $temp`
14133 : create config.sh file
14135 echo "Creating config.sh..." >&4
14136 $spitshell <<EOT >config.sh
14139 # This file was produced by running the Configure script. It holds all the
14140 # definitions figured out by Configure. Should you modify one of these values,
14141 # do not forget to propagate your changes by running "Configure -der". You may
14142 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14145 # Package name : $package
14146 # Source directory : $src
14147 # Configuration time: $cf_time
14148 # Configured by : $cf_by
14149 # Target system : $myuname
14159 Revision='$Revision'
14166 alignbytes='$alignbytes'
14167 ansi2knr='$ansi2knr'
14168 aphostname='$aphostname'
14169 apiversion='$apiversion'
14172 archlibexp='$archlibexp'
14173 archname64='$archname64'
14174 archname='$archname'
14175 archobjs='$archobjs'
14180 bincompat5005='$bincompat5005'
14184 byteorder='$byteorder'
14186 castflags='$castflags'
14189 cccdlflags='$cccdlflags'
14190 ccdlflags='$ccdlflags'
14192 ccsymbols='$ccsymbols'
14194 cf_email='$cf_email'
14196 charsize='$charsize'
14200 clocktype='$clocktype'
14202 compress='$compress'
14203 contains='$contains'
14207 cpp_stuff='$cpp_stuff'
14208 cppccsymbols='$cppccsymbols'
14209 cppflags='$cppflags'
14211 cppminus='$cppminus'
14213 cppstdin='$cppstdin'
14214 cppsymbols='$cppsymbols'
14215 crosscompile='$crosscompile'
14216 cryptlib='$cryptlib'
14218 d_Gconvert='$d_Gconvert'
14219 d_PRIEldbl='$d_PRIEldbl'
14220 d_PRIFldbl='$d_PRIFldbl'
14221 d_PRIGldbl='$d_PRIGldbl'
14222 d_PRIX64='$d_PRIX64'
14223 d_PRId64='$d_PRId64'
14224 d_PRIeldbl='$d_PRIeldbl'
14225 d_PRIfldbl='$d_PRIfldbl'
14226 d_PRIgldbl='$d_PRIgldbl'
14227 d_PRIi64='$d_PRIi64'
14228 d_PRIo64='$d_PRIo64'
14229 d_PRIu64='$d_PRIu64'
14230 d_PRIx64='$d_PRIx64'
14231 d_access='$d_access'
14232 d_accessx='$d_accessx'
14234 d_archlib='$d_archlib'
14237 d_attribut='$d_attribut'
14240 d_bincompat5005='$d_bincompat5005'
14242 d_bsdgetpgrp='$d_bsdgetpgrp'
14243 d_bsdsetpgrp='$d_bsdsetpgrp'
14245 d_casti32='$d_casti32'
14246 d_castneg='$d_castneg'
14247 d_charvspr='$d_charvspr'
14249 d_chroot='$d_chroot'
14250 d_chsize='$d_chsize'
14251 d_closedir='$d_closedir'
14255 d_cuserid='$d_cuserid'
14256 d_dbl_dig='$d_dbl_dig'
14257 d_difftime='$d_difftime'
14258 d_dirnamlen='$d_dirnamlen'
14259 d_dlerror='$d_dlerror'
14260 d_dlopen='$d_dlopen'
14261 d_dlsymun='$d_dlsymun'
14262 d_dosuid='$d_dosuid'
14263 d_drand48proto='$d_drand48proto'
14265 d_eaccess='$d_eaccess'
14266 d_endgrent='$d_endgrent'
14267 d_endhent='$d_endhent'
14268 d_endnent='$d_endnent'
14269 d_endpent='$d_endpent'
14270 d_endpwent='$d_endpwent'
14271 d_endsent='$d_endsent'
14272 d_endspent='$d_endspent'
14273 d_eofnblk='$d_eofnblk'
14274 d_eunice='$d_eunice'
14275 d_fchmod='$d_fchmod'
14276 d_fchown='$d_fchown'
14278 d_fd_macros='$d_fd_macros'
14279 d_fd_set='$d_fd_set'
14280 d_fds_bits='$d_fds_bits'
14281 d_fgetpos='$d_fgetpos'
14282 d_flexfnam='$d_flexfnam'
14285 d_fpathconf='$d_fpathconf'
14286 d_fpos64_t='$d_fpos64_t'
14287 d_fs_data_s='$d_fs_data_s'
14288 d_fseeko='$d_fseeko'
14289 d_fsetpos='$d_fsetpos'
14290 d_fstatfs='$d_fstatfs'
14291 d_fstatvfs='$d_fstatvfs'
14292 d_ftello='$d_ftello'
14294 d_getgrent='$d_getgrent'
14295 d_getgrps='$d_getgrps'
14296 d_gethbyaddr='$d_gethbyaddr'
14297 d_gethbyname='$d_gethbyname'
14298 d_gethent='$d_gethent'
14299 d_gethname='$d_gethname'
14300 d_gethostprotos='$d_gethostprotos'
14301 d_getlogin='$d_getlogin'
14302 d_getmnt='$d_getmnt'
14303 d_getmntent='$d_getmntent'
14304 d_getnbyaddr='$d_getnbyaddr'
14305 d_getnbyname='$d_getnbyname'
14306 d_getnent='$d_getnent'
14307 d_getnetprotos='$d_getnetprotos'
14308 d_getpbyname='$d_getpbyname'
14309 d_getpbynumber='$d_getpbynumber'
14310 d_getpent='$d_getpent'
14311 d_getpgid='$d_getpgid'
14312 d_getpgrp2='$d_getpgrp2'
14313 d_getpgrp='$d_getpgrp'
14314 d_getppid='$d_getppid'
14315 d_getprior='$d_getprior'
14316 d_getprotoprotos='$d_getprotoprotos'
14317 d_getpwent='$d_getpwent'
14318 d_getsbyname='$d_getsbyname'
14319 d_getsbyport='$d_getsbyport'
14320 d_getsent='$d_getsent'
14321 d_getservprotos='$d_getservprotos'
14322 d_getspent='$d_getspent'
14323 d_getspnam='$d_getspnam'
14324 d_gettimeod='$d_gettimeod'
14325 d_gnulibc='$d_gnulibc'
14326 d_grpasswd='$d_grpasswd'
14327 d_hasmntopt='$d_hasmntopt'
14330 d_inetaton='$d_inetaton'
14331 d_int64t='$d_int64t'
14332 d_isascii='$d_isascii'
14333 d_killpg='$d_killpg'
14334 d_lchown='$d_lchown'
14335 d_ldbl_dig='$d_ldbl_dig'
14337 d_locconv='$d_locconv'
14339 d_longdbl='$d_longdbl'
14340 d_longlong='$d_longlong'
14343 d_mbstowcs='$d_mbstowcs'
14344 d_mbtowc='$d_mbtowc'
14345 d_memchr='$d_memchr'
14346 d_memcmp='$d_memcmp'
14347 d_memcpy='$d_memcpy'
14348 d_memmove='$d_memmove'
14349 d_memset='$d_memset'
14351 d_mkfifo='$d_mkfifo'
14352 d_mktime='$d_mktime'
14354 d_msg_ctrunc='$d_msg_ctrunc'
14355 d_msg_dontroute='$d_msg_dontroute'
14356 d_msg_oob='$d_msg_oob'
14357 d_msg_peek='$d_msg_peek'
14358 d_msg_proxy='$d_msg_proxy'
14359 d_msgctl='$d_msgctl'
14360 d_msgget='$d_msgget'
14361 d_msgrcv='$d_msgrcv'
14362 d_msgsnd='$d_msgsnd'
14363 d_mymalloc='$d_mymalloc'
14365 d_off64_t='$d_off64_t'
14366 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14367 d_oldpthreads='$d_oldpthreads'
14368 d_oldsock='$d_oldsock'
14370 d_pathconf='$d_pathconf'
14372 d_phostname='$d_phostname'
14375 d_portable='$d_portable'
14376 d_pthread_yield='$d_pthread_yield'
14378 d_pwchange='$d_pwchange'
14379 d_pwclass='$d_pwclass'
14380 d_pwcomment='$d_pwcomment'
14381 d_pwexpire='$d_pwexpire'
14382 d_pwgecos='$d_pwgecos'
14383 d_pwpasswd='$d_pwpasswd'
14384 d_pwquota='$d_pwquota'
14386 d_readdir='$d_readdir'
14387 d_readlink='$d_readlink'
14388 d_rename='$d_rename'
14389 d_rewinddir='$d_rewinddir'
14391 d_safebcpy='$d_safebcpy'
14392 d_safemcpy='$d_safemcpy'
14393 d_sanemcmp='$d_sanemcmp'
14394 d_sched_yield='$d_sched_yield'
14395 d_scm_rights='$d_scm_rights'
14396 d_seekdir='$d_seekdir'
14397 d_select='$d_select'
14399 d_semctl='$d_semctl'
14400 d_semctl_semid_ds='$d_semctl_semid_ds'
14401 d_semctl_semun='$d_semctl_semun'
14402 d_semget='$d_semget'
14404 d_setegid='$d_setegid'
14405 d_seteuid='$d_seteuid'
14406 d_setgrent='$d_setgrent'
14407 d_setgrps='$d_setgrps'
14408 d_sethent='$d_sethent'
14409 d_setlinebuf='$d_setlinebuf'
14410 d_setlocale='$d_setlocale'
14411 d_setnent='$d_setnent'
14412 d_setpent='$d_setpent'
14413 d_setpgid='$d_setpgid'
14414 d_setpgrp2='$d_setpgrp2'
14415 d_setpgrp='$d_setpgrp'
14416 d_setprior='$d_setprior'
14417 d_setpwent='$d_setpwent'
14418 d_setregid='$d_setregid'
14419 d_setresgid='$d_setresgid'
14420 d_setresuid='$d_setresuid'
14421 d_setreuid='$d_setreuid'
14422 d_setrgid='$d_setrgid'
14423 d_setruid='$d_setruid'
14424 d_setsent='$d_setsent'
14425 d_setsid='$d_setsid'
14426 d_setspent='$d_setspent'
14427 d_setvbuf='$d_setvbuf'
14431 d_shmatprototype='$d_shmatprototype'
14432 d_shmctl='$d_shmctl'
14434 d_shmget='$d_shmget'
14435 d_sigaction='$d_sigaction'
14436 d_sigsetjmp='$d_sigsetjmp'
14437 d_socket='$d_socket'
14438 d_sockpair='$d_sockpair'
14440 d_statblks='$d_statblks'
14441 d_statfs_f_flags='$d_statfs_f_flags'
14442 d_statfs_s='$d_statfs_s'
14443 d_statvfs='$d_statvfs'
14444 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14445 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14446 d_stdio_stream_array='$d_stdio_stream_array'
14447 d_stdiobase='$d_stdiobase'
14448 d_stdstdio='$d_stdstdio'
14449 d_strchr='$d_strchr'
14450 d_strcoll='$d_strcoll'
14451 d_strctcpy='$d_strctcpy'
14452 d_strerrm='$d_strerrm'
14453 d_strerror='$d_strerror'
14454 d_strtod='$d_strtod'
14455 d_strtol='$d_strtol'
14456 d_strtoul='$d_strtoul'
14457 d_strtoull='$d_strtoull'
14458 d_strxfrm='$d_strxfrm'
14459 d_suidsafe='$d_suidsafe'
14460 d_symlink='$d_symlink'
14461 d_syscall='$d_syscall'
14462 d_sysconf='$d_sysconf'
14463 d_sysernlst='$d_sysernlst'
14464 d_syserrlst='$d_syserrlst'
14465 d_system='$d_system'
14466 d_tcgetpgrp='$d_tcgetpgrp'
14467 d_tcsetpgrp='$d_tcsetpgrp'
14468 d_telldir='$d_telldir'
14469 d_telldirproto='$d_telldirproto'
14472 d_truncate='$d_truncate'
14473 d_tzname='$d_tzname'
14476 d_union_semun='$d_union_semun'
14478 d_vendorbin='$d_vendorbin'
14479 d_vendorlib='$d_vendorlib'
14481 d_void_closedir='$d_void_closedir'
14482 d_voidsig='$d_voidsig'
14483 d_voidtty='$d_voidtty'
14484 d_volatile='$d_volatile'
14485 d_vprintf='$d_vprintf'
14487 d_waitpid='$d_waitpid'
14488 d_wcstombs='$d_wcstombs'
14489 d_wctomb='$d_wctomb'
14492 db_hashtype='$db_hashtype'
14493 db_prefixtype='$db_prefixtype'
14494 defvoidused='$defvoidused'
14495 direntrytype='$direntrytype'
14498 doublesize='$doublesize'
14500 dynamic_ext='$dynamic_ext'
14506 eunicefix='$eunicefix'
14509 extensions='$extensions'
14510 fflushNULL='$fflushNULL'
14511 fflushall='$fflushall'
14513 firstmakefile='$firstmakefile'
14515 fpossize='$fpossize'
14516 fpostype='$fpostype'
14517 freetype='$freetype'
14519 full_csh='$full_csh'
14520 full_sed='$full_sed'
14521 gccversion='$gccversion'
14522 gidformat='$gidformat'
14528 groupcat='$groupcat'
14529 groupstype='$groupstype'
14532 h_sysfile='$h_sysfile'
14544 i_arpainet='$i_arpainet'
14545 i_bsdioctl='$i_bsdioctl'
14548 i_dirent='$i_dirent'
14555 i_inttypes='$i_inttypes'
14556 i_limits='$i_limits'
14557 i_locale='$i_locale'
14558 i_machcthr='$i_machcthr'
14559 i_malloc='$i_malloc'
14561 i_memory='$i_memory'
14562 i_mntent='$i_mntent'
14565 i_neterrno='$i_neterrno'
14566 i_netinettcp='$i_netinettcp'
14569 i_pthread='$i_pthread'
14571 i_rpcsvcdbm='$i_rpcsvcdbm'
14574 i_shadow='$i_shadow'
14576 i_stdarg='$i_stdarg'
14577 i_stddef='$i_stddef'
14578 i_stdlib='$i_stdlib'
14579 i_string='$i_string'
14580 i_sysaccess='$i_sysaccess'
14581 i_sysdir='$i_sysdir'
14582 i_sysfile='$i_sysfile'
14583 i_sysfilio='$i_sysfilio'
14585 i_sysioctl='$i_sysioctl'
14586 i_sysmount='$i_sysmount'
14587 i_sysndir='$i_sysndir'
14588 i_sysparam='$i_sysparam'
14589 i_sysresrc='$i_sysresrc'
14590 i_syssecrt='$i_syssecrt'
14591 i_sysselct='$i_sysselct'
14592 i_syssockio='$i_syssockio'
14593 i_sysstat='$i_sysstat'
14594 i_sysstatfs='$i_sysstatfs'
14595 i_sysstatvfs='$i_sysstatvfs'
14596 i_systime='$i_systime'
14597 i_systimek='$i_systimek'
14598 i_systimes='$i_systimes'
14599 i_systypes='$i_systypes'
14600 i_sysuio='$i_sysuio'
14602 i_sysvfs='$i_sysvfs'
14603 i_syswait='$i_syswait'
14604 i_termio='$i_termio'
14605 i_termios='$i_termios'
14607 i_unistd='$i_unistd'
14610 i_values='$i_values'
14611 i_varargs='$i_varargs'
14612 i_varhdr='$i_varhdr'
14614 ignore_versioned_solibs='$ignore_versioned_solibs'
14617 installarchlib='$installarchlib'
14618 installbin='$installbin'
14619 installman1dir='$installman1dir'
14620 installman3dir='$installman3dir'
14621 installprefix='$installprefix'
14622 installprefixexp='$installprefixexp'
14623 installprivlib='$installprivlib'
14624 installscript='$installscript'
14625 installsitearch='$installsitearch'
14626 installsitebin='$installsitebin'
14627 installsitelib='$installsitelib'
14628 installstyle='$installstyle'
14629 installusrbinperl='$installusrbinperl'
14630 installvendorbin='$installvendorbin'
14631 installvendorlib='$installvendorlib'
14633 ivdformat='$ivdformat'
14636 known_extensions='$known_extensions'
14640 lddlflags='$lddlflags'
14642 ldlibpthname='$ldlibpthname'
14649 libswanted='$libswanted'
14655 locincpth='$locincpth'
14656 loclibpth='$loclibpth'
14657 longdblsize='$longdblsize'
14658 longlongsize='$longlongsize'
14659 longsize='$longsize'
14663 lseeksize='$lseeksize'
14664 lseektype='$lseektype'
14668 make_set_make='$make_set_make'
14669 mallocobj='$mallocobj'
14670 mallocsrc='$mallocsrc'
14671 malloctype='$malloctype'
14673 man1direxp='$man1direxp'
14676 man3direxp='$man3direxp'
14679 mips_type='$mips_type'
14682 modetype='$modetype'
14684 multiarch='$multiarch'
14686 myarchname='$myarchname'
14687 mydomain='$mydomain'
14688 myhostname='$myhostname'
14691 netdb_hlen_type='$netdb_hlen_type'
14692 netdb_host_type='$netdb_host_type'
14693 netdb_name_type='$netdb_name_type'
14694 netdb_net_type='$netdb_net_type'
14697 nm_so_opt='$nm_so_opt'
14698 nonxs_ext='$nonxs_ext'
14702 o_nonblock='$o_nonblock'
14704 old_pthread_create_joinable='$old_pthread_create_joinable'
14705 optimize='$optimize'
14706 orderlib='$orderlib'
14712 patchlevel='$patchlevel'
14713 path_sep='$path_sep'
14715 perladmin='$perladmin'
14716 perlpath='$perlpath'
14718 phostname='$phostname'
14721 pm_apiversion='$pm_apiversion'
14725 prefixexp='$prefixexp'
14727 privlibexp='$privlibexp'
14728 prototype='$prototype'
14730 quadkind='$quadkind'
14731 quadtype='$quadtype'
14732 randbits='$randbits'
14733 randfunc='$randfunc'
14734 randseedtype='$randseedtype'
14736 rd_nodata='$rd_nodata'
14740 sPRIEldbl='$sPRIEldbl'
14741 sPRIFldbl='$sPRIFldbl'
14742 sPRIGldbl='$sPRIGldbl'
14745 sPRIeldbl='$sPRIeldbl'
14746 sPRIfldbl='$sPRIfldbl'
14747 sPRIgldbl='$sPRIgldbl'
14752 sched_yield='$sched_yield'
14753 scriptdir='$scriptdir'
14754 scriptdirexp='$scriptdirexp'
14756 seedfunc='$seedfunc'
14757 selectminbits='$selectminbits'
14758 selecttype='$selecttype'
14759 sendmail='$sendmail'
14762 sharpbang='$sharpbang'
14763 shmattype='$shmattype'
14764 shortsize='$shortsize'
14767 sig_count='$sig_count'
14768 sig_name='$sig_name'
14769 sig_name_init='$sig_name_init'
14771 sig_num_init='$sig_num_init'
14772 signal_t='$signal_t'
14773 sitearch='$sitearch'
14774 sitearchexp='$sitearchexp'
14776 sitebinexp='$sitebinexp'
14778 sitelibexp='$sitelibexp'
14779 siteprefix='$siteprefix'
14780 siteprefixexp='$siteprefixexp'
14781 sizetype='$sizetype'
14786 sockethdr='$sockethdr'
14787 socketlib='$socketlib'
14789 spackage='$spackage'
14790 spitshell='$spitshell'
14793 ssizetype='$ssizetype'
14794 startperl='$startperl'
14796 static_ext='$static_ext'
14798 stdio_base='$stdio_base'
14799 stdio_bufsiz='$stdio_bufsiz'
14800 stdio_cnt='$stdio_cnt'
14801 stdio_filbuf='$stdio_filbuf'
14802 stdio_ptr='$stdio_ptr'
14803 stdio_stream_array='$stdio_stream_array'
14806 subversion='$subversion'
14813 timeincl='$timeincl'
14814 timetype='$timetype'
14827 uidformat='$uidformat'
14833 uquadtype='$uquadtype'
14834 use64bits='$use64bits'
14836 uselargefiles='$uselargefiles'
14837 uselongdouble='$uselongdouble'
14838 uselonglong='$uselonglong'
14839 usemorebits='$usemorebits'
14840 usemultiplicity='$usemultiplicity'
14841 usemymalloc='$usemymalloc'
14843 useopcode='$useopcode'
14844 useperlio='$useperlio'
14845 useposix='$useposix'
14847 useshrplib='$useshrplib'
14848 usesocks='$usesocks'
14849 usethreads='$usethreads'
14850 usevendorprefix='$usevendorprefix'
14851 usevfork='$usevfork'
14854 uvoformat='$uvoformat'
14857 uvuformat='$uvuformat'
14858 uvxformat='$uvxformat'
14859 vendorbin='$vendorbin'
14860 vendorbinexp='$vendorbinexp'
14861 vendorlib='$vendorlib'
14862 vendorlibexp='$vendorlibexp'
14863 vendorprefix='$vendorprefix'
14864 vendorprefixexp='$vendorprefixexp'
14867 voidflags='$voidflags'
14869 xs_apiversion='$xs_apiversion'
14874 : Add in command line options if available
14875 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14877 : add special variables
14878 $test -f $src/patchlevel.h && \
14879 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14880 echo "CONFIGDOTSH=true" >>config.sh
14882 : propagate old symbols
14883 if $test -f UU/config.sh; then
14884 <UU/config.sh sort | uniq >UU/oldconfig.sh
14885 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14886 sort | uniq -u >UU/oldsyms
14887 set X `cat UU/oldsyms`
14893 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14895 echo "# Variables propagated from previous config.sh file." >>config.sh
14896 for sym in `cat UU/oldsyms`; do
14897 echo " Propagating $hint variable "'$'"$sym..."
14898 eval 'tmp="$'"${sym}"'"'
14900 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14906 : Finish up by extracting the .SH files
14920 If you'd like to make any changes to the config.sh file before I begin
14921 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14924 rp="Press return or use a shell escape to edit config.sh:"
14929 *) : in case they cannot read
14930 sh 1>&4 -c "$ans";;
14935 : if this fails, just run all the .SH files by hand
14942 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14949 Now you need to generate make dependencies by running "$make depend".
14950 You might prefer to run it in background: "$make depend > makedepend.out &"
14951 It can take a while, so you might not want to run it right now.
14956 rp="Run $make depend now?"
14960 $make depend && echo "Now you must run a $make."
14963 echo "You must run '$make depend' then '$make'."
14966 elif test -f [Mm]akefile; then
14968 echo "Now you must run a $make."
14973 if $test -f Policy.sh; then
14976 If you compile $package on a different machine or from a different object
14977 directory, copy the Policy.sh file from this object directory to the
14978 new one before you run Configure -- this will help you with most of
14979 the policy defaults.
14983 if $test -f config.msg; then
14984 echo "Hmm. I also noted the following information while running:"
14986 $cat config.msg >&4
14989 $rm -f kit*isdone ark*isdone