3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Wed Dec 22 14:18:58 EST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
688 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
888 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
891 : We must find out about Eunice early
893 if test -f /etc/unixtovms; then
894 eunicefix=/etc/unixtovms
896 if test -f /etc/unixtovms.exe; then
897 eunicefix=/etc/unixtovms.exe
901 : Possible local include directories to search.
902 : Set locincpth to "" in a hint file to defeat local include searches.
903 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
904 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
906 : no include file wanted by default
909 : list of known cpp symbols, sorted alphabetically
910 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
911 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
912 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
913 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
914 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
915 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
916 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
917 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
918 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
919 al="$al VMS Xenix286"
920 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
921 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
922 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
923 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
924 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
925 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
926 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
927 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
928 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
929 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
930 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
931 al="$al __SVR4_2__ __UMAXV__"
932 al="$al ____386BSD____ __alpha __alpha__ __amiga"
933 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
934 al="$al __host_mips__"
935 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
936 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
937 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
938 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
939 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
940 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
941 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
942 al="$al __mc88100 __mc88100__ __mips __mips__"
943 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
944 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
945 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
946 al="$al _host_mips _mips _unix"
947 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
948 al="$al apollo ardent att386 att3b"
949 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
950 al="$al cadmus clipper concurrent convex cray ctix"
951 al="$al dmert encore gcos gcx gimpel gould"
952 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
953 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
954 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
955 al="$al i186 i286 i386 i486 i8086"
956 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
957 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
958 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
959 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
960 al="$al mc88000 mc88100 merlin mert mips mvs n16"
961 al="$al ncl_el ncl_mr"
962 al="$al news1500 news1700 news1800 news1900 news3700"
963 al="$al news700 news800 news900 ns16000 ns32000"
964 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
965 al="$al parisc pc532 pdp11 plexus posix pyr"
966 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
967 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
968 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
969 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
970 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
971 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
974 : Trailing extension. Override this in a hint file, if needed.
976 : Extra object files, if any, needed on this platform.
979 : change the next line if compiling for Xenix/286 on Xenix/386
980 xlibpth='/usr/lib/386 /lib/386'
982 : Possible local library directories to search.
983 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
984 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
986 : general looking path for locating libraries
987 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
988 glibpth="$glibpth /lib /usr/lib $xlibpth"
989 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
990 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
992 : Private path used by Configure to find libraries. Its value
993 : is prepended to libpth. This variable takes care of special
994 : machines, like the mips. Usually, it should be empty.
997 : default library list
999 : some systems want to use only the non-versioned libso:s
1000 ignore_versioned_solibs=''
1001 : full support for void wanted by default
1004 : set useposix=false in your hint file to disable the POSIX extension.
1006 : set useopcode=false in your hint file to disable the Opcode extension.
1008 : set usemultiplicity on the Configure command line to enable multiplicity.
1009 : set usesocks on the Configure command line to enable socks.
1010 : set usethreads on the Configure command line to enable threads.
1011 : List of libraries we want.
1012 : If anyone needs -lnet, put it in a hint file.
1013 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1014 libswanted="$libswanted dld ld sun m c cposix posix"
1015 libswanted="$libswanted ndir dir crypt sec"
1016 libswanted="$libswanted ucb bsd BSD PW x"
1017 : We probably want to search /usr/shlib before most other libraries.
1018 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1019 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1020 glibpth="/usr/shlib $glibpth"
1021 : Do not use vfork unless overridden by a hint file.
1024 : Find the basic shell for Bourne shell scripts
1028 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1031 if test -f "$xxx"; then
1034 : Build up a list and do a single loop so we can 'break' out.
1035 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1036 for xxx in sh bash ksh pdksh ash; do
1038 try="$try ${p}/${xxx}"
1042 if test -f "$xxx"; then
1045 elif test -f "$xxx.exe"; then
1056 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1058 Usually it's in /bin/sh. How did you even get this far?
1059 Please contact me (Perl Maintainers) at perlbug@perl.com and
1060 we'll try to straighten this all out.
1066 : see if sh knows # comments
1067 if `$sh -c '#' >/dev/null 2>&1`; then
1071 test -f $xcat || xcat=/usr/bin/cat
1076 if test -s today; then
1079 echo "#! $xcat" > try
1083 if test -s today; then
1091 echo "Your $sh doesn't grok # comments--I will strip them later on."
1094 echo "exec grep -v '^[ ]*#'" >spitshell
1096 $eunicefix spitshell
1097 spitshell=`pwd`/spitshell
1099 echo "I presume that if # doesn't work, #! won't work either!"
1104 : figure out how to guarantee sh startup
1106 '') startsh=${sharpbang}${sh} ;;
1118 : echo "Yup, it does."
1120 echo "Hmm... '$startsh' does not guarantee sh startup..."
1121 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1126 : Save command line options in file UU/cmdline.opt for later use in
1127 : generating config.sh.
1128 cat > cmdline.opt <<EOSH
1129 # Configure command line arguments.
1136 cat >>cmdline.opt <<EOSH
1137 config_arg$argn='$arg'
1139 argn=`expr $argn + 1`
1142 : produce awk script to parse command line options
1143 cat >options.awk <<'EOF'
1145 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1147 len = length(optstr);
1148 for (i = 1; i <= len; i++) {
1149 c = substr(optstr, i, 1);
1150 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1161 if (substr(str, 1, 1) != "-") {
1162 printf("'%s'\n", str);
1166 for (i = 2; i <= len; i++) {
1167 c = substr(str, i, 1);
1169 printf("-%s\n", substr(str, i));
1175 printf("'%s'\n", substr(str, i + 1));
1188 : process the command line options
1189 set X `for arg in "$@"; do echo "X$arg"; done |
1190 sed -e s/X// | awk -f options.awk`
1195 : set up default values
1205 rm -f optdef.sh posthint.sh
1206 cat >optdef.sh <<EOS
1212 while test $# -gt 0; do
1214 -d) shift; fastread=yes;;
1215 -e) shift; alldone=cont;;
1219 if test -r "$1"; then
1222 echo "$me: cannot read config file $1." >&2
1227 -h) shift; error=true;;
1228 -r) shift; reuseval=true;;
1229 -s) shift; silent=true; realsilent=true;;
1230 -E) shift; alldone=exit;;
1231 -K) shift; knowitall=true;;
1232 -O) shift; override=true;;
1233 -S) shift; silent=true; extractsh=true;;
1238 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1239 echo "$me: ignoring -D $1" >&2
1242 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1243 *) echo "$1='define'" >> optdef.sh;;
1250 *=) echo "$1" >> optdef.sh;;
1252 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1253 echo "$me: ignoring -U $1" >&2
1255 *) echo "$1='undef'" >> optdef.sh;;
1266 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1270 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1271 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1277 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1278 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1279 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1281 *) xxx=`echo $yyy|sed 's!:.*!!'`
1282 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1288 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1290 echo "$yyy=''" >> posthint.sh ;;
1295 echo "$yyy='$zzz'" >> posthint.sh ;;
1297 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1304 echo "$yyy=$zzz" >> posthint.sh ;;
1305 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1308 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1311 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1319 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1320 [-U symbol] [-U symbol=] [-A command:symbol...]
1321 -d : use defaults for all answers.
1322 -e : go on without questioning past the production of config.sh.
1323 -f : specify an alternate default configuration file.
1324 -h : print this help message and exit (with an error status).
1325 -r : reuse C symbols value if possible (skips costly nm extraction).
1326 -s : silent mode, only echoes questions and essential information.
1327 -D : define symbol to have some value:
1328 -D symbol symbol gets the value 'define'
1329 -D symbol=value symbol gets the value 'value'
1330 -E : stop at the end of questions, after having produced config.sh.
1331 -K : do not use unless you know what you are doing.
1332 -O : let -D and -U override definitions from loaded configuration file.
1333 -S : perform variable substitutions on all .SH files (can mix with -f)
1334 -U : undefine symbol:
1335 -U symbol symbol gets the value 'undef'
1336 -U symbol= symbol gets completely empty
1337 -A : manipulate symbol after the platform specific hints have been applied:
1338 -A symbol=value append " "value to symbol
1339 -A append:symbol=value append value to symbol
1340 -A define:symbol=value define symbol to have value
1341 -A clear:symbol define symbol to be ''
1342 -A define:symbol define symbol to be 'define'
1343 -A eval:symbol=value define symbol to be eval of value
1344 -A prepend:symbol=value prepend value to symbol
1345 -A undef:symbol define symbol to be 'undef'
1346 -A undef:symbol= define symbol to be ''
1347 -V : print version number and exit (with a zero status).
1354 case "$fastread$alldone" in
1357 if test ! -t 0; then
1358 echo "Say 'sh Configure', not 'sh <Configure'"
1366 true) exec 1>/dev/null;;
1369 : run the defines and the undefines, if any, but leave the file out there...
1372 : create the posthint manipulation script and leave the file out there...
1377 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1378 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1379 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1380 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1381 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1384 : Some greps do not return status, grrr.
1385 echo "grimblepritz" >grimble
1386 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1388 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1394 : the following should work in any shell
1398 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1399 cat >contains <<'EOSS'
1400 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1405 : Find the path to the source tree
1408 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1411 *) src=`cd ../$src && pwd` ;;
1424 if test -f $rsrc/Configure && \
1425 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1427 : found it, so we are ok.
1430 for src in . .. ../.. ../../.. ../../../..; do
1431 if test -f ../$src/Configure && \
1432 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1443 Sorry, I can't seem to locate the source dir for $package. Please start
1444 Configure with an explicit path -- i.e. /some/path/Configure.
1452 echo "Sources for $package found in \"$src\"." >&4
1456 : script used to extract .SH files with variable substitutions
1457 cat >extract <<'EOS'
1459 echo "Doing variable substitutions on .SH files..."
1460 if test -f $src/MANIFEST; then
1461 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1463 echo "(Looking for .SH files under the source directory.)"
1464 set x `(cd $src; find . -name "*.SH" -print)`
1468 0) set x `(cd $src; echo *.SH)`; shift;;
1470 if test ! -f $src/$1; then
1476 while test $name; do
1477 if test ! -d "$name"; then
1478 create="$name $create";
1479 name=`echo $name | sed -e "s|^[^/]*$||"`;
1480 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1485 for file in $create; do
1494 dir=`expr X$file : 'X\(.*\)/'`
1495 file=`expr X$file : 'X.*/\(.*\)'`
1496 (cd $dir && . ./$file)
1506 dir=`expr X$file : 'X\(.*\)/'`
1507 file=`expr X$file : 'X.*/\(.*\)'`
1508 (set x $dir; shift; eval $mkdir_p)
1518 if test -f $src/config_h.SH; then
1519 if test ! -f config.h; then
1520 : oops, they left it out of MANIFEST, probably, so do it anyway.
1526 : extract files and exit if asked to do so
1527 case "$extractsh" in
1529 case "$realsilent" in
1533 case "$config_sh" in
1534 '') config_sh='config.sh';;
1537 echo "Fetching answers from $config_sh..."
1540 test "$override" && . ./optdef.sh
1549 : Eunice requires " " instead of "", can you believe it
1552 echo "Beginning of configuration questions for $package."
1554 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1556 : first determine how to suppress newline on echo command
1558 echo "Checking echo to see how to suppress newlines..."
1559 (echo "hi there\c" ; echo " ") >.echotmp
1560 if $contains c .echotmp >/dev/null 2>&1 ; then
1571 echo $n "The star should be here-->$c"
1575 : Now test for existence of everything in MANIFEST
1577 if test -f $rsrc/MANIFEST; then
1578 echo "First let's make sure your kit is complete. Checking..." >&4
1579 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1582 for filelist in x??; do
1583 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1585 if test -s missing; then
1589 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1591 You have the option of continuing the configuration process, despite the
1592 distinct possibility that your kit is damaged, by typing 'y'es. If you
1593 do, don't blame me if something goes wrong. I advise you to type 'n'o
1594 and contact the author (perlbug@perl.com).
1597 echo $n "Continue? [n] $c" >&4
1601 echo "Continuing..." >&4
1605 echo "ABORTING..." >&4
1610 echo "Looks good..."
1613 echo "There is no MANIFEST file. I hope your kit is complete !"
1618 : Find the appropriate value for a newline for tr
1619 if test -n "$DJGPP"; then
1622 if test X"$trnl" = X; then
1623 case "`echo foo|tr '\n' x 2>/dev/null`" in
1627 if test X"$trnl" = X; then
1628 case "`echo foo|tr '\012' x 2>/dev/null`" in
1629 foox) trnl='\012' ;;
1632 if test X"$trnl" = X; then
1635 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1641 : compute the number of columns on the terminal for proper question formatting
1646 : set up the echo used in my read
1647 myecho="case \"\$xxxm\" in
1648 '') echo $n \"\$rp $c\" >&4;;
1650 '') echo $n \"[\$xxxm] $c\";;
1652 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1654 echo $n \"[\$xxxm] $c\" >&4
1656 echo $n \"\$rp [\$xxxm] $c\" >&4
1662 : now set up to do reads with possible shell escape and default assignment
1668 case "\$fastread" in
1669 yes) case "\$dflt" in
1672 case "\$silent-\$rp" in
1677 *) case "\$silent" in
1678 true) case "\$rp" in
1683 while expr "X\$ans" : "X!" >/dev/null; do
1687 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1695 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1704 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1709 echo "(OK, I'll run with -d after this question.)" >&4
1712 echo "*** Sorry, \$1 not supported yet." >&4
1722 echo "*** Substitution done -- please confirm."
1724 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1729 echo "*** Error -- try again."
1736 case "\$ans\$xxxm\$nostick" in
1748 : create .config dir to save info across Configure sessions
1749 test -d ../.config || mkdir ../.config
1750 cat >../.config/README <<EOF
1751 This directory created by Configure to save information that should
1752 persist across sessions for $package.
1754 You may safely delete it if you wish.
1757 : general instructions
1760 user=`(logname) 2>/dev/null`
1762 '') user=`whoami 2>&1`;;
1764 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1767 rp='Would you like to see the instructions?'
1778 This installation shell script will examine your system and ask you questions
1779 to determine how the perl5 package should be installed. If you get
1780 stuck on a question, you may use a ! shell escape to start a subshell or
1781 execute a command. Many of the questions will have default answers in square
1782 brackets; typing carriage return will give you the default.
1784 On some of the questions which ask for file or directory names you are allowed
1785 to use the ~name construct to specify the login directory belonging to "name",
1786 even if you don't have a shell which knows about that. Questions where this is
1787 allowed will be marked "(~name ok)".
1791 dflt='Type carriage return to continue'
1795 The prompter used in this script allows you to use shell variables and
1796 backticks in your answers. You may use $1, $2, etc... to refer to the words
1797 in the default answer, as if the default line was a set of arguments given to a
1798 script shell. This means you may also use $* to repeat the whole default line,
1799 so you do not have to re-type everything to add something to the default.
1801 Everytime there is a substitution, you will have to confirm. If there is an
1802 error (e.g. an unmatched backtick), the default answer will remain unchanged
1803 and you will be prompted again.
1805 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1806 the questions and use the computed defaults (or the previous answers if there
1807 was already a config.sh file). Type 'Configure -h' for a list of options.
1808 You may also start interactively and then answer '& -d' at any prompt to turn
1809 on the non-interactive behaviour for the remainder of the execution.
1815 Much effort has been expended to ensure that this shell script will run on any
1816 Unix system. If despite that it blows up on yours, your best bet is to edit
1817 Configure and run it again. If you can't run Configure for some reason,
1818 you'll have to generate a config.sh file by hand. Whatever problems you
1819 have, let me (perlbug@perl.com) know how I blew it.
1821 This installation script affects things in two ways:
1823 1) it may do direct variable substitutions on some of the files included
1825 2) it builds a config.h file for inclusion in C programs. You may edit
1826 any of these files as the need arises after running this script.
1828 If you make a mistake on a question, there is no easy way to back up to it
1829 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1830 files. Configure will offer to let you do this before it runs the SH files.
1833 dflt='Type carriage return to continue'
1835 case "$firsttime" in
1836 true) echo $user >>../.config/instruct;;
1840 : find out where common programs are
1842 echo "Locating common programs..." >&4
1855 if test -d \$dir/\$thing; then
1861 for thisthing in \$dir/\$thing; do
1862 : just loop through to pick last item
1864 if test -f \$thisthing; then
1867 elif test -f \$dir/\$thing.exe; then
1868 if test -n "$DJGPP"; then
1869 echo \$dir/\$thing.exe
1871 : on Eunice apparently
1921 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1922 pth="$pth /lib /usr/lib"
1923 for file in $loclist; do
1927 if test -f "$xxx"; then
1930 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1931 xxx=`./loc $file $file $pth`
1934 '') xxx=`./loc $file $file $pth`;;
1935 *) xxx=`./loc $xxx $xxx $pth`;;
1941 echo $file is in $xxx.
1944 echo $file is in $xxx.
1947 echo "I don't know where '$file' is, and my life depends on it." >&4
1948 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1954 echo "Don't worry if any of the following aren't found..."
1956 for file in $trylist; do
1960 if test -f "$xxx"; then
1963 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1964 xxx=`./loc $file $file $pth`
1967 '') xxx=`./loc $file $file $pth`;;
1968 *) xxx=`./loc $xxx $xxx $pth`;;
1974 echo $file is in $xxx.
1977 echo $file is in $xxx.
1980 echo "I don't see $file out there, $say."
1987 echo "Substituting grep for egrep."
1993 echo "Substituting cp for ln."
1999 echo "Hopefully test is built into your sh."
2002 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2003 echo "Using the test built into your sh."
2011 echo "Hopefully echo is built into your sh."
2016 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2017 $echo $n "hi there$c" >foo1
2018 echo $n "hi there$c" >foo2
2019 if cmp foo1 foo2 >/dev/null 2>&1; then
2020 echo "They are compatible. In fact, they may be identical."
2027 They are not compatible! You are probably running ksh on a non-USG system.
2028 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2029 have echo built in and we may have to run some Bourne shell scripts. That
2030 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2033 $echo $n "The star should be here-->$c"
2040 : determine whether symbolic links are supported
2043 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2044 echo "Symbolic links are supported." >&4
2047 echo "Symbolic links are NOT supported." >&4
2052 : see whether [:lower:] and [:upper:] are supported character classes
2054 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2056 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2060 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2061 # (0xc9 and 0xd1), therefore that is a nice testing point.
2062 if test "X$up" = X -o "X$low" = X; then
2063 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2069 if test "X$up" = X -o "X$low" = X; then
2070 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2076 if test "X$up" = X -o "X$low" = X; then
2077 case "`echo IJ | od -x 2>/dev/null`" in
2079 echo "Hey, this might be EBCDIC." >&4
2080 if test "X$up" = X -o "X$low" = X; then
2081 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2082 ij) up='[A-IJ-RS-Z]'
2087 if test "X$up" = X -o "X$low" = X; then
2088 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2098 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2100 echo "Using $up and $low to convert case." >&4
2103 echo "I don't know how to translate letters from upper to lower case." >&4
2104 echo "Your tr is not acting any way I know of." >&4
2108 : set up the translation script tr, must be called with ./tr of course
2112 '[A-Z][a-z]') exec $tr '$up' '$low';;
2113 '[a-z][A-Z]') exec $tr '$low' '$up';;
2120 : Try to determine whether config.sh was made on this system
2121 case "$config_sh" in
2123 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2124 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2125 # because the A-Z/a-z are not consecutive.
2126 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2127 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2128 newmyuname="$myuname"
2130 case "$knowitall" in
2132 if test -f ../config.sh; then
2133 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2134 eval "`grep myuname= ../config.sh`"
2136 if test "X$myuname" = "X$newmyuname"; then
2144 : Get old answers from old config file if Configure was run on the
2145 : same system, otherwise use the hints.
2148 if test -f config.sh; then
2150 rp="I see a config.sh file. Shall I use it to set the defaults?"
2153 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2154 *) echo "Fetching default answers from your old config.sh file..." >&4
2162 : Older versions did not always set $sh. Catch re-use of such
2171 if test ! -f config.sh; then
2174 First time through, eh? I have some defaults handy for some systems
2175 that need some extra help getting the Configure answers right:
2178 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2180 : Half the following guesses are probably wrong... If you have better
2181 : tests or hints, please send them to perlbug@perl.com
2182 : The metaconfig authors would also appreciate a copy...
2183 $test -f /irix && osname=irix
2184 $test -f /xenix && osname=sco_xenix
2185 $test -f /dynix && osname=dynix
2186 $test -f /dnix && osname=dnix
2187 $test -f /lynx.os && osname=lynxos
2188 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2189 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2190 $test -f /bin/mips && /bin/mips && osname=mips
2191 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2192 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2193 $test -d /usr/apollo/bin && osname=apollo
2194 $test -f /etc/saf/_sactab && osname=svr4
2195 $test -d /usr/include/minix && osname=minix
2196 if $test -d /MachTen -o -d /MachTen_Folder; then
2198 if $test -x /sbin/version; then
2199 osvers=`/sbin/version | $awk '{print $2}' |
2200 $sed -e 's/[A-Za-z]$//'`
2201 elif $test -x /usr/etc/version; then
2202 osvers=`/usr/etc/version | $awk '{print $2}' |
2203 $sed -e 's/[A-Za-z]$//'`
2208 $test -f /sys/posix.dll &&
2209 $test -f /usr/bin/what &&
2210 set X `/usr/bin/what /sys/posix.dll` &&
2211 $test "$3" = UWIN &&
2214 if $test -f $uname; then
2222 umips) osname=umips ;;
2225 [23]100) osname=mips ;;
2226 next*) osname=next ;;
2228 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2229 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2232 elif $test -f /etc/kconfig; then
2234 if test "$lns" = "$ln -s"; then
2236 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2238 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2245 if test -n "$DJGPP"; then
2254 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2256 'not found') osvers="$4"."$3" ;;
2257 '<3240'|'<>3240') osvers=3.2.0 ;;
2258 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2259 '=3250'|'>3250') osvers=3.2.5 ;;
2263 *dc.osx) osname=dcosx
2269 domainos) osname=apollo
2275 dynixptx*) osname=dynixptx
2276 osvers=`echo "$4"|sed 's/^v//'`
2278 freebsd) osname=freebsd
2280 genix) osname=genix ;;
2282 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2298 netbsd*) osname=netbsd
2301 news-os) osvers="$3"
2303 4*) osname=newsos4 ;;
2307 bsd386) osname=bsd386
2310 POSIX-BC | posix-bc ) osname=posix-bc
2313 powerux | power_ux | powermax_os | powermaxos | \
2314 powerunix | power_unix) osname=powerux
2317 next*) osname=next ;;
2318 solaris) osname=solaris
2320 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2327 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2331 titanos) osname=titanos
2340 ultrix) osname=ultrix
2343 osf1|mls+) case "$5" in
2346 osvers=`echo "$3" | sed 's/^[xvt]//'`
2348 hp*) osname=hp_osf1 ;;
2349 mips) osname=mips_osf1 ;;
2352 unixware) osname=svr5
2361 cygwin*) osname=cygwin
2364 $2) case "$osname" in
2368 : svr4.x or possibly later
2378 if test -f /stand/boot ; then
2379 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2380 if test -n "$INITPROG" -a -f "$INITPROG"; then
2381 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2382 if test -n "$isesix"; then
2390 *) if test -f /etc/systemid; then
2392 set `echo $3 | $sed 's/\./ /g'` $4
2393 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2395 elif $test -f $src/hints/sco_$1_$2.sh; then
2397 elif $test -f $src/hints/sco_$1.sh; then
2402 '') : Still unknown. Probably a generic Sys V.
2411 *) case "$osname" in
2412 '') : Still unknown. Probably a generic BSD.
2420 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2421 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2422 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2425 $rm -f UU/kernel.what
2426 elif test -d c:/.; then
2433 : Now look for a hint file osname_osvers, unless one has been
2434 : specified already.
2437 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2438 : Also try without trailing minor version numbers.
2439 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2440 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2441 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2442 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2445 *) case "$osvers" in
2448 *) if $test -f $src/hints/$file.sh ; then
2450 elif $test -f $src/hints/$xfile.sh ; then
2452 elif $test -f $src/hints/$xxfile.sh ; then
2454 elif $test -f $src/hints/$xxxfile.sh ; then
2456 elif $test -f $src/hints/$xxxxfile.sh ; then
2458 elif $test -f "$src/hints/${osname}.sh" ; then
2467 if $test -f Policy.sh ; then
2470 none) dflt="Policy" ;;
2471 *) dflt="Policy $dflt" ;;
2476 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2480 if $test -f Policy.sh ; then
2483 There's also a Policy hint file available, which should make the
2484 site-specific (policy) questions easier to answer.
2491 You may give one or more space-separated answers, or "none" if appropriate.
2492 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2493 is a good thing. DO NOT give a wrong version or a wrong OS.
2497 rp="Which of these apply, if any?"
2500 for file in $tans; do
2501 if $test X$file = XPolicy -a -f Policy.sh; then
2503 $cat Policy.sh >> UU/config.sh
2504 elif $test -f $src/hints/$file.sh; then
2505 . $src/hints/$file.sh
2506 $cat $src/hints/$file.sh >> UU/config.sh
2507 elif $test X$tans = X -o X$tans = Xnone ; then
2510 : Give one chance to correct a possible typo.
2511 echo "$file.sh does not exist"
2513 rp="hint to use instead?"
2515 for file in $ans; do
2516 if $test -f "$src/hints/$file.sh"; then
2517 . $src/hints/$file.sh
2518 $cat $src/hints/$file.sh >> UU/config.sh
2519 elif $test X$ans = X -o X$ans = Xnone ; then
2522 echo "$file.sh does not exist -- ignored."
2529 : Remember our hint file for later.
2530 if $test -f "$src/hints/$file.sh" ; then
2540 echo "Fetching default answers from $config_sh..." >&4
2544 cp $config_sh config.sh 2>/dev/null
2554 test "$override" && . ./optdef.sh
2555 myuname="$newmyuname"
2557 : Restore computed paths
2558 for file in $loclist $trylist; do
2559 eval $file="\$_$file"
2564 Configure uses the operating system name and version to set some defaults.
2565 The default value is probably right if the name rings a bell. Otherwise,
2566 since spelling matters for me, either accept the default or answer "none"
2573 ''|' '|none) dflt=none ;;
2574 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2577 *) dflt="$osname" ;;
2579 rp="Operating system name?"
2583 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2589 ''|' '|none) dflt=none ;;
2590 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2591 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2593 ''|' ') dflt=none ;;
2598 *) dflt="$osvers" ;;
2600 rp="Operating system version?"
2610 : who configured the system
2611 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2612 cf_by=`(logname) 2>/dev/null`
2615 cf_by=`(whoami) 2>/dev/null`
2617 "") cf_by=unknown ;;
2621 : set up the script used to warn in case of inconsistency
2628 echo "*** WHOA THERE!!! ***" >&4
2629 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2630 rp=" Keep the $hint value?"
2633 y) td=$was; tu=$was;;
2637 : function used to set $1 to $val
2638 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2640 $define$undef) . ./whoa; eval "$var=\$td";;
2641 $undef$define) . ./whoa; eval "$var=\$tu";;
2642 *) eval "$var=$val";;
2647 Perl can be built to take advantage of threads, on some systems.
2648 To do so, Configure must be run with -Dusethreads.
2650 Note that threading is a highly experimental feature, and
2651 some known race conditions still remain. If you choose to try
2652 it, be very sure to not actually deploy it for production
2653 purposes. README.threads has more details, and is required
2654 reading if you enable threads.
2656 case "$usethreads" in
2657 $define|true|[yY]*) dflt='y';;
2660 rp='Build a threading Perl?'
2663 y|Y) val="$define" ;;
2669 case "$d_oldpthreads" in
2670 '') : Configure tests would be welcome here. For now, assume undef.
2672 *) val="$d_oldpthreads" ;;
2678 case "$usethreads" in
2679 "$define"|true|[yY]*)
2680 : Look for a hint-file generated 'call-back-unit'. If the
2681 : user has specified that a threading perl is to be built,
2682 : we may need to set or change some other defaults.
2683 if $test -f usethreads.cbu; then
2684 echo "Your platform has some specific hints for threaded builds, using them..."
2688 (Your platform doesn't have any specific hints for threaded builds.
2689 Assuming POSIX threads, then.)
2697 Perl can be built so that multiple Perl interpreters can coexist
2698 within the same Perl executable. To do so, Configure must be run with
2701 Normally you do not need this and you should answer no.
2704 case "$usemultiplicity" in
2705 $define|true|[yY]*) dflt='y';;
2708 rp='Build Perl for multiplicity?'
2711 y|Y) val="$define" ;;
2717 : determine where manual pages are on this system
2721 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2722 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2723 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2724 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2725 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2726 sysman=`./loc . /usr/man/man1 $syspath`
2729 if $test -d "$sysman"; then
2730 echo "System manual is in $sysman." >&4
2732 echo "Could not find manual pages in source form." >&4
2735 : see what memory models we can support
2738 $cat >pdp11.c <<'EOP'
2747 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2748 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2749 dflt='unsplit split'
2751 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2754 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2759 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2762 if $test -d /lib/large || $test -d /usr/lib/large; then
2765 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2774 Some systems have different model sizes. On most systems they are called
2775 small, medium, large, and huge. On the PDP11 they are called unsplit and
2776 split. If your system doesn't support different memory models, say "none".
2777 If you wish to force everything to one memory model, say "none" here and
2778 put the appropriate flags later when it asks you for other cc and ld flags.
2779 Venix systems may wish to put "none" and let the compiler figure things out.
2780 (In the following question multiple model names should be space separated.)
2782 The default for most systems is "none".
2785 rp="Which memory models are supported?"
2800 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2801 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2808 rp="What flag indicates separate I and D space?"
2816 *large*|*small*|*medium*|*huge*)
2823 rp="What flag indicates large model?"
2833 *huge*) case "$huge" in
2837 rp="What flag indicates huge model?"
2847 *medium*) case "$medium" in
2851 rp="What flag indicates medium model?"
2858 *) medium="$large";;
2861 *small*) case "$small" in
2865 rp="What flag indicates small model?"
2876 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2879 $rm -f pdp11.* pdp11
2881 : make some quick guesses about what we are up against
2883 $echo $n "Hmm... $c"
2893 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2894 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2896 echo "Looks kind of like an OSF/1 system, but we'll see..."
2898 elif test `echo abc | tr a-z A-Z` = Abc ; then
2899 xxx=`./loc addbib blurfl $pth`
2900 if $test -f $xxx; then
2901 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2905 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2906 echo "Looks kind of like an extended USG system, but we'll see..."
2908 echo "Looks kind of like a USG system, but we'll see..."
2912 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2913 echo "Looks kind of like a BSD system, but we'll see..."
2917 echo "Looks kind of like a Version 7 system, but we'll see..."
2920 case "$eunicefix" in
2923 There is, however, a strange, musty smell in the air that reminds me of
2924 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2928 : it so happens the Eunice I know will not run shell scripts in Unix format
2932 echo "Congratulations. You aren't running Eunice."
2936 : Detect OS2. The p_ variable is set above in the Head.U unit.
2941 I have the feeling something is not exactly right, however...don't tell me...
2942 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2947 if test -f /xenix; then
2948 echo "Actually, this looks more like a XENIX system..."
2953 echo "It's not Xenix..."
2958 if test -f /venix; then
2959 echo "Actually, this looks more like a VENIX system..."
2966 echo "Nor is it Venix..."
2969 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2970 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2973 : see if we need a special compiler
2981 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2982 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2996 On some older systems the default C compiler will not resolve multiple global
2997 references that happen to have the same name. On some such systems the "Mcc"
2998 command may be used to force these to be resolved. On other systems a "cc -M"
2999 command is required. (Note that the -M flag on other systems indicates a
3000 memory model to use!) If you have the Gnu C compiler, you might wish to use
3006 rp="Use which C compiler?"
3014 rp="Use which C compiler?"
3018 : Look for a hint-file generated 'call-back-unit'. Now that the
3019 : user has specified the compiler, we may need to set or change some
3021 if $test -f cc.cbu; then
3025 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3026 $cat >gccvers.c <<EOM
3031 printf("%s\n", __VERSION__);
3033 printf("%s\n", "1");
3039 if $cc -o gccvers gccvers.c; then
3040 gccversion=`./gccvers`
3041 case "$gccversion" in
3042 '') echo "You are not using GNU cc." ;;
3043 *) echo "You are using GNU cc $gccversion." ;;
3047 echo "*** WHOA THERE!!! ***" >&4
3048 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3049 case "$knowitall" in
3051 echo " You'd better start hunting for one and let me know about it." >&4
3057 case "$gccversion" in
3058 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3061 : see how we invoke the C preprocessor
3063 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3064 cat <<'EOT' >testcpp.c
3070 if test ! -f cppstdin; then
3071 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3072 # AIX cc -E doesn't show the absolute headerfile
3073 # locations but we'll cheat by using the -M flag.
3074 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
3076 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3079 echo "Keeping your $hint cppstdin wrapper."
3082 wrapper=`pwd`/cppstdin
3086 if $test "X$cppstdin" != "X" && \
3087 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3088 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3090 echo "You used to use $cppstdin $cppminus so we'll use that again."
3092 '') echo "But let's see if we can live without a wrapper..." ;;
3094 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3095 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3097 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3100 echo "(However, $cpprun $cpplast does not work, let's see...)"
3108 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3115 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3116 $cc -E <testcpp.c >testcpp.out 2>&1; \
3117 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3118 echo "Yup, it does."
3121 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3122 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3123 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3124 echo "Yup, it does."
3127 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3128 $cc -P <testcpp.c >testcpp.out 2>&1; \
3129 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3130 echo "Yipee, that works!"
3133 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3134 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3135 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3136 echo "At long last!"
3139 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3140 $cpp <testcpp.c >testcpp.out 2>&1; \
3141 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3145 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3146 $cpp - <testcpp.c >testcpp.out 2>&1; \
3147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3148 echo "Hooray, it works! I was beginning to wonder."
3151 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3152 $wrapper <testcpp.c >testcpp.out 2>&1; \
3153 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3159 rp="No dice. I can't find a C preprocessor. Name one:"
3163 $x_cpp <testcpp.c >testcpp.out 2>&1
3164 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3165 echo "OK, that will do." >&4
3167 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3182 echo "Perhaps can we force $cc -E using a wrapper..."
3183 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3184 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3190 echo "Nope, we'll have to live without it..."
3204 "$wrapper"|'cppstdin') ;;
3205 *) $rm -f $wrapper;;
3207 $rm -f testcpp.c testcpp.out
3209 : decide how portable to be. Allow command line overrides.
3210 case "$d_portable" in
3212 *) d_portable="$define" ;;
3215 : set up shell script to do ~ expansion
3221 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3224 if $test -f /bin/csh; then
3225 /bin/csh -f -c "glob \$1"
3230 name=\`$expr x\$1 : '..\([^/]*\)'\`
3231 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3232 if $test ! -d "\$dir"; then
3234 echo "\$me: can't locate home directory for: \$name" >&2
3239 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3255 : now set up to get a file name
3259 cat <<'EOSC' >>getfile
3275 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3276 fn=`echo $fn | sed 's/(.*)//'`
3282 loc_file=`expr $fn : '.*:\(.*\)'`
3283 fn=`expr $fn : '\(.*\):.*'`
3291 */*) fullpath=true;;
3300 *e*) exp_file=true;;
3303 *p*) nopath_ok=true;;
3308 *d*) type='Directory';;
3309 *l*) type='Locate';;
3314 Locate) what='File';;
3319 case "$d_portable" in
3327 while test "$type"; do
3332 true) rp="$rp (~name ok)";;
3335 if test -f UU/getfile.ok && \
3336 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3355 value=`UU/filexp $ans`
3358 if test "$ans" != "$value"; then
3359 echo "(That expands to $value on this system.)"
3373 /*) value="$ansexp" ;;
3378 echo "I shall only accept a full path name, as in /bin/ls." >&4
3379 echo "Use a ! shell escape if you wish to check pathnames." >&4
3382 echo "Please give a full path name, starting with slash." >&4
3385 echo "Note that using ~name is ok provided it expands well." >&4
3398 for fp in $gfpth; do
3399 if test "X$fp" = X.; then
3404 if test -f "$pf"; then
3406 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3408 echo "($value is not a plain file, but that's ok.)"
3411 if test X"$type" = X; then
3418 for fp in $gfpth; do
3419 if test "X$fp" = X.; then
3424 if test -d "$pf"; then
3432 if test -d "$ansexp"; then
3433 echo "(Looking for $loc_file in directory $value.)"
3434 value="$value/$loc_file"
3435 ansexp="$ansexp/$loc_file"
3437 if test -f "$ansexp"; then
3440 case "$nopath_ok" in
3441 true) case "$value" in
3443 *) echo "Assuming $value will be in people's path."
3459 if test "$fastread" = yes; then
3464 rp="$what $value doesn't exist. Use that name anyway?"
3483 test "X$gfpthkeep" != Xy && gfpth=""
3486 : What should the include directory be ?
3488 $echo $n "Hmm... $c"
3492 if $test -f /bin/mips && /bin/mips; then
3493 echo "Looks like a MIPS system..."
3494 $cat >usr.c <<'EOCP'
3495 #ifdef SYSTYPE_BSD43
3499 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3500 dflt='/bsd43/usr/include'
3504 mips_type='System V'
3506 $rm -f usr.c usr.out
3507 echo "and you're compiling with the $mips_type compiler and libraries."
3511 echo "Doesn't look like a MIPS system."
3521 case "$xxx_prompt" in
3524 rp='Where are the include files you want to use?'
3532 : Set private lib path
3535 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3540 '') dlist="$loclibpth $plibpth $glibpth";;
3541 *) dlist="$libpth";;
3544 : Now check and see which directories actually exist, avoiding duplicates
3548 if $test -d $xxx; then
3551 *) libpth="$libpth $xxx";;
3557 Some systems have incompatible or broken versions of libraries. Among
3558 the directories listed in the question below, please remove any you
3559 know not to be holding relevant libraries, and add any that are needed.
3560 Say "none" for none.
3571 rp="Directories to use for library searches?"
3578 : compute shared library extension
3581 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3591 On some systems, shared libraries may be available. Answer 'none' if
3592 you want to suppress searching of shared libraries for the remaining
3593 of this configuration.
3596 rp='What is the file extension used for shared libraries?'
3600 : Define several unixisms.
3601 : Hints files or command line option can be used to override them.
3602 : The convoluted testing is in case hints files set either the old
3605 '') case "$exe_ext" in
3607 *) _exe="$exe_ext" ;;
3612 '') case "$lib_ext" in
3619 '') case "$obj_ext" in
3626 '') case "$path_sep" in
3637 : Which makefile gets called first. This is used by make depend.
3638 case "$firstmakefile" in
3639 '') firstmakefile='makefile';;
3644 Perl can be built to use the SOCKS proxy protocol library. To do so,
3645 Configure must be run with -Dusesocks.
3647 Normally you do not need this and you should answer no.
3651 $define|true|[yY]*) dflt='y';;
3654 rp='Build Perl for SOCKS?'
3657 y|Y) val="$define" ;;
3663 : Looking for optional libraries
3665 echo "Checking for optional libraries..." >&4
3670 case "$libswanted" in
3671 '') libswanted='c_s';;
3675 libswanted="$libswanted socks5 socks5_sh"
3678 for thislib in $libswanted; do
3680 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3681 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3682 echo "Found -l$thislib (shared)."
3685 *) dflt="$dflt -l$thislib";;
3687 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3688 echo "Found -l$thislib (shared)."
3691 *) dflt="$dflt -l$thislib";;
3693 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3694 echo "Found -l$thislib."
3697 *) dflt="$dflt -l$thislib";;
3699 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3700 echo "Found -l$thislib."
3703 *) dflt="$dflt -l$thislib";;
3705 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3706 echo "Found -l${thislib}_s."
3709 *) dflt="$dflt -l${thislib}_s";;
3711 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3712 echo "Found -l$thislib."
3715 *) dflt="$dflt -l$thislib";;
3718 echo "No -l$thislib."
3729 ' '|'') dflt='none';;
3734 In order to compile $package on your machine, a number of libraries
3735 are usually needed. Include any other special libraries here as well.
3736 Say "none" for none. The default list is almost always right.
3740 rp="What libraries to use?"
3747 : determine optimization, if desired, or use for debug flag also
3749 ' '|$undef) dflt='none';;
3751 *) dflt="$optimize";;
3755 By default, $package compiles with the -O flag to use the optimizer.
3756 Alternately, you might want to use the symbolic debugger, which uses
3757 the -g flag (on traditional Unix systems). Either flag can be
3758 specified here. To use neither flag, specify the word "none".
3761 rp="What optimizer/debugger flag should be used?"
3765 'none') optimize=" ";;
3769 : We will not override a previous value, but we might want to
3770 : augment a hint file
3772 default|recommended)
3773 case "$gccversion" in
3774 1*) dflt='-fpcc-struct-return' ;;
3777 *-g*) dflt="$dflt -DDEBUGGING";;
3779 case "$gccversion" in
3780 2*) if test -d /etc/conf/kconfig.d &&
3781 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3787 case "$gccversion" in
3791 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3792 echo 'int main(void) { return 0; }' > gcctest.c
3793 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3794 echo "Yes, it does." 2>&1
3797 echo "Leaving current flags $ccflags alone." 2>&1
3799 *) dflt="$dflt -fno-strict-aliasing" ;;
3802 echo "Nope, it doesn't, but that's ok." 2>&1
3809 case "$mips_type" in
3810 *BSD*|'') inclwanted="$locincpth $usrinc";;
3811 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3813 for thisincl in $inclwanted; do
3814 if $test -d $thisincl; then
3815 if $test x$thisincl != x$usrinc; then
3818 *) dflt="$dflt -I$thisincl";;
3824 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3826 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3834 *) dflt="$dflt -D$2";;
3838 set signal.h LANGUAGE_C; eval $inctest
3842 ccflags="$ccflags -DSOCKS"
3847 default|recommended) dflt="$ccflags $dflt" ;;
3848 *) dflt="$ccflags";;
3856 Your C compiler may want other flags. For this question you should include
3857 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3858 but you should NOT include libraries or ld flags like -lwhatever. If you
3859 want $package to honor its debug switch, you should include -DDEBUGGING here.
3860 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3862 To use no flags, specify the word "none".
3868 rp="Any additional cc flags?"
3875 : the following weeds options from ccflags that are of no interest to cpp
3877 case "$gccversion" in
3878 1*) cppflags="$cppflags -D__GNUC__"
3880 case "$mips_type" in
3882 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3888 echo "Let me guess what the preprocessor flags are..." >&4
3902 *) ftry="$previous $flag";;
3904 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3905 >cpp1.out 2>/dev/null && \
3906 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3907 >cpp2.out 2>/dev/null && \
3908 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3909 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3911 cppflags="$cppflags $ftry"
3921 *-*) echo "They appear to be: $cppflags";;
3923 $rm -f cpp.c cpp?.out
3927 : flags used in final linking phase
3929 '') if ./venix; then
3935 *-posix*) dflt="$dflt -posix" ;;
3938 *) dflt="$ldflags";;
3941 : Try to guess additional flags to pick up local libraries.
3942 for thislibdir in $libpth; do
3943 case " $loclibpth " in
3946 *"-L$thislibdir "*) ;;
3947 *) dflt="$dflt -L$thislibdir" ;;
3959 Your C linker may need flags. For this question you should
3960 include -L/whatever and any other flags used by the C linker, but you
3961 should NOT include libraries like -lwhatever.
3963 Make sure you include the appropriate -L/path flags if your C linker
3964 does not normally search all of the directories you specified above,
3967 To use no flags, specify the word "none".
3971 rp="Any additional ld flags (NOT including libraries)?"
3977 rmlist="$rmlist pdp11"
3981 echo "Checking your choice of C compiler and flags for coherency..." >&4
3982 $cat > try.c <<'EOF'
3984 int main() { printf("Ok\n"); exit(0); }
3986 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3988 $cat >try.msg <<'EOM'
3989 I've tried to compile and run the following simple program:
3992 $cat try.c >> try.msg
3994 $cat >> try.msg <<EOM
4001 and I got the following output:
4005 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4006 if sh -c './try' >>try.msg 2>&1; then
4010 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4013 cat >> try.msg <<'EOQS'
4014 If $libs contains -lsfio, and sfio is mis-configured, then it
4015 sometimes (apparently) runs and exits with a 0 status, but with no
4016 output! It may have to do with sfio's use of _exit vs. exit.
4019 rp="You have a big problem. Shall I abort Configure"
4026 echo "The program compiled OK, but exited with status $?." >>try.msg
4027 rp="You have a problem. Shall I abort Configure"
4031 echo "I can't compile the test program." >>try.msg
4032 rp="You have a BIG problem. Shall I abort Configure"
4038 case "$knowitall" in
4040 echo "(The supplied flags or libraries might be incorrect.)"
4048 *) echo "Ok. Stopping Configure." >&4
4053 n) echo "OK, that should do.";;
4055 $rm -f try try.* core
4057 : define an is-a-typedef? function
4058 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4060 "") inclist="sys/types.h";;
4062 eval "varval=\$$var";
4066 for inc in $inclist; do
4067 echo "#include <$inc>" >>temp.c;
4069 echo "#ifdef $type" >> temp.c;
4070 echo "printf(\"We have $type\");" >> temp.c;
4071 echo "#endif" >> temp.c;
4072 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4073 if $contains $type temp.E >/dev/null 2>&1; then
4079 *) eval "$var=\$varval";;
4082 : define an is-a-typedef? function that prompts if the type is not available.
4083 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4085 "") inclist="sys/types.h";;
4087 eval "varval=\$$var";
4091 for inc in $inclist; do
4092 echo "#include <$inc>" >>temp.c;
4094 echo "#ifdef $type" >> temp.c;
4095 echo "printf(\"We have $type\");" >> temp.c;
4096 echo "#endif" >> temp.c;
4097 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4099 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4100 if $contains $type temp.E >/dev/null 2>&1; then
4101 echo "$type found." >&4;
4104 echo "$type NOT found." >&4;
4110 *) eval "$var=\$varval";;
4113 : define a shorthand compile call
4117 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4118 : define a shorthand compile call for compilations that should be ok.
4122 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4124 : check for lengths of integral types
4128 echo "Checking to see how big your integers are..." >&4
4129 $cat >intsize.c <<'EOCP'
4133 printf("intsize=%d;\n", (int)sizeof(int));
4134 printf("longsize=%d;\n", (int)sizeof(long));
4135 printf("shortsize=%d;\n", (int)sizeof(short));
4140 if eval $compile_ok && ./intsize > /dev/null; then
4142 echo "Your integers are $intsize bytes long."
4143 echo "Your long integers are $longsize bytes long."
4144 echo "Your short integers are $shortsize bytes long."
4148 Help! I can't compile and run the intsize test program: please enlighten me!
4149 (This is probably a misconfiguration in your system or libraries, and
4150 you really ought to fix it. Still, I'll try anyway.)
4154 rp="What is the size of an integer (in bytes)?"
4158 rp="What is the size of a long integer (in bytes)?"
4162 rp="What is the size of a short integer (in bytes)?"
4168 $rm -f intsize intsize.*
4170 : see what type lseek is declared as in the kernel
4171 rp="What is the type used for lseek's offset on this system?"
4172 set off_t lseektype long stdio.h sys/types.h
4176 $echo $n "Checking to see how big your file offsets are...$c" >&4
4178 #include <sys/types.h>
4182 printf("%d\n", (int)sizeof($lseektype));
4187 if eval $compile_ok; then
4189 $echo " $lseeksize bytes." >&4
4193 echo "(I can't seem to compile the test program. Guessing...)"
4194 rp="What is the size of your file offsets (in bytes)?"
4200 : see what type file positions are declared as in the library
4201 rp="What is the type for file position used by fsetpos()?"
4202 set fpos_t fpostype long stdio.h sys/types.h
4207 *_t) zzz="$fpostype" ;;
4210 $echo $n "Checking the size of $zzz...$c" >&4
4212 #include <sys/types.h>
4215 printf("%d\n", (int)sizeof($fpostype));
4220 if eval $compile_ok; then
4225 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4228 echo " $fpossize bytes."
4234 echo "(I can't compile the test program. Guessing...)" >&4
4235 rp="What is the size of your file positions (in bytes)?"
4242 case "$lseeksize:$fpossize" in
4245 You can have files larger than 2 gigabytes.
4250 Perl can be built to understand large files (files larger than 2 gigabytes)
4251 on some systems. To do so, Configure must be run with -Duselargefiles.
4253 If this doesn't make any sense to you, just accept the default 'y'.
4255 case "$uselargefiles" in
4256 "$undef"|false|[nN]*) dflt='n' ;;
4259 rp='Try to understand large files, if available?'
4262 y|Y) val="$define" ;;
4269 case "$uselargefiles" in
4271 : Look for a hint-file generated 'call-back-unit'. If the
4272 : user has specified that a large files perl is to be built,
4273 : we may need to set or change some other defaults.
4274 if $test -f uselfs.cbu; then
4275 echo "Your platform has some specific hints for large file builds, using them..."
4278 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4280 #include <sys/types.h>
4284 printf("%d\n", (int)sizeof($lseektype));
4289 if eval $compile_ok; then
4291 $echo " $lseeksize bytes." >&4
4295 echo "(I can't seem to compile the test program. Guessing...)"
4296 rp="What is the size of your file offsets (in bytes)?"
4301 *_t) zzz="$fpostype" ;;
4304 $echo $n "Rechecking the size of $zzz...$c" >&4
4306 #include <sys/types.h>
4309 printf("%d\n", (int)sizeof($fpostype));
4314 if eval $compile_ok; then
4319 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4322 echo " $fpossize bytes."
4328 echo "(I can't compile the test program. Guessing...)" >&4
4329 rp="What is the size of your file positions (in bytes)?"
4339 case "$usemorebits" in
4340 "$define"|true|[yY]*)
4342 uselongdouble="$define"
4343 usemorebits="$define"
4345 *) usemorebits="$undef"
4350 case "$intsize:$longsize" in
4353 You have natively 64-bit integers.
4358 Perl can be built to take advantage of 64-bit integer types
4359 on some systems. To do so, Configure must be run with -Duse64bits.
4361 If this doesn't make any sense to you, just accept the default.
4363 case "$use64bits" in
4364 $define|true|[yY]*) dflt='y';;
4367 rp='Try to use 64-bit integers, if available?'
4370 y|Y) val="$define" ;;
4378 case "$archname64" in
4379 '') archname64='' ;; # not a typo
4382 case "$use64bits" in
4383 "$define"|true|[yY]*)
4384 : Look for a hint-file generated 'call-back-unit'. If the
4385 : user has specified that a 64-bit perl is to be built,
4386 : we may need to set or change some other defaults.
4387 if $test -f use64bits.cbu; then
4388 echo "Your platform has some specific hints for 64-bit builds, using them..."
4392 (Your platform doesn't have any specific hints for 64-bit builds.)
4394 case "$intsize:$longsize" in
4396 (This is probably okay, as your system is a natively 64-bit system.)
4400 case "$gccversion" in
4402 *) case "$ccflags" in
4403 *-DUSE_LONG_LONG*) ;;
4405 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4406 to the compilation flags.
4408 ccflags="$ccflags -DUSE_LONG_LONG"
4417 : determine the architecture name
4419 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4420 tarch=`arch`"-$osname"
4421 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4422 if uname -m > tmparch 2>&1 ; then
4423 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4424 -e 's/$/'"-$osname/" tmparch`
4432 case "$myarchname" in
4435 echo "(Your architecture name used to be $myarchname.)"
4442 *) dflt="$archname";;
4444 rp='What is your architecture name'
4447 case "$usethreads" in
4449 echo "Threads selected." >&4
4451 *-thread*) echo "...and architecture name already has -thread." >&4
4453 *) archname="$archname-thread"
4454 echo "...setting architecture name to $archname." >&4
4459 case "$usemultiplicity" in
4461 echo "Multiplicity selected." >&4
4463 *-multi*) echo "...and architecture name already has -multi." >&4
4465 *) archname="$archname-multi"
4466 echo "...setting architecture name to $archname." >&4
4471 case "$use64bits" in
4473 case "$archname64" in
4478 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4480 *) archname="$archname-$archname64"
4481 echo "...setting architecture name to $archname." >&4
4488 : determine root of directory hierarchy where package will be installed.
4491 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4499 By default, $package will be installed in $dflt/bin, manual pages
4500 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4501 installation directories. Typically this is something like /usr/local.
4502 If you wish to have binaries under /usr/bin but other parts of the
4503 installation under /usr/local, that's ok: you will be prompted
4504 separately for each of the installation directories, the prefix being
4505 only used to set the defaults.
4509 rp='Installation prefix to use?'
4517 *) oldprefix="$prefix";;
4527 $define|true) afs=true ;;
4528 $undef|false) afs=false ;;
4529 *) if test -d /afs; then
4537 echo "AFS may be running... I'll be extra cautious then..." >&4
4539 echo "AFS does not seem to be running..." >&4
4542 : determine installation prefix for where package is to be installed.
4546 Since you are running AFS, I need to distinguish the directory in which
4547 files will reside from the directory in which they are installed (and from
4548 which they are presumably copied to the former directory by occult means).
4551 case "$installprefix" in
4552 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4553 *) dflt="$installprefix";;
4558 In some special cases, particularly when building $package for distribution,
4559 it is convenient to distinguish between the directory in which files should
4560 be installed from the directory ($prefix) in which they
4561 will eventually reside. For most users, these two directories are the same.
4564 case "$installprefix" in
4566 *) dflt=$installprefix;;
4570 rp='What installation prefix should I use for installing files?'
4572 installprefix="$ans"
4573 installprefixexp="$ansexp"
4575 : set the prefixit variable, to compute a suitable default value
4576 prefixit='case "$3" in
4578 case "$oldprefix" in
4579 "") eval "$1=\"\$$2\"";;
4586 ""|" ") eval "$1=\"\$$2\"";;
4592 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4594 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4595 /*-$oldprefix/*|\~*-$oldprefix/*)
4596 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4597 *) eval "$1=\"\$$2\"";;
4601 : set the base revision
4604 : get the patchlevel
4606 echo "Getting the current patchlevel..." >&4
4607 if $test -r $rsrc/patchlevel.h;then
4608 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4609 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4610 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
4616 $echo $n "(You have $package" $c
4619 *) $echo $n " $baserev" $c ;;
4621 $echo $n " patchlevel $patchlevel" $c
4622 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4625 if test 0 -eq "$subversion"; then
4626 version=`LC_ALL=C; export LC_ALL; \
4627 echo $baserev $patchlevel | \
4628 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
4630 version=`LC_ALL=C; export LC_ALL; \
4631 echo $baserev $patchlevel $subversion | \
4632 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
4635 : determine installation style
4636 : For now, try to deduce it from prefix unless it is already set.
4637 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4638 case "$installstyle" in
4639 '') case "$prefix" in
4640 *perl*) dflt='lib';;
4641 *) dflt='lib/perl5' ;;
4644 *) dflt='lib/perl5' ;;
4646 : Probably not worth prompting for this since we prompt for all
4647 : the directories individually, and the prompt would be too long and
4651 : determine where private library files go
4652 : Usual default is /usr/local/lib/perl5/$version.
4653 : Also allow things like /opt/perl/lib/$version, since
4654 : /opt/perl/lib/perl5... would be redundant.
4655 : The default "style" setting is made in installstyle.U
4656 case "$installstyle" in
4657 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4658 *) set dflt privlib lib/$version ;;
4663 There are some auxiliary files for $package that need to be put into a
4664 private library directory that is accessible by everyone.
4668 rp='Pathname where the private library files will reside?'
4671 privlibexp="$ansexp"
4672 : Change installation prefix, if necessary.
4673 if $test X"$prefix" != X"$installprefix"; then
4674 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4676 installprivlib="$privlibexp"
4679 : set the prefixup variable, to restore leading tilda escape
4680 prefixup='case "$prefixexp" in
4682 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4685 : determine where public architecture dependent libraries go
4688 : privlib default is /usr/local/lib/$package/$version
4689 : archlib default is /usr/local/lib/$package/$version/$archname
4690 : privlib may have an optional trailing /share.
4691 tdflt=`echo $privlib | $sed 's,/share$,,'`
4692 tdflt=$tdflt/$archname
4701 $spackage contains architecture-dependent library files. If you are
4702 sharing libraries in a heterogeneous environment, you might store
4703 these files in a separate location. Otherwise, you can just include
4704 them with the rest of the public library files.
4708 rp='Where do you want to put the public architecture-dependent libraries?'
4711 archlibexp="$ansexp"
4712 if $test X"$archlib" = X"$privlib"; then
4717 : Change installation prefix, if necessary.
4718 if $test X"$prefix" != X"$installprefix"; then
4719 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4721 installarchlib="$archlibexp"
4725 : Binary compatibility with 5.005 is not possible for builds
4726 : with advanced features
4727 case "$usethreads$usemultiplicity" in
4729 bincompat5005="$undef"
4730 d_bincompat5005="$undef"
4734 Perl 5.006 can be compiled for binary compatibility with 5.005.
4735 If you decide to do so, you will be able to continue using most
4736 of the extensions that were compiled for Perl 5.005.
4739 case "$bincompat5005$d_bincompat5005" in
4740 *"$undef"*) dflt=n ;;
4743 rp='Binary compatibility with Perl 5.005?'
4746 y*) val="$define" ;;
4751 case "$d_bincompat5005" in
4753 bincompat5005="$define"
4755 *) bincompat5005="$undef"
4756 d_bincompat5005="$undef"
4763 : see if setuid scripts can be secure
4766 Some kernels have a bug that prevents setuid #! scripts from being
4767 secure. Some sites have disabled setuid #! scripts because of this.
4769 First let's decide if your kernel supports secure setuid #! scripts.
4770 (If setuid #! scripts would be secure but have been disabled anyway,
4771 don't say that they are secure if asked.)
4776 if $test -d /dev/fd; then
4777 echo "#!$ls" >reflect
4778 chmod +x,u+s reflect
4779 ./reflect >flect 2>&1
4780 if $contains "/dev/fd" flect >/dev/null; then
4781 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4785 If you are not sure if they are secure, I can check but I'll need a
4786 username and password different from the one you are using right now.
4787 If you don't have such a username or don't want me to test, simply
4791 rp='Other username to test security of setuid scripts with?'
4796 case "$d_suidsafe" in
4797 '') echo "I'll assume setuid scripts are *not* secure." >&4
4800 echo "Well, the $hint value is *not* secure." >&4
4802 *) echo "Well, the $hint value *is* secure." >&4
4807 $rm -f reflect flect
4808 echo "#!$ls" >reflect
4809 chmod +x,u+s reflect
4812 echo '"su" will (probably) prompt you for '"$ans's password."
4813 su $ans -c './reflect >flect'
4814 if $contains "/dev/fd" flect >/dev/null; then
4815 echo "Okay, it looks like setuid scripts are secure." >&4
4818 echo "I don't think setuid scripts are secure." >&4
4823 rp='Does your kernel have *secure* setuid scripts?'
4826 [yY]*) val="$define";;
4831 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4832 echo "(That's for file descriptors, not floppy disks.)"
4838 $rm -f reflect flect
4840 : now see if they want to do setuid emulation
4843 case "$d_suidsafe" in
4846 echo "No need to emulate SUID scripts since they are secure here." >& 4
4850 Some systems have disabled setuid scripts, especially systems where
4851 setuid scripts cannot be secure. On systems where setuid scripts have
4852 been disabled, the setuid/setgid bits on scripts are currently
4853 useless. It is possible for $package to detect those bits and emulate
4854 setuid/setgid in a secure fashion. This emulation will only work if
4855 setuid scripts have been disabled in your kernel.
4859 "$define") dflt=y ;;
4862 rp="Do you want to do setuid/setgid emulation?"
4865 [yY]*) val="$define";;
4873 : determine filename position in cpp output
4875 echo "Computing filename position in cpp output for #include directives..." >&4
4876 echo '#include <stdio.h>' > foo.c
4879 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4880 $grep '^[ ]*#.*stdio\.h' | \
4881 while read cline; do
4884 while $test \$# -gt 0; do
4885 if $test -r \`echo \$1 | $tr -d '"'\`; then
4890 pos=\`expr \$pos + 1\`
4902 *) pos="${fieldn}th";;
4904 echo "Your cpp writes the filename in the $pos field of the line."
4906 : locate header file
4911 for usrincdir in $usrinc
4913 if test -f \$usrincdir/\$wanted; then
4914 echo "\$usrincdir/\$wanted"
4918 awkprg='{ print \$$fieldn }'
4919 echo "#include <\$wanted>" > foo\$\$.c
4920 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4921 $grep "^[ ]*#.*\$wanted" | \
4922 while read cline; do
4923 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4925 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4926 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4931 # status = 0: grep returned 0 lines, case statement not executed
4932 # status = 1: headerfile found
4933 # status = 2: while loop executed, no headerfile found
4937 if test \$status -eq 1; then
4944 : define an alternate in-header-list? function
4945 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4946 cont=true; xxf="echo \"<\$1> found.\" >&4";
4947 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4948 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4950 case $# in 4) instead=instead;; *) instead="at last";; esac;
4951 while $test "$cont"; do
4953 var=$2; eval "was=\$$2";
4954 if $test "$xxx" && $test -r "$xxx";
4956 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4959 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4960 set $yyy; shift; shift; yyy=$@;
4961 case $# in 0) cont="";;
4962 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4963 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4964 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4965 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4969 do set $yyy; var=$2; eval "was=\$$2";
4970 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4971 set $yyy; shift; shift; yyy=$@;
4974 : see if this is a malloc.h system
4975 set malloc.h i_malloc
4978 : see if stdlib is available
4979 set stdlib.h i_stdlib
4982 : determine which malloc to compile in
4984 case "$usemymalloc" in
4985 ''|[yY]*|true|$define) dflt='y' ;;
4988 rp="Do you wish to attempt to use the malloc that comes with $package?"
4994 mallocsrc='malloc.c'
4995 mallocobj="malloc$_o"
4996 d_mymalloc="$define"
4999 : Remove malloc from list of libraries to use
5000 echo "Removing unneeded -lmalloc from library list" >&4
5001 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5004 echo "libs = $libs" >&4
5016 : compute the return types of malloc and free
5018 $cat >malloc.c <<END
5022 #include <sys/types.h>
5036 case "$malloctype" in
5038 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5045 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5049 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5056 echo "Your system uses $freetype free(), it would seem." >&4
5060 The installation process will also create a directory for
5061 vendor-supplied add-ons. Vendors who supply perl with their system
5062 may find it convenient to place all vendor-supplied files in this
5063 directory rather than in the main distribution directory. This will
5064 ease upgrades between binary-compatible maintenance versions of perl.
5066 Of course you may also use these directories in whatever way you see
5067 fit. For example, you might use them to access modules shared over a
5068 company-wide network.
5070 The default answer should be fine for most people.
5071 This causes further questions about vendor add-ons to be skipped
5072 and no vendor-specific directories will be configured for perl.
5075 rp='Do you want to configure vendor-specific add-on directories?'
5076 case "$usevendorprefix" in
5077 define|true|[yY]*) dflt=y ;;
5083 rp='Installation prefix to use for vendor-supplied add-ons?'
5084 case "$vendorprefix" in
5086 *) dflt=$vendorprefix ;;
5090 case "$vendorprefix" in
5094 *) oldvendorprefix="$prefix";;
5098 usevendorprefix="$define"
5100 vendorprefixexp="$ansexp"
5102 *) usevendorprefix="$undef"
5108 case "$vendorprefix" in
5109 '') d_vendorlib="$undef"
5113 *) d_vendorlib="$define"
5114 : determine where vendor-supplied modules go.
5115 : Usual default is /usr/local/lib/perl5/vendor_perl
5116 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5117 case "$installstyle" in
5118 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
5119 *) dflt=$vendorprefix/lib/vendor_$prog ;;
5122 rp='Pathname for the vendor-supplied library files?'
5125 vendorlibexp="$ansexp"
5126 : Change installation prefix, if necessary.
5127 if $test X"$prefix" != X"$installprefix"; then
5128 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5130 installvendorlib="$vendorlibexp"
5135 : Cruising for prototypes
5137 echo "Checking out function prototypes..." >&4
5138 $cat >prototype.c <<'EOCP'
5139 int main(int argc, char *argv[]) {
5142 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5143 echo "Your C compiler appears to support function prototypes."
5146 echo "Your C compiler doesn't seem to understand function prototypes."
5153 case "$prototype" in
5155 *) ansi2knr='ansi2knr'
5160 This version of $package can only be compiled by a compiler that
5161 understands function prototypes. Unfortunately, your C compiler
5163 doesn't seem to understand them. Sorry about that.
5165 If GNU cc is available for your system, perhaps you could try that instead.
5167 Eventually, we hope to support building Perl with pre-ANSI compilers.
5168 If you would like to help in that effort, please contact <perlbug@perl.org>.
5170 Aborting Configure now.
5176 : determine where public executables go
5181 rp='Pathname where the public executables will reside?'
5183 if $test "X$ansexp" != "X$binexp"; then
5188 : Change installation prefix, if necessary.
5189 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5190 if $test X"$prefix" != X"$installprefix"; then
5191 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5193 installbin="$binexp"
5196 : determine whether to install perl also as /usr/bin/perl
5199 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5201 Many scripts expect to perl to be installed as /usr/bin/perl.
5202 I can install the perl you are about to compile also as /usr/bin/perl
5203 (in addition to $installbin/perl).
5205 case "$installusrbinperl" in
5206 "$undef"|[nN]*) dflt='n';;
5209 rp="Do you want to install perl as /usr/bin/perl?"
5212 [yY]*) val="$define";;
5218 set installusrbinperl
5222 echo "Checking for GNU C Library..." >&4
5223 cat >gnulibc.c <<EOM
5235 if eval $compile_ok && ./gnulibc; then
5237 echo "You are using the GNU C Library"
5240 echo "You are not using the GNU C Library"
5246 : see if nm is to be used to determine whether a symbol is defined or not
5250 case "$d_gnulibc" in
5253 echo "nm probably won't work on the GNU C Library." >&4
5259 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5261 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5262 echo "'nm' won't be sufficient on this sytem." >&4
5268 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5269 if $test $dflt -gt 20; then
5279 true|$define) dflt=y;;
5286 I can use $nm to extract the symbols from your C libraries. This
5287 is a time consuming task which may generate huge output on the disk (up
5288 to 3 megabytes) but that should make the symbols extraction faster. The
5289 alternative is to skip the 'nm' extraction part and to compile a small
5290 test program instead to determine whether each symbol is present. If
5291 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5292 this may be the best solution.
5294 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5297 rp="Shall I use $nm to extract C symbols from the libraries?"
5300 [Nn]*) usenm=false;;
5309 : nm options which may be necessary
5311 '') if $test -f /mach_boot; then
5313 elif $test -d /usr/ccs/lib; then
5314 nm_opt='-p' # Solaris (and SunOS?)
5315 elif $test -f /dgux; then
5317 elif $test -f /lib64/rld; then
5318 nm_opt='-p' # 64-bit Irix
5324 : nm options which may be necessary for shared libraries but illegal
5325 : for archive libraries. Thank you, Linux.
5326 case "$nm_so_opt" in
5327 '') case "$myuname" in
5329 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5330 nm_so_opt='--dynamic'
5339 : get list of predefined functions in a handy place
5344 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5351 *) for thislib in $libs; do
5354 : Handle C library specially below.
5357 thislib=`echo $thislib | $sed -e 's/^-l//'`
5358 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5360 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5362 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5364 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5366 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5368 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5370 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5375 libnames="$libnames $try"
5377 *) libnames="$libnames $thislib" ;;
5386 for xxx in $libpth; do
5387 $test -r $1 || set $xxx/libc.$so
5388 : The messy sed command sorts on library version numbers.
5390 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5391 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5393 s/[0-9][0-9]*/0000&/g
5394 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5397 sort | $sed -e 's/^.* //'`
5400 $test -r $1 || set /usr/ccs/lib/libc.$so
5401 $test -r $1 || set /lib/libsys_s$_a
5407 if $test -r "$1"; then
5408 echo "Your (shared) C library seems to be in $1."
5410 elif $test -r /lib/libc && $test -r /lib/clib; then
5411 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5413 libc='/lib/clib /lib/libc'
5414 if $test -r /lib/syslib; then
5415 echo "(Your math library is in /lib/syslib.)"
5416 libc="$libc /lib/syslib"
5418 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5419 echo "Your C library seems to be in $libc, as you said before."
5420 elif $test -r $incpath/usr/lib/libc$_a; then
5421 libc=$incpath/usr/lib/libc$_a;
5422 echo "Your C library seems to be in $libc. That's fine."
5423 elif $test -r /lib/libc$_a; then
5425 echo "Your C library seems to be in $libc. You're normal."
5427 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5429 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5430 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5431 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5433 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5435 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5438 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5440 if $test -r "$tans"; then
5441 echo "Your C library seems to be in $tans, of all places."
5447 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5451 If the guess above is wrong (which it might be if you're using a strange
5452 compiler, or your machine supports multiple models), you can override it here.
5457 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5459 I can't seem to find your C library. I've looked in the following places:
5462 $sed 's/^/ /' libpath
5465 None of these seems to contain your C library. I need to get its name...
5470 rp='Where is your C library?'
5475 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5476 set X `cat libnames`
5479 case $# in 1) xxx=file; esac
5480 echo "Extracting names from the following $xxx for later perusal:" >&4
5482 $sed 's/^/ /' libnames >&4
5484 $echo $n "This may take a while...$c" >&4
5488 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5489 *) $nm $nm_opt $file 2>/dev/null;;
5494 $grep fprintf libc.tmp > libc.ptf
5495 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5496 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5498 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5500 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5502 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5504 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5506 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5508 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5510 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5512 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5514 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5516 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5518 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5520 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5522 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5523 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5525 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5527 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5529 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5531 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5533 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5535 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5537 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5539 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5541 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5543 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5545 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5547 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5549 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5551 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5553 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5556 $nm -p $* 2>/dev/null >libc.tmp
5557 $grep fprintf libc.tmp > libc.ptf
5558 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5559 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5565 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5567 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5568 for thisname in $libnames $libc; do
5569 $ar t $thisname >>libc.tmp
5571 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5573 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5574 # Repeat libc to extract forwarders to DLL entries too
5575 for thisname in $libnames $libc; do
5576 $ar tv $thisname >>libc.tmp
5577 # Revision 50 of EMX has bug in $ar.
5578 # it will not extract forwarders to DLL entries
5579 # Use emximp which will extract exactly them.
5580 emximp -o tmp.imp $thisname \
5582 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5583 < tmp.imp >>libc.tmp
5586 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5589 echo "$ar didn't seem to work right." >&4
5590 echo "Maybe this is a Cray...trying bld instead..." >&4
5591 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5593 for thisname in $libnames; do
5595 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5596 $ar t $thisname >>libc.tmp
5600 echo "That didn't work either. Giving up." >&4
5607 if $test -f /lib/syscalls.exp; then
5609 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5610 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5614 $rm -f libnames libpath
5616 : see if dld is available
5620 : is a C symbol defined?
5623 -v) tf=libc.tmp; tc=""; tdc="";;
5624 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5625 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5628 case "$reuseval-$4" in
5630 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5636 if $contains $tlook $tf >/dev/null 2>&1;
5641 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5642 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5650 $define) tval=true;;
5656 : define an is-in-libc? function
5657 inlibc='echo " "; td=$define; tu=$undef;
5658 sym=$1; var=$2; eval "was=\$$2";
5660 case "$reuseval$was" in
5670 echo "$sym() found." >&4;
5671 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5673 echo "$sym() NOT found." >&4;
5674 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5678 $define) echo "$sym() found." >&4;;
5679 *) echo "$sym() NOT found." >&4;;
5683 : see if dlopen exists
5690 : determine which dynamic loading, if any, to compile in
5692 dldir="ext/DynaLoader"
5705 $define) dflt='y' ;;
5708 $define) dflt='y' ;;
5710 : Does a dl_xxx.xs file exist for this operating system
5711 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5714 rp="Do you wish to use dynamic loading?"
5721 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5722 dflt="$dldir/dl_${osname}.xs"
5723 elif $test "$d_dlopen" = "$define" ; then
5724 dflt="$dldir/dl_dlopen.xs"
5725 elif $test "$i_dld" = "$define" ; then
5726 dflt="$dldir/dl_dld.xs"
5731 *) dflt="$dldir/$dlsrc"
5734 echo "The following dynamic loading files are available:"
5735 : Can not go over to $dldir because getfile has path hard-coded in.
5736 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5737 rp="Source file to use for dynamic loading"
5743 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5747 Some systems may require passing special flags to $cc -c to
5748 compile modules that will be used to create a shared library.
5749 To use no flags, say "none".
5752 case "$cccdlflags" in
5753 '') case "$gccversion" in
5754 '') case "$osname" in
5756 next) dflt='none' ;;
5757 irix*) dflt='-KPIC' ;;
5758 svr4*|esix*|solaris) dflt='-KPIC' ;;
5759 sunos) dflt='-pic' ;;
5763 *) case "$osname" in
5764 svr4*|esix*|solaris) dflt='-fPIC' ;;
5769 *) dflt="$cccdlflags" ;;
5771 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5774 none) cccdlflags=' ' ;;
5775 *) cccdlflags="$ans" ;;
5780 Some systems use ld to create libraries that can be dynamically loaded,
5781 while other systems (such as those using ELF) use $cc.
5785 '') $cat >try.c <<'EOM'
5786 /* Test for whether ELF binaries are produced */
5791 int i = open("a.out",O_RDONLY);
5794 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5795 exit(0); /* succeed (yes, it's ELF) */
5800 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5802 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5806 echo "I'll use ld to build dynamic libraries."
5815 rp="What command should be used to create dynamic libraries?"
5821 Some systems may require passing special flags to $ld to create a
5822 library that can be dynamically loaded. If your ld flags include
5823 -L/other/path options to locate libraries outside your loader's normal
5824 search path, you may need to specify those -L options here as well. To
5825 use no flags, say "none".
5828 case "$lddlflags" in
5829 '') case "$osname" in
5830 beos) dflt='-nostart' ;;
5832 linux|irix*) dflt='-shared' ;;
5833 next) dflt='none' ;;
5834 solaris) dflt='-G' ;;
5835 sunos) dflt='-assert nodefinitions' ;;
5836 svr4*|esix*) dflt="-G $ldflags" ;;
5840 *) dflt="$lddlflags" ;;
5843 : Try to guess additional flags to pick up local libraries.
5844 : Be careful not to append to a plain 'none'
5848 for thisflag in $ldflags; do
5853 *) dflt="$dflt $thisflag" ;;
5860 ''|' ') dflt='none' ;;
5863 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5866 none) lddlflags=' ' ;;
5867 *) lddlflags="$ans" ;;
5872 Some systems may require passing special flags to $cc to indicate that
5873 the resulting executable will use dynamic linking. To use no flags,
5877 case "$ccdlflags" in
5878 '') case "$osname" in
5879 hpux) dflt='-Wl,-E' ;;
5880 linux) dflt='-rdynamic' ;;
5881 next) dflt='none' ;;
5882 sunos) dflt='none' ;;
5886 *) dflt="$ccdlflags" ;;
5888 rp="Any special flags to pass to $cc to use dynamic loading?"
5891 none) ccdlflags=' ' ;;
5892 *) ccdlflags="$ans" ;;
5906 # No dynamic loading being used, so don't bother even to prompt.
5909 *) case "$useshrplib" in
5910 '') case "$osname" in
5911 svr4*|dgux|dynixptx|esix|powerux|beos)
5913 also='Building a shared libperl is required for dynamic loading to work on your system.'
5918 also='Building a shared libperl is needed for MAB support.'
5936 The perl executable is normally obtained by linking perlmain.c with
5937 libperl${_a}, any static extensions (usually just DynaLoader), and
5938 any other libraries needed on this system (such as -lm, etc.). Since
5939 your system supports dynamic loading, it is probably possible to build
5940 a shared libperl.$so. If you will have more than one executable linked
5941 to libperl.$so, this will significantly reduce the size of each
5942 executable, but it may have a noticeable affect on performance. The
5943 default is probably sensible for your system.
5947 rp="Build a shared libperl.$so (y/n)"
5951 useshrplib='true' ;;
5952 *) useshrplib='false' ;;
5957 case "$useshrplib" in
5961 # Figure out a good name for libperl.so. Since it gets stored in
5962 # a version-specific architecture-dependent library, the version
5963 # number isn't really that important, except for making cc/ld happy.
5965 # A name such as libperl.so.3.1
5966 majmin="libperl.$so.$patchlevel.$subversion"
5967 # A name such as libperl.so.301
5968 majonly=`echo $patchlevel $subversion |
5969 $awk '{printf "%d%02d", $1, $2}'`
5970 majonly=libperl.$so.$majonly
5971 # I'd prefer to keep the os-specific stuff here to a minimum, and
5972 # rely on figuring it out from the naming of libc.
5973 case "${osname}${osvers}" in
5976 # XXX How handle the --version stuff for MAB?
5978 linux*) # ld won't link with a bare -lperl otherwise.
5981 *) # Try to guess based on whether libc has major.minor.
5983 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5984 *libc.$so.[0-9]*) dflt=$majonly ;;
5985 *) dflt=libperl.$so ;;
5995 I need to select a good name for the shared libperl. If your system uses
5996 library names with major and minor numbers, then you might want something
5997 like $majmin. Alternatively, if your system uses a single version
5998 number for shared libraries, then you might want to use $majonly.
5999 Or, your system might be quite happy with a simple libperl.$so.
6001 Since the shared libperl will get installed into a version-specific
6002 architecture-dependent directory, the version number of the shared perl
6003 library probably isn't important, so the default should be o.k.
6006 rp='What name do you want to give to the shared libperl?'
6009 echo "Ok, I'll use $libperl"
6012 libperl="libperl${_a}"
6016 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6020 WARNING: Use of the shrpdir variable for the installation location of
6021 the shared $libperl is not supported. It was never documented and
6022 will not work in this version. Let me (perlbug@perl.com)
6023 know of any problems this may cause.
6029 But your current setting of $shrpdir is
6030 the default anyway, so it's harmless.
6035 Further, your current attempted setting of $shrpdir
6036 conflicts with the value of $archlibexp/CORE
6037 that installperl will use.
6044 # How will the perl executable find the installed shared $libperl?
6045 # Add $xxx to ccdlflags.
6046 # If we can't figure out a command-line option, use $shrpenv to
6047 # set env LD_RUN_PATH. The main perl makefile uses this.
6048 shrpdir=$archlibexp/CORE
6051 if "$useshrplib"; then
6054 # We'll set it in Makefile.SH...
6060 xxx="-Wl,-R$shrpdir"
6062 linux|irix*|dec_osf)
6063 xxx="-Wl,-rpath,$shrpdir"
6066 # next doesn't like the default...
6069 # beos doesn't like the default, either.
6072 # hpux doesn't like the default, either.
6073 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6076 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6082 # Only add $xxx if it isn't already in ccdlflags.
6083 case " $ccdlflags " in
6085 *) ccdlflags="$ccdlflags $xxx"
6088 Adding $xxx to the flags
6089 passed to $ld so that the perl executable will find the
6090 installed shared $libperl.
6098 # Fix ccdlflags in AIX for building external extensions.
6099 # (For building Perl itself bare -bE:perl.exp is needed,
6100 # Makefile.SH takes care of this.)
6102 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6104 # Respect a hint or command-line value.
6106 '') shrpenv="$tmp_shrpenv" ;;
6108 case "$ldlibpthname" in
6109 '') ldlibpthname=LD_LIBRARY_PATH ;;
6110 none) ldlibpthname='' ;;
6113 : determine where manual pages go
6114 set man1dir man1dir none
6118 $spackage has manual pages available in source form.
6122 echo "However, you don't have nroff, so they're probably useless to you."
6124 '') man1dir="none";;
6127 echo "If you don't want the manual sources installed, answer 'none'."
6132 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6133 lookpath="$lookpath $prefixexp/man/p_man/man1"
6134 lookpath="$lookpath $prefixexp/man/u_man/man1"
6135 lookpath="$lookpath $prefixexp/man/man.1"
6137 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6138 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6148 rp="Where do the main $spackage manual pages (source) go?"
6150 if $test "X$man1direxp" != "X$ansexp"; then
6154 man1direxp="$ansexp"
6160 : Change installation prefix, if necessary.
6161 if $test X"$prefix" != X"$installprefix"; then
6162 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6164 installman1dir="$man1direxp"
6167 : What suffix to use on installed man pages
6174 rp="What suffix should be used for the main $spackage man pages?"
6176 '') case "$man1dir" in
6190 *) dflt="$man1ext";;
6197 : see if we can have long filenames
6199 rmlist="$rmlist /tmp/cf$$"
6200 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6201 first=123456789abcdef
6202 second=/tmp/cf$$/$first
6203 $rm -f $first $second
6204 if (echo hi >$first) 2>/dev/null; then
6205 if $test -f 123456789abcde; then
6206 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6209 if (echo hi >$second) 2>/dev/null; then
6210 if $test -f /tmp/cf$$/123456789abcde; then
6212 That's peculiar... You can have filenames longer than 14 characters, but only
6213 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6214 I shall consider your system cannot support long filenames at all.
6218 echo 'You can have filenames longer than 14 characters.' >&4
6223 How confusing! Some of your filesystems are sane enough to allow filenames
6224 longer than 14 characters but some others like /tmp can't even think about them.
6225 So, for now on, I shall assume your kernel does not allow them at all.
6232 You can't have filenames longer than 14 chars. You can't even think about them!
6238 $rm -rf /tmp/cf$$ 123456789abcde*
6240 : determine where library module manual pages go
6241 set man3dir man3dir none
6245 $spackage has manual pages for many of the library modules.
6251 However, you don't have nroff, so they're probably useless to you.
6254 '') man3dir="none";;
6258 case "$d_flexfnam" in
6261 However, your system can't handle the long file names like File::Basename.3.
6264 '') man3dir="none";;
6268 echo "If you don't want the manual sources installed, answer 'none'."
6269 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6271 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6272 if $test -d "$privlib/man/man3"; then
6275 WARNING: Previous versions of perl installed man3 pages into
6276 $privlib/man/man3. This version will suggest a
6277 new default of $dflt.
6281 rp='Do you wish to preserve the old behavior?(y/n)'
6284 y*) dflt="$privlib/man/man3" ;;
6290 *) dflt="$man3dir" ;;
6294 rp="Where do the $package library man pages (source) go?"
6297 man3direxp="$ansexp"
6303 : Change installation prefix, if necessary.
6304 if $test X"$prefix" != X"$installprefix"; then
6305 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6307 installman3dir="$man3direxp"
6310 : What suffix to use on installed man pages
6316 rp="What suffix should be used for the $package library man pages?"
6318 '') case "$man3dir" in
6332 *) dflt="$man3ext";;
6339 : see if we have to deal with yellow pages, now NIS.
6340 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6341 if $test -f /usr/etc/nibindd; then
6343 echo "I'm fairly confident you're on a NeXT."
6345 rp='Do you get the hosts file via NetInfo?'
6354 y*) hostcat='nidump hosts .';;
6355 *) case "$hostcat" in
6356 nidump*) hostcat='';;
6366 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6374 rp='Are you getting the hosts file via yellow pages?'
6377 y*) hostcat='ypcat hosts';;
6378 *) hostcat='cat /etc/hosts';;
6384 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6387 '') test -f /etc/group && groupcat='cat /etc/group';;
6390 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6393 : now get the host name
6395 echo "Figuring out host name..." >&4
6396 case "$myhostname" in
6398 echo 'Maybe "hostname" will work...'
6399 if tans=`sh -c hostname 2>&1` ; then
6407 if $test "$cont"; then
6409 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6410 if tans=`cat /etc/systemid 2>&1` ; then
6412 phostname='cat /etc/systemid'
6413 echo "Whadyaknow. Xenix always was a bit strange..."
6416 elif $test -r /etc/systemid; then
6417 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6420 if $test "$cont"; then
6421 echo 'No, maybe "uuname -l" will work...'
6422 if tans=`sh -c 'uuname -l' 2>&1` ; then
6424 phostname='uuname -l'
6426 echo 'Strange. Maybe "uname -n" will work...'
6427 if tans=`sh -c 'uname -n' 2>&1` ; then
6429 phostname='uname -n'
6431 echo 'Oh well, maybe I can mine it out of whoami.h...'
6432 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6433 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6434 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6436 case "$myhostname" in
6437 '') echo "Does this machine have an identity crisis or something?"
6440 echo "Well, you said $myhostname before..."
6441 phostname='echo $myhostname';;
6447 : you do not want to know about this
6452 if $test "$myhostname" ; then
6454 rp='Your host name appears to be "'$myhostname'".'" Right?"
6462 : bad guess or no guess
6463 while $test "X$myhostname" = X ; do
6465 rp="Please type the (one word) name of your host:"
6470 : translate upper to lower if necessary
6471 case "$myhostname" in
6473 echo "(Normalizing case in your host name)"
6474 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6478 case "$myhostname" in
6480 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6481 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6482 echo "(Trimming domain name from host name--host name is now $myhostname)"
6484 *) case "$mydomain" in
6487 test "X$hostcat" = "Xypcat hosts" &&
6488 ypmatch "$myhostname" hosts 2>/dev/null |\
6489 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6492 test "X$hostcat" != "X" &&
6493 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6494 /[ ]$myhostname[ . ]/p" > hosts
6497 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6498 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6499 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6500 hosts | $sort | $uniq | \
6501 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6502 case `$echo X$dflt` in
6503 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6506 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6511 tans=`./loc resolv.conf X /etc /usr/etc`
6512 if $test -f "$tans"; then
6513 echo "(Attempting domain name extraction from $tans)"
6514 dflt=.`$sed -n -e 's/ / /g' \
6515 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6516 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6518 .) dflt=.`$sed -n -e 's/ / /g' \
6519 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6520 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6527 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6528 dflt=.`sh -c domainname 2>/dev/null`
6531 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6536 .) echo "(Lost all hope -- silly guess then)"
6542 *) dflt="$mydomain";;
6546 rp="What is your domain name?"
6556 : translate upper to lower if necessary
6559 echo "(Normalizing case in your domain name)"
6560 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6564 : a little sanity check here
6565 case "$phostname" in
6568 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6569 $myhostname$mydomain|$myhostname) ;;
6571 case "$phostname" in
6573 echo "(That doesn't agree with your whoami.h file, by the way.)"
6576 echo "(That doesn't agree with your $phostname command, by the way.)"
6586 I need to get your e-mail address in Internet format if possible, i.e.
6587 something like user@host.domain. Please answer accurately since I have
6588 no easy means to double check it. The default value provided below
6589 is most probably close to the reality but may not be valid from outside
6590 your organization...
6594 while test "$cont"; do
6596 '') dflt="$cf_by@$myhostname$mydomain";;
6597 *) dflt="$cf_email";;
6599 rp='What is your e-mail address?'
6605 rp='Address does not look like an Internet one. Use it anyway?'
6621 If you or somebody else will be maintaining perl at your site, please
6622 fill in the correct e-mail address here so that they may be contacted
6623 if necessary. Currently, the "perlbug" program included with perl
6624 will send mail to this address in addition to perlbug@perl.com. You may
6625 enter "none" for no administrator.
6628 case "$perladmin" in
6629 '') dflt="$cf_email";;
6630 *) dflt="$perladmin";;
6632 rp='Perl administrator e-mail address'
6636 : figure out how to guarantee perl startup
6637 case "$startperl" in
6639 case "$sharpbang" in
6643 I can use the #! construct to start perl on your system. This will
6644 make startup of perl scripts faster, but may cause problems if you
6645 want to share those scripts and perl is not in a standard place
6646 ($binexp/perl) on all your platforms. The alternative is to force
6647 a shell by starting the script with a single ':' character.
6651 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6654 none) startperl=": # use perl";;
6655 *) startperl="#!$ans"
6656 if $test 30 -lt `echo "$ans" | wc -c`; then
6659 WARNING: Some systems limit the #! command to 32 characters.
6660 If you experience difficulty running Perl scripts with #!, try
6661 installing Perl in a directory with a shorter pathname.
6667 *) startperl=": # use perl"
6672 echo "I'll use $startperl to start perl scripts."
6674 : figure best path for perl in scripts
6677 perlpath="$binexp/perl"
6678 case "$startperl" in
6683 I will use the "eval 'exec'" idiom to start Perl on your system.
6684 I can use the full path of your Perl binary for this purpose, but
6685 doing so may cause problems if you want to share those scripts and
6686 Perl is not always in a standard place ($binexp/perl).
6690 rp="What path shall I use in \"eval 'exec'\"?"
6697 case "$startperl" in
6699 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6702 : determine where public executable scripts go
6703 set scriptdir scriptdir
6705 case "$scriptdir" in
6708 : guess some guesses
6709 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6710 $test -d /usr/share/bin && dflt=/usr/share/bin
6711 $test -d /usr/local/script && dflt=/usr/local/script
6712 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6713 $test -d $prefixexp/script && dflt=$prefixexp/script
6717 *) dflt="$scriptdir"
6722 Some installations have a separate directory just for executable scripts so
6723 that they can mount it across multiple architectures but keep the scripts in
6724 one spot. You might, for example, have a subdirectory of /usr/share for this.
6725 Or you might just lump your scripts in with all your other executables.
6729 rp='Where do you keep publicly executable scripts?'
6731 if $test "X$ansexp" != "X$scriptdirexp"; then
6735 scriptdirexp="$ansexp"
6736 : Change installation prefix, if necessary.
6737 if $test X"$prefix" != X"$installprefix"; then
6738 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6740 installscript="$scriptdirexp"
6745 After $package is installed, you may wish to install various
6746 add-on modules and utilities. Typically, these add-ons will
6747 be installed under $prefix with the rest
6748 of this package. However, you may wish to install such add-ons
6749 elsewhere under a different prefix.
6751 If you do not wish to put everything under a single prefix, that's
6752 ok. You will be prompted for the individual locations; this siteprefix
6753 is only used to suggest the defaults.
6755 The default should be fine for most people.
6759 rp='Installation prefix to use for add-on modules and utilities?'
6760 : XXX Here might be another good place for an installstyle setting.
6761 case "$siteprefix" in
6763 *) dflt=$siteprefix ;;
6767 case "$siteprefix" in
6772 *) oldsiteprefix="$prefix";;
6777 siteprefixexp="$ansexp"
6779 : determine where site specific libraries go.
6780 : Usual default is /usr/local/lib/perl5/site_perl
6781 : The default "style" setting is made in installstyle.U
6782 : XXX No longer works with Prefixit stuff.
6783 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6784 case "$installstyle" in
6785 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog ;;
6786 *) dflt=$siteprefix/lib/site_$prog ;;
6790 The installation process will create a directory for
6791 site-specific extensions and modules. Most users find it convenient
6792 to place all site-specific files in this directory rather than in the
6793 main distribution directory.
6797 rp='Pathname for the site-specific library files?'
6800 sitelibexp="$ansexp"
6801 : Change installation prefix, if necessary.
6802 if $test X"$prefix" != X"$installprefix"; then
6803 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6805 installsitelib="$sitelibexp"
6808 : determine where site specific architecture-dependent libraries go.
6809 : sitelib default is /usr/local/lib/perl5/site_perl/
6810 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6811 : sitelib may have an optional trailing /share.
6812 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6813 tdflt="$tdflt/$apiversion/$archname"
6814 set sitearch sitearch none
6817 '') dflt="$tdflt" ;;
6818 *) dflt="$sitearch" ;;
6822 The installation process will also create a directory for
6823 architecture-dependent site-specific extensions and modules.
6827 rp='Pathname for the site-specific architecture-dependent library files?'
6830 sitearchexp="$ansexp"
6831 : Change installation prefix, if necessary.
6832 if $test X"$prefix" != X"$installprefix"; then
6833 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6835 installsitearch="$sitearchexp"
6838 : determine where add-on public executables go
6840 '') dflt=$siteprefix/bin ;;
6844 rp='Pathname where the add-on public executables should be installed?'
6847 sitebinexp="$ansexp"
6848 : Change installation prefix, if necessary.
6849 if $test X"$prefix" != X"$installprefix"; then
6850 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6852 installsitebin="$sitebinexp"
6857 Perl can be built to take advantage of long doubles which
6858 (if available) may give more accuracy and range for floating point numbers.
6860 If this doesn't make any sense to you, just accept the default 'n'.
6864 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6867 case "$uselongdouble" in
6868 $define|true|[yY]*) dflt='y';;
6871 rp='Try to use long doubles if available?'
6874 y|Y) val="$define" ;;
6880 case "$uselongdouble" in
6881 true|[yY]*) uselongdouble="$define" ;;
6884 case "$uselongdouble" in
6886 : Look for a hint-file generated 'call-back-unit'. If the
6887 : user has specified that long doubles should be used,
6888 : we may need to set or change some other defaults.
6889 if $test -f uselongdouble.cbu; then
6890 echo "Your platform has some specific hints for long doubles, using them..."
6891 . ./uselongdouble.cbu
6894 (Your platform doesn't have any specific hints for long doubles.)
6902 Perl can be built to take advantage of long longs which
6903 (if available) may give more range for integer numbers.
6905 If this doesn't make any sense to you, just accept the default 'n'.
6909 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
6912 case "$uselonglong" in
6913 $define|true|[yY]*) dflt='y';;
6916 rp='Try to use long longs if available?'
6919 y|Y) val="$define" ;;
6925 case "$uselonglong" in
6926 true|[yY]*) uselonglong="$define" ;;
6929 case "$uselonglong" in
6931 : Look for a hint-file generated 'call-back-unit'. If the
6932 : user has specified that long longs should be used,
6933 : we may need to set or change some other defaults.
6934 if $test -f uselonglong.cbu; then
6935 echo "Your platform has some specific hints for long longs, using them..."
6939 (Your platform doesn't have any specific hints for long longs.)
6947 Previous version of $package used the standard IO mechanisms as defined
6948 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6949 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6950 the default. This abstraction layer can use AT&T's sfio (if you already
6951 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6952 problems with some extension modules. Using PerlIO with stdio is safe,
6953 but it is slower than plain stdio and therefore is not the default.
6955 If this doesn't make any sense to you, just accept the default 'n'.
6957 case "$useperlio" in
6958 $define|true|[yY]*) dflt='y';;
6961 rp='Use the experimental PerlIO abstraction layer?'
6968 echo "Ok, doing things the stdio way"
6975 case "$vendorprefix" in
6976 '') d_vendorbin="$undef"
6980 *) d_vendorbin="$define"
6981 : determine where vendor-supplied executables go.
6982 dflt=$vendorprefix/bin
6984 rp='Pathname for the vendor-supplied executables directory?'
6987 vendorbinexp="$ansexp"
6988 : Change installation prefix, if necessary.
6989 if $test X"$prefix" != X"$installprefix"; then
6990 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6992 installvendorbin="$vendorbinexp"
6997 : Check how to convert floats to strings.
6998 if test "X$d_Gconvert" = X; then
7000 echo "Checking for an efficient way to convert floats to strings."
7003 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7004 char *myname = "gconvert";
7007 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7008 char *myname = "gcvt";
7011 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7012 char *myname = "sprintf";
7018 checkit(expect, got)
7022 if (strcmp(expect, got)) {
7023 printf("%s oddity: Expected %s, got %s\n",
7024 myname, expect, got);
7034 /* This must be 1st test on (which?) platform */
7035 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7036 Gconvert(0.1, 8, 0, buf);
7037 checkit("0.1", buf);
7039 Gconvert(1.0, 8, 0, buf);
7042 Gconvert(0.0, 8, 0, buf);
7045 Gconvert(-1.0, 8, 0, buf);
7048 /* Some Linux gcvt's give 1.e+5 here. */
7049 Gconvert(100000.0, 8, 0, buf);
7050 checkit("100000", buf);
7052 /* Some Linux gcvt's give -1.e+5 here. */
7053 Gconvert(-100000.0, 8, 0, buf);
7054 checkit("-100000", buf);
7059 case "$d_Gconvert" in
7060 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7061 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7062 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7063 *) xxx_list='gconvert gcvt sprintf' ;;
7066 for xxx_convert in $xxx_list; do
7067 echo "Trying $xxx_convert"
7069 set try -DTRY_$xxx_convert
7070 if eval $compile; then
7071 echo "$xxx_convert" found. >&4
7073 echo "I'll use $xxx_convert to convert floats into a string." >&4
7076 echo "...But $xxx_convert didn't work as I expected."
7079 echo "$xxx_convert NOT found." >&4
7083 case "$xxx_convert" in
7084 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7085 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7086 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7090 : check for length of double
7092 case "$doublesize" in
7094 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7095 $cat >try.c <<'EOCP'
7099 printf("%d\n", (int)sizeof(double));
7104 if eval $compile_ok; then
7106 $echo " $doublesize bytes." >&4
7109 echo "(I can't seem to compile the test program. Guessing...)"
7110 rp="What is the size of a double precision number (in bytes)?"
7118 : check for long doubles
7120 $echo $n "Checking to see if your system supports long double..." $c >&4
7121 echo 'int main() { long double x = 7.0; }' > try.c
7123 if eval $compile; then
7125 echo " Yes, it does." >&4
7128 echo " No, it doesn't." >&4
7134 : check for length of long double
7135 case "${d_longdbl}${longdblsize}" in
7138 $echo $n "Checking to see how big your long doubles are..." $c >&4
7139 $cat >try.c <<'EOCP'
7143 printf("%d\n", sizeof(long double));
7148 if eval $compile; then
7149 longdblsize=`./try$exe_ext`
7150 $echo " $longdblsize bytes." >&4
7154 echo "(I can't seem to compile the test program. Guessing...)" >&4
7155 rp="What is the size of a long double (in bytes)?"
7159 if $test "X$doublesize" = "X$longdblsize"; then
7160 echo "(That isn't any different from an ordinary double.)"
7168 if $test X"$d_longdbl" = X"$define"; then
7170 echo "Checking how to print long doubles..." >&4
7172 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7173 $cat >try.c <<'EOCP'
7174 #include <sys/types.h>
7178 printf("%.3f\n", d);
7182 if eval $compile; then
7186 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7187 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7188 echo "We will use %f."
7194 if $test X"$sPRIfldbl" = X; then
7195 $cat >try.c <<'EOCP'
7196 #include <sys/types.h>
7199 long double d = 123.456;
7200 printf("%.3llf\n", d);
7204 if eval $compile; then
7208 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7209 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7210 echo "We will use %llf."
7216 if $test X"$sPRIfldbl" = X; then
7217 $cat >try.c <<'EOCP'
7218 #include <sys/types.h>
7221 long double d = 123.456;
7222 printf("%.3Lf\n", d);
7226 if eval $compile; then
7230 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7231 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7232 echo "We will use %Lf."
7238 if $test X"$sPRIfldbl" = X; then
7239 $cat >try.c <<'EOCP'
7240 #include <sys/types.h>
7243 long double d = 123.456;
7244 printf("%.3lf\n", d);
7248 if eval $compile; then
7252 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7253 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7254 echo "We will use %lf."
7260 if $test X"$sPRIfldbl" = X; then
7261 echo "Cannot figure out how to print long doubles." >&4
7268 case "$sPRIfldbl" in
7269 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7270 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7272 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7273 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7277 : Initialize h_fcntl
7280 : Initialize h_sysfile
7283 : access call always available on UNIX
7287 : locate the flags for 'access()'
7291 $cat >access.c <<'EOCP'
7292 #include <sys/types.h>
7297 #include <sys/file.h>
7306 : check sys/file.h first, no particular reason here
7307 if $test `./findhdr sys/file.h` && \
7308 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7310 echo "<sys/file.h> defines the *_OK access constants." >&4
7311 elif $test `./findhdr fcntl.h` && \
7312 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7314 echo "<fcntl.h> defines the *_OK access constants." >&4
7315 elif $test `./findhdr unistd.h` && \
7316 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7317 echo "<unistd.h> defines the *_OK access constants." >&4
7319 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7325 : see if accessx exists
7326 set accessx d_accessx
7329 : see if alarm exists
7333 : see if atolf exists
7337 : see if atoll exists
7341 : Look for GNU-cc style attribute checking
7343 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7344 $cat >attrib.c <<'EOCP'
7346 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7348 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7349 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7350 echo "Your C compiler doesn't fully support __attribute__."
7353 echo "Your C compiler supports __attribute__."
7357 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7364 : see if bcmp exists
7368 : see if bcopy exists
7372 : see if this is a unistd.h system
7373 set unistd.h i_unistd
7376 : see if getpgrp exists
7377 set getpgrp d_getpgrp
7380 case "$d_getpgrp" in
7383 echo "Checking to see which flavor of getpgrp is in use..."
7386 #include <sys/types.h>
7388 # include <unistd.h>
7392 if (getuid() == 0) {
7393 printf("(I see you are running Configure as super-user...)\n");
7397 if (getpgrp(1) == 0)
7406 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7407 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7409 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7410 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7413 echo "I can't seem to compile and run the test program."
7415 xxx="a USG one, i.e. you use getpgrp()."
7417 # SVR4 systems can appear rather BSD-ish.
7420 xxx="a BSD one, i.e. you use getpgrp(pid)."
7424 xxx="probably a USG one, i.e. you use getpgrp()."
7429 echo "Assuming your getpgrp is $xxx" >&4
7438 : see if setpgrp exists
7439 set setpgrp d_setpgrp
7442 case "$d_setpgrp" in
7445 echo "Checking to see which flavor of setpgrp is in use..."
7448 #include <sys/types.h>
7450 # include <unistd.h>
7454 if (getuid() == 0) {
7455 printf("(I see you are running Configure as super-user...)\n");
7459 if (-1 == setpgrp(1, 1))
7462 if (setpgrp() != -1)
7468 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7469 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7471 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7472 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7475 echo "(I can't seem to compile and run the test program.)"
7477 xxx="a USG one, i.e. you use setpgrp()."
7479 # SVR4 systems can appear rather BSD-ish.
7482 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7486 xxx="probably a USG one, i.e. you use setpgrp()."
7491 echo "Assuming your setpgrp is $xxx" >&4
7499 : see if bzero exists
7503 : see if signal is declared as pointer to function returning int or void
7505 xxx=`./findhdr signal.h`
7506 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7507 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7508 echo "You have int (*signal())() instead of void." >&4
7510 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7511 echo "You have void (*signal())()." >&4
7513 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7514 echo "You have int (*signal())() instead of void." >&4
7516 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7517 echo "You have void (*signal())()." >&4
7520 case "$d_voidsig" in
7522 echo "I can't determine whether signal handler returns void or int..." >&4
7524 rp="What type does your signal handler return?"
7531 echo "As you already told me, signal handler returns void." >&4
7534 *) echo "As you already told me, signal handler returns int." >&4
7541 case "$d_voidsig" in
7542 "$define") signal_t="void";;
7547 : check for ability to cast large floats to 32-bit ints.
7549 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7550 if $test "$intsize" -ge 4; then
7557 #include <sys/types.h>
7559 $signal_t blech(s) int s; { exit(3); }
7566 signal(SIGFPE, blech);
7568 /* Don't let compiler optimize the test away. Store the number
7569 in a writable string for gcc to pass to sscanf under HP/UX.
7571 sprintf(str, "2147483647");
7572 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7576 /* x86 processors will probably give 0x8000 0000, which is a
7577 sign change. We don't want that. We want to mimic SPARC
7578 behavior here, which is to preserve the sign and give
7581 if (i32 != ($xxx) f)
7587 if eval $compile_ok; then
7591 echo "(I can't seem to compile the test program--assuming it can't)"
7599 echo "Nope, it can't."
7606 : check for ability to cast negative floats to unsigned
7608 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7611 #include <sys/types.h>
7613 $signal_t blech(s) int s; { exit(7); }
7614 $signal_t blech_in_list(s) int s; { exit(4); }
7615 unsigned long dummy_long(p) unsigned long p; { return p; }
7616 unsigned int dummy_int(p) unsigned int p; { return p; }
7617 unsigned short dummy_short(p) unsigned short p; { return p; }
7621 unsigned long along;
7623 unsigned short ashort;
7627 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7628 a direct f = -123. assignment. gcc-2.8.0 reportedly
7629 optimized the whole file away
7631 /* Store the number in a writable string for gcc to pass to
7634 sprintf(str, "-123");
7635 sscanf(str, "%lf", &f); /* f = -123.; */
7637 signal(SIGFPE, blech);
7638 along = (unsigned long)f;
7639 aint = (unsigned int)f;
7640 ashort = (unsigned short)f;
7641 if (along != (unsigned long)-123)
7643 if (aint != (unsigned int)-123)
7645 if (ashort != (unsigned short)-123)
7647 sprintf(str, "1073741824.");
7648 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7651 along = (unsigned long)f;
7652 if (along != 0x80000000)
7656 along = (unsigned long)f;
7657 if (along != 0x7fffffff)
7661 along = (unsigned long)f;
7662 if (along != 0x80000001)
7666 signal(SIGFPE, blech_in_list);
7667 sprintf(str, "123.");
7668 sscanf(str, "%lf", &f); /* f = 123.; */
7669 along = dummy_long((unsigned long)f);
7670 aint = dummy_int((unsigned int)f);
7671 ashort = dummy_short((unsigned short)f);
7672 if (along != (unsigned long)123)
7674 if (aint != (unsigned int)123)
7676 if (ashort != (unsigned short)123)
7683 if eval $compile_ok; then
7687 echo "(I can't seem to compile the test program--assuming it can't)"
7690 case "$castflags" in
7695 echo "Nope, it can't."
7702 : see if vprintf exists
7704 if set vprintf val -f d_vprintf; eval $csym; $val; then
7705 echo 'vprintf() found.' >&4
7707 $cat >vprintf.c <<'EOF'
7708 #include <varargs.h>
7710 int main() { xxx("foo"); }
7719 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7723 if eval $compile && ./vprintf; then
7724 echo "Your vsprintf() returns (int)." >&4
7727 echo "Your vsprintf() returns (char*)." >&4
7731 echo 'vprintf() NOT found.' >&4
7741 : see if chown exists
7745 : see if chroot exists
7749 : see if chsize exists
7753 : check for const keyword
7755 echo 'Checking to see if your C compiler knows about "const"...' >&4
7756 $cat >const.c <<'EOCP'
7757 typedef struct spug { int drokk; } spug;
7764 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7766 echo "Yup, it does."
7769 echo "Nope, it doesn't."
7774 : see if crypt exists
7776 if set crypt val -f d_crypt; eval $csym; $val; then
7777 echo 'crypt() found.' >&4
7781 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7782 if $test -z "$cryptlib"; then
7783 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7787 if $test -z "$cryptlib"; then
7788 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7792 if $test -z "$cryptlib"; then
7793 cryptlib=`./loc libcrypt$_a "" $libpth`
7797 if $test -z "$cryptlib"; then
7798 echo 'crypt() NOT found.' >&4
7807 : get csh whereabouts
7809 'csh') val="$undef" ;;
7814 : Respect a hint or command line value for full_csh.
7816 '') full_csh=$csh ;;
7819 : see if cuserid exists
7820 set cuserid d_cuserid
7823 : see if this is a limits.h system
7824 set limits.h i_limits
7827 : see if this is a float.h system
7831 : See if number of significant digits in a double precision number is known
7833 $cat >dbl_dig.c <<EOM
7843 printf("Contains DBL_DIG");
7846 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7847 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7848 echo "DBL_DIG found." >&4
7851 echo "DBL_DIG NOT found." >&4
7858 : see if difftime exists
7859 set difftime d_difftime
7862 : see if this is a dirent system
7864 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7866 echo "<dirent.h> found." >&4
7869 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7870 echo "<sys/dir.h> found." >&4
7873 xinc=`./findhdr sys/ndir.h`
7875 echo "<dirent.h> NOT found." >&4
7880 : Look for type of directory structure.
7882 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7884 case "$direntrytype" in
7887 $define) guess1='struct dirent' ;;
7888 *) guess1='struct direct' ;;
7891 *) guess1="$direntrytype"
7896 'struct dirent') guess2='struct direct' ;;
7897 *) guess2='struct dirent' ;;
7900 if $contains "$guess1" try.c >/dev/null 2>&1; then
7901 direntrytype="$guess1"
7902 echo "Your directory entries are $direntrytype." >&4
7903 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7904 direntrytype="$guess2"
7905 echo "Your directory entries seem to be $direntrytype." >&4
7907 echo "I don't recognize your system's directory entries." >&4
7908 rp="What type is used for directory entries on this system?"
7916 : see if the directory entry stores field length
7918 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7919 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7920 echo "Good, your directory entry keeps length information in d_namlen." >&4
7923 echo "Your directory entry does not know about the d_namlen field." >&4
7930 : see if dlerror exists
7933 set dlerror d_dlerror
7937 : see if dlfcn is available
7945 On a few systems, the dynamically loaded modules that perl generates and uses
7946 will need a different extension than shared libs. The default will probably
7954 rp='What is the extension of dynamically loaded modules'
7963 : Check if dlsym need a leading underscore
7969 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7970 $cat >dyna.c <<'EOM'
7979 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7981 #include <sys/types.h>
7995 int mode = RTLD_LAZY ;
7997 handle = dlopen("./dyna.$dlext", mode) ;
7998 if (handle == NULL) {
8003 symbol = dlsym(handle, "fred") ;
8004 if (symbol == NULL) {
8005 /* try putting a leading underscore */
8006 symbol = dlsym(handle, "_fred") ;
8007 if (symbol == NULL) {
8020 : Call the object file tmp-dyna.o in case dlext=o.
8021 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8022 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8023 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8024 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8027 1) echo "Test program failed using dlopen." >&4
8028 echo "Perhaps you should not use dynamic loading." >&4;;
8029 2) echo "Test program failed using dlsym." >&4
8030 echo "Perhaps you should not use dynamic loading." >&4;;
8031 3) echo "dlsym needs a leading underscore" >&4
8033 4) echo "dlsym doesn't need a leading underscore." >&4;;
8036 echo "I can't compile and run the test program." >&4
8037 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8042 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8047 hasproto='varname=$1; func=$2; shift; shift;
8048 while $test $# -ge 2; do
8050 $define) echo "#include <$2>";;
8054 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8055 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8056 echo "$func() prototype found.";
8059 echo "$func() prototype NOT found.";
8064 $rm -f try.c tryout.c'
8066 : see if prototype for drand48 is available
8068 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8071 : see if dup2 exists
8075 : see if eaccess exists
8076 set eaccess d_eaccess
8079 : see if endgrent exists
8080 set endgrent d_endgrent
8083 : see if endhostent exists
8084 set endhostent d_endhent
8087 : see if endnetent exists
8088 set endnetent d_endnent
8091 : see if endprotoent exists
8092 set endprotoent d_endpent
8095 : see if endpwent exists
8096 set endpwent d_endpwent
8099 : see if endservent exists
8100 set endservent d_endsent
8103 : see if endspent exists
8104 set endspent d_endspent
8107 : Locate the flags for 'open()'
8109 $cat >open3.c <<'EOCP'
8110 #include <sys/types.h>
8115 #include <sys/file.h>
8126 : check sys/file.h first to get FREAD on Sun
8127 if $test `./findhdr sys/file.h` && \
8128 set open3 -DI_SYS_FILE && eval $compile; then
8130 echo "<sys/file.h> defines the O_* constants..." >&4
8132 echo "and you have the 3 argument form of open()." >&4
8135 echo "but not the 3 argument form of open(). Oh, well." >&4
8138 elif $test `./findhdr fcntl.h` && \
8139 set open3 -DI_FCNTL && eval $compile; then
8141 echo "<fcntl.h> defines the O_* constants..." >&4
8143 echo "and you have the 3 argument form of open()." >&4
8146 echo "but not the 3 argument form of open(). Oh, well." >&4
8151 echo "I can't find the O_* constant definitions! You got problems." >&4
8157 : see which of string.h or strings.h is needed
8159 strings=`./findhdr string.h`
8160 if $test "$strings" && $test -r "$strings"; then
8161 echo "Using <string.h> instead of <strings.h>." >&4
8165 strings=`./findhdr strings.h`
8166 if $test "$strings" && $test -r "$strings"; then
8167 echo "Using <strings.h> instead of <string.h>." >&4
8169 echo "No string header found -- You'll surely have problems." >&4
8175 "$undef") strings=`./findhdr strings.h`;;
8176 *) strings=`./findhdr string.h`;;
8179 : check for non-blocking I/O stuff
8180 case "$h_sysfile" in
8181 true) echo "#include <sys/file.h>" > head.c;;
8184 true) echo "#include <fcntl.h>" > head.c;;
8185 *) echo "#include <sys/fcntl.h>" > head.c;;
8190 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8191 case "$o_nonblock" in
8194 $cat >>try.c <<'EOCP'
8198 printf("O_NONBLOCK\n");
8202 printf("O_NDELAY\n");
8206 printf("FNDELAY\n");
8213 if eval $compile_ok; then
8215 case "$o_nonblock" in
8216 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8217 *) echo "Seems like we can use $o_nonblock.";;
8220 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8223 *) echo "Using $hint value $o_nonblock.";;
8225 $rm -f try try.* .out core
8228 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8234 #include <sys/types.h>
8237 #define MY_O_NONBLOCK $o_nonblock
8238 #ifndef errno /* XXX need better Configure test */
8248 #include <strings.h>
8250 $signal_t blech(x) int x; { exit(3); }
8252 $cat >> try.c <<'EOCP'
8260 pipe(pd); /* Down: child -> parent */
8261 pipe(pu); /* Up: parent -> child */
8264 close(pd[1]); /* Parent reads from pd[0] */
8265 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8266 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8268 signal(SIGALRM, blech);
8270 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8272 sprintf(string, "%d\n", ret);
8273 write(2, string, strlen(string));
8276 if (errno == EAGAIN) {
8282 if (errno == EWOULDBLOCK)
8283 printf("EWOULDBLOCK\n");
8286 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8287 sleep(2); /* Give it time to close our pipe */
8289 ret = read(pd[0], buf, 1); /* Should read EOF */
8291 sprintf(string, "%d\n", ret);
8292 write(3, string, strlen(string));
8296 close(pd[0]); /* We write to pd[1] */
8297 close(pu[1]); /* We read from pu[0] */
8298 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8299 close(pd[1]); /* Pipe pd is now fully closed! */
8300 exit(0); /* Bye bye, thank you for playing! */
8304 if eval $compile_ok; then
8305 echo "$startsh" >mtry
8306 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8308 ./mtry >/dev/null 2>&1
8310 0) eagain=`$cat try.out`;;
8311 1) echo "Could not perform non-blocking setting!";;
8312 2) echo "I did a successful read() for something that was not there!";;
8313 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8314 *) echo "Something terribly wrong happened during testing.";;
8316 rd_nodata=`$cat try.ret`
8317 echo "A read() system call with no data present returns $rd_nodata."
8318 case "$rd_nodata" in
8321 echo "(That's peculiar, fixing that to be -1.)"
8327 echo "Forcing errno EAGAIN on read() with no data available."
8331 echo "Your read() sets errno to $eagain when no data is available."
8334 status=`$cat try.err`
8336 0) echo "And it correctly returns 0 to signal EOF.";;
8337 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8338 *) echo "However, your read() returns '$status' on EOF??";;
8341 if test "$status" = "$rd_nodata"; then
8342 echo "WARNING: you can't distinguish between EOF and no data!"
8346 echo "I can't compile the test program--assuming errno EAGAIN will do."
8353 echo "Using $hint value $eagain."
8354 echo "Your read() returns $rd_nodata when no data is present."
8355 case "$d_eofnblk" in
8356 "$define") echo "And you can see EOF because read() returns 0.";;
8357 "$undef") echo "But you can't see EOF status from read() returned value.";;
8359 echo "(Assuming you can't see EOF status from read anyway.)"
8365 $rm -f try try.* .out core head.c mtry
8367 : see if fchmod exists
8371 : see if fchown exists
8375 : see if this is an fcntl system
8379 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8380 while $test $# -ge 2; do
8382 $define) echo "#include <$2>";;
8386 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8388 if eval $compile; then
8399 : see whether socket exists
8401 $echo $n "Hmm... $c" >&4
8402 if set socket val -f d_socket; eval $csym; $val; then
8403 echo "Looks like you have Berkeley networking support." >&4
8405 if set setsockopt val -f; eval $csym; $val; then
8408 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8412 if $contains socklib libc.list >/dev/null 2>&1; then
8413 echo "Looks like you have Berkeley networking support." >&4
8415 : we will have to assume that it supports the 4.2 BSD interface
8418 echo "You don't have Berkeley networking in libc$_a..." >&4
8419 if test "X$d_socket" = "X$define"; then
8420 echo "...but you seem to believe that you have sockets." >&4
8422 for net in net socket
8424 if test -f /usr/lib/lib$net$_a; then
8425 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8426 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8427 if $contains socket libc.list >/dev/null 2>&1; then
8432 echo "...but the Wollongong group seems to have hacked it in." >&4
8433 sockethdr="-I/usr/netinclude"
8436 echo "Found Berkeley sockets interface in lib$net." >& 4
8437 if $contains setsockopt libc.list >/dev/null 2>&1; then
8440 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8447 if test "X$d_socket" != "X$define"; then
8448 echo "or anywhere else I see." >&4
8456 : see if socketpair exists
8457 set socketpair d_sockpair
8462 echo "Checking the availability of certain socket constants..." >& 4
8463 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8464 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8466 #include <sys/types.h>
8467 #include <sys/socket.h>
8473 set try; if eval $compile; then
8476 set d_${enum}; eval $setvar
8480 : see if sys/select.h has to be included
8481 set sys/select.h i_sysselct
8484 : see if we should include time.h, sys/time.h, or both
8486 if test "X$timeincl" = X; then
8487 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8488 $echo $n "I'm now running the test program...$c"
8489 $cat >try.c <<'EOCP'
8490 #include <sys/types.h>
8495 #ifdef SYSTIMEKERNEL
8498 #include <sys/time.h>
8501 #include <sys/select.h>
8510 struct timezone tzp;
8512 if (foo.tm_sec == foo.tm_sec)
8515 if (bar.tv_sec == bar.tv_sec)
8522 for s_timezone in '-DS_TIMEZONE' ''; do
8524 for s_timeval in '-DS_TIMEVAL' ''; do
8525 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8526 for i_time in '' '-DI_TIME'; do
8527 for i_systime in '-DI_SYSTIME' ''; do
8530 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8531 if eval $compile; then
8532 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8536 $echo $n "Succeeded with $flags$c"
8548 *SYSTIMEKERNEL*) i_systimek="$define"
8549 timeincl=`./findhdr sys/time.h`
8550 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8551 *) i_systimek="$undef";;
8554 *I_TIME*) i_time="$define"
8555 timeincl=`./findhdr time.h`" $timeincl"
8556 echo "We'll include <time.h>." >&4;;
8557 *) i_time="$undef";;
8560 *I_SYSTIME*) i_systime="$define"
8561 timeincl=`./findhdr sys/time.h`" $timeincl"
8562 echo "We'll include <sys/time.h>." >&4;;
8563 *) i_systime="$undef";;
8568 : check for fd_set items
8571 Checking to see how well your C compiler handles fd_set and friends ...
8573 $cat >fd_set.c <<EOCP
8574 #$i_systime I_SYS_TIME
8575 #$i_sysselct I_SYS_SELECT
8576 #$d_socket HAS_SOCKET
8577 #include <sys/types.h>
8579 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8582 #include <sys/time.h>
8585 #include <sys/select.h>
8594 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8601 set fd_set -DTRYBITS
8602 if eval $compile; then
8603 d_fds_bits="$define"
8605 echo "Well, your system knows about the normal fd_set typedef..." >&4
8607 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8608 d_fd_macros="$define"
8611 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8613 d_fd_macros="$undef"
8617 Hmm, your compiler has some difficulty with fd_set. Checking further...
8620 if eval $compile; then
8623 echo "Well, your system has some sort of fd_set available..." >&4
8625 echo "and you have the normal fd_set macros." >&4
8626 d_fd_macros="$define"
8629 but not the normal fd_set macros! Gross! More work for me...
8631 d_fd_macros="$undef"
8634 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8637 d_fd_macros="$undef"
8642 : see if fgetpos exists
8643 set fgetpos d_fgetpos
8646 : see if flock exists
8650 : see if fork exists
8654 : see if pathconf exists
8655 set pathconf d_pathconf
8658 : see if fpathconf exists
8659 set fpathconf d_fpathconf
8665 echo "Checking to see if your system supports off64_t..." >&4
8667 #include <sys/types.h>
8669 int main() { off64_t x = 7; }'
8672 if eval $compile; then
8674 echo "Yes, it does."
8677 echo "No, it doesn't."
8678 case "$lseeksize" in
8679 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8686 : check for fpos64_t
8688 echo "Checking to see if your system supports fpos64_t..." >&4
8690 #include <sys/stdio.h>
8691 int main() { fpos64_t x x = 7; }'
8694 if eval $compile; then
8696 echo "Yes, it does."
8699 echo "No, it doesn't."
8701 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8708 hasstruct='varname=$1; struct=$2; shift; shift;
8709 while $test $# -ge 2; do
8711 $define) echo "#include <$2>";;
8715 echo "int main () { struct $struct foo; }" >> try.c;
8717 if eval $compile; then
8726 : see if this is a sys/param system
8727 set sys/param.h i_sysparam
8730 : see if this is a sys/mount.h system
8731 set sys/mount.h i_sysmount
8734 : see if sys/types.h has to be included
8735 set sys/types.h i_systypes
8740 echo "Checking to see if your system supports struct fs_data..." >&4
8741 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8743 case "$d_fs_data_s" in
8744 "$define") echo "Yes, it does." ;;
8745 *) echo "No, it doesn't." ;;
8748 : see if fseeko exists
8752 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8755 : see if fsetpos exists
8756 set fsetpos d_fsetpos
8760 : see if fstatfs exists
8761 set fstatfs d_fstatfs
8765 : see if statvfs exists
8766 set statvfs d_statvfs
8769 : see if fstatvfs exists
8770 set fstatvfs d_fstatvfs
8774 : see if ftello exists
8778 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8781 : see if getgrent exists
8782 set getgrent d_getgrent
8785 : see if gethostbyaddr exists
8786 set gethostbyaddr d_gethbyaddr
8789 : see if gethostbyname exists
8790 set gethostbyname d_gethbyname
8793 : see if gethostent exists
8794 set gethostent d_gethent
8797 : see how we will look up host name
8800 if set gethostname val -f d_gethname; eval $csym; $val; then
8801 echo 'gethostname() found.' >&4
8802 d_gethname="$define"
8805 if set uname val -f d_uname; eval $csym; $val; then
8808 uname() was found, but you're running xenix, and older versions of xenix
8809 have a broken uname(). If you don't really know whether your xenix is old
8810 enough to have a broken system call, use the default answer.
8817 rp='Is your uname() broken?'
8820 n*) d_uname="$define"; call=uname;;
8823 echo 'uname() found.' >&4
8830 case "$d_gethname" in
8831 '') d_gethname="$undef";;
8834 '') d_uname="$undef";;
8836 case "$d_uname$d_gethname" in
8841 Every now and then someone has a $call() that lies about the hostname
8842 but can't be fixed for political or economic reasons. If you wish, I can
8843 pretend $call() isn't there and maybe compute hostname at run-time
8844 thanks to the '$phostname' command.
8847 rp="Shall I ignore $call() from now on?"
8850 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8853 case "$phostname" in
8855 *) case "$aphostname" in
8861 file=`./loc $file $file $pth`
8862 aphostname=`echo $file $*`
8867 case "$d_uname$d_gethname" in
8870 case "$phostname" in
8872 echo "There will be no way for $package to get your hostname." >&4;;
8874 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8878 case "$d_phostname" in
8879 '') d_phostname="$undef";;
8882 : see if this is a netdb.h system
8886 : see if prototypes for various gethostxxx netdb.h functions are available
8888 set d_gethostprotos gethostent $i_netdb netdb.h
8891 : see if getlogin exists
8892 set getlogin d_getlogin
8895 : see if getmnt exists
8899 : see if getmntent exists
8900 set getmntent d_getmntent
8903 : see if getnetbyaddr exists
8904 set getnetbyaddr d_getnbyaddr
8907 : see if getnetbyname exists
8908 set getnetbyname d_getnbyname
8911 : see if getnetent exists
8912 set getnetent d_getnent
8915 : see if prototypes for various getnetxxx netdb.h functions are available
8917 set d_getnetprotos getnetent $i_netdb netdb.h
8921 : see if getprotobyname exists
8922 set getprotobyname d_getpbyname
8925 : see if getprotobynumber exists
8926 set getprotobynumber d_getpbynumber
8929 : see if getprotoent exists
8930 set getprotoent d_getpent
8933 : see if getpgid exists
8934 set getpgid d_getpgid
8937 : see if getpgrp2 exists
8938 set getpgrp2 d_getpgrp2
8941 : see if getppid exists
8942 set getppid d_getppid
8945 : see if getpriority exists
8946 set getpriority d_getprior
8949 : see if prototypes for various getprotoxxx netdb.h functions are available
8951 set d_getprotoprotos getprotoent $i_netdb netdb.h
8954 : see if getpwent exists
8955 set getpwent d_getpwent
8959 : see if getservbyname exists
8960 set getservbyname d_getsbyname
8963 : see if getservbyport exists
8964 set getservbyport d_getsbyport
8967 : see if getservent exists
8968 set getservent d_getsent
8971 : see if prototypes for various getservxxx netdb.h functions are available
8973 set d_getservprotos getservent $i_netdb netdb.h
8976 : see if getspent exists
8977 set getspent d_getspent
8980 : see if getspnam exists
8981 set getspnam d_getspnam
8984 : see if gettimeofday or ftime exists
8985 set gettimeofday d_gettimeod
8987 case "$d_gettimeod" in
8993 val="$undef"; set d_ftime; eval $setvar
8996 case "$d_gettimeod$d_ftime" in
8999 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9003 : see if this is an grp system
9009 xxx=`./findhdr grp.h`
9010 $cppstdin $cppflags $cppminus < $xxx >$$.h
9012 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9024 set d_grpasswd; eval $setvar
9028 : see if hasmntopt exists
9029 set hasmntopt d_hasmntopt
9032 : see if this is a netinet/in.h or sys/in.h system
9033 set netinet/in.h i_niin sys/in.h i_sysin
9036 : see if arpa/inet.h has to be included
9037 set arpa/inet.h i_arpainet
9040 : see if htonl --and friends-- exists
9045 : Maybe they are macros.
9050 #include <sys/types.h>
9051 #$i_niin I_NETINET_IN
9053 #$i_arpainet I_ARPA_INET
9055 #include <netinet/in.h>
9061 #include <arpa/inet.h>
9064 printf("Defined as a macro.");
9067 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9068 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9070 echo "But it seems to be defined as a macro." >&4
9080 if set index val -f; eval $csym; $val; then
9081 if set strchr val -f d_strchr; eval $csym; $val; then
9082 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9085 echo "strchr() found." >&4
9089 echo "index() found." >&4
9094 echo "index() found." >&4
9097 if set strchr val -f d_strchr; eval $csym; $val; then
9100 echo "strchr() found." >&4
9102 echo "No index() or strchr() found!" >&4
9107 set d_strchr; eval $setvar
9109 set d_index; eval $setvar
9111 : check whether inet_aton exists
9112 set inet_aton d_inetaton
9115 : see if inttypes.h is available
9116 : we want a real compile instead of Inhdr because some systems
9117 : have an inttypes.h which includes non-existent headers
9120 #include <inttypes.h>
9122 static int32_t foo32 = 0x12345678;
9126 if eval $compile; then
9127 echo "<inttypes.h> found." >&4
9130 echo "<inttypes.h> NOT found." >&4
9139 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9141 #include <sys/types.h>
9142 #$i_inttypes I_INTTYPES
9144 #include <inttypes.h>
9146 int main() { int64_t x = 7; }
9149 if eval $compile; then
9151 echo " Yes, it does." >&4
9154 echo " No, it doesn't." >&4
9162 $cat >isascii.c <<'EOCP'
9174 if eval $compile; then
9175 echo "isascii() found." >&4
9178 echo "isascii() NOT found." >&4
9185 : see if killpg exists
9189 : see if lchown exists
9191 $cat > try.c <<'EOCP'
9192 /* System header to define __stub macros and hopefully few prototypes,
9193 which can conflict with char lchown(); below. */
9195 /* Override any gcc2 internal prototype to avoid an error. */
9196 /* We use char because int might match the return type of a gcc2
9197 builtin and then its argument prototype would still apply. */
9200 /* The GNU C library defines this for functions which it implements
9201 to always fail with ENOSYS. Some functions are actually named
9202 something starting with __ and the normal name is an alias. */
9203 #if defined (__stub_lchown) || defined (__stub___lchown)
9211 if eval $compile; then
9212 $echo "lchown() found." >&4
9215 $echo "lchown() NOT found." >&4
9221 : See if number of significant digits in a double precision number is known
9223 $cat >ldbl_dig.c <<EOM
9233 printf("Contains LDBL_DIG");
9236 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9237 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9238 echo "LDBL_DIG found." >&4
9241 echo "LDBL_DIG NOT found." >&4
9248 : see if link exists
9252 : see if localeconv exists
9253 set localeconv d_locconv
9256 : see if lockf exists
9260 : check for long long
9262 $echo $n "Checking to see if your system supports long long..." $c >&4
9263 echo 'int main() { long long x = 7; return 0; }' > try.c
9265 if eval $compile; then
9267 echo " Yes, it does." >&4
9270 echo " No, it doesn't." >&4
9276 : check for length of long long
9277 case "${d_longlong}${longlongsize}" in
9280 $echo $n "Checking to see how big your long longs are..." $c >&4
9281 $cat >try.c <<'EOCP'
9285 printf("%d\n", (int)sizeof(long long));
9290 if eval $compile_ok; then
9291 longlongsize=`./try$exe_ext`
9292 $echo " $longlongsize bytes." >&4
9296 echo "(I can't seem to compile the test program. Guessing...)"
9297 rp="What is the size of a long long (in bytes)?"
9301 if $test "X$longsize" = "X$longlongsize"; then
9302 echo "(That isn't any different from an ordinary long.)"
9308 : see if lstat exists
9312 : see if mblen exists
9316 : see if mbstowcs exists
9317 set mbstowcs d_mbstowcs
9320 : see if mbtowc exists
9324 : see if memchr exists
9328 : see if memcmp exists
9332 : see if memcpy exists
9336 : see if memmove exists
9337 set memmove d_memmove
9340 : see if memset exists
9344 : see if mkdir exists
9348 : see if mkfifo exists
9352 : see if mktime exists
9356 : see if msgctl exists
9360 : see if msgget exists
9364 : see if msgsnd exists
9368 : see if msgrcv exists
9372 : see how much of the 'msg*(2)' library is present.
9375 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9376 *"$undef"*) h_msg=false;;
9380 case "`ipcs 2>&1`" in
9381 "SVID messages"*"not configured"*)
9382 echo "Your $osname does not have the msg*(2) configured." >&4
9397 : we could also check for sys/ipc.h ...
9398 if $h_msg && $test `./findhdr sys/msg.h`; then
9399 echo "You have the full msg*(2) library." >&4
9402 echo "You don't have the full msg*(2) library." >&4
9408 : see if nice exists
9412 : see if POSIX threads are available
9413 set pthread.h i_pthread
9419 : how to create joinable pthreads
9420 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9422 echo "Checking what constant to use for creating joinable pthreads..." >&4
9423 $cat >try.c <<'EOCP'
9424 #include <pthread.h>
9426 int detachstate = JOINABLE;
9429 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9430 if eval $compile; then
9431 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9432 val="$undef" # Yes, undef.
9433 set d_old_pthread_create_joinable
9436 set old_pthread_create_joinable
9439 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9440 if eval $compile; then
9441 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9443 set d_old_pthread_create_joinable
9445 val=PTHREAD_CREATE_UNDETACHED
9446 set old_pthread_create_joinable
9449 set try -DJOINABLE=__UNDETACHED
9450 if eval $compile; then
9451 echo "You seem to use __UNDETACHED." >&4
9453 set d_old_pthread_create_joinable
9456 set old_pthread_create_joinable
9459 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9461 set d_old_pthread_create_joinable
9464 set old_pthread_create_joinable
9471 d_old_pthread_create_joinable="$undef"
9472 old_pthread_create_joinable=""
9475 : see if pause exists
9479 : see if pipe exists
9483 : see if poll exists
9488 : see whether the various POSIXish _yields exist
9490 #include <pthread.h>
9496 #ifdef PTHREAD_YIELD
9499 #ifdef PTHREAD_YIELD_NULL
9500 pthread_yield(NULL);
9506 : see if sched_yield exists
9507 set try -DSCHED_YIELD
9508 if eval $compile; then
9510 sched_yield='sched_yield()'
9514 case "$usethreads" in
9517 $define) echo 'sched_yield() found.' >&4 ;;
9518 *) echo 'sched_yield() NOT found.' >&4 ;;
9524 : see if pthread_yield exists
9525 set try -DPTHREAD_YIELD
9526 if eval $compile; then
9528 case "$sched_yield" in
9529 '') sched_yield='pthread_yield()' ;;
9532 set try -DPTHREAD_YIELD_NULL
9533 if eval $compile; then
9535 case "$sched_yield" in
9536 '') sched_yield='pthread_yield(NULL)' ;;
9542 case "$usethreads" in
9545 $define) echo 'pthread_yield() found.' >&4 ;;
9546 *) echo 'pthread_yield() NOT found.' >&4 ;;
9553 case "$sched_yield" in
9554 '') sched_yield=undef ;;
9559 : see if this is a pwd.h system
9565 xxx=`./findhdr pwd.h`
9566 $cppstdin $cppflags $cppminus < $xxx >$$.h
9568 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9576 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9584 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9592 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9600 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9608 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9616 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9624 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9636 set d_pwquota; eval $setvar
9637 set d_pwage; eval $setvar
9638 set d_pwchange; eval $setvar
9639 set d_pwclass; eval $setvar
9640 set d_pwexpire; eval $setvar
9641 set d_pwcomment; eval $setvar
9642 set d_pwgecos; eval $setvar
9643 set d_pwpasswd; eval $setvar
9649 echo "Checking which 64-bit integer type we could use..." >&4
9655 val='"unsigned int"'
9660 *) case "$longsize" in
9664 val='"unsigned long"'
9669 *) case "$uselonglong:$d_longlong:$longlongsize" in
9674 val='"unsigned long long"'
9679 *) case "$d_int64t" in
9698 '') case "$uselonglong:$d_longlong:$longlongsize" in
9700 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9701 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9705 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9710 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9715 : see if readdir and friends exist
9716 set readdir d_readdir
9718 set seekdir d_seekdir
9720 set telldir d_telldir
9722 set rewinddir d_rewinddir
9725 : see if readlink exists
9726 set readlink d_readlink
9729 : see if rename exists
9733 : see if rmdir exists
9737 : see if memory.h is available.
9742 : See if it conflicts with string.h
9748 $cppstdin $cppflags $cppminus < $strings > mem.h
9749 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9751 echo "We won't be including <memory.h>."
9761 : can bcopy handle overlapping blocks?
9766 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9773 $cat >>try.c <<'EOCP'
9776 # include <memory.h>
9779 # include <stdlib.h>
9782 # include <string.h>
9784 # include <strings.h>
9787 # include <unistd.h> /* Needed for NetBSD */
9791 char buf[128], abc[128];
9797 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9799 for (align = 7; align >= 0; align--) {
9800 for (len = 36; len; len--) {
9803 for (off = 1; off <= len; off++) {
9804 bcopy(b, b+off, len);
9805 bcopy(b+off, b, len);
9806 if (bcmp(b, abc, len))
9815 if eval $compile_ok; then
9816 if ./try 2>/dev/null; then
9820 echo "It can't, sorry."
9821 case "$d_memmove" in
9822 "$define") echo "But that's Ok since you have memmove()." ;;
9826 echo "(I can't compile the test program, so we'll assume not...)"
9827 case "$d_memmove" in
9828 "$define") echo "But that's Ok since you have memmove()." ;;
9833 $rm -f try.* try core
9837 : can memcpy handle overlapping blocks?
9842 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9849 $cat >>try.c <<'EOCP'
9852 # include <memory.h>
9855 # include <stdlib.h>
9858 # include <string.h>
9860 # include <strings.h>
9863 # include <unistd.h> /* Needed for NetBSD */
9867 char buf[128], abc[128];
9873 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9874 try to store the string in read-only memory. */
9875 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9877 for (align = 7; align >= 0; align--) {
9878 for (len = 36; len; len--) {
9880 memcpy(b, abc, len);
9881 for (off = 1; off <= len; off++) {
9882 memcpy(b+off, b, len);
9883 memcpy(b, b+off, len);
9884 if (memcmp(b, abc, len))
9893 if eval $compile_ok; then
9894 if ./try 2>/dev/null; then
9898 echo "It can't, sorry."
9899 case "$d_memmove" in
9900 "$define") echo "But that's Ok since you have memmove()." ;;
9904 echo "(I can't compile the test program, so we'll assume not...)"
9905 case "$d_memmove" in
9906 "$define") echo "But that's Ok since you have memmove()." ;;
9911 $rm -f try.* try core
9915 : can memcmp be trusted to compare relative magnitude?
9920 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9927 $cat >>try.c <<'EOCP'
9930 # include <memory.h>
9933 # include <stdlib.h>
9936 # include <string.h>
9938 # include <strings.h>
9941 # include <unistd.h> /* Needed for NetBSD */
9947 if ((a < b) && memcmp(&a, &b, 1) < 0)
9953 if eval $compile_ok; then
9954 if ./try 2>/dev/null; then
9958 echo "No, it can't (it uses signed chars)."
9961 echo "(I can't compile the test program, so we'll assume not...)"
9965 $rm -f try.* try core
9969 : see if select exists
9973 : see if semctl exists
9977 : see if semget exists
9981 : see if semop exists
9985 : see how much of the 'sem*(2)' library is present.
9988 case "$d_semctl$d_semget$d_semop" in
9989 *"$undef"*) h_sem=false;;
9993 case "`ipcs 2>&1`" in
9994 "SVID messages"*"not configured"*)
9995 echo "Your $osname does not have the sem*(2) configured." >&4
10000 set semget d_semget
10008 : we could also check for sys/ipc.h ...
10009 if $h_sem && $test `./findhdr sys/sem.h`; then
10010 echo "You have the full sem*(2) library." >&4
10013 echo "You don't have the full sem*(2) library." >&4
10019 : see whether sys/sem.h defines union semun
10021 $cat > try.c <<'END'
10022 #include <sys/types.h>
10023 #include <sys/ipc.h>
10024 #include <sys/sem.h>
10025 int main () { union semun semun; semun.buf = 0; }
10028 if eval $compile; then
10029 echo "You have union semun in <sys/sem.h>." >&4
10032 echo "You do not have union semun in <sys/sem.h>." >&4
10035 $rm -f try try.c try.h
10039 : see how to do semctl IPC_STAT
10042 : see whether semctl IPC_STAT can use union semun
10047 # define S_IRUSR S_IREAD
10048 # define S_IWUSR S_IWRITE
10049 # define S_IXUSR S_IEXEC
10051 # define S_IRUSR 0400
10052 # define S_IWUSR 0200
10053 # define S_IXUSR 0100
10055 # define S_IRGRP (S_IRUSR>>3)
10056 # define S_IWGRP (S_IWUSR>>3)
10057 # define S_IXGRP (S_IXUSR>>3)
10058 # define S_IROTH (S_IRUSR>>6)
10059 # define S_IWOTH (S_IWUSR>>6)
10060 # define S_IXOTH (S_IXUSR>>6)
10063 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10064 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10065 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10070 #include <sys/types.h>
10071 #include <sys/ipc.h>
10072 #include <sys/sem.h>
10073 #include <sys/stat.h>
10080 #$d_union_semun HAS_UNION_SEMUN
10083 #ifndef HAS_UNION_SEMUN
10086 struct semid_ds *buf;
10087 unsigned short *array;
10093 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10094 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10096 struct semid_ds argbuf;
10099 st = semctl(sem, 0, IPC_STAT, arg);
10103 # endif /* IPC_STAT */
10104 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10106 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10107 # endif /* IPC_RMID */
10108 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10110 #endif /* IPC_PRIVATE && ... */
10111 printf("semget failed: errno = %d\n", errno);
10117 if eval $compile; then
10120 semun) val="$define" ;;
10126 case "$d_semctl_semun" in
10128 echo "You can use union semun for semctl IPC_STAT." >&4
10131 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10136 : see whether semctl IPC_STAT can use struct semid_ds pointer
10137 $cat > try.c <<'END'
10138 #include <sys/types.h>
10139 #include <sys/ipc.h>
10140 #include <sys/sem.h>
10141 #include <sys/stat.h>
10149 struct semid_ds arg;
10152 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10153 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10156 st = semctl(sem, 0, IPC_STAT, &arg);
10158 printf("semid_ds\n");
10160 # endif /* IPC_STAT */
10161 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10163 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10164 # endif /* IPC_RMID */
10165 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10167 #endif /* IPC_PRIVATE && ... */
10168 printf("semget failed: errno = %d\n", errno);
10175 if eval $compile; then
10178 semid_ds) val="$define" ;;
10182 set d_semctl_semid_ds
10184 case "$d_semctl_semid_ds" in
10186 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10188 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10195 # We do not have the full sem*(2) library, so assume we can not
10201 set d_semctl_semid_ds
10206 : see if setegid exists
10207 set setegid d_setegid
10210 : see if seteuid exists
10211 set seteuid d_seteuid
10214 : see if setgrent exists
10215 set setgrent d_setgrent
10218 : see if sethostent exists
10219 set sethostent d_sethent
10222 : see if setlinebuf exists
10223 set setlinebuf d_setlinebuf
10226 : see if setlocale exists
10227 set setlocale d_setlocale
10230 : see if setnetent exists
10231 set setnetent d_setnent
10234 : see if setprotoent exists
10235 set setprotoent d_setpent
10238 : see if setpgid exists
10239 set setpgid d_setpgid
10242 : see if setpgrp2 exists
10243 set setpgrp2 d_setpgrp2
10246 : see if setpriority exists
10247 set setpriority d_setprior
10250 : see if setpwent exists
10251 set setpwent d_setpwent
10254 : see if setregid exists
10255 set setregid d_setregid
10257 set setresgid d_setresgid
10260 : see if setreuid exists
10261 set setreuid d_setreuid
10263 set setresuid d_setresuid
10266 : see if setrgid exists
10267 set setrgid d_setrgid
10270 : see if setruid exists
10271 set setruid d_setruid
10274 : see if setservent exists
10275 set setservent d_setsent
10278 : see if setsid exists
10279 set setsid d_setsid
10282 : see if setspent exists
10283 set setspent d_setspent
10286 : see if setvbuf exists
10287 set setvbuf d_setvbuf
10290 : see if sfio.h is available
10295 : see if sfio library is available
10306 : Ok, but do we want to use it.
10310 true|$define|[yY]*) dflt='y';;
10313 echo "$package can use the sfio library, but it is experimental."
10314 rp="You seem to have sfio available, do you want to try using it?"
10318 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10320 : Remove sfio from list of libraries to use
10321 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10324 echo "libs = $libs" >&4
10328 *) case "$usesfio" in
10329 true|$define|[yY]*)
10330 echo "Sorry, cannot find sfio on this machine" >&4
10331 echo "Ignoring your setting of usesfio=$usesfio" >&4
10339 $define) usesfio='true';;
10340 *) usesfio='false';;
10343 : see if shmctl exists
10344 set shmctl d_shmctl
10347 : see if shmget exists
10348 set shmget d_shmget
10351 : see if shmat exists
10354 : see what shmat returns
10357 $cat >shmat.c <<'END'
10358 #include <sys/shm.h>
10361 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10366 echo "and it returns ($shmattype)." >&4
10367 : see if a prototype for shmat is available
10368 xxx=`./findhdr sys/shm.h`
10369 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10370 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10381 set d_shmatprototype
10384 : see if shmdt exists
10388 : see how much of the 'shm*(2)' library is present.
10391 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10392 *"$undef"*) h_shm=false;;
10396 case "`ipcs 2>&1`" in
10397 "SVID shared memory"*"not configured"*)
10398 echo "Your $osname does not have the shm*(2) configured." >&4
10401 set shmctl d_shmctl
10403 set shmget d_shmget
10413 : we could also check for sys/ipc.h ...
10414 if $h_shm && $test `./findhdr sys/shm.h`; then
10415 echo "You have the full shm*(2) library." >&4
10418 echo "You don't have the full shm*(2) library." >&4
10425 : see if we have sigaction
10426 if set sigaction val -f d_sigaction; eval $csym; $val; then
10427 echo 'sigaction() found.' >&4
10428 $cat > try.c <<'EOP'
10430 #include <sys/types.h>
10431 #include <signal.h>
10434 struct sigaction act, oact;
10436 oact.sa_handler = 0;
10437 /* so that act and oact are used */
10438 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10442 if eval $compile_ok; then
10445 echo "But you don't seem to have a useable struct sigaction." >&4
10449 echo 'sigaction NOT found.' >&4
10452 set d_sigaction; eval $setvar
10453 $rm -f try try$_o try.c
10455 : see if sigsetjmp exists
10457 case "$d_sigsetjmp" in
10459 $cat >try.c <<'EOP'
10460 #include <setjmp.h>
10465 if (sigsetjmp(env,1))
10468 siglongjmp(env, 1);
10473 if eval $compile; then
10474 if ./try >/dev/null 2>&1; then
10475 echo "POSIX sigsetjmp found." >&4
10479 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10485 echo "sigsetjmp not found." >&4
10489 *) val="$d_sigsetjmp"
10490 case "$d_sigsetjmp" in
10491 $define) echo "POSIX sigsetjmp found." >&4;;
10492 $undef) echo "sigsetjmp not found." >&4;;
10500 : see if sqrtl exists
10504 : see if sys/stat.h is available
10505 set sys/stat.h i_sysstat
10509 : see if stat knows about block sizes
10511 echo "Checking to see if your struct stat has st_blocks field..." >&4
10512 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10516 : see if this is a sys/vfs.h system
10517 set sys/vfs.h i_sysvfs
10521 : see if this is a sys/statfs.h system
10522 set sys/statfs.h i_sysstatfs
10527 echo "Checking to see if your system supports struct statfs..." >&4
10528 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
10530 case "$d_statfs_s" in
10531 "$define") echo "Yes, it does." ;;
10532 *) echo "No, it doesn't." ;;
10537 : see if struct statfs knows about f_flags
10538 case "$d_statfs_s" in
10541 echo "Checking to see if your struct statfs has f_flags field..." >&4
10542 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
10546 set d_statfs_f_flags
10550 case "$d_statfs_f_flags" in
10551 "$define") echo "Yes, it does." ;;
10552 *) echo "No, it doesn't." ;;
10555 : see if _ptr and _cnt from stdio act std
10557 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10558 echo "(Looks like you have stdio.h from Linux.)"
10559 case "$stdio_ptr" in
10560 '') stdio_ptr='((fp)->_IO_read_ptr)'
10563 *) ptr_lval=$d_stdio_ptr_lval;;
10565 case "$stdio_cnt" in
10566 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10569 *) cnt_lval=$d_stdio_cnt_lval;;
10571 case "$stdio_base" in
10572 '') stdio_base='((fp)->_IO_read_base)';;
10574 case "$stdio_bufsiz" in
10575 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10578 case "$stdio_ptr" in
10579 '') stdio_ptr='((fp)->_ptr)'
10582 *) ptr_lval=$d_stdio_ptr_lval;;
10584 case "$stdio_cnt" in
10585 '') stdio_cnt='((fp)->_cnt)'
10588 *) cnt_lval=$d_stdio_cnt_lval;;
10590 case "$stdio_base" in
10591 '') stdio_base='((fp)->_base)';;
10593 case "$stdio_bufsiz" in
10594 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10597 : test whether _ptr and _cnt really work
10598 echo "Checking how std your stdio is..." >&4
10601 #define FILE_ptr(fp) $stdio_ptr
10602 #define FILE_cnt(fp) $stdio_cnt
10604 FILE *fp = fopen("try.c", "r");
10607 18 <= FILE_cnt(fp) &&
10608 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10616 if eval $compile; then
10618 echo "Your stdio acts pretty std."
10621 echo "Your stdio isn't very std."
10624 echo "Your stdio doesn't appear very std."
10630 : Can _ptr be used as an lvalue?
10631 case "$d_stdstdio$ptr_lval" in
10632 $define$define) val=$define ;;
10635 set d_stdio_ptr_lval
10638 : Can _cnt be used as an lvalue?
10639 case "$d_stdstdio$cnt_lval" in
10640 $define$define) val=$define ;;
10643 set d_stdio_cnt_lval
10646 : see if _base is also standard
10648 case "$d_stdstdio" in
10652 #define FILE_base(fp) $stdio_base
10653 #define FILE_bufsiz(fp) $stdio_bufsiz
10655 FILE *fp = fopen("try.c", "r");
10658 19 <= FILE_bufsiz(fp) &&
10659 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10666 if eval $compile; then
10668 echo "And its _base field acts std."
10671 echo "But its _base field isn't std."
10674 echo "However, it seems to be lacking the _base field."
10683 Checking how to access stdio streams by file descriptor number...
10685 case "$stdio_stream_array" in
10686 '') $cat >try.c <<EOCP
10689 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10693 for s in _iob __iob __sF
10695 set try -DSTDIO_STREAM_ARRAY=$s
10696 if eval $compile; then
10697 case "`./try$exe_ext`" in
10698 yes) stdio_stream_array=$s; break ;;
10702 $rm -f try.* try$exe_ext
10704 case "$stdio_stream_array" in
10706 I can't figure out how to access stdio streams by file descriptor number.
10708 d_stdio_stream_array="$undef"
10711 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10713 d_stdio_stream_array="$define"
10717 : see if strcoll exists
10718 set strcoll d_strcoll
10721 : check for structure copying
10723 echo "Checking to see if your C compiler can copy structs..." >&4
10724 $cat >try.c <<'EOCP'
10734 if $cc -c try.c >/dev/null 2>&1 ; then
10736 echo "Yup, it can."
10739 echo "Nope, it can't."
10745 : see if strerror and/or sys_errlist[] exist
10747 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10748 if set strerror val -f d_strerror; eval $csym; $val; then
10749 echo 'strerror() found.' >&4
10750 d_strerror="$define"
10751 d_strerrm='strerror(e)'
10752 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10753 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10754 d_syserrlst="$define"
10756 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10757 d_syserrlst="$undef"
10759 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10760 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10761 echo 'strerror() found in string header.' >&4
10762 d_strerror="$define"
10763 d_strerrm='strerror(e)'
10764 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10765 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10766 d_syserrlst="$define"
10768 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10769 d_syserrlst="$undef"
10771 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10772 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10773 d_strerror="$undef"
10774 d_syserrlst="$define"
10775 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10777 echo 'strerror() and sys_errlist[] NOT found.' >&4
10778 d_strerror="$undef"
10779 d_syserrlst="$undef"
10780 d_strerrm='"unknown"'
10784 : see if strtod exists
10785 set strtod d_strtod
10788 : see if strtol exists
10789 set strtol d_strtol
10792 : see if strtoul exists
10793 set strtoul d_strtoul
10796 : see if strtoull exists
10797 set strtoull d_strtoull
10800 : see if strxfrm exists
10801 set strxfrm d_strxfrm
10804 : see if symlink exists
10805 set symlink d_symlink
10808 : see if syscall exists
10809 set syscall d_syscall
10812 : see if sysconf exists
10813 set sysconf d_sysconf
10816 : see if system exists
10817 set system d_system
10820 : see if tcgetpgrp exists
10821 set tcgetpgrp d_tcgetpgrp
10824 : see if tcsetpgrp exists
10825 set tcsetpgrp d_tcsetpgrp
10828 : see if prototype for telldir is available
10830 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10833 : see if this is a sys/times.h system
10834 set sys/times.h i_systimes
10837 : see if times exists
10839 if set times val -f d_times; eval $csym; $val; then
10840 echo 'times() found.' >&4
10843 case "$i_systimes" in
10844 "$define") inc='sys/times.h';;
10846 rp="What is the type returned by times() on this system?"
10847 set clock_t clocktype long stdio.h sys/types.h $inc
10850 echo 'times() NOT found, hope that will do.' >&4
10855 : see if truncate exists
10856 set truncate d_truncate
10859 : see if tzname[] exists
10861 if set tzname val -a d_tzname; eval $csym; $val; then
10863 echo 'tzname[] found.' >&4
10866 echo 'tzname[] NOT found.' >&4
10871 : see if umask exists
10875 : see if ustat exists
10879 : backward compatibility for d_hvfork
10880 if test X$d_hvfork != X; then
10881 d_vfork="$d_hvfork"
10884 : see if there is a vfork
10889 : Ok, but do we want to use it. vfork is reportedly unreliable in
10890 : perl on Solaris 2.x, and probably elsewhere.
10894 case "$usevfork" in
10900 Perl can only use a vfork() that doesn't suffer from strict
10901 restrictions on calling functions or modifying global data in
10902 the child. For example, glibc-2.1 contains such a vfork()
10903 that is unsuitable. If your system provides a proper fork()
10904 call, chances are that you do NOT want perl to use vfork().
10907 rp="Do you still want to use vfork()?"
10912 echo "Ok, we won't use vfork()."
10921 $define) usevfork='true';;
10922 *) usevfork='false';;
10925 : see if this is an sysdir system
10926 set sys/dir.h i_sysdir
10929 : see if this is an sysndir system
10930 set sys/ndir.h i_sysndir
10933 : see if closedir exists
10934 set closedir d_closedir
10937 case "$d_closedir" in
10940 echo "Checking whether closedir() returns a status..." >&4
10941 cat > closedir.c <<EOM
10942 #$i_dirent I_DIRENT /**/
10943 #$i_sysdir I_SYS_DIR /**/
10944 #$i_sysndir I_SYS_NDIR /**/
10945 #$i_systypes I_SYS_TYPES /**/
10947 #if defined(I_SYS_TYPES)
10948 #include <sys/types.h>
10950 #if defined(I_DIRENT)
10951 #include <dirent.h>
10952 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10953 #include <sys/dir.h>
10957 #include <sys/ndir.h>
10961 #include <ndir.h> /* may be wrong in the future */
10963 #include <sys/dir.h>
10968 int main() { return closedir(opendir(".")); }
10971 if eval $compile_ok; then
10972 if ./closedir > /dev/null 2>&1 ; then
10973 echo "Yes, it does."
10976 echo "No, it doesn't."
10980 echo "(I can't seem to compile the test program--assuming it doesn't)"
10988 set d_void_closedir
10991 : check for volatile keyword
10993 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10994 $cat >try.c <<'EOCP'
10997 typedef struct _goo_struct goo_struct;
10998 goo_struct * volatile goo = ((goo_struct *)0);
10999 struct _goo_struct {
11004 typedef unsigned short foo_t;
11005 char *volatile foo;
11007 volatile foo_t blech;
11011 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11013 echo "Yup, it does."
11016 echo "Nope, it doesn't."
11022 : see if there is a wait4
11026 : see if waitpid exists
11027 set waitpid d_waitpid
11030 : see if wcstombs exists
11031 set wcstombs d_wcstombs
11034 : see if wctomb exists
11035 set wctomb d_wctomb
11038 : preserve RCS keywords in files with variable substitution, grrr
11043 Revision='$Revision'
11045 case "$crosscompile" in
11046 ''|[nN]*) crosscompile="$undef" ;;
11050 next|rhapsody) multiarch="$define" ;;
11052 case "$multiarch" in
11053 ''|[nN]*) multiarch="$undef" ;;
11056 : check for alignment requirements
11058 case "$crosscompile$multiarch" in
11061 You seem to be either cross-compiling or doing a multiarchitecture build,
11062 skipping the memory alignment check.
11065 case "$alignbytes" in
11066 '') alignbytes=8 ;;
11070 case "$alignbytes" in
11071 '') echo "Checking alignment constraints..." >&4
11072 $cat >try.c <<'EOCP'
11080 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11085 if eval $compile_ok; then
11089 echo "(I can't seem to compile the test program...)"
11092 *) dflt="$alignbytes"
11095 rp="Doubles must be aligned on a how-many-byte boundary?"
11103 : check for ordering of bytes in a long
11105 case "$crosscompile$multiarch" in
11108 You seem to be either cross-compiling or doing a multiarchitecture build,
11109 skipping the byteorder check.
11115 case "$byteorder" in
11118 In the following, larger digits indicate more significance. A big-endian
11119 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11120 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11121 machines may have weird orders like 3412. A Cray will report 87654321,
11122 an Alpha will report 12345678. If the test program works the default is
11124 I'm now running the test program...
11126 $cat >try.c <<'EOCP'
11133 char c[sizeof(long)];
11136 if (sizeof(long) > 4)
11137 u.l = (0x08070605L << 32) | 0x04030201L;
11140 for (i = 0; i < sizeof(long); i++)
11141 printf("%c", u.c[i]+'0');
11148 if eval $compile && ./try > /dev/null; then
11151 [1-4][1-4][1-4][1-4]|12345678|87654321)
11152 echo "(The test program ran ok.)"
11153 echo "byteorder=$dflt"
11156 ????|????????) echo "(The test program ran ok.)" ;;
11157 *) echo "(The test program didn't run right for some reason.)" ;;
11162 (I can't seem to compile the test program. Guessing big-endian...)
11165 case "$xxx_prompt" in
11167 rp="What is the order of bytes in a long?"
11181 : how do we catenate cpp tokens here?
11183 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11184 $cat >cpp_stuff.c <<'EOCP'
11185 #define RCAT(a,b)a/**/b
11186 #define ACAT(a,b)a ## b
11190 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11191 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11192 echo "Oh! Smells like ANSI's been here." >&4
11193 echo "We can catify or stringify, separately or together!"
11195 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11196 echo "Ah, yes! The good old days!" >&4
11197 echo "However, in the good old days we don't know how to stringify and"
11198 echo "catify at the same time."
11202 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11203 to have to edit the values of CAT[2-5] in config.h...
11205 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11209 : see if this is a db.h system
11215 : Check db version.
11217 echo "Checking Berkeley DB version ..." >&4
11223 #include <sys/types.h>
11228 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11229 int Major, Minor, Patch ;
11230 unsigned long Version ;
11231 (void)db_version(&Major, &Minor, &Patch) ;
11232 printf("You have Berkeley DB Version 2 or greater\n");
11234 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11235 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11236 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11237 Major, Minor, Patch) ;
11239 /* check that db.h & libdb are compatible */
11240 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11241 printf("db.h and libdb are incompatible\n") ;
11245 printf("db.h and libdb are compatible\n") ;
11247 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11248 + DB_VERSION_PATCH ;
11250 /* needs to be >= 2.3.4 */
11251 if (Version < 2003004) {
11252 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11253 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11259 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11260 printf("You have Berkeley DB Version 1\n");
11261 exit(0); /* DB version < 2: the coast is clear. */
11263 exit(1); /* <db.h> not Berkeley DB? */
11269 if eval $compile_ok && ./try; then
11270 echo 'Looks OK.' >&4
11272 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11276 : Remove db from list of libraries to use
11277 echo "Removing unusable -ldb from library list" >&4
11278 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11281 echo "libs = $libs" >&4
11291 : Check the return type needed for hash
11293 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11299 #include <sys/types.h>
11302 #ifndef DB_VERSION_MAJOR
11303 u_int32_t hash_cb (ptr, size)
11311 info.hash = hash_cb;
11315 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11316 if $contains warning try.out >>/dev/null 2>&1 ; then
11319 db_hashtype='u_int32_t'
11322 : XXX Maybe we should just give up here.
11323 db_hashtype=u_int32_t
11325 echo "Help: I can't seem to compile the db test program." >&4
11326 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11329 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11331 *) db_hashtype=u_int32_t
11336 : Check the return type needed for prefix
11338 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11344 #include <sys/types.h>
11347 #ifndef DB_VERSION_MAJOR
11348 size_t prefix_cb (key1, key2)
11356 info.prefix = prefix_cb;
11360 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11361 if $contains warning try.out >>/dev/null 2>&1 ; then
11362 db_prefixtype='int'
11364 db_prefixtype='size_t'
11367 db_prefixtype='size_t'
11368 : XXX Maybe we should just give up here.
11370 echo "Help: I can't seem to compile the db test program." >&4
11371 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11374 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11376 *) db_prefixtype='size_t'
11380 : check for void type
11382 echo "Checking to see how well your C compiler groks the void type..." >&4
11383 case "$voidflags" in
11385 $cat >try.c <<'EOCP'
11391 extern void moo(); /* function returning void */
11392 void (*goo)(); /* ptr to func returning void */
11394 void *hue; /* generic ptr */
11407 int main() { sub(); }
11409 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11410 voidflags=$defvoidused
11411 echo "Good. It appears to support void to the level $package wants.">&4
11412 if $contains warning .out >/dev/null 2>&1; then
11413 echo "However, you might get some warnings that look like this:"
11417 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11418 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11419 echo "It supports 1..."
11420 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11421 echo "It also supports 2..."
11422 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11424 echo "And it supports 4 but not 8 definitely."
11426 echo "It doesn't support 4..."
11427 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11429 echo "But it supports 8."
11432 echo "Neither does it support 8."
11436 echo "It does not support 2..."
11437 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11439 echo "But it supports 4 and 8."
11441 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11443 echo "And it supports 4 but has not heard about 8."
11445 echo "However it supports 8 but not 4."
11450 echo "There is no support at all for void."
11455 case "$voidflags" in
11457 *) $cat >&4 <<'EOM'
11458 Support flag bits are:
11459 1: basic void declarations.
11460 2: arrays of pointers to functions returning void.
11461 4: operations between pointers to and addresses of void functions.
11462 8: generic void pointers.
11465 rp="Your void support flags add up to what?"
11473 : How can we generate normalized random numbers ?
11475 echo "Looking for a random number function..." >&4
11476 case "$randfunc" in
11478 if set drand48 val -f; eval $csym; $val; then
11480 echo "Good, found drand48()." >&4
11481 elif set random val -f; eval $csym; $val; then
11483 echo "OK, found random()." >&4
11486 echo "Yick, looks like I have to use rand()." >&4
11497 *-Dmy_rand=*|*-Dmy_srand=*)
11498 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11499 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11500 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11501 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11505 while $test "$cont"; do
11506 rp="Use which function to generate random numbers?"
11508 if $test "$ans" = "$dflt"; then
11514 if set $ans val -f; eval $csym; $val; then
11518 rp="I cannot find function $ans. Use that name anyway?"
11527 case "$randfunc" in
11529 drand01="drand48()"
11535 case "$randbits" in
11537 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11539 #$i_unistd I_UNISTD
11540 #$i_stdlib I_STDLIB
11543 # include <unistd.h>
11546 # include <stdlib.h>
11551 register unsigned long tmp;
11552 register unsigned long max = 0L;
11554 for (i = 1000; i; i--) {
11555 tmp = (unsigned long) $randfunc();
11556 if (tmp > max) max = tmp;
11558 for (i = 0; max; i++)
11564 if eval $compile_ok; then
11568 echo "(I can't seem to compile the test program...)"
11575 rp="How many bits does your $randfunc() function produce?"
11579 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11580 seedfunc="s$randfunc"
11581 randseedtype=unsigned
11585 rp="How many bits does your $randfunc() function produce?"
11588 seedfunc="s$randfunc"
11589 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11590 if set $seedfunc val -f; eval $csym; $val; then
11591 echo "(Using $seedfunc() to seed random generator)"
11593 echo "(Warning: no $seedfunc() to seed random generator)"
11596 randseedtype=unsigned
11604 echo "Determining whether or not we are on an EBCDIC system..." >&4
11605 $cat >tebcdic.c <<'EOM'
11608 if ('M'==0xd4) return 0;
11615 if eval $compile_ok; then
11617 echo "You have EBCDIC." >&4
11620 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11623 echo "I'm unable to compile the test program." >&4
11624 echo "I'll assume ASCII or some ISO Latin." >&4
11626 $rm -f tebcdic.c tebcdic
11632 Checking how to flush all pending stdio output...
11634 # I only know how to find the first 32 possibly open files on SunOS.
11635 # See also hints/sunos_4_1.sh and util.c --AD
11637 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11639 $cat >>try.c <<EOCP
11641 #$i_unistd I_UNISTD
11643 # include <unistd.h>
11645 #$d_sysconf HAS_SYSCONF
11646 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11647 #ifdef HAS_STDIO_STREAM_ARRAY
11648 # define STDIO_STREAM_ARRAY $stdio_stream_array
11651 FILE* p = fopen("try.out", "w");
11655 # ifdef TRY_FPRINTF
11659 #ifdef TRY_FFLUSH_NULL
11662 #ifdef TRY_FFLUSH_ALL
11664 long open_max = -1;
11665 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11666 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11668 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11669 open_max = sysconf(_SC_OPEN_MAX);
11672 open_max = FOPEN_MAX;
11675 open_max = OPEN_MAX;
11684 # ifdef HAS_STDIO_STREAM_ARRAY
11685 if (open_max > 0) {
11687 for (i = 0; i < open_max; i++)
11688 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11689 STDIO_STREAM_ARRAY[i]._file < open_max &&
11690 STDIO_STREAM_ARRAY[i]._flag)
11691 fflush(&STDIO_STREAM_ARRAY[i]);
11699 : first we have to find out how _not_ to flush
11700 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11702 set try -DTRY_FPUTC
11703 if eval $compile; then
11705 ./try$exe_ext 2>/dev/null
11706 if $test ! -s try.out -a "X$?" = X42; then
11712 set try -DTRY_FPRINTF
11714 if eval $compile; then
11716 ./try$exe_ext 2>/dev/null
11717 if $test ! -s try.out -a "X$?" = X42; then
11718 output=-DTRY_FPRINTF
11724 : check for fflush NULL behaviour
11725 case "$fflushNULL" in
11726 '') set try -DTRY_FFLUSH_NULL $output
11727 if eval $compile; then
11729 ./try$exe_ext 2>/dev/null
11731 if $test -s try.out -a "X$code" = X42; then
11732 fflushNULL="`$cat try.out`"
11734 if $test "X$code" != X42; then
11736 (If this test failed, don't worry, we'll try another method shortly.)
11741 $rm -f core try.core core.try.*
11742 case "$fflushNULL" in
11744 Your fflush(NULL) works okay.
11746 fflushNULL="$define"
11749 Your fflush(NULL) isn't working (contrary to ANSI C).
11751 fflushNULL="$undef"
11754 Cannot figure out whether your fflush(NULL) works or not.
11755 I'm assuming it doesn't (contrary to ANSI C).
11757 fflushNULL="$undef"
11761 $define|true|[yY]*)
11762 fflushNULL="$define"
11765 fflushNULL="$undef"
11768 : check explicit looping only if NULL did not work
11769 case "$fflushNULL" in
11771 : check for fflush all behaviour
11772 case "$fflushall" in
11773 '') set try -DTRY_FFLUSH_ALL $output
11774 if eval $compile; then
11776 (Now testing the other method--but note that also this may fail.)
11779 ./try$exe_ext 2>/dev/null
11780 if $test -s try.out -a "X$?" = X42; then
11781 fflushall="`$cat try.out`"
11784 $rm -f core try.core core.try.*
11785 case "$fflushall" in
11787 Whew. Flushing explicitly all the stdio streams works.
11789 fflushall="$define"
11792 Sigh. Flushing explicitly all the stdio streams doesn't work.
11797 Cannot figure out whether flushing stdio streams explicitly works or not.
11798 I'm assuming it doesn't.
11804 "$define"|true|[yY]*)
11805 fflushall="$define"
11812 *) fflushall="$undef"
11815 case "$fflushNULL$fflushall" in
11818 I cannot figure out how to flush pending stdio output.
11822 $rm -f try.* try$exe_ext
11824 : Store the full pathname to the ar program for use in the C program
11825 : Respect a hint or command line value for full_ar.
11830 : Store the full pathname to the sed program for use in the C program
11833 : see what type gids are declared as in the kernel
11835 echo "Looking for the type for group ids returned by getgid()."
11836 set gid_t gidtype xxx stdio.h sys/types.h
11840 xxx=`./findhdr sys/user.h`
11841 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11843 unsigned) dflt="$1 $2" ;;
11847 *) dflt="$gidtype";;
11850 gid_t) echo "gid_t found." ;;
11851 *) rp="What is the type for group ids returned by getgid()?"
11859 *_t) zzz="$gidtype" ;;
11862 echo "Checking the size of $zzz..." >&4
11864 #include <sys/types.h>
11867 printf("%d\n", (int)sizeof($gidtype));
11872 if eval $compile_ok; then
11876 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11879 echo "Your $zzz size is $gidsize bytes."
11884 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11890 *_t) zzz="$gidtype" ;;
11893 echo "Checking the sign of $zzz..." >&4
11895 #include <sys/types.h>
11906 if eval $compile; then
11910 echo "(I can't execute the test program--guessing unsigned.)" >&4
11914 1) echo "Your $zzz is unsigned." ;;
11915 -1) echo "Your $zzz is signed." ;;
11921 echo "(I can't compile the test program--guessing unsigned.)" >&4
11925 : check for length of character
11927 case "$charsize" in
11929 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11930 $cat >try.c <<'EOCP'
11934 printf("%d\n", (int)sizeof(char));
11939 if eval $compile_ok; then
11943 echo "(I can't seem to compile the test program. Guessing...)"
11950 rp="What is the size of a character (in bytes)?"
11957 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11959 case "$use64bits:$d_quad:$quadtype" in
11962 uvtype="$uquadtype"
11967 uvtype="unsigned long"
11973 case "$uselongdouble:$d_longdbl" in
11975 nvtype="long double"
11976 nvsize=$longdblsize
11983 echo "(IV will be "$ivtype", $ivsize bytes)"
11984 echo "(UV will be "$uvtype", $uvsize bytes)"
11985 echo "(NV will be "$nvtype", $nvsize bytes)"
11988 #$i_inttypes I_INTTYPES
11990 #include <inttypes.h>
11995 int8_t i = INT8_MAX;
11996 uint8_t u = UINT8_MAX;
11997 printf("int8_t\n");
12000 int16_t i = INT16_MAX;
12001 uint16_t i = UINT16_MAX;
12002 printf("int16_t\n");
12005 int32_t i = INT32_MAX;
12006 uint32_t u = UINT32_MAX;
12007 printf("int32_t\n");
12013 '') case "$charsize" in
12015 u8type="unsigned char"
12024 if eval $compile; then
12025 case "`./try$exe_ext`" in
12026 int8_t) i8type=int8_t
12036 '') if $test $charsize -ge 1; then
12038 u8type="unsigned char"
12046 '') case "$shortsize" in
12048 u16type="unsigned short"
12056 '') set try -DINT16
12057 if eval $compile; then
12058 case "`./try$exe_ext`" in
12070 '') if $test $shortsize -ge 2; then
12072 u16type="unsigned short"
12080 '') case "$longsize" in
12082 u32type="unsigned long"
12086 *) case "$intsize" in
12088 u32type="unsigned int"
12098 '') set try -DINT32
12099 if eval $compile; then
12100 case "`./try$exe_ext`" in
12112 '') if $test $intsize -ge 4; then
12114 u32type="unsigned int"
12122 '') case "$d_quad:$quadtype" in
12124 i64type="$quadtype"
12125 u64type="$uquadtype"
12137 if $test X"$quadtype" != X; then
12139 echo "Checking how to print 64-bit integers..." >&4
12141 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12142 $cat >try.c <<'EOCP'
12143 #include <sys/types.h>
12146 int q = 12345678901;
12147 printf("%ld\n", q);
12151 if eval $compile; then
12152 yyy=`./try$exe_ext`
12155 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12156 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12157 echo "We will use %d."
12163 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12164 $cat >try.c <<'EOCP'
12165 #include <sys/types.h>
12168 long q = 12345678901;
12169 printf("%ld\n", q);
12173 if eval $compile; then
12174 yyy=`./try$exe_ext`
12177 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12178 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12179 echo "We will use %ld."
12185 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12186 $cat >try.c <<'EOCP'
12187 #include <sys/types.h>
12188 #include <inttypes.h>
12191 int64_t q = 12345678901;
12192 printf("%" PRId64 "\n", q);
12196 if eval $compile; then
12197 yyy=`./try$exe_ext`
12200 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12201 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12202 echo "We will use the C9X style."
12208 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12209 $cat >try.c <<'EOCP'
12210 #include <sys/types.h>
12213 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12214 printf("%lld\n", q);
12218 if eval $compile; then
12219 yyy=`./try$exe_ext`
12222 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12223 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12224 echo "We will use the %lld style."
12230 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12232 #include <sys/types.h>
12235 $quadtype q = 12345678901;
12236 printf("%Ld\n", q);
12240 if eval $compile; then
12241 yyy=`./try$exe_ext`
12244 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12245 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12246 echo "We will use %Ld."
12252 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12254 #include <sys/types.h>
12257 $quadtype q = 12345678901;
12258 printf("%qd\n", q);
12262 if eval $compile; then
12263 yyy=`./try$exe_ext`
12266 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12267 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12268 echo "We will use %qd."
12274 if $test X"$sPRId64" = X; then
12275 echo "Cannot figure out how to print 64-bit integers." >&4
12283 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12284 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12286 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12287 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12293 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12295 if $test X"$ivsize" = X8; then
12296 ivdformat="$sPRId64"
12297 uvuformat="$sPRIu64"
12298 uvoformat="$sPRIo64"
12299 uvxformat="$sPRIx64"
12301 if $test X"$ivsize" = X"$longsize"; then
12307 if $test X"$ivsize" = X"$intsize"; then
12314 if $test X"$ivsize" = X"$shortsize"; then
12324 case "$ivdformat" in
12325 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12332 $echo "Checking the format string to be used for gids..." >&4
12335 -1) if $test X"$gidsize" = X"$ivsize"; then
12336 gidformat="$ivdformat"
12338 if $test X"$gidsize" = X"$longsize"; then
12341 if $test X"$gidsize" = X"$intsize"; then
12344 if $test X"$gidsize" = X"$shortsize"; then
12351 *) if $test X"$gidsize" = X"$uvsize"; then
12352 gidformat="$uvuformat"
12354 if $test X"$gidsize" = X"$longsize"; then
12357 if $test X"$gidsize" = X"$intsize"; then
12360 if $test X"$gidsize" = X"$shortsize"; then
12369 : see if getgroups exists
12370 set getgroups d_getgrps
12373 : see if setgroups exists
12374 set setgroups d_setgrps
12378 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12380 case "$d_getgrps$d_setgrps" in
12382 case "$groupstype" in
12383 '') dflt="$gidtype" ;;
12384 *) dflt="$groupstype" ;;
12387 What type of pointer is the second argument to getgroups() and setgroups()?
12388 Usually this is the same as group ids, $gidtype, but not always.
12391 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12395 *) groupstype="$gidtype";;
12399 echo "Checking if your $make program sets \$(MAKE)..." >&4
12400 case "$make_set_make" in
12402 $sed 's/^X //' > testmake.mak << 'EOF'
12404 X @echo 'maketemp="$(MAKE)"'
12406 case "`$make -f testmake.mak 2>/dev/null`" in
12407 *maketemp=*) make_set_make='#' ;;
12408 *) make_set_make="MAKE=$make" ;;
12410 $rm -f testmake.mak
12413 case "$make_set_make" in
12414 '#') echo "Yup, it does.";;
12415 *) echo "Nope, it doesn't.";;
12418 : see what type is used for mode_t
12419 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12420 set mode_t modetype int stdio.h sys/types.h
12423 : define a fucntion to check prototypes
12424 $cat > protochk <<EOSH
12427 optimize="$optimize"
12429 prototype="$prototype"
12434 $cat >> protochk <<'EOSH'
12439 while test $# -ge 2; do
12441 $define) echo "#include <$2>" >> try.c ;;
12442 literal) echo "$2" >> try.c ;;
12446 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12447 cat >> try.c <<'EOCP'
12448 #ifdef CAN_PROTOTYPE
12449 #define _(args) args
12454 echo "$foo" >> try.c
12455 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12456 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12462 $eunicefix protochk
12464 : see what type is used for size_t
12465 rp="What is the type used for the length parameter for string functions?"
12466 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12469 : check for type of arguments to gethostbyaddr.
12470 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12471 case "$d_gethbyaddr" in
12475 Checking to see what type of arguments are accepted by gethostbyaddr().
12477 hdrs="$define sys/types.h
12478 $d_socket sys/socket.h
12479 $i_niin netinet/in.h
12481 $i_unistd unistd.h"
12482 : The first arg can 'char *' or 'void *'
12483 : The second arg is some of integral type
12484 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12485 for yyy in size_t long int; do
12486 case "$netdb_host_type" in
12487 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12488 if ./protochk "$try" $hdrs; then
12489 echo "Your system accepts $xxx for the first arg."
12490 echo "...and $yyy for the second arg."
12491 netdb_host_type="$xxx"
12492 netdb_hlen_type="$yyy"
12498 : In case none of those worked, prompt the user.
12499 case "$netdb_host_type" in
12500 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12503 netdb_host_type=$ans
12504 rp='What is the type for the 2nd argument to gethostbyaddr?'
12507 netdb_hlen_type=$ans
12511 *) : no gethostbyaddr, so pick harmless defaults
12512 netdb_host_type='char *'
12513 netdb_hlen_type="$sizetype"
12516 # Remove the "const" if needed. -- but then we'll have a
12518 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12521 : check for type of argument to gethostbyname.
12522 if test "X$netdb_name_type" = X ; then
12523 case "$d_gethbyname" in
12527 Checking to see what type of argument is accepted by gethostbyname().
12529 hdrs="$define sys/types.h
12530 $d_socket sys/socket.h
12531 $i_niin netinet/in.h
12533 $i_unistd unistd.h"
12534 for xxx in "const char *" "char *"; do
12535 case "$netdb_name_type" in
12536 '') try="extern struct hostent *gethostbyname($xxx);"
12537 if ./protochk "$try" $hdrs; then
12538 echo "Your system accepts $xxx."
12539 netdb_name_type="$xxx"
12544 : In case none of those worked, prompt the user.
12545 case "$netdb_name_type" in
12546 '') rp='What is the type for the 1st argument to gethostbyname?'
12549 netdb_name_type=$ans
12553 *) : no gethostbyname, so pick harmless default
12554 netdb_name_type='char *'
12559 : check for type of 1st argument to getnetbyaddr.
12560 if test "X$netdb_net_type" = X ; then
12561 case "$d_getnbyaddr" in
12565 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12567 hdrs="$define sys/types.h
12568 $d_socket sys/socket.h
12569 $i_niin netinet/in.h
12571 $i_unistd unistd.h"
12572 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12573 case "$netdb_net_type" in
12574 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12575 if ./protochk "$try" $hdrs; then
12576 echo "Your system accepts $xxx."
12577 netdb_net_type="$xxx"
12582 : In case none of those worked, prompt the user.
12583 case "$netdb_net_type" in
12584 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12587 netdb_net_type=$ans
12591 *) : no getnetbyaddr, so pick harmless default
12592 netdb_net_type='long'
12596 : locate the preferred pager for this system
12610 '') dflt=/usr/ucb/more;;
12617 rp='What pager is used on your system?'
12621 : see what type pids are declared as in the kernel
12622 rp="What is the type of process ids on this system?"
12623 set pid_t pidtype int stdio.h sys/types.h
12626 : Find earliest binary compatible site_perl subdirectory perl can use.
12627 case "$bincompat5005" in
12628 "$define") xs_apiversion='5.005' ;;
12629 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12631 : Find earliest pure perl site_perl subdirectory perl can use.
12632 : The versioned directories started at 5.005.
12633 pm_apiversion='5.005'
12635 : check for length of pointer
12639 $echo $n "Checking to see how big your pointers are...$c" >&4
12640 if test "$voidflags" -gt 7; then
12641 echo '#define VOID_PTR char *' > try.c
12643 echo '#define VOID_PTR void *' > try.c
12645 $cat >>try.c <<'EOCP'
12649 printf("%d\n", (int)sizeof(VOID_PTR));
12654 if eval $compile_ok; then
12656 $echo " $ptrsize bytes." >&4
12659 echo "(I can't seem to compile the test program. Guessing...)" >&4
12660 rp="What is the size of a pointer (in bytes)?"
12668 : see if ar generates random libraries by itself
12670 echo "Checking how to generate random libraries on your machine..." >&4
12671 echo 'int bar1() { return bar2(); }' > bar1.c
12672 echo 'int bar2() { return 2; }' > bar2.c
12673 $cat > foo.c <<'EOP'
12674 int main() { printf("%d\n", bar1()); exit(0); }
12676 $cc $ccflags -c bar1.c >/dev/null 2>&1
12677 $cc $ccflags -c bar2.c >/dev/null 2>&1
12678 $cc $ccflags -c foo.c >/dev/null 2>&1
12679 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12680 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12681 ./foobar >/dev/null 2>&1; then
12682 echo "$ar appears to generate random libraries itself."
12685 elif $ar ts bar$_a >/dev/null 2>&1 &&
12686 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12687 ./foobar >/dev/null 2>&1; then
12688 echo "a table of contents needs to be added with '$ar ts'."
12695 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12696 $test -f $ranlib || ranlib=''
12699 if $test -n "$ranlib"; then
12700 echo "your system has '$ranlib'; we'll use that."
12703 echo "your system doesn't seem to support random libraries"
12704 echo "so we'll use lorder and tsort to order the libraries."
12711 : check for type of arguments to select.
12712 case "$selecttype" in
12713 '') case "$d_select" in
12716 Checking to see what type of arguments are accepted by select().
12718 hdrs="$define sys/types.h
12719 $i_systime sys/time.h
12720 $i_sysselct sys/select.h
12721 $d_socket sys/socket.h"
12722 : The first arg can be int, unsigned, or size_t
12723 : The last arg may or may not be 'const'
12725 : void pointer has been seen but using that
12726 : breaks the selectminbits test
12727 for xxx in 'fd_set *' 'int *'; do
12728 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12729 for tmo in 'struct timeval *' 'const struct timeval *'; do
12731 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12732 if ./protochk "$try" $hdrs; then
12733 echo "Your system accepts $xxx."
12742 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12743 case "$d_fd_set" in
12744 $define) dflt="fd_set *" ;;
12753 *) : no select, so pick a harmless default
12760 : check for the select 'width'
12761 case "$selectminbits" in
12762 '') case "$d_select" in
12766 Checking to see on how many bits at a time your select() operates...
12769 #include <sys/types.h>
12771 #$i_systime I_SYS_TIME
12772 #$i_systimek I_SYS_TIME_KERNEL
12777 # ifdef I_SYS_TIME_KERNEL
12780 # include <sys/time.h>
12781 # ifdef I_SYS_TIME_KERNEL
12785 #$i_sysselct I_SYS_SELECT
12786 #ifdef I_SYS_SELECT
12787 #include <sys/select.h>
12789 #$d_socket HAS_SOCKET
12791 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12795 #define S sizeof(*(b))
12797 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12798 #define NBITS (NBYTES * 8)
12807 fp = fopen("try.c", "r");
12813 b = ($selecttype)s;
12814 for (i = 0; i < NBITS; i++)
12818 select(fd + 1, b, 0, 0, &t);
12819 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12820 printf("%d\n", i + 1);
12825 if eval $compile_ok; then
12826 selectminbits=`./try`
12827 case "$selectminbits" in
12829 Cannot figure out on how many bits at a time your select() operates.
12830 I'll play safe and guess it is 32 bits.
12836 *) bits="$selectminbits bits" ;;
12838 echo "Your select() operates on $bits at a time." >&4
12840 rp='What is the minimum number of bits your select() operates on?'
12841 case "$byteorder" in
12842 1234|12345678) dflt=32 ;;
12847 selectminbits="$val"
12851 *) : no select, so pick a harmless default
12858 : Trace out the files included by signal.h, then look for SIGxxx names.
12859 : Remove SIGARRAYSIZE used by HPUX.
12860 : Remove SIGSTKSIZE used by Linux.
12861 : Remove SIGSTKSZ used by Posix.
12862 : Remove SIGTYP void lines used by OS2.
12863 : Some cpps, like os390, dont give the file name anywhere
12864 if [ "X$fieldn" = X ]; then
12865 : Just make some guesses. We check them later.
12866 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
12868 xxx=`echo '#include <signal.h>' |
12869 $cppstdin $cppminus $cppflags 2>/dev/null |
12870 $grep '^[ ]*#.*include' |
12871 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12873 : Check this list of files to be sure we have parsed the cpp output ok.
12874 : This will also avoid potentially non-existent files, such
12877 for xx in $xxx /dev/null ; do
12878 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12880 : If we have found no files, at least try signal.h
12881 case "$xxxfiles" in
12882 '') xxxfiles=`./findhdr signal.h` ;;
12885 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12886 print substr($2, 4, 20)
12888 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12889 print substr($3, 4, 20)
12891 : Append some common names just in case the awk scan failed.
12892 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
12893 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
12894 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
12895 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
12896 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
12898 : generate a few handy files for later
12899 $cat > signal.c <<'EOCP'
12900 #include <sys/types.h>
12901 #include <signal.h>
12905 /* Strange style to avoid deeply-nested #if/#else/#endif */
12908 # define NSIG (_NSIG)
12914 # define NSIG (SIGMAX+1)
12920 # define NSIG (SIG_MAX+1)
12926 # define NSIG (MAXSIG+1)
12932 # define NSIG (MAX_SIG+1)
12937 # ifdef SIGARRAYSIZE
12938 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12944 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12948 /* Default to some arbitrary number that's big enough to get most
12949 of the common signals.
12955 printf("NSIG %d\n", NSIG);
12961 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12963 printf "#ifdef SIG"; printf $1; printf "\n"
12964 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12965 printf $1; printf ");\n"
12969 printf "#endif /* JUST_NSIG */\n";
12970 printf "exit(0);\n}\n";
12973 $cat >signal.awk <<'EOP'
12974 BEGIN { ndups = 0 }
12975 $1 ~ /^NSIG$/ { nsig = $2 }
12976 ($1 !~ /^NSIG$/) && (NF == 2) {
12977 if ($2 > maxsig) { maxsig = $2 }
12978 if (sig_name[$2]) {
12979 dup_name[ndups] = $1
12980 dup_num[ndups] = $2
12992 printf("NSIG %d\n", nsig);
12993 for (n = 1; n < nsig; n++) {
12995 printf("%s %d\n", sig_name[n], sig_num[n])
12998 printf("NUM%d %d\n", n, n)
13001 for (n = 0; n < ndups; n++) {
13002 printf("%s %d\n", dup_name[n], dup_num[n])
13006 $cat >signal_cmd <<EOS
13008 if $test -s signal.lst; then
13009 echo "Using your existing signal.lst file"
13014 $cat >>signal_cmd <<'EOS'
13017 if eval $compile_ok; then
13018 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13020 echo "(I can't seem be able to compile the whole test program)" >&4
13021 echo "(I'll try it in little pieces.)" >&4
13022 set signal -DJUST_NSIG
13023 if eval $compile_ok; then
13024 ./signal$_exe > signal.nsg
13027 echo "I can't seem to figure out how many signals you have." >&4
13028 echo "Guessing 50." >&4
13029 echo 'NSIG 50' > signal.nsg
13031 : Now look at all the signal names, one at a time.
13032 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13033 $cat > signal.c <<EOCP
13034 #include <sys/types.h>
13035 #include <signal.h>
13038 printf("$xx %d\n", SIG${xx});
13043 if eval $compile; then
13044 echo "SIG${xx} found."
13045 ./signal$_exe >> signal.ls1
13047 echo "SIG${xx} NOT found."
13050 if $test -s signal.ls1; then
13051 $cat signal.nsg signal.ls1 |
13052 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13056 if $test -s signal.lst; then
13059 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13060 echo 'kill -l' >signal
13061 set X `csh -f <signal`
13065 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13067 echo $@ | $tr ' ' $trnl | \
13068 $awk '{ printf "%s %d\n", $1, ++s; }
13069 END { printf "NSIG %d\n", ++s }' >signal.lst
13071 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13073 chmod a+x signal_cmd
13074 $eunicefix signal_cmd
13076 : generate list of signal names
13078 case "$sig_name_init" in
13080 *) case "$sig_num_init" in
13081 ''|*,*) doinit=yes ;;
13086 echo "Generating a list of signal names and numbers..." >&4
13088 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13089 sig_name=`$awk 'BEGIN { printf "ZERO " }
13090 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13091 sig_num=`$awk 'BEGIN { printf "0 " }
13092 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13093 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13094 !/^NSIG/ { printf "\"%s\", ", $1 }
13095 END { printf "0\n" }' signal.lst`
13096 sig_num_init=`$awk 'BEGIN { printf "0, " }
13097 !/^NSIG/ { printf "%d, ", $2}
13098 END { printf "0\n"}' signal.lst`
13101 echo "The following $sig_count signals are available:"
13103 echo $sig_name | $awk \
13104 'BEGIN { linelen = 0 }
13106 for (i = 1; i <= NF; i++) {
13107 name = "SIG" $i " "
13108 linelen = linelen + length(name)
13109 if (linelen > 70) {
13111 linelen = length(name)
13117 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13119 : see what type is used for signed size_t
13120 set ssize_t ssizetype int stdio.h sys/types.h
13123 $cat > ssize.c <<EOM
13125 #include <sys/types.h>
13126 #define Size_t $sizetype
13127 #define SSize_t $dflt
13130 if (sizeof(Size_t) == sizeof(SSize_t))
13132 else if (sizeof(Size_t) == sizeof(int))
13141 if eval $compile_ok && ./ssize > /dev/null; then
13142 ssizetype=`./ssize`
13143 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13146 Help! I can't compile and run the ssize_t test program: please enlighten me!
13147 (This is probably a misconfiguration in your system or libraries, and
13148 you really ought to fix it. Still, I'll try anyway.)
13150 I need a type that is the same size as $sizetype, but is guaranteed to
13151 be signed. Common values are ssize_t, int and long.
13154 rp="What signed type is the same size as $sizetype?"
13158 $rm -f ssize ssize.*
13160 : see what type of char stdio uses.
13162 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13163 echo "Your stdio uses unsigned chars." >&4
13164 stdchar="unsigned char"
13166 echo "Your stdio uses signed chars." >&4
13170 : see if time exists
13172 if test "X$d_time" = X -o X"$timetype" = X; then
13173 if set time val -f d_time; eval $csym; $val; then
13174 echo 'time() found.' >&4
13176 rp="What is the type returned by time() on this system?"
13177 set time_t timetype long stdio.h sys/types.h
13180 echo 'time() not found, hope that will do.' >&4
13188 : see what type uids are declared as in the kernel
13190 echo "Looking for the type for user ids returned by getuid()."
13191 set uid_t uidtype xxx stdio.h sys/types.h
13195 xxx=`./findhdr sys/user.h`
13196 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13198 unsigned) dflt="$1 $2" ;;
13202 *) dflt="$uidtype";;
13205 uid_t) echo "uid_t found." ;;
13206 *) rp="What is the type for user ids returned by getuid()?"
13214 *_t) zzz="$uidtype" ;;
13217 echo "Checking the size of $zzz..." >&4
13219 #include <sys/types.h>
13222 printf("%d\n", (int)sizeof($uidtype));
13227 if eval $compile_ok; then
13231 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13234 echo "Your $zzz size is $uidsize bytes."
13239 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13244 *_t) zzz="$uidtype" ;;
13247 echo "Checking the sign of $zzz..." >&4
13249 #include <sys/types.h>
13260 if eval $compile; then
13264 echo "(I can't execute the test program--guessing unsigned.)" >&4
13268 1) echo "Your $zzz is unsigned." ;;
13269 -1) echo "Your $zzz is signed." ;;
13275 echo "(I can't compile the test program--guessing unsigned.)" >&4
13281 $echo "Checking the format string to be used for uids..." >&4
13284 -1) if $test X"$uidsize" = X"$ivsize"; then
13285 uidformat="$ivdformat"
13287 if $test X"$uidsize" = X"$longsize"; then
13290 if $test X"$uidsize" = X"$intsize"; then
13293 if $test X"$uidsize" = X"$shortsize"; then
13300 *) if $test X"$uidsize" = X"$uvsize"; then
13301 uidformat="$uvuformat"
13303 if $test X"$uidsize" = X"$longsize"; then
13306 if $test X"$uidsize" = X"$intsize"; then
13309 if $test X"$uidsize" = X"$shortsize"; then
13318 : see if dbm.h is available
13319 : see if dbmclose exists
13320 set dbmclose d_dbmclose
13323 case "$d_dbmclose" in
13333 *) set rpcsvc/dbm.h i_rpcsvcdbm
13338 *) echo "We won't be including <dbm.h>"
13348 : see if this is a sys/file.h system
13353 : do we need to include sys/file.h ?
13357 if $h_sysfile; then
13359 echo "We'll be including <sys/file.h>." >&4
13362 echo "We won't be including <sys/file.h>." >&4
13372 : see if fcntl.h is there
13377 : see if we can include fcntl.h
13383 echo "We'll be including <fcntl.h>." >&4
13386 if $h_sysfile; then
13387 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13389 echo "We won't be including <fcntl.h>." >&4
13401 : see if locale.h is available
13402 set locale.h i_locale
13405 : see if mach cthreads are available
13406 if test "X$usethreads" = "X$define"; then
13407 set mach/cthreads.h i_machcthr
13410 i_machcthr="$undef"
13415 : see if this is a math.h system
13419 : see if this is a mntent.h system
13420 set mntent.h i_mntent
13423 : see if ndbm.h is available
13428 : see if dbm_open exists
13429 set dbm_open d_dbm_open
13431 case "$d_dbm_open" in
13434 echo "We won't be including <ndbm.h>"
13443 : see if net/errno.h is available
13445 set net/errno.h val
13448 : Unfortunately, it causes problems on some systems. Arrgh.
13451 cat > try.c <<'EOM'
13454 #include <net/errno.h>
13460 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13461 echo "We'll be including <net/errno.h>." >&4
13463 echo "We won't be including <net/errno.h>." >&4
13472 : see if netinet/tcp.h is available
13473 set netinet/tcp.h i_netinettcp
13476 : see if this is a poll.h system
13480 : get C preprocessor symbols handy
13482 $echo $n "Hmm... $c"
13483 echo $al | $tr ' ' $trnl >Cppsym.know
13484 $cat <<EOSS >Cppsym
13492 case "\$list\$#" in
13495 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13497 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13500 unknown="\$unknown \$sym"
13510 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13512 exit 0; _ _ _ _\1\\ \1\\
13515 echo "exit 1; _ _ _" >>Cppsym\$\$
13516 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13518 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13524 $rm -f Cppsym\$\$ Cppsym2\$\$
13529 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13531 : now check the C compiler for additional symbols
13532 postprocess_cc_v=''
13534 aix) postprocess_cc_v="|$tr , ' '" ;;
13541 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13544 -D*) echo "\$i" | $sed 's/^-D//';;
13545 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13550 postprocess_cc_v=''
13553 ./ccsym > ccsym1.raw
13554 if $test -s ccsym1.raw; then
13555 $sort ccsym1.raw | $uniq >ccsym.raw
13557 mv ccsym1.raw ccsym.raw
13560 $awk '/\=/ { print $0; next }
13561 { print $0"=1" }' ccsym.raw >ccsym.list
13562 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13563 $comm -13 ccsym.true ccsym.list >ccsym.own
13564 $comm -12 ccsym.true ccsym.list >ccsym.com
13565 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13567 if $test -z ccsym.raw; then
13568 echo "Your C compiler doesn't seem to define any symbols!" >&4
13570 echo "However, your C preprocessor defines the following symbols:"
13573 cppsymbols=`$cat Cppsym.true`
13574 cppsymbols=`echo $cppsymbols`
13575 cppccsymbols="$cppsymbols"
13577 if $test -s ccsym.com; then
13578 echo "Your C compiler and pre-processor define these symbols:"
13579 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13582 cppccsymbols=`$cat ccsym.com`
13583 cppccsymbols=`echo $cppccsymbols`
13584 $test "$silent" || sleep 1
13586 if $test -s ccsym.cpp; then
13587 $test "$also" && echo " "
13588 echo "Your C pre-processor ${also}defines the following symbols:"
13589 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13591 cppsymbols=`$cat ccsym.cpp`
13592 cppsymbols=`echo $cppsymbols`
13593 $test "$silent" || sleep 1
13595 if $test -s ccsym.own; then
13596 $test "$also" && echo " "
13597 echo "Your C compiler ${also}defines the following cpp symbols:"
13598 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13599 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13600 ccsymbols=`$cat ccsym.own`
13601 ccsymbols=`echo $ccsymbols`
13602 $test "$silent" || sleep 1
13607 : see if this is a termio system
13611 if $test `./findhdr termios.h`; then
13612 set tcsetattr i_termios
13618 "$define") echo "You have POSIX termios.h... good!" >&4;;
13619 *) if ./Cppsym pyr; then
13620 case "`/bin/universe`" in
13621 ucb) if $test `./findhdr sgtty.h`; then
13623 echo "<sgtty.h> found." >&4
13625 echo "System is pyramid with BSD universe."
13626 echo "<sgtty.h> not found--you could have problems." >&4
13628 *) if $test `./findhdr termio.h`; then
13630 echo "<termio.h> found." >&4
13632 echo "System is pyramid with USG universe."
13633 echo "<termio.h> not found--you could have problems." >&4
13637 if $test `./findhdr termio.h`; then
13638 echo "<termio.h> found." >&4
13640 elif $test `./findhdr sgtty.h`; then
13641 echo "<sgtty.h> found." >&4
13644 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13647 if $test `./findhdr sgtty.h`; then
13648 echo "<sgtty.h> found." >&4
13650 elif $test `./findhdr termio.h`; then
13651 echo "<termio.h> found." >&4
13654 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13658 set i_termio; eval $setvar
13659 val=$val2; set i_sgtty; eval $setvar
13660 val=$val3; set i_termios; eval $setvar
13662 : see if this is a shadow.h system
13663 set shadow.h i_shadow
13666 : see if this is a socks.h system
13667 set socks.h i_socks
13670 : see if stdarg is available
13672 if $test `./findhdr stdarg.h`; then
13673 echo "<stdarg.h> found." >&4
13676 echo "<stdarg.h> NOT found." >&4
13680 : see if varags is available
13682 if $test `./findhdr varargs.h`; then
13683 echo "<varargs.h> found." >&4
13685 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13688 : set up the varargs testing programs
13689 $cat > varargs.c <<EOP
13691 #include <stdarg.h>
13694 #include <varargs.h>
13698 int f(char *p, ...)
13712 p = va_arg(ap, char *);
13717 $cat > varargs <<EOP
13719 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13728 : now check which varargs header should be included
13733 if `./varargs I_STDARG`; then
13735 elif `./varargs I_VARARGS`; then
13740 if `./varargs I_VARARGS`; then
13747 echo "I could not find the definition for va_dcl... You have problems..." >&4
13748 val="$undef"; set i_stdarg; eval $setvar
13749 val="$undef"; set i_varargs; eval $setvar
13754 case "$i_varhdr" in
13756 val="$define"; set i_stdarg; eval $setvar
13757 val="$undef"; set i_varargs; eval $setvar
13760 val="$undef"; set i_stdarg; eval $setvar
13761 val="$define"; set i_varargs; eval $setvar
13764 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13768 : see if stddef is available
13769 set stddef.h i_stddef
13772 : see if sys/access.h is available
13773 set sys/access.h i_sysaccess
13776 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13777 set sys/filio.h i_sysfilio
13780 if $test `./findhdr sys/ioctl.h`; then
13782 echo '<sys/ioctl.h> found.' >&4
13785 if $test $i_sysfilio = "$define"; then
13786 echo '<sys/ioctl.h> NOT found.' >&4
13788 $test $i_sgtty = "$define" && xxx="sgtty.h"
13789 $test $i_termio = "$define" && xxx="termio.h"
13790 $test $i_termios = "$define" && xxx="termios.h"
13791 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13797 : see if sys/resource.h has to be included
13798 set sys/resource.h i_sysresrc
13801 : see if sys/security.h is available
13802 set sys/security.h i_syssecrt
13805 : see if this is a sys/statvfs.h system
13806 set sys/statvfs.h i_sysstatvfs
13809 : see if this is a sys/uio.h system
13810 set sys/uio.h i_sysuio
13813 : see if this is a sys/un.h system
13814 set sys/un.h i_sysun
13817 : see if this is a syswait system
13818 set sys/wait.h i_syswait
13821 : see if this is a ustat.h system
13822 set ustat.h i_ustat
13825 : see if this is an utime system
13826 set utime.h i_utime
13829 : see if this is a values.h system
13830 set values.h i_values
13833 : see if this is a vfork system
13836 set vfork.h i_vfork
13844 : see if gdbm.h is available
13849 : see if gdbm_open exists
13850 set gdbm_open d_gdbm_open
13852 case "$d_gdbm_open" in
13855 echo "We won't be including <gdbm.h>"
13865 echo "Looking for extensions..." >&4
13866 : If we are using the old config.sh, known_extensions may contain
13867 : old or inaccurate or duplicate values.
13868 known_extensions=''
13869 nonxs_extensions=''
13870 : We do not use find because it might not be available.
13871 : We do not just use MANIFEST because the user may have dropped
13872 : some additional extensions into the source tree and expect them
13875 : Function to recursively find available extensions, ignoring DynaLoader
13876 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13880 DynaLoader|dynaload) ;;
13882 if $test -f $xxx/$xxx.xs; then
13883 known_extensions="$known_extensions $1$xxx";
13884 elif $test -f $xxx/Makefile.PL; then
13885 nonxs_extensions="$nonxs_extensions $1$xxx";
13887 if $test -d $xxx -a $# -lt 10; then
13890 eval $find_extensions;
13902 eval $find_extensions
13903 set X $nonxs_extensions
13905 nonxs_extensions="$*"
13906 set X $known_extensions
13908 known_extensions="$*"
13911 : Now see which are supported on this system.
13913 for xxx in $known_extensions ; do
13917 $define) avail_ext="$avail_ext $xxx" ;;
13920 GDBM_File|gdbm_fil)
13922 $define) avail_ext="$avail_ext $xxx" ;;
13925 NDBM_File|ndbm_fil)
13927 $define) avail_ext="$avail_ext $xxx" ;;
13930 ODBM_File|odbm_fil)
13931 case "${i_dbm}${i_rpcsvcdbm}" in
13932 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13936 case "$useposix" in
13937 true|define|y) avail_ext="$avail_ext $xxx" ;;
13941 case "$useopcode" in
13942 true|define|y) avail_ext="$avail_ext $xxx" ;;
13946 case "$d_socket" in
13947 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13951 case "$usethreads" in
13952 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13956 : XXX Do we need a useipcsysv variable here
13957 case "${d_msg}${d_sem}${d_shm}" in
13958 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13961 *) avail_ext="$avail_ext $xxx"
13970 : Now see which nonxs extensions are supported on this system.
13971 : For now assume all are.
13973 for xxx in $nonxs_extensions ; do
13975 *) nonxs_ext="$nonxs_ext $xxx"
13987 A number of extensions are supplied with $package. You may choose to
13988 compile these extensions for dynamic loading (the default), compile
13989 them into the $package executable (static loading), or not include
13990 them at all. Answer "none" to include no extensions.
13991 Note that DynaLoader is always built and need not be mentioned here.
13994 case "$dynamic_ext" in
13995 '') dflt="$avail_ext" ;;
13996 *) dflt="$dynamic_ext"
13997 # Perhaps we are reusing an old out-of-date config.sh.
14000 if test X"$dynamic_ext" != X"$avail_ext"; then
14002 NOTICE: Your previous config.sh list may be incorrect.
14003 The extensions now available to you are
14005 but the default list from your previous config.sh is
14017 rp="What extensions do you wish to load dynamically?"
14020 none) dynamic_ext=' ' ;;
14021 *) dynamic_ext="$ans" ;;
14024 case "$static_ext" in
14026 : Exclude those already listed in dynamic linking
14028 for xxx in $avail_ext; do
14029 case " $dynamic_ext " in
14031 *) dflt="$dflt $xxx" ;;
14038 *) dflt="$static_ext"
14045 rp="What extensions do you wish to load statically?"
14048 none) static_ext=' ' ;;
14049 *) static_ext="$ans" ;;
14054 A number of extensions are supplied with $package. Answer "none"
14055 to include no extensions.
14056 Note that DynaLoader is always built and need not be mentioned here.
14059 case "$static_ext" in
14060 '') dflt="$avail_ext" ;;
14061 *) dflt="$static_ext"
14062 # Perhaps we are reusing an old out-of-date config.sh.
14065 if test X"$static_ext" != X"$avail_ext"; then
14067 NOTICE: Your previous config.sh list may be incorrect.
14068 The extensions now available to you are
14070 but the default list from your previous config.sh is
14079 : Exclude those that are not xs extensions
14083 rp="What extensions do you wish to include?"
14086 none) static_ext=' ' ;;
14087 *) static_ext="$ans" ;;
14092 set X $dynamic_ext $static_ext $nonxs_ext
14096 : Remove build directory name from cppstdin so it can be used from
14097 : either the present location or the final installed location.
14099 : Get out of the UU directory to get correct path name.
14101 case "$cppstdin" in
14103 echo "Stripping down cppstdin path name"
14109 : end of configuration questions
14111 echo "End of configuration questions."
14114 : back to where it started
14115 if test -d ../UU; then
14119 : configuration may be patched via a 'config.over' file
14120 if $test -f config.over; then
14123 rp='I see a config.over file. Do you wish to load it?'
14126 n*) echo "OK, I'll ignore it.";;
14128 echo "Configuration override changes have been loaded."
14133 : in case they want portability, strip down executable paths
14134 case "$d_portable" in
14137 echo "Stripping down executable paths..." >&4
14138 for file in $loclist $trylist; do
14140 eval $file=`basename $temp`
14145 : create config.sh file
14147 echo "Creating config.sh..." >&4
14148 $spitshell <<EOT >config.sh
14151 # This file was produced by running the Configure script. It holds all the
14152 # definitions figured out by Configure. Should you modify one of these values,
14153 # do not forget to propagate your changes by running "Configure -der". You may
14154 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14157 # Package name : $package
14158 # Source directory : $src
14159 # Configuration time: $cf_time
14160 # Configured by : $cf_by
14161 # Target system : $myuname
14171 Revision='$Revision'
14178 alignbytes='$alignbytes'
14179 ansi2knr='$ansi2knr'
14180 aphostname='$aphostname'
14181 apiversion='$apiversion'
14184 archlibexp='$archlibexp'
14185 archname64='$archname64'
14186 archname='$archname'
14187 archobjs='$archobjs'
14192 bincompat5005='$bincompat5005'
14196 byteorder='$byteorder'
14198 castflags='$castflags'
14201 cccdlflags='$cccdlflags'
14202 ccdlflags='$ccdlflags'
14204 ccsymbols='$ccsymbols'
14206 cf_email='$cf_email'
14208 charsize='$charsize'
14212 clocktype='$clocktype'
14214 compress='$compress'
14215 contains='$contains'
14219 cpp_stuff='$cpp_stuff'
14220 cppccsymbols='$cppccsymbols'
14221 cppflags='$cppflags'
14223 cppminus='$cppminus'
14225 cppstdin='$cppstdin'
14226 cppsymbols='$cppsymbols'
14227 crosscompile='$crosscompile'
14228 cryptlib='$cryptlib'
14230 d_Gconvert='$d_Gconvert'
14231 d_PRIEldbl='$d_PRIEldbl'
14232 d_PRIFldbl='$d_PRIFldbl'
14233 d_PRIGldbl='$d_PRIGldbl'
14234 d_PRIX64='$d_PRIX64'
14235 d_PRId64='$d_PRId64'
14236 d_PRIeldbl='$d_PRIeldbl'
14237 d_PRIfldbl='$d_PRIfldbl'
14238 d_PRIgldbl='$d_PRIgldbl'
14239 d_PRIi64='$d_PRIi64'
14240 d_PRIo64='$d_PRIo64'
14241 d_PRIu64='$d_PRIu64'
14242 d_PRIx64='$d_PRIx64'
14243 d_access='$d_access'
14244 d_accessx='$d_accessx'
14246 d_archlib='$d_archlib'
14249 d_attribut='$d_attribut'
14252 d_bincompat5005='$d_bincompat5005'
14254 d_bsdgetpgrp='$d_bsdgetpgrp'
14255 d_bsdsetpgrp='$d_bsdsetpgrp'
14257 d_casti32='$d_casti32'
14258 d_castneg='$d_castneg'
14259 d_charvspr='$d_charvspr'
14261 d_chroot='$d_chroot'
14262 d_chsize='$d_chsize'
14263 d_closedir='$d_closedir'
14267 d_cuserid='$d_cuserid'
14268 d_dbl_dig='$d_dbl_dig'
14269 d_difftime='$d_difftime'
14270 d_dirnamlen='$d_dirnamlen'
14271 d_dlerror='$d_dlerror'
14272 d_dlopen='$d_dlopen'
14273 d_dlsymun='$d_dlsymun'
14274 d_dosuid='$d_dosuid'
14275 d_drand48proto='$d_drand48proto'
14277 d_eaccess='$d_eaccess'
14278 d_endgrent='$d_endgrent'
14279 d_endhent='$d_endhent'
14280 d_endnent='$d_endnent'
14281 d_endpent='$d_endpent'
14282 d_endpwent='$d_endpwent'
14283 d_endsent='$d_endsent'
14284 d_endspent='$d_endspent'
14285 d_eofnblk='$d_eofnblk'
14286 d_eunice='$d_eunice'
14287 d_fchmod='$d_fchmod'
14288 d_fchown='$d_fchown'
14290 d_fd_macros='$d_fd_macros'
14291 d_fd_set='$d_fd_set'
14292 d_fds_bits='$d_fds_bits'
14293 d_fgetpos='$d_fgetpos'
14294 d_flexfnam='$d_flexfnam'
14297 d_fpathconf='$d_fpathconf'
14298 d_fpos64_t='$d_fpos64_t'
14299 d_fs_data_s='$d_fs_data_s'
14300 d_fseeko='$d_fseeko'
14301 d_fsetpos='$d_fsetpos'
14302 d_fstatfs='$d_fstatfs'
14303 d_fstatvfs='$d_fstatvfs'
14304 d_ftello='$d_ftello'
14306 d_getgrent='$d_getgrent'
14307 d_getgrps='$d_getgrps'
14308 d_gethbyaddr='$d_gethbyaddr'
14309 d_gethbyname='$d_gethbyname'
14310 d_gethent='$d_gethent'
14311 d_gethname='$d_gethname'
14312 d_gethostprotos='$d_gethostprotos'
14313 d_getlogin='$d_getlogin'
14314 d_getmnt='$d_getmnt'
14315 d_getmntent='$d_getmntent'
14316 d_getnbyaddr='$d_getnbyaddr'
14317 d_getnbyname='$d_getnbyname'
14318 d_getnent='$d_getnent'
14319 d_getnetprotos='$d_getnetprotos'
14320 d_getpbyname='$d_getpbyname'
14321 d_getpbynumber='$d_getpbynumber'
14322 d_getpent='$d_getpent'
14323 d_getpgid='$d_getpgid'
14324 d_getpgrp2='$d_getpgrp2'
14325 d_getpgrp='$d_getpgrp'
14326 d_getppid='$d_getppid'
14327 d_getprior='$d_getprior'
14328 d_getprotoprotos='$d_getprotoprotos'
14329 d_getpwent='$d_getpwent'
14330 d_getsbyname='$d_getsbyname'
14331 d_getsbyport='$d_getsbyport'
14332 d_getsent='$d_getsent'
14333 d_getservprotos='$d_getservprotos'
14334 d_getspent='$d_getspent'
14335 d_getspnam='$d_getspnam'
14336 d_gettimeod='$d_gettimeod'
14337 d_gnulibc='$d_gnulibc'
14338 d_grpasswd='$d_grpasswd'
14339 d_hasmntopt='$d_hasmntopt'
14342 d_inetaton='$d_inetaton'
14343 d_int64t='$d_int64t'
14344 d_isascii='$d_isascii'
14345 d_killpg='$d_killpg'
14346 d_lchown='$d_lchown'
14347 d_ldbl_dig='$d_ldbl_dig'
14349 d_locconv='$d_locconv'
14351 d_longdbl='$d_longdbl'
14352 d_longlong='$d_longlong'
14355 d_mbstowcs='$d_mbstowcs'
14356 d_mbtowc='$d_mbtowc'
14357 d_memchr='$d_memchr'
14358 d_memcmp='$d_memcmp'
14359 d_memcpy='$d_memcpy'
14360 d_memmove='$d_memmove'
14361 d_memset='$d_memset'
14363 d_mkfifo='$d_mkfifo'
14364 d_mktime='$d_mktime'
14366 d_msg_ctrunc='$d_msg_ctrunc'
14367 d_msg_dontroute='$d_msg_dontroute'
14368 d_msg_oob='$d_msg_oob'
14369 d_msg_peek='$d_msg_peek'
14370 d_msg_proxy='$d_msg_proxy'
14371 d_msgctl='$d_msgctl'
14372 d_msgget='$d_msgget'
14373 d_msgrcv='$d_msgrcv'
14374 d_msgsnd='$d_msgsnd'
14375 d_mymalloc='$d_mymalloc'
14377 d_off64_t='$d_off64_t'
14378 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14379 d_oldpthreads='$d_oldpthreads'
14380 d_oldsock='$d_oldsock'
14382 d_pathconf='$d_pathconf'
14384 d_phostname='$d_phostname'
14387 d_portable='$d_portable'
14388 d_pthread_yield='$d_pthread_yield'
14390 d_pwchange='$d_pwchange'
14391 d_pwclass='$d_pwclass'
14392 d_pwcomment='$d_pwcomment'
14393 d_pwexpire='$d_pwexpire'
14394 d_pwgecos='$d_pwgecos'
14395 d_pwpasswd='$d_pwpasswd'
14396 d_pwquota='$d_pwquota'
14398 d_readdir='$d_readdir'
14399 d_readlink='$d_readlink'
14400 d_rename='$d_rename'
14401 d_rewinddir='$d_rewinddir'
14403 d_safebcpy='$d_safebcpy'
14404 d_safemcpy='$d_safemcpy'
14405 d_sanemcmp='$d_sanemcmp'
14406 d_sched_yield='$d_sched_yield'
14407 d_scm_rights='$d_scm_rights'
14408 d_seekdir='$d_seekdir'
14409 d_select='$d_select'
14411 d_semctl='$d_semctl'
14412 d_semctl_semid_ds='$d_semctl_semid_ds'
14413 d_semctl_semun='$d_semctl_semun'
14414 d_semget='$d_semget'
14416 d_setegid='$d_setegid'
14417 d_seteuid='$d_seteuid'
14418 d_setgrent='$d_setgrent'
14419 d_setgrps='$d_setgrps'
14420 d_sethent='$d_sethent'
14421 d_setlinebuf='$d_setlinebuf'
14422 d_setlocale='$d_setlocale'
14423 d_setnent='$d_setnent'
14424 d_setpent='$d_setpent'
14425 d_setpgid='$d_setpgid'
14426 d_setpgrp2='$d_setpgrp2'
14427 d_setpgrp='$d_setpgrp'
14428 d_setprior='$d_setprior'
14429 d_setpwent='$d_setpwent'
14430 d_setregid='$d_setregid'
14431 d_setresgid='$d_setresgid'
14432 d_setresuid='$d_setresuid'
14433 d_setreuid='$d_setreuid'
14434 d_setrgid='$d_setrgid'
14435 d_setruid='$d_setruid'
14436 d_setsent='$d_setsent'
14437 d_setsid='$d_setsid'
14438 d_setspent='$d_setspent'
14439 d_setvbuf='$d_setvbuf'
14443 d_shmatprototype='$d_shmatprototype'
14444 d_shmctl='$d_shmctl'
14446 d_shmget='$d_shmget'
14447 d_sigaction='$d_sigaction'
14448 d_sigsetjmp='$d_sigsetjmp'
14449 d_socket='$d_socket'
14450 d_sockpair='$d_sockpair'
14452 d_statblks='$d_statblks'
14453 d_statfs_f_flags='$d_statfs_f_flags'
14454 d_statfs_s='$d_statfs_s'
14455 d_statvfs='$d_statvfs'
14456 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14457 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14458 d_stdio_stream_array='$d_stdio_stream_array'
14459 d_stdiobase='$d_stdiobase'
14460 d_stdstdio='$d_stdstdio'
14461 d_strchr='$d_strchr'
14462 d_strcoll='$d_strcoll'
14463 d_strctcpy='$d_strctcpy'
14464 d_strerrm='$d_strerrm'
14465 d_strerror='$d_strerror'
14466 d_strtod='$d_strtod'
14467 d_strtol='$d_strtol'
14468 d_strtoul='$d_strtoul'
14469 d_strtoull='$d_strtoull'
14470 d_strxfrm='$d_strxfrm'
14471 d_suidsafe='$d_suidsafe'
14472 d_symlink='$d_symlink'
14473 d_syscall='$d_syscall'
14474 d_sysconf='$d_sysconf'
14475 d_sysernlst='$d_sysernlst'
14476 d_syserrlst='$d_syserrlst'
14477 d_system='$d_system'
14478 d_tcgetpgrp='$d_tcgetpgrp'
14479 d_tcsetpgrp='$d_tcsetpgrp'
14480 d_telldir='$d_telldir'
14481 d_telldirproto='$d_telldirproto'
14484 d_truncate='$d_truncate'
14485 d_tzname='$d_tzname'
14488 d_union_semun='$d_union_semun'
14490 d_vendorbin='$d_vendorbin'
14491 d_vendorlib='$d_vendorlib'
14493 d_void_closedir='$d_void_closedir'
14494 d_voidsig='$d_voidsig'
14495 d_voidtty='$d_voidtty'
14496 d_volatile='$d_volatile'
14497 d_vprintf='$d_vprintf'
14499 d_waitpid='$d_waitpid'
14500 d_wcstombs='$d_wcstombs'
14501 d_wctomb='$d_wctomb'
14504 db_hashtype='$db_hashtype'
14505 db_prefixtype='$db_prefixtype'
14506 defvoidused='$defvoidused'
14507 direntrytype='$direntrytype'
14510 doublesize='$doublesize'
14512 dynamic_ext='$dynamic_ext'
14518 eunicefix='$eunicefix'
14521 extensions='$extensions'
14522 fflushNULL='$fflushNULL'
14523 fflushall='$fflushall'
14525 firstmakefile='$firstmakefile'
14527 fpossize='$fpossize'
14528 fpostype='$fpostype'
14529 freetype='$freetype'
14531 full_csh='$full_csh'
14532 full_sed='$full_sed'
14533 gccversion='$gccversion'
14534 gidformat='$gidformat'
14540 groupcat='$groupcat'
14541 groupstype='$groupstype'
14544 h_sysfile='$h_sysfile'
14556 i_arpainet='$i_arpainet'
14557 i_bsdioctl='$i_bsdioctl'
14560 i_dirent='$i_dirent'
14567 i_inttypes='$i_inttypes'
14568 i_limits='$i_limits'
14569 i_locale='$i_locale'
14570 i_machcthr='$i_machcthr'
14571 i_malloc='$i_malloc'
14573 i_memory='$i_memory'
14574 i_mntent='$i_mntent'
14577 i_neterrno='$i_neterrno'
14578 i_netinettcp='$i_netinettcp'
14581 i_pthread='$i_pthread'
14583 i_rpcsvcdbm='$i_rpcsvcdbm'
14586 i_shadow='$i_shadow'
14588 i_stdarg='$i_stdarg'
14589 i_stddef='$i_stddef'
14590 i_stdlib='$i_stdlib'
14591 i_string='$i_string'
14592 i_sysaccess='$i_sysaccess'
14593 i_sysdir='$i_sysdir'
14594 i_sysfile='$i_sysfile'
14595 i_sysfilio='$i_sysfilio'
14597 i_sysioctl='$i_sysioctl'
14598 i_sysmount='$i_sysmount'
14599 i_sysndir='$i_sysndir'
14600 i_sysparam='$i_sysparam'
14601 i_sysresrc='$i_sysresrc'
14602 i_syssecrt='$i_syssecrt'
14603 i_sysselct='$i_sysselct'
14604 i_syssockio='$i_syssockio'
14605 i_sysstat='$i_sysstat'
14606 i_sysstatfs='$i_sysstatfs'
14607 i_sysstatvfs='$i_sysstatvfs'
14608 i_systime='$i_systime'
14609 i_systimek='$i_systimek'
14610 i_systimes='$i_systimes'
14611 i_systypes='$i_systypes'
14612 i_sysuio='$i_sysuio'
14614 i_sysvfs='$i_sysvfs'
14615 i_syswait='$i_syswait'
14616 i_termio='$i_termio'
14617 i_termios='$i_termios'
14619 i_unistd='$i_unistd'
14622 i_values='$i_values'
14623 i_varargs='$i_varargs'
14624 i_varhdr='$i_varhdr'
14626 ignore_versioned_solibs='$ignore_versioned_solibs'
14629 installarchlib='$installarchlib'
14630 installbin='$installbin'
14631 installman1dir='$installman1dir'
14632 installman3dir='$installman3dir'
14633 installprefix='$installprefix'
14634 installprefixexp='$installprefixexp'
14635 installprivlib='$installprivlib'
14636 installscript='$installscript'
14637 installsitearch='$installsitearch'
14638 installsitebin='$installsitebin'
14639 installsitelib='$installsitelib'
14640 installstyle='$installstyle'
14641 installusrbinperl='$installusrbinperl'
14642 installvendorbin='$installvendorbin'
14643 installvendorlib='$installvendorlib'
14645 ivdformat='$ivdformat'
14648 known_extensions='$known_extensions'
14652 lddlflags='$lddlflags'
14654 ldlibpthname='$ldlibpthname'
14661 libswanted='$libswanted'
14667 locincpth='$locincpth'
14668 loclibpth='$loclibpth'
14669 longdblsize='$longdblsize'
14670 longlongsize='$longlongsize'
14671 longsize='$longsize'
14675 lseeksize='$lseeksize'
14676 lseektype='$lseektype'
14680 make_set_make='$make_set_make'
14681 mallocobj='$mallocobj'
14682 mallocsrc='$mallocsrc'
14683 malloctype='$malloctype'
14685 man1direxp='$man1direxp'
14688 man3direxp='$man3direxp'
14691 mips_type='$mips_type'
14694 modetype='$modetype'
14696 multiarch='$multiarch'
14698 myarchname='$myarchname'
14699 mydomain='$mydomain'
14700 myhostname='$myhostname'
14703 netdb_hlen_type='$netdb_hlen_type'
14704 netdb_host_type='$netdb_host_type'
14705 netdb_name_type='$netdb_name_type'
14706 netdb_net_type='$netdb_net_type'
14709 nm_so_opt='$nm_so_opt'
14710 nonxs_ext='$nonxs_ext'
14714 o_nonblock='$o_nonblock'
14716 old_pthread_create_joinable='$old_pthread_create_joinable'
14717 optimize='$optimize'
14718 orderlib='$orderlib'
14724 patchlevel='$patchlevel'
14725 path_sep='$path_sep'
14727 perladmin='$perladmin'
14728 perlpath='$perlpath'
14730 phostname='$phostname'
14733 pm_apiversion='$pm_apiversion'
14737 prefixexp='$prefixexp'
14739 privlibexp='$privlibexp'
14740 prototype='$prototype'
14742 quadkind='$quadkind'
14743 quadtype='$quadtype'
14744 randbits='$randbits'
14745 randfunc='$randfunc'
14746 randseedtype='$randseedtype'
14748 rd_nodata='$rd_nodata'
14752 sPRIEldbl='$sPRIEldbl'
14753 sPRIFldbl='$sPRIFldbl'
14754 sPRIGldbl='$sPRIGldbl'
14757 sPRIeldbl='$sPRIeldbl'
14758 sPRIfldbl='$sPRIfldbl'
14759 sPRIgldbl='$sPRIgldbl'
14764 sched_yield='$sched_yield'
14765 scriptdir='$scriptdir'
14766 scriptdirexp='$scriptdirexp'
14768 seedfunc='$seedfunc'
14769 selectminbits='$selectminbits'
14770 selecttype='$selecttype'
14771 sendmail='$sendmail'
14774 sharpbang='$sharpbang'
14775 shmattype='$shmattype'
14776 shortsize='$shortsize'
14779 sig_count='$sig_count'
14780 sig_name='$sig_name'
14781 sig_name_init='$sig_name_init'
14783 sig_num_init='$sig_num_init'
14784 signal_t='$signal_t'
14785 sitearch='$sitearch'
14786 sitearchexp='$sitearchexp'
14788 sitebinexp='$sitebinexp'
14790 sitelibexp='$sitelibexp'
14791 siteprefix='$siteprefix'
14792 siteprefixexp='$siteprefixexp'
14793 sizetype='$sizetype'
14798 sockethdr='$sockethdr'
14799 socketlib='$socketlib'
14801 spackage='$spackage'
14802 spitshell='$spitshell'
14805 ssizetype='$ssizetype'
14806 startperl='$startperl'
14808 static_ext='$static_ext'
14810 stdio_base='$stdio_base'
14811 stdio_bufsiz='$stdio_bufsiz'
14812 stdio_cnt='$stdio_cnt'
14813 stdio_filbuf='$stdio_filbuf'
14814 stdio_ptr='$stdio_ptr'
14815 stdio_stream_array='$stdio_stream_array'
14818 subversion='$subversion'
14825 timeincl='$timeincl'
14826 timetype='$timetype'
14839 uidformat='$uidformat'
14845 uquadtype='$uquadtype'
14846 use64bits='$use64bits'
14848 uselargefiles='$uselargefiles'
14849 uselongdouble='$uselongdouble'
14850 uselonglong='$uselonglong'
14851 usemorebits='$usemorebits'
14852 usemultiplicity='$usemultiplicity'
14853 usemymalloc='$usemymalloc'
14855 useopcode='$useopcode'
14856 useperlio='$useperlio'
14857 useposix='$useposix'
14859 useshrplib='$useshrplib'
14860 usesocks='$usesocks'
14861 usethreads='$usethreads'
14862 usevendorprefix='$usevendorprefix'
14863 usevfork='$usevfork'
14866 uvoformat='$uvoformat'
14869 uvuformat='$uvuformat'
14870 uvxformat='$uvxformat'
14871 vendorbin='$vendorbin'
14872 vendorbinexp='$vendorbinexp'
14873 vendorlib='$vendorlib'
14874 vendorlibexp='$vendorlibexp'
14875 vendorprefix='$vendorprefix'
14876 vendorprefixexp='$vendorprefixexp'
14879 voidflags='$voidflags'
14881 xs_apiversion='$xs_apiversion'
14886 : Add in command line options if available
14887 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14889 : add special variables
14890 $test -f $src/patchlevel.h && \
14891 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14892 echo "CONFIGDOTSH=true" >>config.sh
14894 : propagate old symbols
14895 if $test -f UU/config.sh; then
14896 <UU/config.sh sort | uniq >UU/oldconfig.sh
14897 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14898 sort | uniq -u >UU/oldsyms
14899 set X `cat UU/oldsyms`
14905 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14907 echo "# Variables propagated from previous config.sh file." >>config.sh
14908 for sym in `cat UU/oldsyms`; do
14909 echo " Propagating $hint variable "'$'"$sym..."
14910 eval 'tmp="$'"${sym}"'"'
14912 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14918 : Finish up by extracting the .SH files
14932 If you'd like to make any changes to the config.sh file before I begin
14933 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14936 rp="Press return or use a shell escape to edit config.sh:"
14941 *) : in case they cannot read
14942 sh 1>&4 -c "$ans";;
14947 : if this fails, just run all the .SH files by hand
14954 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14961 Now you need to generate make dependencies by running "$make depend".
14962 You might prefer to run it in background: "$make depend > makedepend.out &"
14963 It can take a while, so you might not want to run it right now.
14968 rp="Run $make depend now?"
14972 $make depend && echo "Now you must run a $make."
14975 echo "You must run '$make depend' then '$make'."
14978 elif test -f [Mm]akefile; then
14980 echo "Now you must run a $make."
14985 if $test -f Policy.sh; then
14988 If you compile $package on a different machine or from a different object
14989 directory, copy the Policy.sh file from this object directory to the
14990 new one before you run Configure -- this will help you with most of
14991 the policy defaults.
14995 if $test -f config.msg; then
14996 echo "Hmm. I also noted the following information while running:"
14998 $cat config.msg >&4
15001 $rm -f kit*isdone ark*isdone