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 Thu Aug 12 22:03:15 EET DST 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=''
712 ignore_versioned_solibs=''
842 d_stdio_stream_array=''
843 stdio_stream_array=''
877 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
880 : We must find out about Eunice early
882 if test -f /etc/unixtovms; then
883 eunicefix=/etc/unixtovms
885 if test -f /etc/unixtovms.exe; then
886 eunicefix=/etc/unixtovms.exe
890 : Possible local include directories to search.
891 : Set locincpth to "" in a hint file to defeat local include searches.
892 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
893 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
895 : no include file wanted by default
898 : list of known cpp symbols, sorted alphabetically
899 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
900 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
901 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
902 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
903 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
904 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
905 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
906 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
907 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
908 al="$al VMS Xenix286"
909 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
910 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
911 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
912 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
913 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
914 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
915 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
916 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
917 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
918 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
919 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
920 al="$al __SVR4_2__ __UMAXV__"
921 al="$al ____386BSD____ __alpha __alpha__ __amiga"
922 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
923 al="$al __host_mips__"
924 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
925 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
926 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
927 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
928 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
929 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
930 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
931 al="$al __mc88100 __mc88100__ __mips __mips__"
932 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
933 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
934 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
935 al="$al _host_mips _mips _unix"
936 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
937 al="$al apollo ardent att386 att3b"
938 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
939 al="$al cadmus clipper concurrent convex cray ctix"
940 al="$al dmert encore gcos gcx gimpel gould"
941 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
942 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
943 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
944 al="$al i186 i286 i386 i486 i8086"
945 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
946 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
947 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
948 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
949 al="$al mc88000 mc88100 merlin mert mips mvs n16"
950 al="$al ncl_el ncl_mr"
951 al="$al news1500 news1700 news1800 news1900 news3700"
952 al="$al news700 news800 news900 ns16000 ns32000"
953 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
954 al="$al parisc pc532 pdp11 plexus posix pyr"
955 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
956 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
957 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
958 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
959 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
960 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
963 : Trailing extension. Override this in a hint file, if needed.
965 : Extra object files, if any, needed on this platform.
968 : change the next line if compiling for Xenix/286 on Xenix/386
969 xlibpth='/usr/lib/386 /lib/386'
971 : Possible local library directories to search.
972 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
973 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
975 : general looking path for locating libraries
976 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
977 glibpth="$glibpth /lib /usr/lib $xlibpth"
978 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
979 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
981 : Private path used by Configure to find libraries. Its value
982 : is prepended to libpth. This variable takes care of special
983 : machines, like the mips. Usually, it should be empty.
986 : default library list
988 : some systems want to use only the non-versioned libso:s
989 ignore_versioned_solibs=''
990 : full support for void wanted by default
993 : set useposix=false in your hint file to disable the POSIX extension.
995 : set useopcode=false in your hint file to disable the Opcode extension.
997 : set usemultiplicity on the Configure command line to enable multiplicity.
998 : set usesocks on the Configure command line to enable socks.
999 : set usethreads on the Configure command line to enable threads.
1000 : List of libraries we want.
1001 : If anyone needs -lnet, put it in a hint file.
1002 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1003 libswanted="$libswanted dld ld sun m rt c cposix posix"
1004 libswanted="$libswanted ndir dir crypt sec"
1005 libswanted="$libswanted ucb bsd BSD PW x"
1006 : We probably want to search /usr/shlib before most other libraries.
1007 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1008 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1009 glibpth="/usr/shlib $glibpth"
1010 : Do not use vfork unless overridden by a hint file.
1013 : Find the basic shell for Bourne shell scripts
1017 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1020 if test -f "$xxx"; then
1023 : Build up a list and do a single loop so we can 'break' out.
1024 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1025 for xxx in sh bash ksh pdksh ash; do
1027 try="$try ${p}/${xxx}"
1031 if test -f "$xxx"; then
1034 elif test -f "$xxx.exe"; then
1045 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1047 Usually it's in /bin/sh. How did you even get this far?
1048 Please contact me (Perl Maintainers) at perlbug@perl.com and
1049 we'll try to straighten this all out.
1055 : see if sh knows # comments
1056 if `$sh -c '#' >/dev/null 2>&1`; then
1060 test -f $xcat || xcat=/usr/bin/cat
1065 if test -s today; then
1068 echo "#! $xcat" > try
1072 if test -s today; then
1080 echo "Your $sh doesn't grok # comments--I will strip them later on."
1083 echo "exec grep -v '^[ ]*#'" >spitshell
1085 $eunicefix spitshell
1086 spitshell=`pwd`/spitshell
1088 echo "I presume that if # doesn't work, #! won't work either!"
1093 : figure out how to guarantee sh startup
1095 '') startsh=${sharpbang}${sh} ;;
1107 : echo "Yup, it does."
1109 echo "Hmm... '$startsh' does not guarantee sh startup..."
1110 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1115 : Save command line options in file UU/cmdline.opt for later use in
1116 : generating config.sh.
1117 cat > cmdline.opt <<EOSH
1118 # Configure command line arguments.
1125 cat >>cmdline.opt <<EOSH
1126 config_arg$argn='$arg'
1128 argn=`expr $argn + 1`
1131 : produce awk script to parse command line options
1132 cat >options.awk <<'EOF'
1134 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1136 len = length(optstr);
1137 for (i = 1; i <= len; i++) {
1138 c = substr(optstr, i, 1);
1139 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1150 if (substr(str, 1, 1) != "-") {
1151 printf("'%s'\n", str);
1155 for (i = 2; i <= len; i++) {
1156 c = substr(str, i, 1);
1158 printf("-%s\n", substr(str, i));
1164 printf("'%s'\n", substr(str, i + 1));
1177 : process the command line options
1178 set X `for arg in "$@"; do echo "X$arg"; done |
1179 sed -e s/X// | awk -f options.awk`
1184 : set up default values
1195 cat >optdef.sh <<EOS
1201 while test $# -gt 0; do
1203 -d) shift; fastread=yes;;
1204 -e) shift; alldone=cont;;
1208 if test -r "$1"; then
1211 echo "$me: cannot read config file $1." >&2
1216 -h) shift; error=true;;
1217 -r) shift; reuseval=true;;
1218 -s) shift; silent=true; realsilent=true;;
1219 -E) shift; alldone=exit;;
1220 -K) shift; knowitall=true;;
1221 -O) shift; override=true;;
1222 -S) shift; silent=true; extractsh=true;;
1227 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1228 echo "$me: ignoring -D $1" >&2
1231 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1232 *) echo "$1='define'" >> optdef.sh;;
1239 *=) echo "$1" >> optdef.sh;;
1241 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1242 echo "$me: ignoring -U $1" >&2
1244 *) echo "$1='undef'" >> optdef.sh;;
1248 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1251 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1259 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1260 [-U symbol] [-U symbol=]
1261 -d : use defaults for all answers.
1262 -e : go on without questioning past the production of config.sh.
1263 -f : specify an alternate default configuration file.
1264 -h : print this help message and exit (with an error status).
1265 -r : reuse C symbols value if possible (skips costly nm extraction).
1266 -s : silent mode, only echoes questions and essential information.
1267 -D : define symbol to have some value:
1268 -D symbol symbol gets the value 'define'
1269 -D symbol=value symbol gets the value 'value'
1270 -E : stop at the end of questions, after having produced config.sh.
1271 -K : do not use unless you know what you are doing.
1272 -O : let -D and -U override definitions from loaded configuration file.
1273 -S : perform variable substitutions on all .SH files (can mix with -f)
1274 -U : undefine symbol:
1275 -U symbol symbol gets the value 'undef'
1276 -U symbol= symbol gets completely empty
1277 -V : print version number and exit (with a zero status).
1284 case "$fastread$alldone" in
1287 if test ! -t 0; then
1288 echo "Say 'sh Configure', not 'sh <Configure'"
1296 true) exec 1>/dev/null;;
1299 : run the defines and the undefines, if any, but leave the file out there...
1305 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1306 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1307 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1308 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1309 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1312 : Some greps do not return status, grrr.
1313 echo "grimblepritz" >grimble
1314 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1316 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1322 : the following should work in any shell
1326 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1327 cat >contains <<'EOSS'
1328 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1333 : Find the path to the source tree
1336 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1339 *) src=`cd ../$src && pwd` ;;
1352 if test -f $rsrc/Configure && \
1353 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1355 : found it, so we are ok.
1358 for src in . .. ../.. ../../.. ../../../..; do
1359 if test -f ../$src/Configure && \
1360 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1371 Sorry, I can't seem to locate the source dir for $package. Please start
1372 Configure with an explicit path -- i.e. /some/path/Configure.
1380 echo "Sources for $package found in \"$src\"." >&4
1384 : script used to extract .SH files with variable substitutions
1385 cat >extract <<'EOS'
1387 echo "Doing variable substitutions on .SH files..."
1388 if test -f $src/MANIFEST; then
1389 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1391 echo "(Looking for .SH files under the source directory.)"
1392 set x `(cd $src; find . -name "*.SH" -print)`
1396 0) set x `(cd $src; echo *.SH)`; shift;;
1398 if test ! -f $src/$1; then
1404 while test $name; do
1405 if test ! -d "$name"; then
1406 create="$name $create";
1407 name=`echo $name | sed -e "s|^[^/]*$||"`;
1408 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1413 for file in $create; do
1422 dir=`expr X$file : 'X\(.*\)/'`
1423 file=`expr X$file : 'X.*/\(.*\)'`
1424 (cd $dir && . ./$file)
1434 dir=`expr X$file : 'X\(.*\)/'`
1435 file=`expr X$file : 'X.*/\(.*\)'`
1436 (set x $dir; shift; eval $mkdir_p)
1446 if test -f $src/config_h.SH; then
1447 if test ! -f config.h; then
1448 : oops, they left it out of MANIFEST, probably, so do it anyway.
1454 : extract files and exit if asked to do so
1455 case "$extractsh" in
1457 case "$realsilent" in
1461 case "$config_sh" in
1462 '') config_sh='config.sh';;
1465 echo "Fetching answers from $config_sh..."
1468 test "$override" && . ./optdef.sh
1477 : Eunice requires " " instead of "", can you believe it
1480 echo "Beginning of configuration questions for $package."
1482 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1484 : first determine how to suppress newline on echo command
1486 echo "Checking echo to see how to suppress newlines..."
1487 (echo "hi there\c" ; echo " ") >.echotmp
1488 if $contains c .echotmp >/dev/null 2>&1 ; then
1499 echo $n "The star should be here-->$c"
1503 : Now test for existence of everything in MANIFEST
1505 if test -f $rsrc/MANIFEST; then
1506 echo "First let's make sure your kit is complete. Checking..." >&4
1507 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1510 for filelist in x??; do
1511 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1513 if test -s missing; then
1517 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1519 You have the option of continuing the configuration process, despite the
1520 distinct possibility that your kit is damaged, by typing 'y'es. If you
1521 do, don't blame me if something goes wrong. I advise you to type 'n'o
1522 and contact the author (perlbug@perl.com).
1525 echo $n "Continue? [n] $c" >&4
1529 echo "Continuing..." >&4
1533 echo "ABORTING..." >&4
1538 echo "Looks good..."
1541 echo "There is no MANIFEST file. I hope your kit is complete !"
1546 : Find the appropriate value for a newline for tr
1547 if test -n "$DJGPP"; then
1550 if test X"$trnl" = X; then
1551 case "`echo foo|tr '\n' x 2>/dev/null`" in
1555 if test X"$trnl" = X; then
1556 case "`echo foo|tr '\012' x 2>/dev/null`" in
1557 foox) trnl='\012' ;;
1560 if test X"$trnl" = X; then
1563 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1569 : compute the number of columns on the terminal for proper question formatting
1574 : set up the echo used in my read
1575 myecho="case \"\$xxxm\" in
1576 '') echo $n \"\$rp $c\" >&4;;
1578 '') echo $n \"[\$xxxm] $c\";;
1580 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1582 echo $n \"[\$xxxm] $c\" >&4
1584 echo $n \"\$rp [\$xxxm] $c\" >&4
1590 : now set up to do reads with possible shell escape and default assignment
1596 case "\$fastread" in
1597 yes) case "\$dflt" in
1600 case "\$silent-\$rp" in
1605 *) case "\$silent" in
1606 true) case "\$rp" in
1611 while expr "X\$ans" : "X!" >/dev/null; do
1615 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1623 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1632 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1637 echo "(OK, I'll run with -d after this question.)" >&4
1640 echo "*** Sorry, \$1 not supported yet." >&4
1650 echo "*** Substitution done -- please confirm."
1652 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1657 echo "*** Error -- try again."
1664 case "\$ans\$xxxm\$nostick" in
1676 : create .config dir to save info across Configure sessions
1677 test -d ../.config || mkdir ../.config
1678 cat >../.config/README <<EOF
1679 This directory created by Configure to save information that should
1680 persist across sessions for $package.
1682 You may safely delete it if you wish.
1685 : general instructions
1688 user=`(logname) 2>/dev/null`
1690 '') user=`whoami 2>&1`;;
1692 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1695 rp='Would you like to see the instructions?'
1706 This installation shell script will examine your system and ask you questions
1707 to determine how the perl5 package should be installed. If you get
1708 stuck on a question, you may use a ! shell escape to start a subshell or
1709 execute a command. Many of the questions will have default answers in square
1710 brackets; typing carriage return will give you the default.
1712 On some of the questions which ask for file or directory names you are allowed
1713 to use the ~name construct to specify the login directory belonging to "name",
1714 even if you don't have a shell which knows about that. Questions where this is
1715 allowed will be marked "(~name ok)".
1719 dflt='Type carriage return to continue'
1723 The prompter used in this script allows you to use shell variables and
1724 backticks in your answers. You may use $1, $2, etc... to refer to the words
1725 in the default answer, as if the default line was a set of arguments given to a
1726 script shell. This means you may also use $* to repeat the whole default line,
1727 so you do not have to re-type everything to add something to the default.
1729 Everytime there is a substitution, you will have to confirm. If there is an
1730 error (e.g. an unmatched backtick), the default answer will remain unchanged
1731 and you will be prompted again.
1733 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1734 the questions and use the computed defaults (or the previous answers if there
1735 was already a config.sh file). Type 'Configure -h' for a list of options.
1736 You may also start interactively and then answer '& -d' at any prompt to turn
1737 on the non-interactive behaviour for the remainder of the execution.
1743 Much effort has been expended to ensure that this shell script will run on any
1744 Unix system. If despite that it blows up on yours, your best bet is to edit
1745 Configure and run it again. If you can't run Configure for some reason,
1746 you'll have to generate a config.sh file by hand. Whatever problems you
1747 have, let me (perlbug@perl.com) know how I blew it.
1749 This installation script affects things in two ways:
1751 1) it may do direct variable substitutions on some of the files included
1753 2) it builds a config.h file for inclusion in C programs. You may edit
1754 any of these files as the need arises after running this script.
1756 If you make a mistake on a question, there is no easy way to back up to it
1757 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1758 files. Configure will offer to let you do this before it runs the SH files.
1761 dflt='Type carriage return to continue'
1763 case "$firsttime" in
1764 true) echo $user >>../.config/instruct;;
1768 : find out where common programs are
1770 echo "Locating common programs..." >&4
1783 if test -d \$dir/\$thing; then
1789 for thisthing in \$dir/\$thing; do
1790 : just loop through to pick last item
1792 if test -f \$thisthing; then
1795 elif test -f \$dir/\$thing.exe; then
1796 if test -n "$DJGPP"; then
1797 echo \$dir/\$thing.exe
1799 : on Eunice apparently
1849 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1850 pth="$pth /lib /usr/lib"
1851 for file in $loclist; do
1855 if test -f "$xxx"; then
1858 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1859 xxx=`./loc $file $file $pth`
1862 '') xxx=`./loc $file $file $pth`;;
1863 *) xxx=`./loc $xxx $xxx $pth`;;
1869 echo $file is in $xxx.
1872 echo $file is in $xxx.
1875 echo "I don't know where '$file' is, and my life depends on it." >&4
1876 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1882 echo "Don't worry if any of the following aren't found..."
1884 for file in $trylist; do
1888 if test -f "$xxx"; then
1891 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1892 xxx=`./loc $file $file $pth`
1895 '') xxx=`./loc $file $file $pth`;;
1896 *) xxx=`./loc $xxx $xxx $pth`;;
1902 echo $file is in $xxx.
1905 echo $file is in $xxx.
1908 echo "I don't see $file out there, $say."
1915 echo "Substituting grep for egrep."
1921 echo "Substituting cp for ln."
1927 echo "Hopefully test is built into your sh."
1930 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1931 echo "Using the test built into your sh."
1939 echo "Hopefully echo is built into your sh."
1944 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1945 $echo $n "hi there$c" >foo1
1946 echo $n "hi there$c" >foo2
1947 if cmp foo1 foo2 >/dev/null 2>&1; then
1948 echo "They are compatible. In fact, they may be identical."
1955 They are not compatible! You are probably running ksh on a non-USG system.
1956 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1957 have echo built in and we may have to run some Bourne shell scripts. That
1958 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1961 $echo $n "The star should be here-->$c"
1968 : determine whether symbolic links are supported
1971 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1972 echo "Symbolic links are supported." >&4
1975 echo "Symbolic links are NOT supported." >&4
1980 : see whether [:lower:] and [:upper:] are supported character classes
1982 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1984 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1988 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1989 # (0xc9 and 0xd1), therefore that is a nice testing point.
1990 if test "X$up" = X -o "X$low" = X; then
1991 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1997 if test "X$up" = X -o "X$low" = X; then
1998 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2004 if test "X$up" = X -o "X$low" = X; then
2005 case "`echo IJ | od -x 2>/dev/null`" in
2007 echo "Hey, this might be EBCDIC." >&4
2008 if test "X$up" = X -o "X$low" = X; then
2009 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2010 ij) up='[A-IJ-RS-Z]'
2015 if test "X$up" = X -o "X$low" = X; then
2016 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2026 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2028 echo "Using $up and $low to convert case." >&4
2031 echo "I don't know how to translate letters from upper to lower case." >&4
2032 echo "Your tr is not acting any way I know of." >&4
2036 : set up the translation script tr, must be called with ./tr of course
2040 '[A-Z][a-z]') exec $tr '$up' '$low';;
2041 '[a-z][A-Z]') exec $tr '$low' '$up';;
2048 : Try to determine whether config.sh was made on this system
2049 case "$config_sh" in
2051 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2052 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2053 # because the A-Z/a-z are not consecutive.
2054 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2055 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2056 newmyuname="$myuname"
2058 case "$knowitall" in
2060 if test -f ../config.sh; then
2061 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2062 eval "`grep myuname= ../config.sh`"
2064 if test "X$myuname" = "X$newmyuname"; then
2072 : Get old answers from old config file if Configure was run on the
2073 : same system, otherwise use the hints.
2076 if test -f config.sh; then
2078 rp="I see a config.sh file. Shall I use it to set the defaults?"
2081 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2082 *) echo "Fetching default answers from your old config.sh file..." >&4
2090 : Older versions did not always set $sh. Catch re-use of such
2099 if test ! -f config.sh; then
2102 First time through, eh? I have some defaults handy for some systems
2103 that need some extra help getting the Configure answers right:
2106 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2108 : Half the following guesses are probably wrong... If you have better
2109 : tests or hints, please send them to perlbug@perl.com
2110 : The metaconfig authors would also appreciate a copy...
2111 $test -f /irix && osname=irix
2112 $test -f /xenix && osname=sco_xenix
2113 $test -f /dynix && osname=dynix
2114 $test -f /dnix && osname=dnix
2115 $test -f /lynx.os && osname=lynxos
2116 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2117 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2118 $test -f /bin/mips && /bin/mips && osname=mips
2119 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2120 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2121 $test -d /usr/apollo/bin && osname=apollo
2122 $test -f /etc/saf/_sactab && osname=svr4
2123 $test -d /usr/include/minix && osname=minix
2124 if $test -d /MachTen -o -d /MachTen_Folder; then
2126 if $test -x /sbin/version; then
2127 osvers=`/sbin/version | $awk '{print $2}' |
2128 $sed -e 's/[A-Za-z]$//'`
2129 elif $test -x /usr/etc/version; then
2130 osvers=`/usr/etc/version | $awk '{print $2}' |
2131 $sed -e 's/[A-Za-z]$//'`
2136 $test -f /sys/posix.dll &&
2137 $test -f /usr/bin/what &&
2138 set X `/usr/bin/what /sys/posix.dll` &&
2139 $test "$3" = UWIN &&
2142 if $test -f $uname; then
2150 umips) osname=umips ;;
2153 [23]100) osname=mips ;;
2154 next*) osname=next ;;
2156 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2157 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2160 elif $test -f /etc/kconfig; then
2162 if test "$lns" = "$ln -s"; then
2164 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2166 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2173 if test -n "$DJGPP"; then
2182 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2184 'not found') osvers="$4"."$3" ;;
2185 '<3240'|'<>3240') osvers=3.2.0 ;;
2186 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2187 '=3250'|'>3250') osvers=3.2.5 ;;
2191 *dc.osx) osname=dcosx
2197 domainos) osname=apollo
2203 dynixptx*) osname=dynixptx
2204 osvers=`echo "$4"|sed 's/^v//'`
2206 freebsd) osname=freebsd
2208 genix) osname=genix ;;
2210 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2226 netbsd*) osname=netbsd
2229 news-os) osvers="$3"
2231 4*) osname=newsos4 ;;
2235 bsd386) osname=bsd386
2238 POSIX-BC | posix-bc ) osname=posix-bc
2241 powerux | power_ux | powermax_os | powermaxos | \
2242 powerunix | power_unix) osname=powerux
2245 next*) osname=next ;;
2246 solaris) osname=solaris
2248 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2255 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2259 titanos) osname=titanos
2268 ultrix) osname=ultrix
2271 osf1|mls+) case "$5" in
2274 osvers=`echo "$3" | sed 's/^[xvt]//'`
2276 hp*) osname=hp_osf1 ;;
2277 mips) osname=mips_osf1 ;;
2286 $2) case "$osname" in
2290 : svr4.x or possibly later
2300 if test -f /stand/boot ; then
2301 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2302 if test -n "$INITPROG" -a -f "$INITPROG"; then
2303 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2304 if test -n "$isesix"; then
2312 *) if test -f /etc/systemid; then
2314 set `echo $3 | $sed 's/\./ /g'` $4
2315 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2317 elif $test -f $src/hints/sco_$1_$2.sh; then
2319 elif $test -f $src/hints/sco_$1.sh; then
2324 '') : Still unknown. Probably a generic Sys V.
2333 *) case "$osname" in
2334 '') : Still unknown. Probably a generic BSD.
2342 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2343 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2344 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2347 $rm -f UU/kernel.what
2348 elif test -d c:/.; then
2355 : Now look for a hint file osname_osvers, unless one has been
2356 : specified already.
2359 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2360 : Also try without trailing minor version numbers.
2361 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2362 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2363 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2364 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2367 *) case "$osvers" in
2370 *) if $test -f $src/hints/$file.sh ; then
2372 elif $test -f $src/hints/$xfile.sh ; then
2374 elif $test -f $src/hints/$xxfile.sh ; then
2376 elif $test -f $src/hints/$xxxfile.sh ; then
2378 elif $test -f $src/hints/$xxxxfile.sh ; then
2380 elif $test -f "$src/hints/${osname}.sh" ; then
2389 if $test -f Policy.sh ; then
2392 none) dflt="Policy" ;;
2393 *) dflt="Policy $dflt" ;;
2398 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2402 if $test -f Policy.sh ; then
2405 There's also a Policy hint file available, which should make the
2406 site-specific (policy) questions easier to answer.
2413 You may give one or more space-separated answers, or "none" if appropriate.
2414 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2415 is a good thing. DO NOT give a wrong version or a wrong OS.
2419 rp="Which of these apply, if any?"
2422 for file in $tans; do
2423 if $test X$file = XPolicy -a -f Policy.sh; then
2425 $cat Policy.sh >> UU/config.sh
2426 elif $test -f $src/hints/$file.sh; then
2427 . $src/hints/$file.sh
2428 $cat $src/hints/$file.sh >> UU/config.sh
2429 elif $test X$tans = X -o X$tans = Xnone ; then
2432 : Give one chance to correct a possible typo.
2433 echo "$file.sh does not exist"
2435 rp="hint to use instead?"
2437 for file in $ans; do
2438 if $test -f "$src/hints/$file.sh"; then
2439 . $src/hints/$file.sh
2440 $cat $src/hints/$file.sh >> UU/config.sh
2441 elif $test X$ans = X -o X$ans = Xnone ; then
2444 echo "$file.sh does not exist -- ignored."
2451 : Remember our hint file for later.
2452 if $test -f "$src/hints/$file.sh" ; then
2462 echo "Fetching default answers from $config_sh..." >&4
2466 cp $config_sh config.sh 2>/dev/null
2476 test "$override" && . ./optdef.sh
2477 myuname="$newmyuname"
2479 : Restore computed paths
2480 for file in $loclist $trylist; do
2481 eval $file="\$_$file"
2486 Configure uses the operating system name and version to set some defaults.
2487 The default value is probably right if the name rings a bell. Otherwise,
2488 since spelling matters for me, either accept the default or answer "none"
2495 ''|' '|none) dflt=none ;;
2496 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2499 *) dflt="$osname" ;;
2501 rp="Operating system name?"
2505 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2511 ''|' '|none) dflt=none ;;
2512 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2513 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2515 ''|' ') dflt=none ;;
2520 *) dflt="$osvers" ;;
2522 rp="Operating system version?"
2529 : who configured the system
2530 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2531 cf_by=`(logname) 2>/dev/null`
2534 cf_by=`(whoami) 2>/dev/null`
2536 "") cf_by=unknown ;;
2540 : set up the script used to warn in case of inconsistency
2547 echo "*** WHOA THERE!!! ***" >&4
2548 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2549 rp=" Keep the $hint value?"
2552 y) td=$was; tu=$was;;
2556 : function used to set $1 to $val
2557 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2559 $define$undef) . ./whoa; eval "$var=\$td";;
2560 $undef$define) . ./whoa; eval "$var=\$tu";;
2561 *) eval "$var=$val";;
2566 Perl can be built to take advantage of threads, on some systems.
2567 To do so, Configure must be run with -Dusethreads.
2569 Note that threading is a highly experimental feature, and
2570 some known race conditions still remain. If you choose to try
2571 it, be very sure to not actually deploy it for production
2572 purposes. README.threads has more details, and is required
2573 reading if you enable threads.
2575 case "$usethreads" in
2576 $define|true|[yY]*) dflt='y';;
2579 rp='Build a threading Perl?'
2582 y|Y) val="$define" ;;
2588 case "$d_oldpthreads" in
2589 '') : Configure tests would be welcome here. For now, assume undef.
2591 *) val="$d_oldpthreads" ;;
2597 case "$usethreads" in
2598 "$define"|true|[yY]*)
2599 : Look for a hint-file generated 'call-back-unit'. If the
2600 : user has specified that a threading perl is to be built,
2601 : we may need to set or change some other defaults.
2602 if $test -f usethreads.cbu; then
2603 echo "Your platform has some specific hints for threaded builds, using them..."
2607 (Your platform doesn't have any specific hints for threaded builds.
2608 Assuming POSIX threads, then.)
2616 Perl can be built so that multiple Perl interpreters can coexist
2617 within the same Perl executable. To do so, Configure must be run with
2620 Normally you do not need this and you should answer no.
2623 case "$usemultiplicity" in
2624 $define|true|[yY]*) dflt='y';;
2627 rp='Build Perl for multiplicity?'
2630 y|Y) val="$define" ;;
2636 : determine where manual pages are on this system
2640 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2641 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2642 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2643 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2644 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2645 sysman=`./loc . /usr/man/man1 $syspath`
2648 if $test -d "$sysman"; then
2649 echo "System manual is in $sysman." >&4
2651 echo "Could not find manual pages in source form." >&4
2654 : see what memory models we can support
2657 $cat >pdp11.c <<'EOP'
2666 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2667 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2668 dflt='unsplit split'
2670 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2673 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2678 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2681 if $test -d /lib/large || $test -d /usr/lib/large; then
2684 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2693 Some systems have different model sizes. On most systems they are called
2694 small, medium, large, and huge. On the PDP11 they are called unsplit and
2695 split. If your system doesn't support different memory models, say "none".
2696 If you wish to force everything to one memory model, say "none" here and
2697 put the appropriate flags later when it asks you for other cc and ld flags.
2698 Venix systems may wish to put "none" and let the compiler figure things out.
2699 (In the following question multiple model names should be space separated.)
2701 The default for most systems is "none".
2704 rp="Which memory models are supported?"
2719 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2720 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2727 rp="What flag indicates separate I and D space?"
2735 *large*|*small*|*medium*|*huge*)
2742 rp="What flag indicates large model?"
2752 *huge*) case "$huge" in
2756 rp="What flag indicates huge model?"
2766 *medium*) case "$medium" in
2770 rp="What flag indicates medium model?"
2777 *) medium="$large";;
2780 *small*) case "$small" in
2784 rp="What flag indicates small model?"
2795 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2798 $rm -f pdp11.* pdp11
2800 : make some quick guesses about what we are up against
2802 $echo $n "Hmm... $c"
2812 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2813 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2815 echo "Looks kind of like an OSF/1 system, but we'll see..."
2817 elif test `echo abc | tr a-z A-Z` = Abc ; then
2818 xxx=`./loc addbib blurfl $pth`
2819 if $test -f $xxx; then
2820 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2824 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2825 echo "Looks kind of like an extended USG system, but we'll see..."
2827 echo "Looks kind of like a USG system, but we'll see..."
2831 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2832 echo "Looks kind of like a BSD system, but we'll see..."
2836 echo "Looks kind of like a Version 7 system, but we'll see..."
2839 case "$eunicefix" in
2842 There is, however, a strange, musty smell in the air that reminds me of
2843 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2847 : it so happens the Eunice I know will not run shell scripts in Unix format
2851 echo "Congratulations. You aren't running Eunice."
2855 : Detect OS2. The p_ variable is set above in the Head.U unit.
2860 I have the feeling something is not exactly right, however...don't tell me...
2861 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2866 if test -f /xenix; then
2867 echo "Actually, this looks more like a XENIX system..."
2872 echo "It's not Xenix..."
2877 if test -f /venix; then
2878 echo "Actually, this looks more like a VENIX system..."
2885 echo "Nor is it Venix..."
2888 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2889 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2892 : see if we need a special compiler
2900 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2901 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2915 On some older systems the default C compiler will not resolve multiple global
2916 references that happen to have the same name. On some such systems the "Mcc"
2917 command may be used to force these to be resolved. On other systems a "cc -M"
2918 command is required. (Note that the -M flag on other systems indicates a
2919 memory model to use!) If you have the Gnu C compiler, you might wish to use
2925 rp="Use which C compiler?"
2933 rp="Use which C compiler?"
2937 : Look for a hint-file generated 'call-back-unit'. Now that the
2938 : user has specified the compiler, we may need to set or change some
2940 if $test -f cc.cbu; then
2944 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2945 $cat >gccvers.c <<EOM
2950 printf("%s\n", __VERSION__);
2952 printf("%s\n", "1");
2958 if $cc -o gccvers gccvers.c; then
2959 gccversion=`./gccvers`
2960 case "$gccversion" in
2961 '') echo "You are not using GNU cc." ;;
2962 *) echo "You are using GNU cc $gccversion." ;;
2966 echo "*** WHOA THERE!!! ***" >&4
2967 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2968 case "$knowitall" in
2970 echo " You'd better start hunting for one and let me know about it." >&4
2976 case "$gccversion" in
2977 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2982 Perl can be built to take advantage of explicit 64-bit interfaces,
2983 on some systems. To do so, Configure must be run with -Duse64bits.
2985 If this doesn't make any sense to you, just accept the default 'n'.
2987 case "$use64bits" in
2988 $define|true|[yY]*) dflt='y';;
2991 rp='Try to use explicit 64-bit interfaces, if available?'
3004 case "$archname64" in
3005 '') archname64='' ;; # not a typo
3008 case "$use64bits" in
3009 "$define"|true|[yY]*)
3010 : Look for a hint-file generated 'call-back-unit'. If the
3011 : user has specified that a 64 bit perl is to be built,
3012 : we may need to set or change some other defaults.
3013 if $test -f use64bits.cbu; then
3014 echo "Your platform has some specific hints for 64-bit builds, using them..."
3018 (Your platform doesn't have any specific hints for 64-bit builds.
3019 This is probably okay, especially if your system is a true 64-bit system.)
3021 case "$gccversion" in
3024 But since you seem to be using gcc,
3025 I will now add -DUSE_LONG_LONG to the compilation flags.
3027 ccflags="$ccflags -DUSE_LONG_LONG"
3034 : determine the architecture name
3036 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3037 tarch=`arch`"-$osname"
3038 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3039 if uname -m > tmparch 2>&1 ; then
3040 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3041 -e 's/$/'"-$osname/" tmparch`
3049 case "$myarchname" in
3052 echo "(Your architecture name used to be $myarchname.)"
3059 *) dflt="$archname";;
3061 rp='What is your architecture name'
3064 case "$usethreads" in
3066 echo "Threads selected." >&4
3068 *-thread*) echo "...and architecture name already has -thread." >&4
3070 *) archname="$archname-thread"
3071 echo "...setting architecture name to $archname." >&4
3076 case "$usemultiplicity" in
3078 echo "Multiplicity selected." >&4
3080 *-multi*) echo "...and architecture name already has -multi." >&4
3082 *) archname="$archname-multi"
3083 echo "...setting architecture name to $archname." >&4
3088 case "$use64bits" in
3090 echo "Explicit 64-bitness selected." >&4
3091 case "$archname64" in
3096 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3098 *) archname="$archname-$archname64"
3099 echo "...setting architecture name to $archname." >&4
3106 : decide how portable to be. Allow command line overrides.
3107 case "$d_portable" in
3109 *) d_portable="$define" ;;
3112 : set up shell script to do ~ expansion
3118 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3121 if $test -f /bin/csh; then
3122 /bin/csh -f -c "glob \$1"
3127 name=\`$expr x\$1 : '..\([^/]*\)'\`
3128 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3129 if $test ! -d "\$dir"; then
3131 echo "\$me: can't locate home directory for: \$name" >&2
3136 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3152 : now set up to get a file name
3156 cat <<'EOSC' >>getfile
3172 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3173 fn=`echo $fn | sed 's/(.*)//'`
3179 loc_file=`expr $fn : '.*:\(.*\)'`
3180 fn=`expr $fn : '\(.*\):.*'`
3188 */*) fullpath=true;;
3197 *e*) exp_file=true;;
3200 *p*) nopath_ok=true;;
3205 *d*) type='Directory';;
3206 *l*) type='Locate';;
3211 Locate) what='File';;
3216 case "$d_portable" in
3224 while test "$type"; do
3229 true) rp="$rp (~name ok)";;
3232 if test -f UU/getfile.ok && \
3233 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3252 value=`UU/filexp $ans`
3255 if test "$ans" != "$value"; then
3256 echo "(That expands to $value on this system.)"
3270 /*) value="$ansexp" ;;
3275 echo "I shall only accept a full path name, as in /bin/ls." >&4
3276 echo "Use a ! shell escape if you wish to check pathnames." >&4
3279 echo "Please give a full path name, starting with slash." >&4
3282 echo "Note that using ~name is ok provided it expands well." >&4
3295 for fp in $gfpth; do
3296 if test "X$fp" = X.; then
3301 if test -f "$pf"; then
3303 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3305 echo "($value is not a plain file, but that's ok.)"
3308 if test X"$type" = X; then
3315 for fp in $gfpth; do
3316 if test "X$fp" = X.; then
3321 if test -d "$pf"; then
3329 if test -d "$ansexp"; then
3330 echo "(Looking for $loc_file in directory $value.)"
3331 value="$value/$loc_file"
3332 ansexp="$ansexp/$loc_file"
3334 if test -f "$ansexp"; then
3337 case "$nopath_ok" in
3338 true) case "$value" in
3340 *) echo "Assuming $value will be in people's path."
3356 if test "$fastread" = yes; then
3361 rp="$what $value doesn't exist. Use that name anyway?"
3380 test "X$gfpthkeep" != Xy && gfpth=""
3383 : determine root of directory hierarchy where package will be installed.
3386 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3394 By default, $package will be installed in $dflt/bin, manual pages
3395 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3396 installation directories. Typically this is something like /usr/local.
3397 If you wish to have binaries under /usr/bin but other parts of the
3398 installation under /usr/local, that's ok: you will be prompted
3399 separately for each of the installation directories, the prefix being
3400 only used to set the defaults.
3404 rp='Installation prefix to use?'
3412 *) oldprefix="$prefix";;
3422 $define|true) afs=true ;;
3423 $undef|false) afs=false ;;
3424 *) if test -d /afs; then
3432 echo "AFS may be running... I'll be extra cautious then..." >&4
3434 echo "AFS does not seem to be running..." >&4
3437 : determine installation prefix for where package is to be installed.
3441 Since you are running AFS, I need to distinguish the directory in which
3442 files will reside from the directory in which they are installed (and from
3443 which they are presumably copied to the former directory by occult means).
3446 case "$installprefix" in
3447 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3448 *) dflt="$installprefix";;
3453 In some special cases, particularly when building $package for distribution,
3454 it is convenient to distinguish between the directory in which files should
3455 be installed from the directory ($prefix) in which they
3456 will eventually reside. For most users, these two directories are the same.
3459 case "$installprefix" in
3461 *) dflt=$installprefix;;
3465 rp='What installation prefix should I use for installing files?'
3467 installprefix="$ans"
3468 installprefixexp="$ansexp"
3470 : set the prefixit variable, to compute a suitable default value
3471 prefixit='case "$3" in
3473 case "$oldprefix" in
3474 "") eval "$1=\"\$$2\"";;
3481 ""|" ") eval "$1=\"\$$2\"";;
3487 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3489 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3490 /*-$oldprefix/*|\~*-$oldprefix/*)
3491 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3492 *) eval "$1=\"\$$2\"";;
3496 : set the base revision
3499 : get the patchlevel
3501 echo "Getting the current patchlevel..." >&4
3502 if $test -r $rsrc/patchlevel.h;then
3503 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3504 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3509 $echo $n "(You have $package" $c
3512 *) $echo $n " $baserev" $c ;;
3514 $echo $n " patchlevel $patchlevel" $c
3515 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3518 if test 0 -eq "$subversion"; then
3519 version=`LC_ALL=C; export LC_ALL; \
3520 echo $baserev $patchlevel | \
3521 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3523 version=`LC_ALL=C; export LC_ALL; \
3524 echo $baserev $patchlevel $subversion | \
3525 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3527 : Figure out perl API version. Perhaps this should be in patchlevel.h
3528 if test "$subversion" -lt 50; then
3529 apiversion=`LC_ALL=C; export LC_ALL; \
3530 LANGUAGE=C; export LANGUAGE; \
3531 echo $baserev $patchlevel | \
3532 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3534 apiversion="$version"
3537 : determine installation style
3538 : For now, try to deduce it from prefix unless it is already set.
3539 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3540 case "$installstyle" in
3541 '') case "$prefix" in
3542 *perl*) dflt='lib';;
3543 *) dflt='lib/perl5' ;;
3546 *) dflt='lib/perl5' ;;
3548 : Probably not worth prompting for this since we prompt for all
3549 : the directories individually, and the prompt would be too long and
3553 : determine where private library files go
3554 : Usual default is /usr/local/lib/perl5/$version.
3555 : Also allow things like /opt/perl/lib/$version, since
3556 : /opt/perl/lib/perl5... would be redundant.
3557 : The default "style" setting is made in installstyle.U
3558 case "$installstyle" in
3559 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3560 *) set dflt privlib lib/$version ;;
3565 There are some auxiliary files for $package that need to be put into a
3566 private library directory that is accessible by everyone.
3570 rp='Pathname where the private library files will reside?'
3573 privlibexp="$ansexp"
3574 : Change installation prefix, if necessary.
3575 if $test X"$prefix" != X"$installprefix"; then
3576 installprivlib=`echo $privlibexp | sed 's#^$prefix#$installprefix#'`
3578 installprivlib="$privlibexp"
3581 : set the prefixup variable, to restore leading tilda escape
3582 prefixup='case "$prefixexp" in
3584 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3587 : determine where public architecture dependent libraries go
3590 : privlib default is /usr/local/lib/$package/$version
3591 : archlib default is /usr/local/lib/$package/$version/$archname
3592 : privlib may have an optional trailing /share.
3593 tdflt=`echo $privlib | $sed 's,/share$,,'`
3594 tdflt=$tdflt/$archname
3603 $spackage contains architecture-dependent library files. If you are
3604 sharing libraries in a heterogeneous environment, you might store
3605 these files in a separate location. Otherwise, you can just include
3606 them with the rest of the public library files.
3610 rp='Where do you want to put the public architecture-dependent libraries?'
3613 archlibexp="$ansexp"
3614 if $test X"$archlib" = X"$privlib"; then
3619 : Change installation prefix, if necessary.
3620 if $test X"$prefix" != X"$installprefix"; then
3621 installarchlib=`echo $archlibexp | sed 's#^$prefix#$installprefix#'`
3623 installarchlib="$archlibexp"
3627 : Binary compatibility with 5.005 is not possible for builds
3628 : with advanced features
3629 case "$usethreads$usemultiplicity" in
3631 bincompat5005="$undef"
3632 d_bincompat5005="$undef"
3636 Perl 5.006 can be compiled for binary compatibility with 5.005.
3637 If you decide to do so, you will be able to continue using most
3638 of the extensions that were compiled for Perl 5.005.
3641 case "$bincompat5005$d_bincompat5005" in
3642 *"$undef"*) dflt=n ;;
3645 rp='Binary compatibility with Perl 5.005?'
3648 y*) val="$define" ;;
3653 case "$d_bincompat5005" in
3655 bincompat5005="$define"
3657 *) bincompat5005="$undef"
3658 d_bincompat5005="$undef"
3665 : see if setuid scripts can be secure
3668 Some kernels have a bug that prevents setuid #! scripts from being
3669 secure. Some sites have disabled setuid #! scripts because of this.
3671 First let's decide if your kernel supports secure setuid #! scripts.
3672 (If setuid #! scripts would be secure but have been disabled anyway,
3673 don't say that they are secure if asked.)
3678 if $test -d /dev/fd; then
3679 echo "#!$ls" >reflect
3680 chmod +x,u+s reflect
3681 ./reflect >flect 2>&1
3682 if $contains "/dev/fd" flect >/dev/null; then
3683 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3687 If you are not sure if they are secure, I can check but I'll need a
3688 username and password different from the one you are using right now.
3689 If you don't have such a username or don't want me to test, simply
3693 rp='Other username to test security of setuid scripts with?'
3698 case "$d_suidsafe" in
3699 '') echo "I'll assume setuid scripts are *not* secure." >&4
3702 echo "Well, the $hint value is *not* secure." >&4
3704 *) echo "Well, the $hint value *is* secure." >&4
3709 $rm -f reflect flect
3710 echo "#!$ls" >reflect
3711 chmod +x,u+s reflect
3714 echo '"su" will (probably) prompt you for '"$ans's password."
3715 su $ans -c './reflect >flect'
3716 if $contains "/dev/fd" flect >/dev/null; then
3717 echo "Okay, it looks like setuid scripts are secure." >&4
3720 echo "I don't think setuid scripts are secure." >&4
3725 rp='Does your kernel have *secure* setuid scripts?'
3728 [yY]*) val="$define";;
3733 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3734 echo "(That's for file descriptors, not floppy disks.)"
3740 $rm -f reflect flect
3742 : now see if they want to do setuid emulation
3745 case "$d_suidsafe" in
3748 echo "No need to emulate SUID scripts since they are secure here." >& 4
3752 Some systems have disabled setuid scripts, especially systems where
3753 setuid scripts cannot be secure. On systems where setuid scripts have
3754 been disabled, the setuid/setgid bits on scripts are currently
3755 useless. It is possible for $package to detect those bits and emulate
3756 setuid/setgid in a secure fashion. This emulation will only work if
3757 setuid scripts have been disabled in your kernel.
3761 "$define") dflt=y ;;
3764 rp="Do you want to do setuid/setgid emulation?"
3767 [yY]*) val="$define";;
3775 : What should the include directory be ?
3777 $echo $n "Hmm... $c"
3781 if $test -f /bin/mips && /bin/mips; then
3782 echo "Looks like a MIPS system..."
3783 $cat >usr.c <<'EOCP'
3784 #ifdef SYSTYPE_BSD43
3788 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3789 dflt='/bsd43/usr/include'
3793 mips_type='System V'
3795 $rm -f usr.c usr.out
3796 echo "and you're compiling with the $mips_type compiler and libraries."
3800 echo "Doesn't look like a MIPS system."
3810 case "$xxx_prompt" in
3813 rp='Where are the include files you want to use?'
3821 : see how we invoke the C preprocessor
3823 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3824 cat <<'EOT' >testcpp.c
3830 if test ! -f cppstdin; then
3831 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3832 # AIX cc -E doesn't show the absolute headerfile
3833 # locations but we'll cheat by using the -M flag.
3834 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
3836 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3839 echo "Keeping your $hint cppstdin wrapper."
3842 wrapper=`pwd`/cppstdin
3846 if $test "X$cppstdin" != "X" && \
3847 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3850 echo "You used to use $cppstdin $cppminus so we'll use that again."
3852 '') echo "But let's see if we can live without a wrapper..." ;;
3854 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3857 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3860 echo "(However, $cpprun $cpplast does not work, let's see...)"
3868 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3875 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3876 $cc -E <testcpp.c >testcpp.out 2>&1; \
3877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3878 echo "Yup, it does."
3881 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3882 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3884 echo "Yup, it does."
3887 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3888 $cc -P <testcpp.c >testcpp.out 2>&1; \
3889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3890 echo "Yipee, that works!"
3893 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3894 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3896 echo "At long last!"
3899 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3900 $cpp <testcpp.c >testcpp.out 2>&1; \
3901 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3905 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3906 $cpp - <testcpp.c >testcpp.out 2>&1; \
3907 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3908 echo "Hooray, it works! I was beginning to wonder."
3911 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3912 $wrapper <testcpp.c >testcpp.out 2>&1; \
3913 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3919 rp="No dice. I can't find a C preprocessor. Name one:"
3923 $x_cpp <testcpp.c >testcpp.out 2>&1
3924 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3925 echo "OK, that will do." >&4
3927 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3942 echo "Perhaps can we force $cc -E using a wrapper..."
3943 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3944 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3950 echo "Nope, we'll have to live without it..."
3964 "$wrapper"|'cppstdin') ;;
3965 *) $rm -f $wrapper;;
3967 $rm -f testcpp.c testcpp.out
3969 : Set private lib path
3972 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3977 '') dlist="$loclibpth $plibpth $glibpth";;
3978 *) dlist="$libpth";;
3981 : Now check and see which directories actually exist, avoiding duplicates
3985 if $test -d $xxx; then
3988 *) libpth="$libpth $xxx";;
3994 Some systems have incompatible or broken versions of libraries. Among
3995 the directories listed in the question below, please remove any you
3996 know not to be holding relevant libraries, and add any that are needed.
3997 Say "none" for none.
4008 rp="Directories to use for library searches?"
4015 : compute shared library extension
4018 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4028 On some systems, shared libraries may be available. Answer 'none' if
4029 you want to suppress searching of shared libraries for the remaining
4030 of this configuration.
4033 rp='What is the file extension used for shared libraries?'
4037 : Define several unixisms.
4038 : Hints files or command line option can be used to override them.
4039 : The convoluted testing is in case hints files set either the old
4042 '') case "$exe_ext" in
4044 *) _exe="$exe_ext" ;;
4049 '') case "$lib_ext" in
4056 '') case "$obj_ext" in
4063 '') case "$path_sep" in
4074 : Which makefile gets called first. This is used by make depend.
4075 case "$firstmakefile" in
4076 '') firstmakefile='makefile';;
4081 Perl can be built to use the SOCKS proxy protocol library. To do so,
4082 Configure must be run with -Dusesocks.
4084 Normally you do not need this and you should answer no.
4088 $define|true|[yY]*) dflt='y';;
4091 rp='Build Perl for SOCKS?'
4094 y|Y) val="$define" ;;
4100 : Looking for optional libraries
4102 echo "Checking for optional libraries..." >&4
4107 case "$libswanted" in
4108 '') libswanted='c_s';;
4112 libswanted="$libswanted socks5 socks5_sh"
4115 for thislib in $libswanted; do
4117 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4118 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4119 echo "Found -l$thislib (shared)."
4122 *) dflt="$dflt -l$thislib";;
4124 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4125 echo "Found -l$thislib (shared)."
4128 *) dflt="$dflt -l$thislib";;
4130 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4131 echo "Found -l$thislib."
4134 *) dflt="$dflt -l$thislib";;
4136 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4137 echo "Found -l$thislib."
4140 *) dflt="$dflt -l$thislib";;
4142 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4143 echo "Found -l${thislib}_s."
4146 *) dflt="$dflt -l${thislib}_s";;
4148 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4149 echo "Found -l$thislib."
4152 *) dflt="$dflt -l$thislib";;
4155 echo "No -l$thislib."
4166 ' '|'') dflt='none';;
4171 In order to compile $package on your machine, a number of libraries
4172 are usually needed. Include any other special libraries here as well.
4173 Say "none" for none. The default list is almost always right.
4177 rp="What libraries to use?"
4184 : determine optimize, if desired, or use for debug flag also
4186 ' '|$undef) dflt='none';;
4188 *) dflt="$optimize";;
4192 Some C compilers have problems with their optimizers. By default, $package
4193 compiles with the -O flag to use the optimizer. Alternately, you might want
4194 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4195 systems). Either flag can be specified here. To use neither flag, specify
4199 rp="What optimizer/debugger flag should be used?"
4203 'none') optimize=" ";;
4207 : We will not override a previous value, but we might want to
4208 : augment a hint file
4211 case "$gccversion" in
4212 1*) dflt='-fpcc-struct-return' ;;
4215 *-g*) dflt="$dflt -DDEBUGGING";;
4217 case "$gccversion" in
4218 2*) if test -d /etc/conf/kconfig.d &&
4219 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4228 case "$mips_type" in
4229 *BSD*|'') inclwanted="$locincpth $usrinc";;
4230 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4232 for thisincl in $inclwanted; do
4233 if $test -d $thisincl; then
4234 if $test x$thisincl != x$usrinc; then
4237 *) dflt="$dflt -I$thisincl";;
4243 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4245 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4253 *) dflt="$dflt -D$2";;
4257 set signal.h LANGUAGE_C; eval $inctest
4261 ccflags="$ccflags -DSOCKS"
4266 none|recommended) dflt="$ccflags $dflt" ;;
4267 *) dflt="$ccflags";;
4275 Your C compiler may want other flags. For this question you should include
4276 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4277 but you should NOT include libraries or ld flags like -lwhatever. If you
4278 want $package to honor its debug switch, you should include -DDEBUGGING here.
4279 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4281 To use no flags, specify the word "none".
4287 rp="Any additional cc flags?"
4294 : the following weeds options from ccflags that are of no interest to cpp
4296 case "$gccversion" in
4297 1*) cppflags="$cppflags -D__GNUC__"
4299 case "$mips_type" in
4301 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4307 echo "Let me guess what the preprocessor flags are..." >&4
4321 *) ftry="$previous $flag";;
4323 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4324 >cpp1.out 2>/dev/null && \
4325 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4326 >cpp2.out 2>/dev/null && \
4327 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4328 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4330 cppflags="$cppflags $ftry"
4340 *-*) echo "They appear to be: $cppflags";;
4342 $rm -f cpp.c cpp?.out
4346 : flags used in final linking phase
4348 '') if ./venix; then
4354 *-posix*) dflt="$dflt -posix" ;;
4357 *) dflt="$ldflags";;
4360 : Try to guess additional flags to pick up local libraries.
4361 for thislibdir in $libpth; do
4362 case " $loclibpth " in
4365 *"-L$thislibdir "*) ;;
4366 *) dflt="$dflt -L$thislibdir" ;;
4378 Your C linker may need flags. For this question you should
4379 include -L/whatever and any other flags used by the C linker, but you
4380 should NOT include libraries like -lwhatever.
4382 Make sure you include the appropriate -L/path flags if your C linker
4383 does not normally search all of the directories you specified above,
4386 To use no flags, specify the word "none".
4390 rp="Any additional ld flags (NOT including libraries)?"
4396 rmlist="$rmlist pdp11"
4400 echo "Checking your choice of C compiler and flags for coherency..." >&4
4401 $cat > try.c <<'EOF'
4403 int main() { printf("Ok\n"); exit(0); }
4405 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4407 $cat >try.msg <<'EOM'
4408 I've tried to compile and run the following simple program:
4411 $cat try.c >> try.msg
4413 $cat >> try.msg <<EOM
4420 and I got the following output:
4424 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4425 if sh -c './try' >>try.msg 2>&1; then
4429 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4432 cat >> try.msg <<'EOQS'
4433 If $libs contains -lsfio, and sfio is mis-configured, then it
4434 sometimes (apparently) runs and exits with a 0 status, but with no
4435 output! It may have to do with sfio's use of _exit vs. exit.
4438 rp="You have a big problem. Shall I abort Configure"
4445 echo "The program compiled OK, but exited with status $?." >>try.msg
4446 rp="You have a problem. Shall I abort Configure"
4450 echo "I can't compile the test program." >>try.msg
4451 rp="You have a BIG problem. Shall I abort Configure"
4457 case "$knowitall" in
4459 echo "(The supplied flags or libraries might be incorrect.)"
4467 *) echo "Ok. Stopping Configure." >&4
4472 n) echo "OK, that should do.";;
4474 $rm -f try try.* core
4476 : determine filename position in cpp output
4478 echo "Computing filename position in cpp output for #include directives..." >&4
4479 echo '#include <stdio.h>' > foo.c
4482 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4483 $grep '^[ ]*#.*stdio\.h' | \
4484 while read cline; do
4487 while $test \$# -gt 0; do
4488 if $test -r \`echo \$1 | $tr -d '"'\`; then
4493 pos=\`expr \$pos + 1\`
4505 *) pos="${fieldn}th";;
4507 echo "Your cpp writes the filename in the $pos field of the line."
4509 : locate header file
4514 for usrincdir in $usrinc
4516 if test -f \$usrincdir/\$wanted; then
4517 echo "\$usrincdir/\$wanted"
4521 awkprg='{ print \$$fieldn }'
4522 echo "#include <\$wanted>" > foo\$\$.c
4523 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4524 $grep "^[ ]*#.*\$wanted" | \
4525 while read cline; do
4526 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4528 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4529 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4534 # status = 0: grep returned 0 lines, case statement not executed
4535 # status = 1: headerfile found
4536 # status = 2: while loop executed, no headerfile found
4540 if test \$status -eq 1; then
4547 : define an alternate in-header-list? function
4548 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4549 cont=true; xxf="echo \"<\$1> found.\" >&4";
4550 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4551 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4553 case $# in 4) instead=instead;; *) instead="at last";; esac;
4554 while $test "$cont"; do
4556 var=$2; eval "was=\$$2";
4557 if $test "$xxx" && $test -r "$xxx";
4559 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4562 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4563 set $yyy; shift; shift; yyy=$@;
4564 case $# in 0) cont="";;
4565 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4566 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4567 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4568 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4572 do set $yyy; var=$2; eval "was=\$$2";
4573 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4574 set $yyy; shift; shift; yyy=$@;
4577 : see if this is a malloc.h system
4578 set malloc.h i_malloc
4581 : see if stdlib is available
4582 set stdlib.h i_stdlib
4585 : determine which malloc to compile in
4587 case "$usemymalloc" in
4588 ''|[yY]*|true|$define) dflt='y' ;;
4591 rp="Do you wish to attempt to use the malloc that comes with $package?"
4597 mallocsrc='malloc.c'
4598 mallocobj="malloc$_o"
4599 d_mymalloc="$define"
4602 : Remove malloc from list of libraries to use
4603 echo "Removing unneeded -lmalloc from library list" >&4
4604 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4607 echo "libs = $libs" >&4
4619 : compute the return types of malloc and free
4621 $cat >malloc.c <<END
4625 #include <sys/types.h>
4639 case "$malloctype" in
4641 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4648 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4652 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4659 echo "Your system uses $freetype free(), it would seem." >&4
4663 The installation process will also create a directory for
4664 vendor-supplied add-ons. Vendors who supply perl with their system
4665 may find it convenient to place all vendor-supplied files in this
4666 directory rather than in the main distribution directory. This will
4667 ease upgrades between binary-compatible maintenance versions of perl.
4669 Of course you may also use these directories in whatever way you see
4670 fit. For example, you might use them to access modules shared over a
4671 company-wide network.
4673 The default answer should be fine for most people.
4674 This causes further questions about vendor add-ons to be skipped
4675 and no vendor-specific directories will be configured for perl.
4678 rp='Do you want to configure vendor-specific add-on directories?'
4679 case "$usevendorprefix" in
4680 define|true|[yY]*) dflt=y ;;
4686 rp='Installation prefix to use for vendor-supplied add-ons?'
4687 case "$vendorprefix" in
4689 *) dflt=$vendorprefix ;;
4693 case "$vendorprefix" in
4697 *) oldvendorprefix="$prefix";;
4701 usevendorprefix="$define"
4703 vendorprefixexp="$ansexp"
4705 *) usevendorprefix="$undef"
4711 case "$vendorprefix" in
4712 '') d_vendorlib="$undef"
4716 *) d_vendorlib="$define"
4717 : determine where vendor-supplied modules go.
4718 : Usual default is /usr/local/lib/perl5/vendor_perl
4719 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4720 case "$installstyle" in
4721 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4722 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4725 rp='Pathname for the vendor-supplied library files?'
4728 vendorlibexp="$ansexp"
4729 : Change installation prefix, if necessary.
4730 if $test X"$prefix" != X"$installprefix"; then
4731 installvendorlib=`echo $vendorlibexp | $sed 's#^$prefix#$installprefix#'`
4733 installvendorlib="$vendorlibexp"
4738 : Cruising for prototypes
4740 echo "Checking out function prototypes..." >&4
4741 $cat >prototype.c <<'EOCP'
4742 int main(int argc, char *argv[]) {
4745 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4746 echo "Your C compiler appears to support function prototypes."
4749 echo "Your C compiler doesn't seem to understand function prototypes."
4756 case "$prototype" in
4758 *) ansi2knr='ansi2knr'
4763 This version of $package can only be compiled by a compiler that
4764 understands function prototypes. Unfortunately, your C compiler
4766 doesn't seem to understand them. Sorry about that.
4768 If GNU cc is available for your system, perhaps you could try that instead.
4770 Eventually, we hope to support building Perl with pre-ANSI compilers.
4771 If you would like to help in that effort, please contact <perlbug@perl.org>.
4773 Aborting Configure now.
4779 : determine where public executables go
4784 rp='Pathname where the public executables will reside?'
4786 if $test "X$ansexp" != "X$binexp"; then
4791 : Change installation prefix, if necessary.
4792 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4793 if $test X"$prefix" != X"$installprefix"; then
4794 installbin=`echo $binexp | sed 's#^$prefix#$installprefix#'`
4796 installbin="$binexp"
4799 : determine whether to install perl also as /usr/bin/perl
4802 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4804 Many scripts expect to perl to be installed as /usr/bin/perl.
4805 I can install the perl you are about to compile also as /usr/bin/perl
4806 (in addition to $installbin/perl).
4808 case "$installusrbinperl" in
4809 "$undef"|[nN]*) dflt='n';;
4812 rp="Do you want to install perl as /usr/bin/perl?"
4815 [yY]*) val="$define";;
4821 set installusrbinperl
4824 : define a shorthand compile call
4828 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4829 : define a shorthand compile call for compilations that should be ok.
4833 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4836 echo "Checking for GNU C Library..." >&4
4837 cat >gnulibc.c <<EOM
4849 if eval $compile_ok && ./gnulibc; then
4851 echo "You are using the GNU C Library"
4854 echo "You are not using the GNU C Library"
4860 : see if nm is to be used to determine whether a symbol is defined or not
4864 case "$d_gnulibc" in
4867 echo "nm probably won't work on the GNU C Library." >&4
4873 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4875 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4876 echo "'nm' won't be sufficient on this sytem." >&4
4882 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4883 if $test $dflt -gt 20; then
4893 true|$define) dflt=y;;
4900 I can use $nm to extract the symbols from your C libraries. This
4901 is a time consuming task which may generate huge output on the disk (up
4902 to 3 megabytes) but that should make the symbols extraction faster. The
4903 alternative is to skip the 'nm' extraction part and to compile a small
4904 test program instead to determine whether each symbol is present. If
4905 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4906 this may be the best solution.
4908 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4911 rp="Shall I use $nm to extract C symbols from the libraries?"
4914 [Nn]*) usenm=false;;
4923 : nm options which may be necessary
4925 '') if $test -f /mach_boot; then
4927 elif $test -d /usr/ccs/lib; then
4928 nm_opt='-p' # Solaris (and SunOS?)
4929 elif $test -f /dgux; then
4931 elif $test -f /lib64/rld; then
4932 nm_opt='-p' # 64-bit Irix
4938 : nm options which may be necessary for shared libraries but illegal
4939 : for archive libraries. Thank you, Linux.
4940 case "$nm_so_opt" in
4941 '') case "$myuname" in
4943 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4944 nm_so_opt='--dynamic'
4953 : get list of predefined functions in a handy place
4958 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4965 *) for thislib in $libs; do
4968 : Handle C library specially below.
4971 thislib=`echo $thislib | $sed -e 's/^-l//'`
4972 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4974 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4976 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4978 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4980 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4982 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4984 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4989 libnames="$libnames $try"
4991 *) libnames="$libnames $thislib" ;;
5000 for xxx in $libpth; do
5001 $test -r $1 || set $xxx/libc.$so
5002 : The messy sed command sorts on library version numbers.
5004 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5005 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5007 s/[0-9][0-9]*/0000&/g
5008 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5011 sort | $sed -e 's/^.* //'`
5014 $test -r $1 || set /usr/ccs/lib/libc.$so
5015 $test -r $1 || set /lib/libsys_s$_a
5021 if $test -r "$1"; then
5022 echo "Your (shared) C library seems to be in $1."
5024 elif $test -r /lib/libc && $test -r /lib/clib; then
5025 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5027 libc='/lib/clib /lib/libc'
5028 if $test -r /lib/syslib; then
5029 echo "(Your math library is in /lib/syslib.)"
5030 libc="$libc /lib/syslib"
5032 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5033 echo "Your C library seems to be in $libc, as you said before."
5034 elif $test -r $incpath/usr/lib/libc$_a; then
5035 libc=$incpath/usr/lib/libc$_a;
5036 echo "Your C library seems to be in $libc. That's fine."
5037 elif $test -r /lib/libc$_a; then
5039 echo "Your C library seems to be in $libc. You're normal."
5041 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5043 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5044 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5045 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5047 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5049 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5052 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5054 if $test -r "$tans"; then
5055 echo "Your C library seems to be in $tans, of all places."
5061 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5065 If the guess above is wrong (which it might be if you're using a strange
5066 compiler, or your machine supports multiple models), you can override it here.
5071 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5073 I can't seem to find your C library. I've looked in the following places:
5076 $sed 's/^/ /' libpath
5079 None of these seems to contain your C library. I need to get its name...
5084 rp='Where is your C library?'
5089 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5090 set X `cat libnames`
5093 case $# in 1) xxx=file; esac
5094 echo "Extracting names from the following $xxx for later perusal:" >&4
5096 $sed 's/^/ /' libnames >&4
5098 $echo $n "This may take a while...$c" >&4
5102 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5103 *) $nm $nm_opt $file 2>/dev/null;;
5108 $grep fprintf libc.tmp > libc.ptf
5109 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5110 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5112 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5114 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5116 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5118 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5120 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5122 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5124 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5126 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5128 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5130 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5132 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5134 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5136 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5137 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5139 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5141 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5143 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5145 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5147 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5149 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5151 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5153 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5155 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5157 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5159 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5161 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5163 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5165 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5167 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5170 $nm -p $* 2>/dev/null >libc.tmp
5171 $grep fprintf libc.tmp > libc.ptf
5172 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5173 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5179 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5181 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5182 for thisname in $libnames $libc; do
5183 $ar t $thisname >>libc.tmp
5185 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5187 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5188 # Repeat libc to extract forwarders to DLL entries too
5189 for thisname in $libnames $libc; do
5190 $ar tv $thisname >>libc.tmp
5191 # Revision 50 of EMX has bug in $ar.
5192 # it will not extract forwarders to DLL entries
5193 # Use emximp which will extract exactly them.
5194 emximp -o tmp.imp $thisname \
5196 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5197 < tmp.imp >>libc.tmp
5200 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5203 echo "$ar didn't seem to work right." >&4
5204 echo "Maybe this is a Cray...trying bld instead..." >&4
5205 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5207 for thisname in $libnames; do
5209 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5210 $ar t $thisname >>libc.tmp
5214 echo "That didn't work either. Giving up." >&4
5221 if $test -f /lib/syscalls.exp; then
5223 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5224 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5228 $rm -f libnames libpath
5230 : see if dld is available
5234 : is a C symbol defined?
5237 -v) tf=libc.tmp; tc=""; tdc="";;
5238 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5239 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5242 case "$reuseval-$4" in
5244 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5250 if $contains $tlook $tf >/dev/null 2>&1;
5255 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5256 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5264 $define) tval=true;;
5270 : define an is-in-libc? function
5271 inlibc='echo " "; td=$define; tu=$undef;
5272 sym=$1; var=$2; eval "was=\$$2";
5274 case "$reuseval$was" in
5284 echo "$sym() found." >&4;
5285 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5287 echo "$sym() NOT found." >&4;
5288 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5292 $define) echo "$sym() found." >&4;;
5293 *) echo "$sym() NOT found." >&4;;
5297 : see if dlopen exists
5304 : determine which dynamic loading, if any, to compile in
5306 dldir="ext/DynaLoader"
5319 $define) dflt='y' ;;
5322 $define) dflt='y' ;;
5324 : Does a dl_xxx.xs file exist for this operating system
5325 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5328 rp="Do you wish to use dynamic loading?"
5335 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5336 dflt="$dldir/dl_${osname}.xs"
5337 elif $test "$d_dlopen" = "$define" ; then
5338 dflt="$dldir/dl_dlopen.xs"
5339 elif $test "$i_dld" = "$define" ; then
5340 dflt="$dldir/dl_dld.xs"
5345 *) dflt="$dldir/$dlsrc"
5348 echo "The following dynamic loading files are available:"
5349 : Can not go over to $dldir because getfile has path hard-coded in.
5350 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5351 rp="Source file to use for dynamic loading"
5357 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5361 Some systems may require passing special flags to $cc -c to
5362 compile modules that will be used to create a shared library.
5363 To use no flags, say "none".
5366 case "$cccdlflags" in
5367 '') case "$gccversion" in
5368 '') case "$osname" in
5370 next) dflt='none' ;;
5371 irix*) dflt='-KPIC' ;;
5372 svr4*|esix*|solaris) dflt='-KPIC' ;;
5373 sunos) dflt='-pic' ;;
5377 *) case "$osname" in
5378 svr4*|esix*|solaris) dflt='-fPIC' ;;
5383 *) dflt="$cccdlflags" ;;
5385 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5388 none) cccdlflags=' ' ;;
5389 *) cccdlflags="$ans" ;;
5394 Some systems use ld to create libraries that can be dynamically loaded,
5395 while other systems (such as those using ELF) use $cc.
5399 '') $cat >try.c <<'EOM'
5400 /* Test for whether ELF binaries are produced */
5405 int i = open("a.out",O_RDONLY);
5408 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5409 exit(0); /* succeed (yes, it's ELF) */
5414 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5416 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5420 echo "I'll use ld to build dynamic libraries."
5429 rp="What command should be used to create dynamic libraries?"
5435 Some systems may require passing special flags to $ld to create a
5436 library that can be dynamically loaded. If your ld flags include
5437 -L/other/path options to locate libraries outside your loader's normal
5438 search path, you may need to specify those -L options here as well. To
5439 use no flags, say "none".
5442 case "$lddlflags" in
5443 '') case "$osname" in
5444 beos) dflt='-nostart' ;;
5446 linux|irix*) dflt='-shared' ;;
5447 next) dflt='none' ;;
5448 solaris) dflt='-G' ;;
5449 sunos) dflt='-assert nodefinitions' ;;
5450 svr4*|esix*) dflt="-G $ldflags" ;;
5454 *) dflt="$lddlflags" ;;
5457 : Try to guess additional flags to pick up local libraries.
5458 : Be careful not to append to a plain 'none'
5462 for thisflag in $ldflags; do
5467 *) dflt="$dflt $thisflag" ;;
5474 ''|' ') dflt='none' ;;
5477 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5480 none) lddlflags=' ' ;;
5481 *) lddlflags="$ans" ;;
5486 Some systems may require passing special flags to $cc to indicate that
5487 the resulting executable will use dynamic linking. To use no flags,
5491 case "$ccdlflags" in
5492 '') case "$osname" in
5493 hpux) dflt='-Wl,-E' ;;
5494 linux) dflt='-rdynamic' ;;
5495 next) dflt='none' ;;
5496 sunos) dflt='none' ;;
5500 *) dflt="$ccdlflags" ;;
5502 rp="Any special flags to pass to $cc to use dynamic loading?"
5505 none) ccdlflags=' ' ;;
5506 *) ccdlflags="$ans" ;;
5520 # No dynamic loading being used, so don't bother even to prompt.
5523 *) case "$useshrplib" in
5524 '') case "$osname" in
5525 svr4*|dgux|dynixptx|esix|powerux|beos)
5527 also='Building a shared libperl is required for dynamic loading to work on your system.'
5532 also='Building a shared libperl is needed for MAB support.'
5550 The perl executable is normally obtained by linking perlmain.c with
5551 libperl${_a}, any static extensions (usually just DynaLoader), and
5552 any other libraries needed on this system (such as -lm, etc.). Since
5553 your system supports dynamic loading, it is probably possible to build
5554 a shared libperl.$so. If you will have more than one executable linked
5555 to libperl.$so, this will significantly reduce the size of each
5556 executable, but it may have a noticeable affect on performance. The
5557 default is probably sensible for your system.
5561 rp="Build a shared libperl.$so (y/n)"
5565 useshrplib='true' ;;
5566 *) useshrplib='false' ;;
5571 case "$useshrplib" in
5575 # Figure out a good name for libperl.so. Since it gets stored in
5576 # a version-specific architecture-dependent library, the version
5577 # number isn't really that important, except for making cc/ld happy.
5579 # A name such as libperl.so.3.1
5580 majmin="libperl.$so.$patchlevel.$subversion"
5581 # A name such as libperl.so.301
5582 majonly=`echo $patchlevel $subversion |
5583 $awk '{printf "%d%02d", $1, $2}'`
5584 majonly=libperl.$so.$majonly
5585 # I'd prefer to keep the os-specific stuff here to a minimum, and
5586 # rely on figuring it out from the naming of libc.
5587 case "${osname}${osvers}" in
5590 # XXX How handle the --version stuff for MAB?
5592 linux*) # ld won't link with a bare -lperl otherwise.
5595 *) # Try to guess based on whether libc has major.minor.
5597 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5598 *libc.$so.[0-9]*) dflt=$majonly ;;
5599 *) dflt=libperl.$so ;;
5609 I need to select a good name for the shared libperl. If your system uses
5610 library names with major and minor numbers, then you might want something
5611 like $majmin. Alternatively, if your system uses a single version
5612 number for shared libraries, then you might want to use $majonly.
5613 Or, your system might be quite happy with a simple libperl.$so.
5615 Since the shared libperl will get installed into a version-specific
5616 architecture-dependent directory, the version number of the shared perl
5617 library probably isn't important, so the default should be o.k.
5620 rp='What name do you want to give to the shared libperl?'
5623 echo "Ok, I'll use $libperl"
5626 libperl="libperl${_a}"
5630 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5634 WARNING: Use of the shrpdir variable for the installation location of
5635 the shared $libperl is not supported. It was never documented and
5636 will not work in this version. Let me (perlbug@perl.com)
5637 know of any problems this may cause.
5643 But your current setting of $shrpdir is
5644 the default anyway, so it's harmless.
5649 Further, your current attempted setting of $shrpdir
5650 conflicts with the value of $archlibexp/CORE
5651 that installperl will use.
5658 # How will the perl executable find the installed shared $libperl?
5659 # Add $xxx to ccdlflags.
5660 # If we can't figure out a command-line option, use $shrpenv to
5661 # set env LD_RUN_PATH. The main perl makefile uses this.
5662 shrpdir=$archlibexp/CORE
5665 if "$useshrplib"; then
5668 # We'll set it in Makefile.SH...
5674 xxx="-Wl,-R$shrpdir"
5676 linux|irix*|dec_osf)
5677 xxx="-Wl,-rpath,$shrpdir"
5680 # next doesn't like the default...
5683 # beos doesn't like the default, either.
5686 # hpux doesn't like the default, either.
5687 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5690 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5696 # Only add $xxx if it isn't already in ccdlflags.
5697 case " $ccdlflags " in
5699 *) ccdlflags="$ccdlflags $xxx"
5702 Adding $xxx to the flags
5703 passed to $ld so that the perl executable will find the
5704 installed shared $libperl.
5712 # Fix ccdlflags in AIX for building external extensions.
5713 # (For building Perl itself bare -bE:perl.exp is needed,
5714 # Makefile.SH takes care of this.)
5716 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5718 # Respect a hint or command-line value.
5720 '') shrpenv="$tmp_shrpenv" ;;
5722 case "$ldlibpthname" in
5723 '') ldlibpthname=LD_LIBRARY_PATH ;;
5724 none) ldlibpthname='' ;;
5727 : determine where manual pages go
5728 set man1dir man1dir none
5732 $spackage has manual pages available in source form.
5736 echo "However, you don't have nroff, so they're probably useless to you."
5738 '') man1dir="none";;
5741 echo "If you don't want the manual sources installed, answer 'none'."
5746 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5747 lookpath="$lookpath $prefixexp/man/p_man/man1"
5748 lookpath="$lookpath $prefixexp/man/u_man/man1"
5749 lookpath="$lookpath $prefixexp/man/man.1"
5751 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5752 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5762 rp="Where do the main $spackage manual pages (source) go?"
5764 if $test "X$man1direxp" != "X$ansexp"; then
5768 man1direxp="$ansexp"
5774 : Change installation prefix, if necessary.
5775 if $test X"$prefix" != X"$installprefix"; then
5776 installman1dir=`echo $man1direxp | $sed 's#^$prefix#$installprefix#'`
5778 installman1dir="$man1direxp"
5781 : What suffix to use on installed man pages
5788 rp="What suffix should be used for the main $spackage man pages?"
5790 '') case "$man1dir" in
5804 *) dflt="$man1ext";;
5811 : see if we can have long filenames
5813 rmlist="$rmlist /tmp/cf$$"
5814 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5815 first=123456789abcdef
5816 second=/tmp/cf$$/$first
5817 $rm -f $first $second
5818 if (echo hi >$first) 2>/dev/null; then
5819 if $test -f 123456789abcde; then
5820 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5823 if (echo hi >$second) 2>/dev/null; then
5824 if $test -f /tmp/cf$$/123456789abcde; then
5826 That's peculiar... You can have filenames longer than 14 characters, but only
5827 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5828 I shall consider your system cannot support long filenames at all.
5832 echo 'You can have filenames longer than 14 characters.' >&4
5837 How confusing! Some of your filesystems are sane enough to allow filenames
5838 longer than 14 characters but some others like /tmp can't even think about them.
5839 So, for now on, I shall assume your kernel does not allow them at all.
5846 You can't have filenames longer than 14 chars. You can't even think about them!
5852 $rm -rf /tmp/cf$$ 123456789abcde*
5854 : determine where library module manual pages go
5855 set man3dir man3dir none
5859 $spackage has manual pages for many of the library modules.
5865 However, you don't have nroff, so they're probably useless to you.
5868 '') man3dir="none";;
5872 case "$d_flexfnam" in
5875 However, your system can't handle the long file names like File::Basename.3.
5878 '') man3dir="none";;
5882 echo "If you don't want the manual sources installed, answer 'none'."
5883 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5885 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5886 if $test -d "$privlib/man/man3"; then
5889 WARNING: Previous versions of perl installed man3 pages into
5890 $privlib/man/man3. This version will suggest a
5891 new default of $dflt.
5895 rp='Do you wish to preserve the old behavior?(y/n)'
5898 y*) dflt="$privlib/man/man3" ;;
5904 *) dflt="$man3dir" ;;
5908 rp="Where do the $package library man pages (source) go?"
5911 man3direxp="$ansexp"
5917 : Change installation prefix, if necessary.
5918 if $test X"$prefix" != X"$installprefix"; then
5919 installman3dir=`echo $man3direxp | $sed 's#^$prefix#$installprefix#'`
5921 installman3dir="$man3direxp"
5924 : What suffix to use on installed man pages
5930 rp="What suffix should be used for the $package library man pages?"
5932 '') case "$man3dir" in
5946 *) dflt="$man3ext";;
5953 : see if we have to deal with yellow pages, now NIS.
5954 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5955 if $test -f /usr/etc/nibindd; then
5957 echo "I'm fairly confident you're on a NeXT."
5959 rp='Do you get the hosts file via NetInfo?'
5968 y*) hostcat='nidump hosts .';;
5969 *) case "$hostcat" in
5970 nidump*) hostcat='';;
5980 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5988 rp='Are you getting the hosts file via yellow pages?'
5991 y*) hostcat='ypcat hosts';;
5992 *) hostcat='cat /etc/hosts';;
5998 '') hostcat='cat /etc/hosts';;
6001 '') groupcat='cat /etc/group';;
6004 '') passcat='cat /etc/passwd';;
6007 : now get the host name
6009 echo "Figuring out host name..." >&4
6010 case "$myhostname" in
6012 echo 'Maybe "hostname" will work...'
6013 if tans=`sh -c hostname 2>&1` ; then
6021 if $test "$cont"; then
6023 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6024 if tans=`cat /etc/systemid 2>&1` ; then
6026 phostname='cat /etc/systemid'
6027 echo "Whadyaknow. Xenix always was a bit strange..."
6030 elif $test -r /etc/systemid; then
6031 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6034 if $test "$cont"; then
6035 echo 'No, maybe "uuname -l" will work...'
6036 if tans=`sh -c 'uuname -l' 2>&1` ; then
6038 phostname='uuname -l'
6040 echo 'Strange. Maybe "uname -n" will work...'
6041 if tans=`sh -c 'uname -n' 2>&1` ; then
6043 phostname='uname -n'
6045 echo 'Oh well, maybe I can mine it out of whoami.h...'
6046 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6047 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6048 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6050 case "$myhostname" in
6051 '') echo "Does this machine have an identity crisis or something?"
6054 echo "Well, you said $myhostname before..."
6055 phostname='echo $myhostname';;
6061 : you do not want to know about this
6066 if $test "$myhostname" ; then
6068 rp='Your host name appears to be "'$myhostname'".'" Right?"
6076 : bad guess or no guess
6077 while $test "X$myhostname" = X ; do
6079 rp="Please type the (one word) name of your host:"
6084 : translate upper to lower if necessary
6085 case "$myhostname" in
6087 echo "(Normalizing case in your host name)"
6088 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6092 case "$myhostname" in
6094 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6095 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6096 echo "(Trimming domain name from host name--host name is now $myhostname)"
6098 *) case "$mydomain" in
6101 test "X$hostcat" = "Xypcat hosts" &&
6102 ypmatch "$myhostname" hosts 2>/dev/null |\
6103 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6106 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6107 /[ ]$myhostname[ . ]/p" > hosts
6110 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6111 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6112 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6113 hosts | $sort | $uniq | \
6114 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6115 case `$echo X$dflt` in
6116 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6119 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6124 tans=`./loc resolv.conf X /etc /usr/etc`
6125 if $test -f "$tans"; then
6126 echo "(Attempting domain name extraction from $tans)"
6127 dflt=.`$sed -n -e 's/ / /g' \
6128 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6129 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6131 .) dflt=.`$sed -n -e 's/ / /g' \
6132 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6133 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6140 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6141 dflt=.`sh -c domainname 2>/dev/null`
6144 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6149 .) echo "(Lost all hope -- silly guess then)"
6155 *) dflt="$mydomain";;
6159 rp="What is your domain name?"
6169 : translate upper to lower if necessary
6172 echo "(Normalizing case in your domain name)"
6173 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6177 : a little sanity check here
6178 case "$phostname" in
6181 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6182 $myhostname$mydomain|$myhostname) ;;
6184 case "$phostname" in
6186 echo "(That doesn't agree with your whoami.h file, by the way.)"
6189 echo "(That doesn't agree with your $phostname command, by the way.)"
6199 I need to get your e-mail address in Internet format if possible, i.e.
6200 something like user@host.domain. Please answer accurately since I have
6201 no easy means to double check it. The default value provided below
6202 is most probably close to the reality but may not be valid from outside
6203 your organization...
6207 while test "$cont"; do
6209 '') dflt="$cf_by@$myhostname$mydomain";;
6210 *) dflt="$cf_email";;
6212 rp='What is your e-mail address?'
6218 rp='Address does not look like an Internet one. Use it anyway?'
6234 If you or somebody else will be maintaining perl at your site, please
6235 fill in the correct e-mail address here so that they may be contacted
6236 if necessary. Currently, the "perlbug" program included with perl
6237 will send mail to this address in addition to perlbug@perl.com. You may
6238 enter "none" for no administrator.
6241 case "$perladmin" in
6242 '') dflt="$cf_email";;
6243 *) dflt="$perladmin";;
6245 rp='Perl administrator e-mail address'
6249 : figure out how to guarantee perl startup
6250 case "$startperl" in
6252 case "$sharpbang" in
6256 I can use the #! construct to start perl on your system. This will
6257 make startup of perl scripts faster, but may cause problems if you
6258 want to share those scripts and perl is not in a standard place
6259 ($binexp/perl) on all your platforms. The alternative is to force
6260 a shell by starting the script with a single ':' character.
6264 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6267 none) startperl=": # use perl";;
6268 *) startperl="#!$ans"
6269 if $test 30 -lt `echo "$ans" | wc -c`; then
6272 WARNING: Some systems limit the #! command to 32 characters.
6273 If you experience difficulty running Perl scripts with #!, try
6274 installing Perl in a directory with a shorter pathname.
6280 *) startperl=": # use perl"
6285 echo "I'll use $startperl to start perl scripts."
6287 : figure best path for perl in scripts
6290 perlpath="$binexp/perl"
6291 case "$startperl" in
6296 I will use the "eval 'exec'" idiom to start Perl on your system.
6297 I can use the full path of your Perl binary for this purpose, but
6298 doing so may cause problems if you want to share those scripts and
6299 Perl is not always in a standard place ($binexp/perl).
6303 rp="What path shall I use in \"eval 'exec'\"?"
6310 case "$startperl" in
6312 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6315 : determine where public executable scripts go
6316 set scriptdir scriptdir
6318 case "$scriptdir" in
6321 : guess some guesses
6322 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6323 $test -d /usr/share/bin && dflt=/usr/share/bin
6324 $test -d /usr/local/script && dflt=/usr/local/script
6325 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6326 $test -d $prefixexp/script && dflt=$prefixexp/script
6330 *) dflt="$scriptdir"
6335 Some installations have a separate directory just for executable scripts so
6336 that they can mount it across multiple architectures but keep the scripts in
6337 one spot. You might, for example, have a subdirectory of /usr/share for this.
6338 Or you might just lump your scripts in with all your other executables.
6342 rp='Where do you keep publicly executable scripts?'
6344 if $test "X$ansexp" != "X$scriptdirexp"; then
6348 scriptdirexp="$ansexp"
6349 : Change installation prefix, if necessary.
6350 if $test X"$prefix" != X"$installprefix"; then
6351 installscript=`echo $scriptdirexp | sed 's#^$prefix#$installprefix#'`
6353 installscript="$scriptdirexp"
6358 After $package is installed, you may wish to install various
6359 add-on modules and utilities. Typically, these add-ons will
6360 be installed under $prefix with the rest
6361 of this package. However, you may wish to install such add-ons
6362 elsewhere under a different prefix.
6364 If you do not wish to put everything under a single prefix, that's
6365 ok. You will be prompted for the individual locations; this siteprefix
6366 is only used to suggest the defaults.
6368 The default should be fine for most people.
6372 rp='Installation prefix to use for add-on modules and utilities?'
6373 : XXX Here might be another good place for an installstyle setting.
6374 case "$siteprefix" in
6376 *) dflt=$siteprefix ;;
6380 case "$siteprefix" in
6385 *) oldsiteprefix="$prefix";;
6390 siteprefixexp="$ansexp"
6392 : determine where site specific libraries go.
6393 : Usual default is /usr/local/lib/perl5/site_perl
6394 : The default "style" setting is made in installstyle.U
6395 : XXX No longer works with Prefixit stuff.
6396 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6397 case "$installstyle" in
6398 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6399 *) dflt=$siteprefix/lib/site_$prog ;;
6403 The installation process will create a directory for
6404 site-specific extensions and modules. Most users find it convenient
6405 to place all site-specific files in this directory rather than in the
6406 main distribution directory.
6410 rp='Pathname for the site-specific library files?'
6413 sitelibexp="$ansexp"
6414 : Change installation prefix, if necessary.
6415 if $test X"$prefix" != X"$installprefix"; then
6416 installsitelib=`echo $sitelibexp | sed 's#^$prefix#$installprefix#'`
6418 installsitelib="$sitelibexp"
6421 : determine where site specific architecture-dependent libraries go.
6422 : sitelib default is /usr/local/lib/perl5/site_perl/
6423 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6424 : sitelib may have an optional trailing /share.
6425 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6426 tdflt="$tdflt/$apiversion/$archname"
6427 set sitearch sitearch none
6430 '') dflt="$tdflt" ;;
6431 *) dflt="$sitearch" ;;
6435 The installation process will also create a directory for
6436 architecture-dependent site-specific extensions and modules.
6440 rp='Pathname for the site-specific architecture-dependent library files?'
6443 sitearchexp="$ansexp"
6444 : Change installation prefix, if necessary.
6445 if $test X"$prefix" != X"$installprefix"; then
6446 installsitearch=`echo $sitearchexp | sed 's#^$prefix#$installprefix#'`
6448 installsitearch="$sitearchexp"
6453 Perl can be built to take advantage of long doubles which
6454 (if available) may give more accuracy and range for floating point
6455 numbers. To do so, Configure must be run with -Duselongdouble.
6457 If this doesn't make any sense to you, just accept the default 'n'.
6459 case "$uselongdouble" in
6460 $define|true|[yY]*) dflt='y';;
6463 rp='Try to use long doubles if available?'
6468 ccflags="$ccflags -DUSE_LONG_DOUBLE"
6480 Previous version of $package used the standard IO mechanisms as defined
6481 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6482 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6483 the default. This abstraction layer can use AT&T's sfio (if you already
6484 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6485 problems with some extension modules. Using PerlIO with stdio is safe,
6486 but it is slower than plain stdio and therefore is not the default.
6488 If this doesn't make any sense to you, just accept the default 'n'.
6490 case "$useperlio" in
6491 $define|true|[yY]*) dflt='y';;
6494 rp='Use the experimental PerlIO abstraction layer?'
6501 echo "Ok, doing things the stdio way"
6508 : Check how to convert floats to strings.
6509 if test "X$d_Gconvert" = X; then
6511 echo "Checking for an efficient way to convert floats to strings."
6514 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6515 char *myname = "gconvert";
6518 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6519 char *myname = "gcvt";
6522 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6523 char *myname = "sprintf";
6529 checkit(expect, got)
6533 if (strcmp(expect, got)) {
6534 printf("%s oddity: Expected %s, got %s\n",
6535 myname, expect, got);
6545 /* This must be 1st test on (which?) platform */
6546 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6547 Gconvert(0.1, 8, 0, buf);
6548 checkit("0.1", buf);
6550 Gconvert(1.0, 8, 0, buf);
6553 Gconvert(0.0, 8, 0, buf);
6556 Gconvert(-1.0, 8, 0, buf);
6559 /* Some Linux gcvt's give 1.e+5 here. */
6560 Gconvert(100000.0, 8, 0, buf);
6561 checkit("100000", buf);
6563 /* Some Linux gcvt's give -1.e+5 here. */
6564 Gconvert(-100000.0, 8, 0, buf);
6565 checkit("-100000", buf);
6570 case "$d_Gconvert" in
6571 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6572 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6573 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6574 *) xxx_list='gconvert gcvt sprintf' ;;
6577 for xxx_convert in $xxx_list; do
6578 echo "Trying $xxx_convert"
6580 set try -DTRY_$xxx_convert
6581 if eval $compile; then
6582 echo "$xxx_convert" found. >&4
6584 echo "I'll use $xxx_convert to convert floats into a string." >&4
6587 echo "...But $xxx_convert didn't work as I expected."
6590 echo "$xxx_convert NOT found." >&4
6594 case "$xxx_convert" in
6595 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6596 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6597 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6601 : see if inttypes.h is available
6602 : we want a real compile instead of Inhdr because some systems
6603 : have an inttypes.h which includes non-existent headers
6606 #include <inttypes.h>
6608 static int32_t foo32 = 0x12345678;
6612 if eval $compile; then
6613 echo "<inttypes.h> found." >&4
6616 echo "<inttypes.h> NOT found." >&4
6624 case "$use64bits" in
6627 echo $n "Checking to see if your system supports int64_t...$c" >&4
6629 #include <sys/types.h>
6630 #$i_inttypes I_INTTYPES
6632 #include <inttypes.h>
6634 int64_t foo() { int64_t x; x = 7; return x; }
6636 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6638 echo " Yup, it does." >&4
6641 echo " Nope, it doesn't." >&4
6652 : check for lengths of integral types
6656 echo "Checking to see how big your integers are..." >&4
6657 $cat >intsize.c <<'EOCP'
6661 printf("intsize=%d;\n", sizeof(int));
6662 printf("longsize=%d;\n", sizeof(long));
6663 printf("shortsize=%d;\n", sizeof(short));
6668 if eval $compile_ok && ./intsize > /dev/null; then
6670 echo "Your integers are $intsize bytes long."
6671 echo "Your long integers are $longsize bytes long."
6672 echo "Your short integers are $shortsize bytes long."
6676 Help! I can't compile and run the intsize test program: please enlighten me!
6677 (This is probably a misconfiguration in your system or libraries, and
6678 you really ought to fix it. Still, I'll try anyway.)
6682 rp="What is the size of an integer (in bytes)?"
6686 rp="What is the size of a long integer (in bytes)?"
6690 rp="What is the size of a short integer (in bytes)?"
6696 $rm -f intsize intsize.*
6698 : check for long long
6700 echo $n "Checking to see if your system supports long long...$c" >&4
6701 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6702 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6704 echo " Yup, it does." >&4
6707 echo " Nope, it doesn't." >&4
6713 : check for length of long long
6714 case "${d_longlong}${longlongsize}" in
6717 $echo $n "Checking to see how big your long longs are...$c" >&4
6718 $cat >try.c <<'EOCP'
6722 printf("%d\n", sizeof(long long));
6726 if eval $compile_ok; then
6727 longlongsize=`./try`
6728 $echo " $longlongsize bytes." >&4
6732 echo "(I can't seem to compile the test program. Guessing...)"
6733 rp="What is the size of a long long (in bytes)?"
6737 if $test "X$longsize" = "X$longlongsize"; then
6738 echo "(That isn't any different from an ordinary long.)"
6746 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6748 echo "Checking how to print 64-bit integers..." >&4
6750 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6752 $cat >try.c <<'EOCP'
6753 #include <sys/types.h>
6756 int q = 12345678901;
6761 if eval $compile; then
6765 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6766 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6767 echo "We will use %d."
6773 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6775 $cat >try.c <<'EOCP'
6776 #include <sys/types.h>
6779 long q = 12345678901;
6784 if eval $compile; then
6788 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6789 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6790 echo "We will use %ld."
6796 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6798 $cat >try.c <<'EOCP'
6799 #include <sys/types.h>
6800 #include <inttypes.h>
6803 int64_t q = 12345678901;
6804 printf("%" PRId64 "\n", q);
6808 if eval $compile; then
6812 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6813 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6814 echo "We will use the C9X style."
6820 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6822 $cat >try.c <<'EOCP'
6823 #include <sys/types.h>
6826 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6827 printf("%lld\n", q);
6831 if eval $compile; then
6835 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6836 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6837 echo "We will use the %lld style."
6843 if $test X"$sPRId64" = X -a X"$quad" != X; then
6845 #include <sys/types.h>
6848 $quad q = 12345678901;
6853 if eval $compile; then
6857 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6858 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6859 echo "We will use %lld."
6865 if $test X"$sPRId64" = X -a X"$quad" != X; then
6867 #include <sys/types.h>
6870 $quad q = 12345678901;
6875 if eval $compile; then
6879 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6880 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6881 echo "We will use %qd."
6887 if $test X"$sPRId64" = X; then
6888 echo "Cannot figure out how to print 64-bit integers." >&4
6893 fi # intsize -o longsize -o d_int64t -o d_longlong
6896 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6897 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6899 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6900 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6904 : check for length of double
6906 case "$doublesize" in
6908 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6909 $cat >try.c <<'EOCP'
6913 printf("%d\n", sizeof(double));
6917 if eval $compile_ok; then
6919 $echo " $doublesize bytes." >&4
6922 echo "(I can't seem to compile the test program. Guessing...)"
6923 rp="What is the size of a double precision number (in bytes)?"
6931 : check for long doubles
6933 echo $n "Checking to see if your system supports long doubles...$c" >&4
6934 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6935 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6937 echo " Yup, it does." >&4
6940 echo " Nope, it doesn't." >&4
6946 : check for length of long double
6947 case "${d_longdbl}${longdblsize}" in
6950 $echo $n "Checking to see how big your long doubles are...$c" >&4
6951 $cat >try.c <<'EOCP'
6955 printf("%d\n", sizeof(long double));
6959 if eval $compile; then
6961 $echo " $longdblsize bytes." >&4
6965 echo "(I can't seem to compile the test program. Guessing...)" >&4
6966 rp="What is the size of a long double (in bytes)?"
6970 if $test "X$doublesize" = "X$longdblsize"; then
6971 echo "(That isn't any different from an ordinary double.)"
6979 if $test X"$d_longdbl" = X"$define"; then
6981 echo "Checking how to print long doubles..." >&4
6983 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6984 $cat >try.c <<'EOCP'
6985 #include <sys/types.h>
6989 printf("%.3f\n", d);
6993 if eval $compile; then
6997 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6998 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6999 echo "We will use %f."
7005 if $test X"$sPRIfldbl" = X; then
7006 $cat >try.c <<'EOCP'
7007 #include <sys/types.h>
7010 long double d = 123.456;
7011 printf("%.3llf\n", d);
7015 if eval $compile; then
7019 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7020 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7021 echo "We will use %llf."
7027 if $test X"$sPRIfldbl" = X; then
7028 echo "Cannot figure out how to print long doubles." >&4
7031 if $test X"$sPRIfldbl" = X; then
7032 $cat >try.c <<'EOCP'
7033 #include <sys/types.h>
7036 long double d = 123.456;
7037 printf("%.3Lf\n", d);
7041 if eval $compile; then
7045 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7046 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7047 echo "We will use %Lf."
7053 if $test X"$sPRIfldbl" = X; then
7054 $cat >try.c <<'EOCP'
7055 #include <sys/types.h>
7058 long double d = 123.456;
7059 printf("%.3lf\n", d);
7063 if eval $compile; then
7067 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7068 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7069 echo "We will use %lf."
7079 case "$sPRIfldbl" in
7080 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7081 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7083 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7084 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7088 : Initialize h_fcntl
7091 : Initialize h_sysfile
7094 : access call always available on UNIX
7098 : locate the flags for 'access()'
7102 $cat >access.c <<'EOCP'
7103 #include <sys/types.h>
7108 #include <sys/file.h>
7117 : check sys/file.h first, no particular reason here
7118 if $test `./findhdr sys/file.h` && \
7119 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7121 echo "<sys/file.h> defines the *_OK access constants." >&4
7122 elif $test `./findhdr fcntl.h` && \
7123 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7125 echo "<fcntl.h> defines the *_OK access constants." >&4
7126 elif $test `./findhdr unistd.h` && \
7127 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7128 echo "<unistd.h> defines the *_OK access constants." >&4
7130 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7136 : see if accessx exists
7137 set accessx d_accessx
7140 : see if alarm exists
7144 : see if atolf exists
7148 : see if atoll exists
7152 : Look for GNU-cc style attribute checking
7154 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7155 $cat >attrib.c <<'EOCP'
7157 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7159 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7160 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7161 echo "Your C compiler doesn't fully support __attribute__."
7164 echo "Your C compiler supports __attribute__."
7168 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7175 : see if bcmp exists
7179 : see if bcopy exists
7183 : see if this is a unistd.h system
7184 set unistd.h i_unistd
7187 : see if getpgrp exists
7188 set getpgrp d_getpgrp
7191 case "$d_getpgrp" in
7194 echo "Checking to see which flavor of getpgrp is in use..."
7197 #include <sys/types.h>
7199 # include <unistd.h>
7203 if (getuid() == 0) {
7204 printf("(I see you are running Configure as super-user...)\n");
7208 if (getpgrp(1) == 0)
7217 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7218 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7220 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7221 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7224 echo "I can't seem to compile and run the test program."
7226 xxx="a USG one, i.e. you use getpgrp()."
7228 # SVR4 systems can appear rather BSD-ish.
7231 xxx="a BSD one, i.e. you use getpgrp(pid)."
7235 xxx="probably a USG one, i.e. you use getpgrp()."
7240 echo "Assuming your getpgrp is $xxx" >&4
7249 : see if setpgrp exists
7250 set setpgrp d_setpgrp
7253 case "$d_setpgrp" in
7256 echo "Checking to see which flavor of setpgrp is in use..."
7259 #include <sys/types.h>
7261 # include <unistd.h>
7265 if (getuid() == 0) {
7266 printf("(I see you are running Configure as super-user...)\n");
7270 if (-1 == setpgrp(1, 1))
7273 if (setpgrp() != -1)
7279 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7280 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7282 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7283 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7286 echo "(I can't seem to compile and run the test program.)"
7288 xxx="a USG one, i.e. you use setpgrp()."
7290 # SVR4 systems can appear rather BSD-ish.
7293 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7297 xxx="probably a USG one, i.e. you use setpgrp()."
7302 echo "Assuming your setpgrp is $xxx" >&4
7310 : see if bzero exists
7314 : see if signal is declared as pointer to function returning int or void
7316 xxx=`./findhdr signal.h`
7317 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7318 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7319 echo "You have int (*signal())() instead of void." >&4
7321 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7322 echo "You have void (*signal())()." >&4
7324 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7325 echo "You have int (*signal())() instead of void." >&4
7327 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7328 echo "You have void (*signal())()." >&4
7331 case "$d_voidsig" in
7333 echo "I can't determine whether signal handler returns void or int..." >&4
7335 rp="What type does your signal handler return?"
7342 echo "As you already told me, signal handler returns void." >&4
7345 *) echo "As you already told me, signal handler returns int." >&4
7352 case "$d_voidsig" in
7353 "$define") signal_t="void";;
7358 : check for ability to cast large floats to 32-bit ints.
7360 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7361 if $test "$intsize" -ge 4; then
7368 #include <sys/types.h>
7370 $signal_t blech(s) int s; { exit(3); }
7377 signal(SIGFPE, blech);
7379 /* Don't let compiler optimize the test away. Store the number
7380 in a writable string for gcc to pass to sscanf under HP/UX.
7382 sprintf(str, "2147483647");
7383 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7387 /* x86 processors will probably give 0x8000 0000, which is a
7388 sign change. We don't want that. We want to mimic SPARC
7389 behavior here, which is to preserve the sign and give
7392 if (i32 != ($xxx) f)
7398 if eval $compile_ok; then
7402 echo "(I can't seem to compile the test program--assuming it can't)"
7410 echo "Nope, it can't."
7417 : check for ability to cast negative floats to unsigned
7419 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7422 #include <sys/types.h>
7424 $signal_t blech(s) int s; { exit(7); }
7425 $signal_t blech_in_list(s) int s; { exit(4); }
7426 unsigned long dummy_long(p) unsigned long p; { return p; }
7427 unsigned int dummy_int(p) unsigned int p; { return p; }
7428 unsigned short dummy_short(p) unsigned short p; { return p; }
7432 unsigned long along;
7434 unsigned short ashort;
7438 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7439 a direct f = -123. assignment. gcc-2.8.0 reportedly
7440 optimized the whole file away
7442 /* Store the number in a writable string for gcc to pass to
7445 sprintf(str, "-123");
7446 sscanf(str, "%lf", &f); /* f = -123.; */
7448 signal(SIGFPE, blech);
7449 along = (unsigned long)f;
7450 aint = (unsigned int)f;
7451 ashort = (unsigned short)f;
7452 if (along != (unsigned long)-123)
7454 if (aint != (unsigned int)-123)
7456 if (ashort != (unsigned short)-123)
7458 sprintf(str, "1073741824.");
7459 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7462 along = (unsigned long)f;
7463 if (along != 0x80000000)
7467 along = (unsigned long)f;
7468 if (along != 0x7fffffff)
7472 along = (unsigned long)f;
7473 if (along != 0x80000001)
7477 signal(SIGFPE, blech_in_list);
7478 sprintf(str, "123.");
7479 sscanf(str, "%lf", &f); /* f = 123.; */
7480 along = dummy_long((unsigned long)f);
7481 aint = dummy_int((unsigned int)f);
7482 ashort = dummy_short((unsigned short)f);
7483 if (along != (unsigned long)123)
7485 if (aint != (unsigned int)123)
7487 if (ashort != (unsigned short)123)
7494 if eval $compile_ok; then
7498 echo "(I can't seem to compile the test program--assuming it can't)"
7501 case "$castflags" in
7506 echo "Nope, it can't."
7513 : see if vprintf exists
7515 if set vprintf val -f d_vprintf; eval $csym; $val; then
7516 echo 'vprintf() found.' >&4
7518 $cat >vprintf.c <<'EOF'
7519 #include <varargs.h>
7521 int main() { xxx("foo"); }
7530 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7534 if eval $compile && ./vprintf; then
7535 echo "Your vsprintf() returns (int)." >&4
7538 echo "Your vsprintf() returns (char*)." >&4
7542 echo 'vprintf() NOT found.' >&4
7552 : see if chown exists
7556 : see if chroot exists
7560 : see if chsize exists
7564 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7565 while $test $# -ge 2; do
7567 $define) echo "#include <$2>";;
7571 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7572 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7581 : see if this is a sys/uio.h system
7582 set sys/uio.h i_sysuio
7585 echo "Checking to see if your system supports struct iovec..." >&4
7586 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7588 case "$d_iovec_s" in
7589 "$define") echo "Yup, it does." >&4
7591 *) echo "Nope, it doesn't." >&4
7597 : see whether socket exists
7599 $echo $n "Hmm... $c" >&4
7600 if set socket val -f d_socket; eval $csym; $val; then
7601 echo "Looks like you have Berkeley networking support." >&4
7603 if set setsockopt val -f; eval $csym; $val; then
7606 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7610 if $contains socklib libc.list >/dev/null 2>&1; then
7611 echo "Looks like you have Berkeley networking support." >&4
7613 : we will have to assume that it supports the 4.2 BSD interface
7616 echo "You don't have Berkeley networking in libc$_a..." >&4
7617 if test "X$d_socket" = "X$define"; then
7618 echo "...but you seem to believe that you have sockets." >&4
7620 for net in net socket
7622 if test -f /usr/lib/lib$net$_a; then
7623 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7624 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7625 if $contains socket libc.list >/dev/null 2>&1; then
7630 echo "...but the Wollongong group seems to have hacked it in." >&4
7631 sockethdr="-I/usr/netinclude"
7634 echo "Found Berkeley sockets interface in lib$net." >& 4
7635 if $contains setsockopt libc.list >/dev/null 2>&1; then
7638 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7645 if test "X$d_socket" != "X$define"; then
7646 echo "or anywhere else I see." >&4
7654 : see if socketpair exists
7655 set socketpair d_sockpair
7660 echo "Checking the availability of certain socket constants..." >& 4
7661 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7662 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7664 #include <sys/types.h>
7665 #include <sys/socket.h>
7671 set try; if eval $compile; then
7674 set d_${enum}; eval $setvar
7678 set sendmsg d_sendmsg
7681 set recvmsg d_recvmsg
7685 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7686 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7688 case "$d_msghdr_s" in
7689 "$define") echo "Yup, it does." >&4
7691 *) echo "Nope, it doesn't." >&4
7695 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7696 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7698 case "$d_cmsghdr_s" in
7699 "$define") echo "Yup, it does." >&4
7701 *) echo "Nope, it doesn't." >&4
7705 : check for const keyword
7707 echo 'Checking to see if your C compiler knows about "const"...' >&4
7708 $cat >const.c <<'EOCP'
7709 typedef struct spug { int drokk; } spug;
7716 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7718 echo "Yup, it does."
7721 echo "Nope, it doesn't."
7726 : see if crypt exists
7728 if set crypt val -f d_crypt; eval $csym; $val; then
7729 echo 'crypt() found.' >&4
7733 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7734 if $test -z "$cryptlib"; then
7735 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7739 if $test -z "$cryptlib"; then
7740 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7744 if $test -z "$cryptlib"; then
7745 cryptlib=`./loc libcrypt$_a "" $libpth`
7749 if $test -z "$cryptlib"; then
7750 echo 'crypt() NOT found.' >&4
7759 : get csh whereabouts
7761 'csh') val="$undef" ;;
7766 : Respect a hint or command line value for full_csh.
7768 '') full_csh=$csh ;;
7771 : see if cuserid exists
7772 set cuserid d_cuserid
7775 : see if this is a limits.h system
7776 set limits.h i_limits
7779 : see if this is a float.h system
7783 : See if number of significant digits in a double precision number is known
7785 $cat >dbl_dig.c <<EOM
7795 printf("Contains DBL_DIG");
7798 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7799 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7800 echo "DBL_DIG found." >&4
7803 echo "DBL_DIG NOT found." >&4
7811 if $test X"$use64bits" = X"$define"; then
7812 : see if dbminit64 exists
7813 set dbminit64 d_dbminit64
7816 : see if dbmclose64 exists
7817 set dbmclose64 d_dbmclose64
7820 : see if fetch64 exists
7821 set fetch64 d_fetch64
7824 : see if store64 exists
7825 set store64 d_store64
7828 : see if delete64 exists
7829 set delete64 d_delete64
7832 : see if firstkey64 exists
7833 set firstkey64 d_firstkey64
7836 : see if nextkey64 exists
7837 set nextkey64 d_nextkey64
7841 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7848 : see if difftime exists
7849 set difftime d_difftime
7852 : see if sys/stat.h is available
7853 set sys/stat.h i_sysstat
7856 : see if this is a dirent system
7858 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7860 echo "<dirent.h> found." >&4
7863 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7864 echo "<sys/dir.h> found." >&4
7867 xinc=`./findhdr sys/ndir.h`
7869 echo "<dirent.h> NOT found." >&4
7874 : Look for type of directory structure.
7876 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7878 case "$direntrytype" in
7881 $define) guess1='struct dirent' ;;
7882 *) guess1='struct direct' ;;
7885 *) guess1="$direntrytype"
7890 'struct dirent') guess2='struct direct' ;;
7891 *) guess2='struct dirent' ;;
7894 if $contains "$guess1" try.c >/dev/null 2>&1; then
7895 direntrytype="$guess1"
7896 echo "Your directory entries are $direntrytype." >&4
7897 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7898 direntrytype="$guess2"
7899 echo "Your directory entries seem to be $direntrytype." >&4
7901 echo "I don't recognize your system's directory entries." >&4
7902 rp="What type is used for directory entries on this system?"
7910 : see if the directory entry stores field length
7912 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7913 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7914 echo "Good, your directory entry keeps length information in d_namlen." >&4
7917 echo "Your directory entry does not know about the d_namlen field." >&4
7925 if $test X"$use64bits" = X"$define"; then
7926 : see if fstat64 exists
7927 set fstat64 d_fstat64
7930 : see if ftruncate64 exists
7931 set ftruncate64 d_ftruncate64
7934 : see if lockf64 exists
7935 set lockf64 d_lockf64
7938 : see if llseek exists
7942 : see if lseek64 exists
7943 set lseek64 d_lseek64
7946 : see if lstat64 exists
7947 set lstat64 d_lstat64
7950 : see if open64 exists
7954 : see if opendir64 exists
7955 set opendir64 d_opendir64
7958 : see if readdir64 exists
7959 set readdir64 d_readdir64
7962 : see if seekdir64 exists
7963 set seekdir64 d_seekdir64
7966 : see if stat64 exists
7970 : see if telldir64 exists
7971 set telldir64 d_telldir64
7974 : see if truncate64 exists
7975 set truncate64 d_truncate64
7980 echo $n "Checking to see if your system supports off64_t...$c" >&4
7982 #include <sys/types.h>
7984 off64_t foo() { off64_t x; x = 7; return x; }'
7986 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7988 echo " Yup, it does." >&4
7991 echo " Nope, it doesn't." >&4
7997 : check for offset_t
7999 echo $n "Checking to see if your system supports offset_t...$c" >&4
8001 #include <sys/types.h>
8003 offset_t foo() { offset_t x; x = 7; return x; }'
8005 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8007 echo " Yup, it does." >&4
8010 echo " Nope, it doesn't." >&4
8018 echo $n "Checking to see if your system supports ino64_t...$c" >&4
8020 case "$i_sysstat" in
8023 #include <sys/types.h>
8024 #include <sys/stat.h>
8025 ino64_t foo() { ino64_t x; x = 7; return x; }'
8027 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8033 if $test "X$val" = X"$define"; then
8034 echo " Yup, it does." >&4
8036 echo " Nope, it doesn't." >&4
8041 : check for struct flock64
8043 echo "Checking to see if your system supports struct flock64..." >&4
8045 set d_flock64_s flock64 l_len define fcntl.h
8052 case "$d_flock64_s" in
8053 "$define") echo "Yup, it does." >&4
8055 *) echo "Nope, it doesn't." >&4
8059 : check for struct dirent64
8061 echo "Checking to see if your system supports struct dirent64..." >&4
8062 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
8064 case "$d_dirent64_s" in
8065 "$define") echo "Yup, it does." >&4
8067 *) echo "Nope, it doesn't." >&4
8073 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
8080 : see if dlerror exists
8083 set dlerror d_dlerror
8087 : see if dlfcn is available
8095 On a few systems, the dynamically loaded modules that perl generates and uses
8096 will need a different extension than shared libs. The default will probably
8104 rp='What is the extension of dynamically loaded modules'
8113 : Check if dlsym need a leading underscore
8119 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8120 $cat >dyna.c <<'EOM'
8129 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8131 #include <sys/types.h>
8145 int mode = RTLD_LAZY ;
8147 handle = dlopen("./dyna.$dlext", mode) ;
8148 if (handle == NULL) {
8153 symbol = dlsym(handle, "fred") ;
8154 if (symbol == NULL) {
8155 /* try putting a leading underscore */
8156 symbol = dlsym(handle, "_fred") ;
8157 if (symbol == NULL) {
8170 : Call the object file tmp-dyna.o in case dlext=o.
8171 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8172 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8173 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8174 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8177 1) echo "Test program failed using dlopen." >&4
8178 echo "Perhaps you should not use dynamic loading." >&4;;
8179 2) echo "Test program failed using dlsym." >&4
8180 echo "Perhaps you should not use dynamic loading." >&4;;
8181 3) echo "dlsym needs a leading underscore" >&4
8183 4) echo "dlsym doesn't need a leading underscore." >&4;;
8186 echo "I can't compile and run the test program." >&4
8191 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8196 hasproto='varname=$1; func=$2; shift; shift;
8197 while $test $# -ge 2; do
8199 $define) echo "#include <$2>";;
8203 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8204 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8205 echo "$func() prototype found.";
8208 echo "$func() prototype NOT found.";
8213 $rm -f try.c tryout.c'
8215 : see if prototype for drand48 is available
8217 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8220 : see if dup2 exists
8224 : see if eaccess exists
8225 set eaccess d_eaccess
8228 : see if endgrent exists
8229 set endgrent d_endgrent
8232 : see if endhostent exists
8233 set endhostent d_endhent
8236 : see if endnetent exists
8237 set endnetent d_endnent
8240 : see if endprotoent exists
8241 set endprotoent d_endpent
8244 : see if endpwent exists
8245 set endpwent d_endpwent
8248 : see if endservent exists
8249 set endservent d_endsent
8252 : see if endspent exists
8253 set endspent d_endspent
8256 : Locate the flags for 'open()'
8258 $cat >open3.c <<'EOCP'
8259 #include <sys/types.h>
8264 #include <sys/file.h>
8275 : check sys/file.h first to get FREAD on Sun
8276 if $test `./findhdr sys/file.h` && \
8277 set open3 -DI_SYS_FILE && eval $compile; then
8279 echo "<sys/file.h> defines the O_* constants..." >&4
8281 echo "and you have the 3 argument form of open()." >&4
8284 echo "but not the 3 argument form of open(). Oh, well." >&4
8287 elif $test `./findhdr fcntl.h` && \
8288 set open3 -DI_FCNTL && eval $compile; then
8290 echo "<fcntl.h> defines the O_* constants..." >&4
8292 echo "and you have the 3 argument form of open()." >&4
8295 echo "but not the 3 argument form of open(). Oh, well." >&4
8300 echo "I can't find the O_* constant definitions! You got problems." >&4
8306 : check for non-blocking I/O stuff
8307 case "$h_sysfile" in
8308 true) echo "#include <sys/file.h>" > head.c;;
8311 true) echo "#include <fcntl.h>" > head.c;;
8312 *) echo "#include <sys/fcntl.h>" > head.c;;
8317 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8318 case "$o_nonblock" in
8321 $cat >>try.c <<'EOCP'
8324 printf("O_NONBLOCK\n");
8328 printf("O_NDELAY\n");
8332 printf("FNDELAY\n");
8339 if eval $compile_ok; then
8341 case "$o_nonblock" in
8342 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8343 *) echo "Seems like we can use $o_nonblock.";;
8346 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8349 *) echo "Using $hint value $o_nonblock.";;
8351 $rm -f try try.* .out core
8354 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8360 #include <sys/types.h>
8362 #define MY_O_NONBLOCK $o_nonblock
8363 #ifndef errno /* XXX need better Configure test */
8366 $signal_t blech(x) int x; { exit(3); }
8368 $cat >> try.c <<'EOCP'
8376 pipe(pd); /* Down: child -> parent */
8377 pipe(pu); /* Up: parent -> child */
8380 close(pd[1]); /* Parent reads from pd[0] */
8381 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8382 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8384 signal(SIGALRM, blech);
8386 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8388 sprintf(string, "%d\n", ret);
8389 write(2, string, strlen(string));
8392 if (errno == EAGAIN) {
8398 if (errno == EWOULDBLOCK)
8399 printf("EWOULDBLOCK\n");
8402 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8403 sleep(2); /* Give it time to close our pipe */
8405 ret = read(pd[0], buf, 1); /* Should read EOF */
8407 sprintf(string, "%d\n", ret);
8408 write(3, string, strlen(string));
8412 close(pd[0]); /* We write to pd[1] */
8413 close(pu[1]); /* We read from pu[0] */
8414 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8415 close(pd[1]); /* Pipe pd is now fully closed! */
8416 exit(0); /* Bye bye, thank you for playing! */
8420 if eval $compile_ok; then
8421 echo "$startsh" >mtry
8422 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8424 ./mtry >/dev/null 2>&1
8426 0) eagain=`$cat try.out`;;
8427 1) echo "Could not perform non-blocking setting!";;
8428 2) echo "I did a successful read() for something that was not there!";;
8429 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8430 *) echo "Something terribly wrong happened during testing.";;
8432 rd_nodata=`$cat try.ret`
8433 echo "A read() system call with no data present returns $rd_nodata."
8434 case "$rd_nodata" in
8437 echo "(That's peculiar, fixing that to be -1.)"
8443 echo "Forcing errno EAGAIN on read() with no data available."
8447 echo "Your read() sets errno to $eagain when no data is available."
8450 status=`$cat try.err`
8452 0) echo "And it correctly returns 0 to signal EOF.";;
8453 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8454 *) echo "However, your read() returns '$status' on EOF??";;
8457 if test "$status" = "$rd_nodata"; then
8458 echo "WARNING: you can't distinguish between EOF and no data!"
8462 echo "I can't compile the test program--assuming errno EAGAIN will do."
8469 echo "Using $hint value $eagain."
8470 echo "Your read() returns $rd_nodata when no data is present."
8471 case "$d_eofnblk" in
8472 "$define") echo "And you can see EOF because read() returns 0.";;
8473 "$undef") echo "But you can't see EOF status from read() returned value.";;
8475 echo "(Assuming you can't see EOF status from read anyway.)"
8481 $rm -f try try.* .out core head.c mtry
8483 : see if fchmod exists
8487 : see if fchown exists
8491 : see if this is an fcntl system
8495 : see if sys/select.h has to be included
8496 set sys/select.h i_sysselct
8499 : see if we should include time.h, sys/time.h, or both
8501 if test "X$timeincl" = X; then
8502 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8503 $echo $n "I'm now running the test program...$c"
8504 $cat >try.c <<'EOCP'
8505 #include <sys/types.h>
8510 #ifdef SYSTIMEKERNEL
8513 #include <sys/time.h>
8516 #include <sys/select.h>
8525 struct timezone tzp;
8527 if (foo.tm_sec == foo.tm_sec)
8530 if (bar.tv_sec == bar.tv_sec)
8537 for s_timezone in '-DS_TIMEZONE' ''; do
8539 for s_timeval in '-DS_TIMEVAL' ''; do
8540 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8541 for i_time in '' '-DI_TIME'; do
8542 for i_systime in '-DI_SYSTIME' ''; do
8545 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8546 if eval $compile; then
8547 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8551 $echo $n "Succeeded with $flags$c"
8563 *SYSTIMEKERNEL*) i_systimek="$define"
8564 timeincl=`./findhdr sys/time.h`
8565 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8566 *) i_systimek="$undef";;
8569 *I_TIME*) i_time="$define"
8570 timeincl=`./findhdr time.h`" $timeincl"
8571 echo "We'll include <time.h>." >&4;;
8572 *) i_time="$undef";;
8575 *I_SYSTIME*) i_systime="$define"
8576 timeincl=`./findhdr sys/time.h`" $timeincl"
8577 echo "We'll include <sys/time.h>." >&4;;
8578 *) i_systime="$undef";;
8583 : check for fd_set items
8586 Checking to see how well your C compiler handles fd_set and friends ...
8588 $cat >fd_set.c <<EOCP
8589 #$i_systime I_SYS_TIME
8590 #$i_sysselct I_SYS_SELECT
8591 #$d_socket HAS_SOCKET
8592 #include <sys/types.h>
8594 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8597 #include <sys/time.h>
8600 #include <sys/select.h>
8609 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8616 set fd_set -DTRYBITS
8617 if eval $compile; then
8618 d_fds_bits="$define"
8620 echo "Well, your system knows about the normal fd_set typedef..." >&4
8622 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8623 d_fd_macros="$define"
8626 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8628 d_fd_macros="$undef"
8632 Hmm, your compiler has some difficulty with fd_set. Checking further...
8635 if eval $compile; then
8638 echo "Well, your system has some sort of fd_set available..." >&4
8640 echo "and you have the normal fd_set macros." >&4
8641 d_fd_macros="$define"
8644 but not the normal fd_set macros! Gross! More work for me...
8646 d_fd_macros="$undef"
8649 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8652 d_fd_macros="$undef"
8657 : see if fgetpos exists
8658 set fgetpos d_fgetpos
8662 if $test X"$use64bits" = X"$define"; then
8663 : see if fgetpos64 exists
8664 set fgetpos64 d_fgetpos64
8667 : see if fopen64 exists
8668 set freopen64 d_fopen64
8671 : see if freopen64 exists
8672 set freopen64 d_freopen64
8675 : see if fseek64 exists
8676 set fseek64 d_fseek64
8679 : see if fseeko64 exists
8680 set fseeko64 d_fseeko64
8683 : see if fsetpos64 exists
8684 set fsetpos64 d_fsetpos64
8687 : see if ftell64 exists
8688 set ftell64 d_ftell64
8691 : see if ftello64 exists
8692 set ftello64 d_ftello64
8695 : see if tmpfile64 exists
8696 set tmpfile64 d_tmpfile64
8700 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8707 : see if flock exists
8711 : see if fork exists
8715 : see if pathconf exists
8716 set pathconf d_pathconf
8719 : see if fpathconf exists
8720 set fpathconf d_fpathconf
8723 : see if fseeko exists
8727 : see if fsetpos exists
8728 set fsetpos d_fsetpos
8731 : see if this is a sys/param system
8732 set sys/param.h i_sysparam
8735 : see if this is a sys/mount.h system
8736 set sys/mount.h i_sysmount
8740 : see if statfs exists
8744 : see if fstatfs exists
8745 set fstatfs d_fstatfs
8748 : see if statfs knows about mount flags
8749 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8753 : see if statvfs exists
8754 set statvfs d_statvfs
8757 : see if fstatvfs exists
8758 set fstatvfs d_fstatvfs
8762 : see if ftello exists
8766 : see if getgrent exists
8767 set getgrent d_getgrent
8770 : see if gethostbyaddr exists
8771 set gethostbyaddr d_gethbyaddr
8774 : see if gethostbyname exists
8775 set gethostbyname d_gethbyname
8778 : see if gethostent exists
8779 set gethostent d_gethent
8782 : see how we will look up host name
8785 if set gethostname val -f d_gethname; eval $csym; $val; then
8786 echo 'gethostname() found.' >&4
8787 d_gethname="$define"
8790 if set uname val -f d_uname; eval $csym; $val; then
8793 uname() was found, but you're running xenix, and older versions of xenix
8794 have a broken uname(). If you don't really know whether your xenix is old
8795 enough to have a broken system call, use the default answer.
8802 rp='Is your uname() broken?'
8805 n*) d_uname="$define"; call=uname;;
8808 echo 'uname() found.' >&4
8815 case "$d_gethname" in
8816 '') d_gethname="$undef";;
8819 '') d_uname="$undef";;
8821 case "$d_uname$d_gethname" in
8826 Every now and then someone has a $call() that lies about the hostname
8827 but can't be fixed for political or economic reasons. If you wish, I can
8828 pretend $call() isn't there and maybe compute hostname at run-time
8829 thanks to the '$phostname' command.
8832 rp="Shall I ignore $call() from now on?"
8835 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8838 case "$phostname" in
8840 *) case "$aphostname" in
8846 file=`./loc $file $file $pth`
8847 aphostname=`echo $file $*`
8852 case "$d_uname$d_gethname" in
8855 case "$phostname" in
8857 echo "There will be no way for $package to get your hostname." >&4;;
8859 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8863 case "$d_phostname" in
8864 '') d_phostname="$undef";;
8867 : see if this is a netdb.h system
8871 : see if prototypes for various gethostxxx netdb.h functions are available
8873 set d_gethostprotos gethostent $i_netdb netdb.h
8876 : see if getlogin exists
8877 set getlogin d_getlogin
8880 : see if getmntent exists
8881 set getmntent d_getmntent
8884 : see if getnetbyaddr exists
8885 set getnetbyaddr d_getnbyaddr
8888 : see if getnetbyname exists
8889 set getnetbyname d_getnbyname
8892 : see if getnetent exists
8893 set getnetent d_getnent
8896 : see if prototypes for various getnetxxx netdb.h functions are available
8898 set d_getnetprotos getnetent $i_netdb netdb.h
8902 : see if getprotobyname exists
8903 set getprotobyname d_getpbyname
8906 : see if getprotobynumber exists
8907 set getprotobynumber d_getpbynumber
8910 : see if getprotoent exists
8911 set getprotoent d_getpent
8914 : see if getpgid exists
8915 set getpgid d_getpgid
8918 : see if getpgrp2 exists
8919 set getpgrp2 d_getpgrp2
8922 : see if getppid exists
8923 set getppid d_getppid
8926 : see if getpriority exists
8927 set getpriority d_getprior
8930 : see if prototypes for various getprotoxxx netdb.h functions are available
8932 set d_getprotoprotos getprotoent $i_netdb netdb.h
8935 : see if getpwent exists
8936 set getpwent d_getpwent
8940 : see if getservbyname exists
8941 set getservbyname d_getsbyname
8944 : see if getservbyport exists
8945 set getservbyport d_getsbyport
8948 : see if getservent exists
8949 set getservent d_getsent
8952 : see if prototypes for various getservxxx netdb.h functions are available
8954 set d_getservprotos getservent $i_netdb netdb.h
8957 : see if getspent exists
8958 set getspent d_getspent
8961 : see if getspnam exists
8962 set getspnam d_getspnam
8965 : see if gettimeofday or ftime exists
8966 set gettimeofday d_gettimeod
8968 case "$d_gettimeod" in
8974 val="$undef"; set d_ftime; eval $setvar
8977 case "$d_gettimeod$d_ftime" in
8980 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8984 : see if this is an grp system
8990 xxx=`./findhdr grp.h`
8991 $cppstdin $cppflags $cppminus < $xxx >$$.h
8993 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9005 set d_grpasswd; eval $setvar
9009 : see if hasmntopt exists
9010 set hasmntopt d_hasmntopt
9013 : see if this is a netinet/in.h or sys/in.h system
9014 set netinet/in.h i_niin sys/in.h i_sysin
9017 : see if arpa/inet.h has to be included
9018 set arpa/inet.h i_arpainet
9021 : see if htonl --and friends-- exists
9026 : Maybe they are macros.
9031 #include <sys/types.h>
9032 #$i_niin I_NETINET_IN
9034 #$i_arpainet I_ARPA_INET
9036 #include <netinet/in.h>
9042 #include <arpa/inet.h>
9045 printf("Defined as a macro.");
9048 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9049 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9051 echo "But it seems to be defined as a macro." >&4
9059 : see which of string.h or strings.h is needed
9061 strings=`./findhdr string.h`
9062 if $test "$strings" && $test -r "$strings"; then
9063 echo "Using <string.h> instead of <strings.h>." >&4
9067 strings=`./findhdr strings.h`
9068 if $test "$strings" && $test -r "$strings"; then
9069 echo "Using <strings.h> instead of <string.h>." >&4
9071 echo "No string header found -- You'll surely have problems." >&4
9077 "$undef") strings=`./findhdr strings.h`;;
9078 *) strings=`./findhdr string.h`;;
9083 if set index val -f; eval $csym; $val; then
9084 if set strchr val -f d_strchr; eval $csym; $val; then
9085 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9088 echo "strchr() found." >&4
9092 echo "index() found." >&4
9097 echo "index() found." >&4
9100 if set strchr val -f d_strchr; eval $csym; $val; then
9103 echo "strchr() found." >&4
9105 echo "No index() or strchr() found!" >&4
9110 set d_strchr; eval $setvar
9112 set d_index; eval $setvar
9114 : check whether inet_aton exists
9115 set inet_aton d_inetaton
9120 $cat >isascii.c <<'EOCP'
9132 if eval $compile; then
9133 echo "isascii() found." >&4
9136 echo "isascii() NOT found." >&4
9143 : see if killpg exists
9147 : see if lchown exists
9149 $cat > try.c <<'EOCP'
9150 /* System header to define __stub macros and hopefully few prototypes,
9151 which can conflict with char lchown(); below. */
9153 /* Override any gcc2 internal prototype to avoid an error. */
9154 /* We use char because int might match the return type of a gcc2
9155 builtin and then its argument prototype would still apply. */
9158 /* The GNU C library defines this for functions which it implements
9159 to always fail with ENOSYS. Some functions are actually named
9160 something starting with __ and the normal name is an alias. */
9161 #if defined (__stub_lchown) || defined (__stub___lchown)
9169 if eval $compile; then
9170 $echo "lchown() found." >&4
9173 $echo "lchown() NOT found." >&4
9179 : see if link exists
9183 : see if localeconv exists
9184 set localeconv d_locconv
9187 : see if lockf exists
9191 : see if lstat exists
9195 : see if madvise exists
9196 set madvise d_madvise
9199 : see if mblen exists
9203 : see if mbstowcs exists
9204 set mbstowcs d_mbstowcs
9207 : see if mbtowc exists
9211 : see if memchr exists
9215 : see if memcmp exists
9219 : see if memcpy exists
9223 : see if memmove exists
9224 set memmove d_memmove
9227 : see if memset exists
9231 : see if mkdir exists
9235 : see if mkfifo exists
9239 : see if mktime exists
9243 : see if this is a sys/mman.h system
9244 set sys/mman.h i_sysmman
9247 : see if mmap exists
9250 : see what shmat returns
9251 : default to something harmless
9253 case "$i_sysmman$d_mmap" in
9255 $cat >mmap.c <<'END'
9256 #include <sys/mman.h>
9259 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9264 echo "and it returns ($mmaptype)." >&4
9270 : see if mprotect exists
9271 set mprotect d_mprotect
9274 : see if msgctl exists
9278 : see if msgget exists
9282 : see if msgsnd exists
9286 : see if msgrcv exists
9290 : see how much of the 'msg*(2)' library is present.
9293 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9294 *"$undef"*) h_msg=false;;
9298 case "`ipcs 2>&1`" in
9299 "SVID messages"*"not configured"*)
9300 echo "Your $osname does not have the msg*(2) configured." >&4
9315 : we could also check for sys/ipc.h ...
9316 if $h_msg && $test `./findhdr sys/msg.h`; then
9317 echo "You have the full msg*(2) library." >&4
9320 echo "You don't have the full msg*(2) library." >&4
9326 : see if msync exists
9330 : see if munmap exists
9334 : see if nice exists
9338 : see if POSIX threads are available
9339 if test "X$usethreads" = "X$define"; then
9340 set pthread.h i_pthread
9348 : how to create joinable pthreads
9349 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9351 echo "Checking what constant to use for creating joinable pthreads..." >&4
9352 $cat >try.c <<'EOCP'
9353 #include <pthread.h>
9355 int detachstate = JOINABLE;
9358 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9359 if eval $compile; then
9360 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9361 val="$undef" # Yes, undef.
9362 set d_old_pthread_create_joinable
9365 set old_pthread_create_joinable
9368 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9369 if eval $compile; then
9370 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9372 set d_old_pthread_create_joinable
9374 val=PTHREAD_CREATE_UNDETACHED
9375 set old_pthread_create_joinable
9378 set try -DJOINABLE=__UNDETACHED
9379 if eval $compile; then
9380 echo "You seem to use __UNDETACHED." >&4
9382 set d_old_pthread_create_joinable
9385 set old_pthread_create_joinable
9388 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9390 set d_old_pthread_create_joinable
9393 set old_pthread_create_joinable
9400 d_old_pthread_create_joinable="$undef"
9401 old_pthread_create_joinable=""
9404 : see if pause exists
9408 : see if pipe exists
9412 : see if poll exists
9417 : see whether the various POSIXish _yields exist
9419 #include <pthread.h>
9425 #ifdef PTHREAD_YIELD
9428 #ifdef PTHREAD_YIELD_NULL
9429 pthread_yield(NULL);
9435 : see if sched_yield exists
9436 set try -DSCHED_YIELD
9437 if eval $compile; then
9439 sched_yield='sched_yield()'
9443 case "$usethreads" in
9446 $define) echo 'sched_yield() found.' >&4 ;;
9447 *) echo 'sched_yield() NOT found.' >&4 ;;
9453 : see if pthread_yield exists
9454 set try -DPTHREAD_YIELD
9455 if eval $compile; then
9457 case "$sched_yield" in
9458 '') sched_yield='pthread_yield()' ;;
9461 set try -DPTHREAD_YIELD_NULL
9462 if eval $compile; then
9464 case "$sched_yield" in
9465 '') sched_yield='pthread_yield(NULL)' ;;
9471 case "$usethreads" in
9474 $define) echo 'pthread_yield() found.' >&4 ;;
9475 *) echo 'pthread_yield() NOT found.' >&4 ;;
9482 case "$sched_yield" in
9483 '') sched_yield=undef ;;
9488 : see if this is a pwd.h system
9494 xxx=`./findhdr pwd.h`
9495 $cppstdin $cppflags $cppminus < $xxx >$$.h
9497 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9505 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9513 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9521 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9529 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9537 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9545 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9553 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9565 set d_pwquota; eval $setvar
9566 set d_pwage; eval $setvar
9567 set d_pwchange; eval $setvar
9568 set d_pwclass; eval $setvar
9569 set d_pwexpire; eval $setvar
9570 set d_pwcomment; eval $setvar
9571 set d_pwgecos; eval $setvar
9572 set d_pwpasswd; eval $setvar
9576 : see if readdir and friends exist
9577 set readdir d_readdir
9579 set seekdir d_seekdir
9581 set telldir d_telldir
9583 set rewinddir d_rewinddir
9586 : see if readlink exists
9587 set readlink d_readlink
9590 : see if readv exists
9594 : see if rename exists
9598 : see if rmdir exists
9602 : see if memory.h is available.
9607 : See if it conflicts with string.h
9613 $cppstdin $cppflags $cppminus < $strings > mem.h
9614 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9616 echo "We won't be including <memory.h>."
9626 : can bcopy handle overlapping blocks?
9631 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9638 $cat >>try.c <<'EOCP'
9641 # include <memory.h>
9644 # include <stdlib.h>
9647 # include <string.h>
9649 # include <strings.h>
9652 # include <unistd.h> /* Needed for NetBSD */
9656 char buf[128], abc[128];
9662 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9664 for (align = 7; align >= 0; align--) {
9665 for (len = 36; len; len--) {
9668 for (off = 1; off <= len; off++) {
9669 bcopy(b, b+off, len);
9670 bcopy(b+off, b, len);
9671 if (bcmp(b, abc, len))
9680 if eval $compile_ok; then
9681 if ./try 2>/dev/null; then
9685 echo "It can't, sorry."
9686 case "$d_memmove" in
9687 "$define") echo "But that's Ok since you have memmove()." ;;
9691 echo "(I can't compile the test program, so we'll assume not...)"
9692 case "$d_memmove" in
9693 "$define") echo "But that's Ok since you have memmove()." ;;
9698 $rm -f try.* try core
9702 : can memcpy handle overlapping blocks?
9707 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9714 $cat >>try.c <<'EOCP'
9717 # include <memory.h>
9720 # include <stdlib.h>
9723 # include <string.h>
9725 # include <strings.h>
9728 # include <unistd.h> /* Needed for NetBSD */
9732 char buf[128], abc[128];
9738 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9739 try to store the string in read-only memory. */
9740 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9742 for (align = 7; align >= 0; align--) {
9743 for (len = 36; len; len--) {
9745 memcpy(b, abc, len);
9746 for (off = 1; off <= len; off++) {
9747 memcpy(b+off, b, len);
9748 memcpy(b, b+off, len);
9749 if (memcmp(b, abc, len))
9758 if eval $compile_ok; then
9759 if ./try 2>/dev/null; then
9763 echo "It can't, sorry."
9764 case "$d_memmove" in
9765 "$define") echo "But that's Ok since you have memmove()." ;;
9769 echo "(I can't compile the test program, so we'll assume not...)"
9770 case "$d_memmove" in
9771 "$define") echo "But that's Ok since you have memmove()." ;;
9776 $rm -f try.* try core
9780 : can memcmp be trusted to compare relative magnitude?
9785 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9792 $cat >>try.c <<'EOCP'
9795 # include <memory.h>
9798 # include <stdlib.h>
9801 # include <string.h>
9803 # include <strings.h>
9806 # include <unistd.h> /* Needed for NetBSD */
9812 if ((a < b) && memcmp(&a, &b, 1) < 0)
9818 if eval $compile_ok; then
9819 if ./try 2>/dev/null; then
9823 echo "No, it can't (it uses signed chars)."
9826 echo "(I can't compile the test program, so we'll assume not...)"
9830 $rm -f try.* try core
9834 : see if select exists
9838 : see if semctl exists
9842 : see if semget exists
9846 : see if semop exists
9850 : see how much of the 'sem*(2)' library is present.
9853 case "$d_semctl$d_semget$d_semop" in
9854 *"$undef"*) h_sem=false;;
9858 case "`ipcs 2>&1`" in
9859 "SVID messages"*"not configured"*)
9860 echo "Your $osname does not have the sem*(2) configured." >&4
9873 : we could also check for sys/ipc.h ...
9874 if $h_sem && $test `./findhdr sys/sem.h`; then
9875 echo "You have the full sem*(2) library." >&4
9878 echo "You don't have the full sem*(2) library." >&4
9884 : see whether sys/sem.h defines union semun
9886 $cat > try.c <<'END'
9887 #include <sys/types.h>
9888 #include <sys/ipc.h>
9889 #include <sys/sem.h>
9890 int main () { union semun semun; semun.buf = 0; }
9893 if eval $compile; then
9894 echo "You have union semun in <sys/sem.h>." >&4
9897 echo "You do not have union semun in <sys/sem.h>." >&4
9900 $rm -f try try.c try.h
9904 : see how to do semctl IPC_STAT
9907 : see whether semctl IPC_STAT can use union semun
9912 # define S_IRUSR S_IREAD
9913 # define S_IWUSR S_IWRITE
9914 # define S_IXUSR S_IEXEC
9916 # define S_IRUSR 0400
9917 # define S_IWUSR 0200
9918 # define S_IXUSR 0100
9920 # define S_IRGRP (S_IRUSR>>3)
9921 # define S_IWGRP (S_IWUSR>>3)
9922 # define S_IXGRP (S_IXUSR>>3)
9923 # define S_IROTH (S_IRUSR>>6)
9924 # define S_IWOTH (S_IWUSR>>6)
9925 # define S_IXOTH (S_IXUSR>>6)
9928 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9929 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9930 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9935 #include <sys/types.h>
9936 #include <sys/ipc.h>
9937 #include <sys/sem.h>
9938 #include <sys/stat.h>
9945 #$d_union_semun HAS_UNION_SEMUN
9948 #ifndef HAS_UNION_SEMUN
9951 struct semid_ds *buf;
9952 unsigned short *array;
9958 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9959 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9961 struct semid_ds argbuf;
9964 st = semctl(sem, 0, IPC_STAT, arg);
9968 # endif /* IPC_STAT */
9969 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9971 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9972 # endif /* IPC_RMID */
9973 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9975 #endif /* IPC_PRIVATE && ... */
9976 printf("semget failed: errno = %d\n", errno);
9982 if eval $compile; then
9985 semun) val="$define" ;;
9991 case "$d_semctl_semun" in
9993 echo "You can use union semun for semctl IPC_STAT." >&4
9996 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10001 : see whether semctl IPC_STAT can use struct semid_ds pointer
10002 $cat > try.c <<'END'
10003 #include <sys/types.h>
10004 #include <sys/ipc.h>
10005 #include <sys/sem.h>
10006 #include <sys/stat.h>
10014 struct semid_ds arg;
10017 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10018 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10021 st = semctl(sem, 0, IPC_STAT, &arg);
10023 printf("semid_ds\n");
10025 # endif /* IPC_STAT */
10026 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10028 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10029 # endif /* IPC_RMID */
10030 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10032 #endif /* IPC_PRIVATE && ... */
10033 printf("semget failed: errno = %d\n", errno);
10040 if eval $compile; then
10043 semid_ds) val="$define" ;;
10047 set d_semctl_semid_ds
10049 case "$d_semctl_semid_ds" in
10051 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10053 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10060 # We do not have the full sem*(2) library, so assume we can not
10066 set d_semctl_semid_ds
10071 : see if setegid exists
10072 set setegid d_setegid
10075 : see if seteuid exists
10076 set seteuid d_seteuid
10079 : see if setgrent exists
10080 set setgrent d_setgrent
10083 : see if sethostent exists
10084 set sethostent d_sethent
10087 : see if setlinebuf exists
10088 set setlinebuf d_setlinebuf
10091 : see if setlocale exists
10092 set setlocale d_setlocale
10095 : see if setnetent exists
10096 set setnetent d_setnent
10099 : see if setprotoent exists
10100 set setprotoent d_setpent
10103 : see if setpgid exists
10104 set setpgid d_setpgid
10107 : see if setpgrp2 exists
10108 set setpgrp2 d_setpgrp2
10111 : see if setpriority exists
10112 set setpriority d_setprior
10115 : see if setpwent exists
10116 set setpwent d_setpwent
10119 : see if setregid exists
10120 set setregid d_setregid
10122 set setresgid d_setresgid
10125 : see if setreuid exists
10126 set setreuid d_setreuid
10128 set setresuid d_setresuid
10131 : see if setrgid exists
10132 set setrgid d_setrgid
10135 : see if setruid exists
10136 set setruid d_setruid
10139 : see if setservent exists
10140 set setservent d_setsent
10143 : see if setsid exists
10144 set setsid d_setsid
10147 : see if setspent exists
10148 set setspent d_setspent
10151 : see if setvbuf exists
10152 set setvbuf d_setvbuf
10155 : see if sfio.h is available
10160 : see if sfio library is available
10171 : Ok, but do we want to use it.
10175 true|$define|[yY]*) dflt='y';;
10178 echo "$package can use the sfio library, but it is experimental."
10179 rp="You seem to have sfio available, do you want to try using it?"
10183 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10185 : Remove sfio from list of libraries to use
10186 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10189 echo "libs = $libs" >&4
10193 *) case "$usesfio" in
10194 true|$define|[yY]*)
10195 echo "Sorry, cannot find sfio on this machine" >&4
10196 echo "Ignoring your setting of usesfio=$usesfio" >&4
10204 $define) usesfio='true';;
10205 *) usesfio='false';;
10208 : see if shmctl exists
10209 set shmctl d_shmctl
10212 : see if shmget exists
10213 set shmget d_shmget
10216 : see if shmat exists
10219 : see what shmat returns
10222 $cat >shmat.c <<'END'
10223 #include <sys/shm.h>
10226 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10231 echo "and it returns ($shmattype)." >&4
10232 : see if a prototype for shmat is available
10233 xxx=`./findhdr sys/shm.h`
10234 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10235 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10246 set d_shmatprototype
10249 : see if shmdt exists
10253 : see how much of the 'shm*(2)' library is present.
10256 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10257 *"$undef"*) h_shm=false;;
10261 case "`ipcs 2>&1`" in
10262 "SVID shared memory"*"not configured"*)
10263 echo "Your $osname does not have the shm*(2) configured." >&4
10266 set shmctl d_shmctl
10268 set shmget d_shmget
10278 : we could also check for sys/ipc.h ...
10279 if $h_shm && $test `./findhdr sys/shm.h`; then
10280 echo "You have the full shm*(2) library." >&4
10283 echo "You don't have the full shm*(2) library." >&4
10290 : see if we have sigaction
10291 if set sigaction val -f d_sigaction; eval $csym; $val; then
10292 echo 'sigaction() found.' >&4
10293 $cat > try.c <<'EOP'
10295 #include <sys/types.h>
10296 #include <signal.h>
10299 struct sigaction act, oact;
10303 if eval $compile_ok; then
10306 echo "But you don't seem to have a useable struct sigaction." >&4
10310 echo 'sigaction NOT found.' >&4
10313 set d_sigaction; eval $setvar
10314 $rm -f try try$_o try.c
10316 : see if sigsetjmp exists
10318 case "$d_sigsetjmp" in
10320 $cat >try.c <<'EOP'
10321 #include <setjmp.h>
10326 if (sigsetjmp(env,1))
10329 siglongjmp(env, 1);
10334 if eval $compile; then
10335 if ./try >/dev/null 2>&1; then
10336 echo "POSIX sigsetjmp found." >&4
10340 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10346 echo "sigsetjmp not found." >&4
10350 *) val="$d_sigsetjmp"
10351 case "$d_sigsetjmp" in
10352 $define) echo "POSIX sigsetjmp found." >&4;;
10353 $undef) echo "sigsetjmp not found." >&4;;
10361 : see if stat knows about block sizes
10363 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10366 : see if _ptr and _cnt from stdio act std
10368 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10369 echo "(Looks like you have stdio.h from Linux.)"
10370 case "$stdio_ptr" in
10371 '') stdio_ptr='((fp)->_IO_read_ptr)'
10374 *) ptr_lval=$d_stdio_ptr_lval;;
10376 case "$stdio_cnt" in
10377 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10380 *) cnt_lval=$d_stdio_cnt_lval;;
10382 case "$stdio_base" in
10383 '') stdio_base='((fp)->_IO_read_base)';;
10385 case "$stdio_bufsiz" in
10386 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10389 case "$stdio_ptr" in
10390 '') stdio_ptr='((fp)->_ptr)'
10393 *) ptr_lval=$d_stdio_ptr_lval;;
10395 case "$stdio_cnt" in
10396 '') stdio_cnt='((fp)->_cnt)'
10399 *) cnt_lval=$d_stdio_cnt_lval;;
10401 case "$stdio_base" in
10402 '') stdio_base='((fp)->_base)';;
10404 case "$stdio_bufsiz" in
10405 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10408 : test whether _ptr and _cnt really work
10409 echo "Checking how std your stdio is..." >&4
10412 #define FILE_ptr(fp) $stdio_ptr
10413 #define FILE_cnt(fp) $stdio_cnt
10415 FILE *fp = fopen("try.c", "r");
10418 18 <= FILE_cnt(fp) &&
10419 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10427 if eval $compile; then
10429 echo "Your stdio acts pretty std."
10432 echo "Your stdio isn't very std."
10435 echo "Your stdio doesn't appear very std."
10441 : Can _ptr be used as an lvalue?
10442 case "$d_stdstdio$ptr_lval" in
10443 $define$define) val=$define ;;
10446 set d_stdio_ptr_lval
10449 : Can _cnt be used as an lvalue?
10450 case "$d_stdstdio$cnt_lval" in
10451 $define$define) val=$define ;;
10454 set d_stdio_cnt_lval
10457 : see if _base is also standard
10459 case "$d_stdstdio" in
10463 #define FILE_base(fp) $stdio_base
10464 #define FILE_bufsiz(fp) $stdio_bufsiz
10466 FILE *fp = fopen("try.c", "r");
10469 19 <= FILE_bufsiz(fp) &&
10470 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10477 if eval $compile; then
10479 echo "And its _base field acts std."
10482 echo "But its _base field isn't std."
10485 echo "However, it seems to be lacking the _base field."
10494 Checking how to access stdio streams by file descriptor number...
10496 case "$stdio_stream_array" in
10497 '') $cat >try.c <<EOCP
10500 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10504 for s in _iob __iob __sF
10506 set try -DSTDIO_STREAM_ARRAY=$s
10507 if eval $compile; then
10508 case "`./try$exe_ext`" in
10509 yes) stdio_stream_array=$s; break ;;
10513 $rm -f try.* try$exe_ext
10515 case "$stdio_stream_array" in
10517 I can't figure out how to access stdio streams by file descriptor number.
10519 d_stdio_stream_array="$undef"
10522 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10524 d_stdio_stream_array="$define"
10528 : see if strcoll exists
10529 set strcoll d_strcoll
10532 : check for structure copying
10534 echo "Checking to see if your C compiler can copy structs..." >&4
10535 $cat >try.c <<'EOCP'
10545 if $cc -c try.c >/dev/null 2>&1 ; then
10547 echo "Yup, it can."
10550 echo "Nope, it can't."
10556 : see if strerror and/or sys_errlist[] exist
10558 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10559 if set strerror val -f d_strerror; eval $csym; $val; then
10560 echo 'strerror() found.' >&4
10561 d_strerror="$define"
10562 d_strerrm='strerror(e)'
10563 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10564 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10565 d_syserrlst="$define"
10567 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10568 d_syserrlst="$undef"
10570 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10571 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10572 echo 'strerror() found in string header.' >&4
10573 d_strerror="$define"
10574 d_strerrm='strerror(e)'
10575 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10576 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10577 d_syserrlst="$define"
10579 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10580 d_syserrlst="$undef"
10582 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10583 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10584 d_strerror="$undef"
10585 d_syserrlst="$define"
10586 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10588 echo 'strerror() and sys_errlist[] NOT found.' >&4
10589 d_strerror="$undef"
10590 d_syserrlst="$undef"
10591 d_strerrm='"unknown"'
10595 : see if strtod exists
10596 set strtod d_strtod
10599 : see if strtol exists
10600 set strtol d_strtol
10603 : see if strtoul exists
10604 set strtoul d_strtoul
10607 : see if strtoull exists
10608 set strtoull d_strtoull
10611 : see if strxfrm exists
10612 set strxfrm d_strxfrm
10615 : see if symlink exists
10616 set symlink d_symlink
10619 : see if syscall exists
10620 set syscall d_syscall
10623 : see if sysconf exists
10624 set sysconf d_sysconf
10627 : see if system exists
10628 set system d_system
10631 : see if tcgetpgrp exists
10632 set tcgetpgrp d_tcgetpgrp
10635 : see if tcsetpgrp exists
10636 set tcsetpgrp d_tcsetpgrp
10639 : see if sys/types.h has to be included
10640 set sys/types.h i_systypes
10643 : see if prototype for telldir is available
10645 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10648 : define an is-a-typedef? function
10649 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10651 "") inclist="sys/types.h";;
10653 eval "varval=\$$var";
10657 for inc in $inclist; do
10658 echo "#include <$inc>" >>temp.c;
10660 echo "#ifdef $type" >> temp.c;
10661 echo "printf(\"We have $type\");" >> temp.c;
10662 echo "#endif" >> temp.c;
10663 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10664 if $contains $type temp.E >/dev/null 2>&1; then
10665 eval "$var=\$type";
10670 *) eval "$var=\$varval";;
10673 : define an is-a-typedef? function that prompts if the type is not available.
10674 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10676 "") inclist="sys/types.h";;
10678 eval "varval=\$$var";
10682 for inc in $inclist; do
10683 echo "#include <$inc>" >>temp.c;
10685 echo "#ifdef $type" >> temp.c;
10686 echo "printf(\"We have $type\");" >> temp.c;
10687 echo "#endif" >> temp.c;
10688 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10690 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10691 if $contains $type temp.E >/dev/null 2>&1; then
10692 echo "$type found." >&4;
10693 eval "$var=\$type";
10695 echo "$type NOT found." >&4;
10701 *) eval "$var=\$varval";;
10704 : see if this is a sys/times.h system
10705 set sys/times.h i_systimes
10708 : see if times exists
10710 if set times val -f d_times; eval $csym; $val; then
10711 echo 'times() found.' >&4
10714 case "$i_systimes" in
10715 "$define") inc='sys/times.h';;
10717 rp="What is the type returned by times() on this system?"
10718 set clock_t clocktype long stdio.h sys/types.h $inc
10721 echo 'times() NOT found, hope that will do.' >&4
10726 : see if truncate exists
10727 set truncate d_truncate
10730 : see if tzname[] exists
10732 if set tzname val -a d_tzname; eval $csym; $val; then
10734 echo 'tzname[] found.' >&4
10737 echo 'tzname[] NOT found.' >&4
10742 : see if umask exists
10746 : backward compatibility for d_hvfork
10747 if test X$d_hvfork != X; then
10748 d_vfork="$d_hvfork"
10751 : see if there is a vfork
10756 : Ok, but do we want to use it. vfork is reportedly unreliable in
10757 : perl on Solaris 2.x, and probably elsewhere.
10761 case "$usevfork" in
10767 Perl can only use a vfork() that doesn't suffer from strict
10768 restrictions on calling functions or modifying global data in
10769 the child. For example, glibc-2.1 contains such a vfork()
10770 that is unsuitable. If your system provides a proper fork()
10771 call, chances are that you do NOT want perl to use vfork().
10774 rp="Do you still want to use vfork()?"
10779 echo "Ok, we won't use vfork()."
10788 $define) usevfork='true';;
10789 *) usevfork='false';;
10792 : see if this is an sysdir system
10793 set sys/dir.h i_sysdir
10796 : see if this is an sysndir system
10797 set sys/ndir.h i_sysndir
10800 : see if closedir exists
10801 set closedir d_closedir
10804 case "$d_closedir" in
10807 echo "Checking whether closedir() returns a status..." >&4
10808 cat > closedir.c <<EOM
10809 #$i_dirent I_DIRENT /**/
10810 #$i_sysdir I_SYS_DIR /**/
10811 #$i_sysndir I_SYS_NDIR /**/
10812 #$i_systypes I_SYS_TYPES /**/
10814 #if defined(I_SYS_TYPES)
10815 #include <sys/types.h>
10817 #if defined(I_DIRENT)
10818 #include <dirent.h>
10819 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10820 #include <sys/dir.h>
10824 #include <sys/ndir.h>
10828 #include <ndir.h> /* may be wrong in the future */
10830 #include <sys/dir.h>
10835 int main() { return closedir(opendir(".")); }
10838 if eval $compile_ok; then
10839 if ./closedir > /dev/null 2>&1 ; then
10840 echo "Yes, it does."
10843 echo "No, it doesn't."
10847 echo "(I can't seem to compile the test program--assuming it doesn't)"
10855 set d_void_closedir
10858 : check for volatile keyword
10860 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10861 $cat >try.c <<'EOCP'
10864 typedef struct _goo_struct goo_struct;
10865 goo_struct * volatile goo = ((goo_struct *)0);
10866 struct _goo_struct {
10871 typedef unsigned short foo_t;
10872 char *volatile foo;
10874 volatile foo_t blech;
10878 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10880 echo "Yup, it does."
10883 echo "Nope, it doesn't."
10889 : see if there is a wait4
10893 : see if waitpid exists
10894 set waitpid d_waitpid
10897 : see if wcstombs exists
10898 set wcstombs d_wcstombs
10901 : see if wctomb exists
10902 set wctomb d_wctomb
10905 : see if writev exists
10906 set writev d_writev
10909 : preserve RCS keywords in files with variable substitution, grrr
10914 Revision='$Revision'
10916 case "$crosscompile" in
10917 ''|[nN]*) crosscompile="$undef" ;;
10921 next|rhapsody) multiarch="$define" ;;
10923 case "$multiarch" in
10924 ''|[nN]*) multiarch="$undef" ;;
10927 : check for alignment requirements
10929 case "$crosscompile$multiarch" in
10932 You seem to be either cross-compiling or doing a multiarchitecture build,
10933 skipping the memory alignment check.
10936 case "$alignbytes" in
10937 '') alignbytes=8 ;;
10941 case "$alignbytes" in
10942 '') echo "Checking alignment constraints..." >&4
10943 $cat >try.c <<'EOCP'
10950 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10954 if eval $compile_ok; then
10958 echo "(I can't seem to compile the test program...)"
10961 *) dflt="$alignbytes"
10964 rp="Doubles must be aligned on a how-many-byte boundary?"
10972 : check for ordering of bytes in a long
10974 case "$crosscompile$multiarch" in
10977 You seem to be either cross-compiling or doing a multiarchitecture build,
10978 skipping the byteorder check.
10984 case "$byteorder" in
10987 In the following, larger digits indicate more significance. A big-endian
10988 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10989 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10990 machines may have weird orders like 3412. A Cray will report 87654321. If
10991 the test program works the default is probably right.
10992 I'm now running the test program...
10994 $cat >try.c <<'EOCP'
11001 char c[sizeof(long)];
11004 if (sizeof(long) > 4)
11005 u.l = (0x08070605L << 32) | 0x04030201L;
11008 for (i = 0; i < sizeof(long); i++)
11009 printf("%c", u.c[i]+'0');
11016 if eval $compile && ./try > /dev/null; then
11019 [1-4][1-4][1-4][1-4]|12345678|87654321)
11020 echo "(The test program ran ok.)"
11021 echo "byteorder=$dflt"
11024 ????|????????) echo "(The test program ran ok.)" ;;
11025 *) echo "(The test program didn't run right for some reason.)" ;;
11030 (I can't seem to compile the test program. Guessing big-endian...)
11033 case "$xxx_prompt" in
11035 rp="What is the order of bytes in a long?"
11049 : how do we catenate cpp tokens here?
11051 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11052 $cat >cpp_stuff.c <<'EOCP'
11053 #define RCAT(a,b)a/**/b
11054 #define ACAT(a,b)a ## b
11058 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11059 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11060 echo "Oh! Smells like ANSI's been here." >&4
11061 echo "We can catify or stringify, separately or together!"
11063 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11064 echo "Ah, yes! The good old days!" >&4
11065 echo "However, in the good old days we don't know how to stringify and"
11066 echo "catify at the same time."
11070 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11071 to have to edit the values of CAT[2-5] in config.h...
11073 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11077 : see if this is a db.h system
11083 : Check db version.
11085 echo "Checking Berkeley DB version ..." >&4
11091 #include <sys/types.h>
11096 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11097 int Major, Minor, Patch ;
11098 unsigned long Version ;
11099 (void)db_version(&Major, &Minor, &Patch) ;
11100 printf("You have Berkeley DB Version 2 or greater\n");
11102 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11103 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11104 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11105 Major, Minor, Patch) ;
11107 /* check that db.h & libdb are compatible */
11108 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11109 printf("db.h and libdb are incompatible\n") ;
11113 printf("db.h and libdb are compatible\n") ;
11115 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11116 + DB_VERSION_PATCH ;
11118 /* needs to be >= 2.3.4 */
11119 if (Version < 2003004) {
11120 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11121 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11127 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11128 printf("You have Berkeley DB Version 1\n");
11129 exit(0); /* DB version < 2: the coast is clear. */
11131 exit(1); /* <db.h> not Berkeley DB? */
11137 if eval $compile && ./try; then
11138 echo 'Looks OK.' >&4
11140 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11144 : Remove db from list of libraries to use
11145 echo "Removing unusable -ldb from library list" >&4
11146 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11149 echo "libs = $libs" >&4
11159 : Check the return type needed for hash
11161 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11167 #include <sys/types.h>
11170 #ifndef DB_VERSION_MAJOR
11171 u_int32_t hash_cb (ptr, size)
11179 info.hash = hash_cb;
11183 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11184 if $contains warning try.out >>/dev/null 2>&1 ; then
11187 db_hashtype='u_int32_t'
11190 : XXX Maybe we should just give up here.
11191 db_hashtype=u_int32_t
11193 echo "Help: I can't seem to compile the db test program." >&4
11194 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11197 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11199 *) db_hashtype=u_int32_t
11204 : Check the return type needed for prefix
11206 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11212 #include <sys/types.h>
11215 #ifndef DB_VERSION_MAJOR
11216 size_t prefix_cb (key1, key2)
11224 info.prefix = prefix_cb;
11228 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11229 if $contains warning try.out >>/dev/null 2>&1 ; then
11230 db_prefixtype='int'
11232 db_prefixtype='size_t'
11235 db_prefixtype='size_t'
11236 : XXX Maybe we should just give up here.
11238 echo "Help: I can't seem to compile the db test program." >&4
11239 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11242 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11244 *) db_prefixtype='size_t'
11248 : check for void type
11250 echo "Checking to see how well your C compiler groks the void type..." >&4
11251 case "$voidflags" in
11253 $cat >try.c <<'EOCP'
11259 extern void moo(); /* function returning void */
11260 void (*goo)(); /* ptr to func returning void */
11262 void *hue; /* generic ptr */
11275 int main() { sub(); }
11277 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11278 voidflags=$defvoidused
11279 echo "Good. It appears to support void to the level $package wants.">&4
11280 if $contains warning .out >/dev/null 2>&1; then
11281 echo "However, you might get some warnings that look like this:"
11285 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11286 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11287 echo "It supports 1..."
11288 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11289 echo "It also supports 2..."
11290 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11292 echo "And it supports 4 but not 8 definitely."
11294 echo "It doesn't support 4..."
11295 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11297 echo "But it supports 8."
11300 echo "Neither does it support 8."
11304 echo "It does not support 2..."
11305 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11307 echo "But it supports 4 and 8."
11309 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11311 echo "And it supports 4 but has not heard about 8."
11313 echo "However it supports 8 but not 4."
11318 echo "There is no support at all for void."
11323 case "$voidflags" in
11325 *) $cat >&4 <<'EOM'
11326 Support flag bits are:
11327 1: basic void declarations.
11328 2: arrays of pointers to functions returning void.
11329 4: operations between pointers to and addresses of void functions.
11330 8: generic void pointers.
11333 rp="Your void support flags add up to what?"
11341 : How can we generate normalized random numbers ?
11343 echo "Looking for a random number function..." >&4
11344 case "$randfunc" in
11346 if set drand48 val -f; eval $csym; $val; then
11348 echo "Good, found drand48()." >&4
11349 elif set random val -f; eval $csym; $val; then
11351 echo "OK, found random()." >&4
11354 echo "Yick, looks like I have to use rand()." >&4
11365 *-Dmy_rand=*|*-Dmy_srand=*)
11366 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11367 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11368 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11369 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11373 while $test "$cont"; do
11374 rp="Use which function to generate random numbers?"
11376 if $test "$ans" = "$dflt"; then
11382 if set $ans val -f; eval $csym; $val; then
11386 rp="I cannot find function $ans. Use that name anyway?"
11395 case "$randfunc" in
11397 drand01="drand48()"
11403 case "$randbits" in
11405 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11407 #$i_unistd I_UNISTD
11408 #$i_stdlib I_STDLIB
11411 # include <unistd.h>
11414 # include <stdlib.h>
11419 register unsigned long tmp;
11420 register unsigned long max = 0L;
11422 for (i = 1000; i; i--) {
11423 tmp = (unsigned long) $randfunc();
11424 if (tmp > max) max = tmp;
11426 for (i = 0; max; i++)
11432 if eval $compile_ok; then
11436 echo "(I can't seem to compile the test program...)"
11443 rp="How many bits does your $randfunc() function produce?"
11447 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11448 seedfunc="s$randfunc"
11449 randseedtype=unsigned
11453 rp="How many bits does your $randfunc() function produce?"
11456 seedfunc="s$randfunc"
11457 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11458 if set $seedfunc val -f; eval $csym; $val; then
11459 echo "(Using $seedfunc() to seed random generator)"
11461 echo "(Warning: no $seedfunc() to seed random generator)"
11464 randseedtype=unsigned
11472 echo "Determining whether or not we are on an EBCDIC system..." >&4
11473 $cat >tebcdic.c <<'EOM'
11476 if ('M'==0xd4) return 0;
11483 if eval $compile_ok; then
11485 echo "You have EBCDIC." >&4
11488 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11491 echo "I'm unable to compile the test program." >&4
11492 echo "I'll assume ASCII or some ISO Latin." >&4
11494 $rm -f tebcdic.c tebcdic
11500 Checking how to flush all pending stdio output...
11502 # I only know how to find the first 32 possibly open files on SunOS.
11503 # See also hints/sunos_4_1.sh and util.c --AD
11505 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11507 $cat >>try.c <<EOCP
11509 #$i_unistd I_UNISTD
11511 # include <unistd.h>
11513 #$d_sysconf HAS_SYSCONF
11514 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11515 #ifdef HAS_STDIO_STREAM_ARRAY
11516 # define STDIO_STREAM_ARRAY $stdio_stream_array
11519 FILE* p = fopen("try.out", "w");
11523 # ifdef TRY_FPRINTF
11527 #ifdef TRY_FFLUSH_NULL
11530 #ifdef TRY_FFLUSH_ALL
11532 long open_max = -1;
11533 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11534 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11536 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11537 open_max = sysconf(_SC_OPEN_MAX);
11540 open_max = FOPEN_MAX;
11543 open_max = OPEN_MAX;
11552 # ifdef HAS_STDIO_STREAM_ARRAY
11553 if (open_max > 0) {
11555 for (i = 0; i < open_max; i++)
11556 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11557 STDIO_STREAM_ARRAY[i]._file < open_max &&
11558 STDIO_STREAM_ARRAY[i]._flag)
11559 fflush(&STDIO_STREAM_ARRAY[i]);
11567 : first we have to find out how _not_ to flush
11568 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11570 set try -DTRY_FPUTC
11571 if eval $compile; then
11573 ./try$exe_ext 2>/dev/null
11574 if $test ! -s try.out -a "X$?" = X42; then
11580 set try -DTRY_FPRINTF
11582 if eval $compile; then
11584 ./try$exe_ext 2>/dev/null
11585 if $test ! -s try.out -a "X$?" = X42; then
11586 output=-DTRY_FPRINTF
11592 : check for fflush NULL behaviour
11593 case "$fflushNULL" in
11594 '') set try -DTRY_FFLUSH_NULL $output
11595 if eval $compile; then
11597 ./try$exe_ext 2>/dev/null
11599 if $test -s try.out -a "X$code" = X42; then
11600 fflushNULL="`$cat try.out`"
11602 if $test "X$code" != X42; then
11604 (If this test failed, don't worry, we'll try another method shortly.)
11609 $rm -f core try.core core.try.*
11610 case "$fflushNULL" in
11612 Your fflush(NULL) works okay.
11614 fflushNULL="$define"
11617 Your fflush(NULL) isn't working (contrary to ANSI C).
11619 fflushNULL="$undef"
11622 Cannot figure out whether your fflush(NULL) works or not.
11623 I'm assuming it doesn't (contrary to ANSI C).
11625 fflushNULL="$undef"
11629 $define|true|[yY]*)
11630 fflushNULL="$define"
11633 fflushNULL="$undef"
11636 : check explicit looping only if NULL did not work
11637 case "$fflushNULL" in
11639 : check for fflush all behaviour
11640 case "$fflushall" in
11641 '') set try -DTRY_FFLUSH_ALL $output
11642 if eval $compile; then
11644 (Now testing the other method--but note that also this may fail.)
11647 ./try$exe_ext 2>/dev/null
11648 if $test -s try.out -a "X$?" = X42; then
11649 fflushall="`$cat try.out`"
11652 $rm -f core try.core core.try.*
11653 case "$fflushall" in
11655 Whew. Flushing explicitly all the stdio streams works.
11657 fflushall="$define"
11660 Sigh. Flushing explicitly all the stdio streams doesn't work.
11665 Cannot figure out whether flushing stdio streams explicitly works or not.
11666 I'm assuming it doesn't.
11672 "$define"|true|[yY]*)
11673 fflushall="$define"
11680 *) fflushall="$undef"
11683 case "$fflushNULL$fflushall" in
11686 I cannot figure out how to flush pending stdio output.
11690 $rm -f try.* try$exe_ext
11692 : see what type file positions are declared as in the library
11693 rp="What is the type for file position used by fsetpos()?"
11694 set fpos_t fpostype long stdio.h sys/types.h
11697 : Store the full pathname to the ar program for use in the C program
11698 : Respect a hint or command line value for full_ar.
11703 : Store the full pathname to the sed program for use in the C program
11706 : see what type gids are declared as in the kernel
11708 echo "Looking for the type for group ids returned by getgid()."
11709 set gid_t gidtype xxx stdio.h sys/types.h
11713 xxx=`./findhdr sys/user.h`
11714 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11716 unsigned) dflt="$1 $2" ;;
11720 *) dflt="$gidtype";;
11723 gid_t) echo "gid_t found." ;;
11724 *) rp="What is the type for group ids returned by getgid()?"
11730 : see if getgroups exists
11731 set getgroups d_getgrps
11734 : see if setgroups exists
11735 set setgroups d_setgrps
11739 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11741 case "$d_getgrps$d_setgrps" in
11743 case "$groupstype" in
11744 '') dflt="$gidtype" ;;
11745 *) dflt="$groupstype" ;;
11748 What type of pointer is the second argument to getgroups() and setgroups()?
11749 Usually this is the same as group ids, $gidtype, but not always.
11752 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11756 *) groupstype="$gidtype";;
11759 : see what type lseek is declared as in the kernel
11760 rp="What is the type used for lseek's offset on this system?"
11761 set off_t lseektype long stdio.h sys/types.h
11765 $echo $n "Checking to see how big your file offsets are...$c" >&4
11767 #include <sys/types.h>
11771 printf("%d\n", sizeof($lseektype));
11775 if eval $compile_ok; then
11777 $echo " $lseeksize bytes." >&4
11781 echo "(I can't seem to compile the test program. Guessing...)"
11782 rp="What is the size of your file offsets (in bytes)?"
11789 echo "Checking if your $make program sets \$(MAKE)..." >&4
11790 case "$make_set_make" in
11792 $sed 's/^X //' > testmake.mak << 'EOF'
11794 X @echo 'maketemp="$(MAKE)"'
11796 case "`$make -f testmake.mak 2>/dev/null`" in
11797 *maketemp=*) make_set_make='#' ;;
11798 *) make_set_make="MAKE=$make" ;;
11800 $rm -f testmake.mak
11803 case "$make_set_make" in
11804 '#') echo "Yup, it does.";;
11805 *) echo "Nope, it doesn't.";;
11808 : see what type is used for mode_t
11809 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11810 set mode_t modetype int stdio.h sys/types.h
11813 : define a fucntion to check prototypes
11814 $cat > protochk <<EOSH
11817 optimize="$optimize"
11819 prototype="$prototype"
11824 $cat >> protochk <<'EOSH'
11829 while test $# -ge 2; do
11831 $define) echo "#include <$2>" >> try.c ;;
11832 literal) echo "$2" >> try.c ;;
11836 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11837 cat >> try.c <<'EOCP'
11838 #ifdef CAN_PROTOTYPE
11839 #define _(args) args
11844 echo "$foo" >> try.c
11845 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11846 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11852 $eunicefix protochk
11854 : see what type is used for size_t
11855 rp="What is the type used for the length parameter for string functions?"
11856 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11859 : check for type of arguments to gethostbyaddr.
11860 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11861 case "$d_gethbyaddr" in
11865 Checking to see what type of arguments are accepted by gethostbyaddr().
11867 hdrs="$define sys/types.h
11868 $d_socket sys/socket.h
11869 $i_niin netinet/in.h
11871 $i_unistd unistd.h"
11872 : The first arg can 'char *' or 'void *'
11873 : The second arg is some of integral type
11874 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11875 for yyy in size_t long int; do
11876 case "$netdb_host_type" in
11877 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11878 if ./protochk "$try" $hdrs; then
11879 echo "Your system accepts $xxx for the first arg."
11880 echo "...and $yyy for the second arg."
11881 netdb_host_type="$xxx"
11882 netdb_hlen_type="$yyy"
11888 : In case none of those worked, prompt the user.
11889 case "$netdb_host_type" in
11890 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11893 netdb_host_type=$ans
11894 rp='What is the type for the 2nd argument to gethostbyaddr?'
11897 netdb_hlen_type=$ans
11901 *) : no gethostbyaddr, so pick harmless defaults
11902 netdb_host_type='char *'
11903 netdb_hlen_type="$sizetype"
11906 # Remove the "const" if needed. -- but then we'll have a
11908 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11911 : check for type of argument to gethostbyname.
11912 if test "X$netdb_name_type" = X ; then
11913 case "$d_gethbyname" in
11917 Checking to see what type of argument is accepted by gethostbyname().
11919 hdrs="$define sys/types.h
11920 $d_socket sys/socket.h
11921 $i_niin netinet/in.h
11923 $i_unistd unistd.h"
11924 for xxx in "const char *" "char *"; do
11925 case "$netdb_name_type" in
11926 '') try="extern struct hostent *gethostbyname($xxx);"
11927 if ./protochk "$try" $hdrs; then
11928 echo "Your system accepts $xxx."
11929 netdb_name_type="$xxx"
11934 : In case none of those worked, prompt the user.
11935 case "$netdb_name_type" in
11936 '') rp='What is the type for the 1st argument to gethostbyname?'
11939 netdb_name_type=$ans
11943 *) : no gethostbyname, so pick harmless default
11944 netdb_name_type='char *'
11949 : check for type of 1st argument to getnetbyaddr.
11950 if test "X$netdb_net_type" = X ; then
11951 case "$d_getnbyaddr" in
11955 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11957 hdrs="$define sys/types.h
11958 $d_socket sys/socket.h
11959 $i_niin netinet/in.h
11961 $i_unistd unistd.h"
11962 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11963 case "$netdb_net_type" in
11964 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11965 if ./protochk "$try" $hdrs; then
11966 echo "Your system accepts $xxx."
11967 netdb_net_type="$xxx"
11972 : In case none of those worked, prompt the user.
11973 case "$netdb_net_type" in
11974 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11977 netdb_net_type=$ans
11981 *) : no getnetbyaddr, so pick harmless default
11982 netdb_net_type='long'
11986 : locate the preferred pager for this system
12000 '') dflt=/usr/ucb/more;;
12007 rp='What pager is used on your system?'
12011 : see what type pids are declared as in the kernel
12012 rp="What is the type of process ids on this system?"
12013 set pid_t pidtype int stdio.h sys/types.h
12016 : check for length of pointer
12020 $echo $n "Checking to see how big your pointers are...$c" >&4
12021 if test "$voidflags" -gt 7; then
12022 echo '#define VOID_PTR char *' > try.c
12024 echo '#define VOID_PTR void *' > try.c
12026 $cat >>try.c <<'EOCP'
12030 printf("%d\n", sizeof(VOID_PTR));
12035 if eval $compile_ok; then
12037 $echo " $ptrsize bytes." >&4
12040 echo "(I can't seem to compile the test program. Guessing...)" >&4
12041 rp="What is the size of a pointer (in bytes)?"
12049 : see if ar generates random libraries by itself
12051 echo "Checking how to generate random libraries on your machine..." >&4
12052 echo 'int bar1() { return bar2(); }' > bar1.c
12053 echo 'int bar2() { return 2; }' > bar2.c
12054 $cat > foo.c <<'EOP'
12055 int main() { printf("%d\n", bar1()); exit(0); }
12057 $cc $ccflags -c bar1.c >/dev/null 2>&1
12058 $cc $ccflags -c bar2.c >/dev/null 2>&1
12059 $cc $ccflags -c foo.c >/dev/null 2>&1
12060 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12061 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12062 ./foobar >/dev/null 2>&1; then
12063 echo "$ar appears to generate random libraries itself."
12066 elif $ar ts bar$_a >/dev/null 2>&1 &&
12067 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12068 ./foobar >/dev/null 2>&1; then
12069 echo "a table of contents needs to be added with '$ar ts'."
12076 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12077 $test -f $ranlib || ranlib=''
12080 if $test -n "$ranlib"; then
12081 echo "your system has '$ranlib'; we'll use that."
12084 echo "your system doesn't seem to support random libraries"
12085 echo "so we'll use lorder and tsort to order the libraries."
12092 : check for type of arguments to select.
12093 case "$selecttype" in
12094 '') case "$d_select" in
12097 Checking to see what type of arguments are accepted by select().
12099 hdrs="$define sys/types.h
12100 $i_systime sys/time.h
12101 $i_sysselct sys/select.h
12102 $d_socket sys/socket.h"
12103 : The first arg can be int, unsigned, or size_t
12104 : The last arg may or may not be 'const'
12106 : void pointer has been seen but using that
12107 : breaks the selectminbits test
12108 for xxx in 'fd_set *' 'int *'; do
12109 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12110 for tmo in 'struct timeval *' 'const struct timeval *'; do
12112 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12113 if ./protochk "$try" $hdrs; then
12114 echo "Your system accepts $xxx."
12123 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12124 case "$d_fd_set" in
12125 $define) dflt="fd_set *" ;;
12134 *) : no select, so pick a harmless default
12141 : check for the select 'width'
12142 case "$selectminbits" in
12143 '') case "$d_select" in
12147 Checking to see on how many bits at a time your select() operates...
12150 #include <sys/types.h>
12152 #$i_systime I_SYS_TIME
12153 #$i_systimek I_SYS_TIME_KERNEL
12158 # ifdef I_SYS_TIME_KERNEL
12161 # include <sys/time.h>
12162 # ifdef I_SYS_TIME_KERNEL
12166 #$i_sysselct I_SYS_SELECT
12167 #ifdef I_SYS_SELECT
12168 #include <sys/select.h>
12170 #$d_socket HAS_SOCKET
12172 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12176 #define S sizeof(*(b))
12178 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12179 #define NBITS (NBYTES * 8)
12188 fp = fopen("try.c", "r");
12194 b = ($selecttype)s;
12195 for (i = 0; i < NBITS; i++)
12199 select(fd + 1, b, 0, 0, &t);
12200 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12201 printf("%d\n", i + 1);
12206 if eval $compile_ok; then
12207 selectminbits=`./try`
12208 case "$selectminbits" in
12210 Cannot figure out on how many bits at a time your select() operates.
12211 I'll play safe and guess it is 32 bits.
12217 *) bits="$selectminbits bits" ;;
12219 echo "Your select() operates on $bits at a time." >&4
12221 rp='What is the minimum number of bits your select() operates on?'
12222 case "$byteorder" in
12223 1234|12345678) dflt=32 ;;
12228 selectminbits="$val"
12232 *) : no select, so pick a harmless default
12239 : Trace out the files included by signal.h, then look for SIGxxx names.
12240 : Remove SIGARRAYSIZE used by HPUX.
12241 : Remove SIGSTKSIZE used by Linux.
12242 : Remove SIGSTKSZ used by Posix.
12243 : Remove SIGTYP void lines used by OS2.
12244 xxx=`echo '#include <signal.h>' |
12245 $cppstdin $cppminus $cppflags 2>/dev/null |
12246 $grep '^[ ]*#.*include' |
12247 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12248 : Check this list of files to be sure we have parsed the cpp output ok.
12249 : This will also avoid potentially non-existent files, such
12252 for xx in $xxx /dev/null ; do
12253 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12255 : If we have found no files, at least try signal.h
12256 case "$xxxfiles" in
12257 '') xxxfiles=`./findhdr signal.h` ;;
12260 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12261 print substr($2, 4, 20)
12263 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12264 print substr($3, 4, 20)
12266 : Append some common names just in case the awk scan failed.
12267 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12268 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12269 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12270 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12271 : generate a few handy files for later
12272 $cat > signal.c <<'EOCP'
12273 #include <sys/types.h>
12274 #include <signal.h>
12278 /* Strange style to avoid deeply-nested #if/#else/#endif */
12281 # define NSIG (_NSIG)
12287 # define NSIG (SIGMAX+1)
12293 # define NSIG (SIG_MAX+1)
12299 # define NSIG (MAXSIG+1)
12305 # define NSIG (MAX_SIG+1)
12310 # ifdef SIGARRAYSIZE
12311 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12317 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12321 /* Default to some arbitrary number that's big enough to get most
12322 of the common signals.
12328 printf("NSIG %d\n", NSIG);
12334 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12336 printf "#ifdef SIG"; printf $1; printf "\n"
12337 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12338 printf $1; printf ");\n"
12342 printf "#endif /* JUST_NSIG */\n";
12346 $cat >signal.awk <<'EOP'
12347 BEGIN { ndups = 0 }
12348 $1 ~ /^NSIG$/ { nsig = $2 }
12349 ($1 !~ /^NSIG$/) && (NF == 2) {
12350 if ($2 > maxsig) { maxsig = $2 }
12351 if (sig_name[$2]) {
12352 dup_name[ndups] = $1
12353 dup_num[ndups] = $2
12365 printf("NSIG %d\n", nsig);
12366 for (n = 1; n < nsig; n++) {
12368 printf("%s %d\n", sig_name[n], sig_num[n])
12371 printf("NUM%d %d\n", n, n)
12374 for (n = 0; n < ndups; n++) {
12375 printf("%s %d\n", dup_name[n], dup_num[n])
12379 $cat >signal_cmd <<EOS
12381 if $test -s signal.lst; then
12382 echo "Using your existing signal.lst file"
12387 $cat >>signal_cmd <<'EOS'
12390 if eval $compile_ok; then
12391 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12393 echo "(I can't seem be able to compile the whole test program)" >&4
12394 echo "(I'll try it in little pieces.)" >&4
12395 set signal -DJUST_NSIG
12396 if eval $compile_ok; then
12397 ./signal$_exe > signal.nsg
12400 echo "I can't seem to figure out how many signals you have." >&4
12401 echo "Guessing 50." >&4
12402 echo 'NSIG 50' > signal.nsg
12404 : Now look at all the signal names, one at a time.
12405 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12406 $cat > signal.c <<EOCP
12407 #include <sys/types.h>
12408 #include <signal.h>
12411 printf("$xx %d\n", SIG${xx});
12416 if eval $compile; then
12417 echo "SIG${xx} found."
12418 ./signal$_exe >> signal.ls1
12420 echo "SIG${xx} NOT found."
12423 if $test -s signal.ls1; then
12424 $cat signal.nsg signal.ls1 |
12425 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12429 if $test -s signal.lst; then
12432 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12433 echo 'kill -l' >signal
12434 set X `csh -f <signal`
12438 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12440 echo $@ | $tr ' ' $trnl | \
12441 $awk '{ printf "%s %d\n", $1, ++s; }
12442 END { printf "NSIG %d\n", ++s }' >signal.lst
12444 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12446 chmod a+x signal_cmd
12447 $eunicefix signal_cmd
12449 : generate list of signal names
12451 case "$sig_name_init" in
12453 *) case "$sig_num_init" in
12454 ''|*,*) doinit=yes ;;
12459 echo "Generating a list of signal names and numbers..." >&4
12461 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12462 sig_name=`$awk 'BEGIN { printf "ZERO " }
12463 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12464 sig_num=`$awk 'BEGIN { printf "0 " }
12465 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12466 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12467 !/^NSIG/ { printf "\"%s\", ", $1 }
12468 END { printf "0\n" }' signal.lst`
12469 sig_num_init=`$awk 'BEGIN { printf "0, " }
12470 !/^NSIG/ { printf "%d, ", $2}
12471 END { printf "0\n"}' signal.lst`
12474 echo "The following $sig_count signals are available:"
12476 echo $sig_name | $awk \
12477 'BEGIN { linelen = 0 }
12479 for (i = 1; i <= NF; i++) {
12480 name = "SIG" $i " "
12481 linelen = linelen + length(name)
12482 if (linelen > 70) {
12484 linelen = length(name)
12490 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12492 : see what type is used for signed size_t
12493 set ssize_t ssizetype int stdio.h sys/types.h
12496 $cat > ssize.c <<EOM
12498 #include <sys/types.h>
12499 #define Size_t $sizetype
12500 #define SSize_t $dflt
12503 if (sizeof(Size_t) == sizeof(SSize_t))
12505 else if (sizeof(Size_t) == sizeof(int))
12514 if eval $compile_ok && ./ssize > /dev/null; then
12515 ssizetype=`./ssize`
12516 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12519 Help! I can't compile and run the ssize_t test program: please enlighten me!
12520 (This is probably a misconfiguration in your system or libraries, and
12521 you really ought to fix it. Still, I'll try anyway.)
12523 I need a type that is the same size as $sizetype, but is guaranteed to
12524 be signed. Common values are ssize_t, int and long.
12527 rp="What signed type is the same size as $sizetype?"
12531 $rm -f ssize ssize.*
12533 : see what type of char stdio uses.
12535 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12536 echo "Your stdio uses unsigned chars." >&4
12537 stdchar="unsigned char"
12539 echo "Your stdio uses signed chars." >&4
12543 : see if time exists
12545 if test "X$d_time" = X -o X"$timetype" = X; then
12546 if set time val -f d_time; eval $csym; $val; then
12547 echo 'time() found.' >&4
12549 rp="What is the type returned by time() on this system?"
12550 set time_t timetype long stdio.h sys/types.h
12553 echo 'time() not found, hope that will do.' >&4
12561 : see what type uids are declared as in the kernel
12563 echo "Looking for the type for user ids returned by getuid()."
12564 set uid_t uidtype xxx stdio.h sys/types.h
12568 xxx=`./findhdr sys/user.h`
12569 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12571 unsigned) dflt="$1 $2" ;;
12575 *) dflt="$uidtype";;
12578 uid_t) echo "uid_t found." ;;
12579 *) rp="What is the type for user ids returned by getuid()?"
12585 : see if dbm.h is available
12586 : see if dbmclose exists
12587 set dbmclose d_dbmclose
12590 case "$d_dbmclose" in
12600 *) set rpcsvc/dbm.h i_rpcsvcdbm
12605 *) echo "We won't be including <dbm.h>"
12615 : see if this is a sys/file.h system
12620 : do we need to include sys/file.h ?
12624 if $h_sysfile; then
12626 echo "We'll be including <sys/file.h>." >&4
12629 echo "We won't be including <sys/file.h>." >&4
12639 : see if fcntl.h is there
12644 : see if we can include fcntl.h
12650 echo "We'll be including <fcntl.h>." >&4
12653 if $h_sysfile; then
12654 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12656 echo "We won't be including <fcntl.h>." >&4
12668 : see if locale.h is available
12669 set locale.h i_locale
12672 : see if mach cthreads are available
12673 if test "X$usethreads" = "X$define"; then
12674 set mach/cthreads.h i_machcthr
12677 i_machcthr="$undef"
12682 : see if this is a math.h system
12686 : see if this is a mntent.h system
12687 set mntent.h i_mntent
12690 : see if ndbm.h is available
12695 : see if dbm_open exists
12696 set dbm_open d_dbm_open
12698 case "$d_dbm_open" in
12701 echo "We won't be including <ndbm.h>"
12710 : see if net/errno.h is available
12712 set net/errno.h val
12715 : Unfortunately, it causes problems on some systems. Arrgh.
12718 cat > try.c <<'EOM'
12721 #include <net/errno.h>
12727 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12728 echo "We'll be including <net/errno.h>." >&4
12730 echo "We won't be including <net/errno.h>." >&4
12739 : see if netinet/tcp.h is available
12740 set netinet/tcp.h i_netinettcp
12743 : see if this is a poll.h system
12747 : get C preprocessor symbols handy
12749 $echo $n "Hmm... $c"
12750 echo $al | $tr ' ' $trnl >Cppsym.know
12751 $cat <<EOSS >Cppsym
12759 case "\$list\$#" in
12762 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12764 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12767 unknown="\$unknown \$sym"
12777 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12779 exit 0; _ _ _ _\1\\ \1\\
12782 echo "exit 1; _ _ _" >>Cppsym\$\$
12783 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12785 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12791 $rm -f Cppsym\$\$ Cppsym2\$\$
12796 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12798 : now check the C compiler for additional symbols
12799 postprocess_cc_v=''
12801 aix) postprocess_cc_v="|$tr , ' '" ;;
12808 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12811 -D*) echo "\$i" | $sed 's/^-D//';;
12812 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12817 postprocess_cc_v=''
12820 ./ccsym > ccsym1.raw
12821 if $test -s ccsym1.raw; then
12822 $sort ccsym1.raw | $uniq >ccsym.raw
12824 mv ccsym1.raw ccsym.raw
12827 $awk '/\=/ { print $0; next }
12828 { print $0"=1" }' ccsym.raw >ccsym.list
12829 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12830 $comm -13 ccsym.true ccsym.list >ccsym.own
12831 $comm -12 ccsym.true ccsym.list >ccsym.com
12832 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12834 if $test -z ccsym.raw; then
12835 echo "Your C compiler doesn't seem to define any symbols!" >&4
12837 echo "However, your C preprocessor defines the following symbols:"
12840 cppsymbols=`$cat Cppsym.true`
12841 cppsymbols=`echo $cppsymbols`
12842 cppccsymbols="$cppsymbols"
12844 if $test -s ccsym.com; then
12845 echo "Your C compiler and pre-processor define these symbols:"
12846 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12849 cppccsymbols=`$cat ccsym.com`
12850 cppccsymbols=`echo $cppccsymbols`
12851 $test "$silent" || sleep 1
12853 if $test -s ccsym.cpp; then
12854 $test "$also" && echo " "
12855 echo "Your C pre-processor ${also}defines the following symbols:"
12856 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12858 cppsymbols=`$cat ccsym.cpp`
12859 cppsymbols=`echo $cppsymbols`
12860 $test "$silent" || sleep 1
12862 if $test -s ccsym.own; then
12863 $test "$also" && echo " "
12864 echo "Your C compiler ${also}defines the following cpp symbols:"
12865 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12866 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12867 ccsymbols=`$cat ccsym.own`
12868 ccsymbols=`echo $ccsymbols`
12869 $test "$silent" || sleep 1
12874 : see if this is a termio system
12878 if $test `./findhdr termios.h`; then
12879 set tcsetattr i_termios
12885 "$define") echo "You have POSIX termios.h... good!" >&4;;
12886 *) if ./Cppsym pyr; then
12887 case "`/bin/universe`" in
12888 ucb) if $test `./findhdr sgtty.h`; then
12890 echo "<sgtty.h> found." >&4
12892 echo "System is pyramid with BSD universe."
12893 echo "<sgtty.h> not found--you could have problems." >&4
12895 *) if $test `./findhdr termio.h`; then
12897 echo "<termio.h> found." >&4
12899 echo "System is pyramid with USG universe."
12900 echo "<termio.h> not found--you could have problems." >&4
12904 if $test `./findhdr termio.h`; then
12905 echo "<termio.h> found." >&4
12907 elif $test `./findhdr sgtty.h`; then
12908 echo "<sgtty.h> found." >&4
12911 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12914 if $test `./findhdr sgtty.h`; then
12915 echo "<sgtty.h> found." >&4
12917 elif $test `./findhdr termio.h`; then
12918 echo "<termio.h> found." >&4
12921 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12925 set i_termio; eval $setvar
12926 val=$val2; set i_sgtty; eval $setvar
12927 val=$val3; set i_termios; eval $setvar
12929 : see if this is a shadow.h system
12930 set shadow.h i_shadow
12933 : see if this is a socks.h system
12934 set socks.h i_socks
12937 : see if stdarg is available
12939 if $test `./findhdr stdarg.h`; then
12940 echo "<stdarg.h> found." >&4
12943 echo "<stdarg.h> NOT found." >&4
12947 : see if varags is available
12949 if $test `./findhdr varargs.h`; then
12950 echo "<varargs.h> found." >&4
12952 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12955 : set up the varargs testing programs
12956 $cat > varargs.c <<EOP
12958 #include <stdarg.h>
12961 #include <varargs.h>
12965 int f(char *p, ...)
12979 p = va_arg(ap, char *);
12984 $cat > varargs <<EOP
12986 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12995 : now check which varargs header should be included
13000 if `./varargs I_STDARG`; then
13002 elif `./varargs I_VARARGS`; then
13007 if `./varargs I_VARARGS`; then
13014 echo "I could not find the definition for va_dcl... You have problems..." >&4
13015 val="$undef"; set i_stdarg; eval $setvar
13016 val="$undef"; set i_varargs; eval $setvar
13021 case "$i_varhdr" in
13023 val="$define"; set i_stdarg; eval $setvar
13024 val="$undef"; set i_varargs; eval $setvar
13027 val="$undef"; set i_stdarg; eval $setvar
13028 val="$define"; set i_varargs; eval $setvar
13031 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13035 : see if stddef is available
13036 set stddef.h i_stddef
13039 : see if sys/access.h is available
13040 set sys/access.h i_sysaccess
13043 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13044 set sys/filio.h i_sysfilio
13047 if $test `./findhdr sys/ioctl.h`; then
13049 echo '<sys/ioctl.h> found.' >&4
13052 if $test $i_sysfilio = "$define"; then
13053 echo '<sys/ioctl.h> NOT found.' >&4
13055 $test $i_sgtty = "$define" && xxx="sgtty.h"
13056 $test $i_termio = "$define" && xxx="termio.h"
13057 $test $i_termios = "$define" && xxx="termios.h"
13058 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13064 : see if sys/resource.h has to be included
13065 set sys/resource.h i_sysresrc
13068 : see if sys/security.h is available
13069 set sys/security.h i_syssecrt
13072 : see if this is a sys/statvfs.h system
13073 set sys/statvfs.h i_sysstatvfs
13076 : see if this is a sys/un.h system
13077 set sys/un.h i_sysun
13080 : see if this is a syswait system
13081 set sys/wait.h i_syswait
13084 : see if this is an utime system
13085 set utime.h i_utime
13088 : see if this is a values.h system
13089 set values.h i_values
13092 : see if this is a vfork system
13095 set vfork.h i_vfork
13103 : see if gdbm.h is available
13108 : see if gdbm_open exists
13109 set gdbm_open d_gdbm_open
13111 case "$d_gdbm_open" in
13114 echo "We won't be including <gdbm.h>"
13124 echo "Looking for extensions..." >&4
13125 : If we are using the old config.sh, known_extensions may contain
13126 : old or inaccurate or duplicate values.
13127 known_extensions=''
13128 nonxs_extensions=''
13129 : We do not use find because it might not be available.
13130 : We do not just use MANIFEST because the user may have dropped
13131 : some additional extensions into the source tree and expect them
13134 : Function to recursively find available extensions, ignoring DynaLoader
13135 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13139 DynaLoader|dynaload) ;;
13141 if $test -f $xxx/$xxx.xs; then
13142 known_extensions="$known_extensions $1$xxx";
13143 elif $test -f $xxx/Makefile.PL; then
13144 nonxs_extensions="$nonxs_extensions $1$xxx";
13146 if $test -d $xxx -a $# -lt 10; then
13149 eval $find_extensions;
13161 eval $find_extensions
13162 set X $nonxs_extensions
13164 nonxs_extensions="$*"
13165 set X $known_extensions
13167 known_extensions="$*"
13170 : Now see which are supported on this system.
13172 for xxx in $known_extensions ; do
13176 $define) avail_ext="$avail_ext $xxx" ;;
13179 GDBM_File|gdbm_fil)
13181 $define) avail_ext="$avail_ext $xxx" ;;
13184 NDBM_File|ndbm_fil)
13186 $define) avail_ext="$avail_ext $xxx" ;;
13189 ODBM_File|odbm_fil)
13190 case "${i_dbm}${i_rpcsvcdbm}" in
13191 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13195 case "$useposix" in
13196 true|define|y) avail_ext="$avail_ext $xxx" ;;
13200 case "$useopcode" in
13201 true|define|y) avail_ext="$avail_ext $xxx" ;;
13205 case "$d_socket" in
13206 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13210 case "$usethreads" in
13211 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13215 : XXX Do we need a useipcsysv variable here
13216 case "${d_msg}${d_sem}${d_shm}" in
13217 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13220 *) avail_ext="$avail_ext $xxx"
13229 : Now see which nonxs extensions are supported on this system.
13230 : For now assume all are.
13232 for xxx in $nonxs_extensions ; do
13234 *) nonxs_ext="$nonxs_ext $xxx"
13246 A number of extensions are supplied with $package. You may choose to
13247 compile these extensions for dynamic loading (the default), compile
13248 them into the $package executable (static loading), or not include
13249 them at all. Answer "none" to include no extensions.
13250 Note that DynaLoader is always built and need not be mentioned here.
13253 case "$dynamic_ext" in
13254 '') dflt="$avail_ext" ;;
13255 *) dflt="$dynamic_ext"
13256 # Perhaps we are reusing an old out-of-date config.sh.
13259 if test X"$dynamic_ext" != X"$avail_ext"; then
13261 NOTICE: Your previous config.sh list may be incorrect.
13262 The extensions now available to you are
13264 but the default list from your previous config.sh is
13276 rp="What extensions do you wish to load dynamically?"
13279 none) dynamic_ext=' ' ;;
13280 *) dynamic_ext="$ans" ;;
13283 case "$static_ext" in
13285 : Exclude those already listed in dynamic linking
13287 for xxx in $avail_ext; do
13288 case " $dynamic_ext " in
13290 *) dflt="$dflt $xxx" ;;
13297 *) dflt="$static_ext"
13304 rp="What extensions do you wish to load statically?"
13307 none) static_ext=' ' ;;
13308 *) static_ext="$ans" ;;
13313 A number of extensions are supplied with $package. Answer "none"
13314 to include no extensions.
13315 Note that DynaLoader is always built and need not be mentioned here.
13318 case "$static_ext" in
13319 '') dflt="$avail_ext" ;;
13320 *) dflt="$static_ext"
13321 # Perhaps we are reusing an old out-of-date config.sh.
13324 if test X"$static_ext" != X"$avail_ext"; then
13326 NOTICE: Your previous config.sh list may be incorrect.
13327 The extensions now available to you are
13329 but the default list from your previous config.sh is
13338 : Exclude those that are not xs extensions
13342 rp="What extensions do you wish to include?"
13345 none) static_ext=' ' ;;
13346 *) static_ext="$ans" ;;
13351 set X $dynamic_ext $static_ext $nonxs_ext
13355 : Remove build directory name from cppstdin so it can be used from
13356 : either the present location or the final installed location.
13358 : Get out of the UU directory to get correct path name.
13360 case "$cppstdin" in
13362 echo "Stripping down cppstdin path name"
13368 : end of configuration questions
13370 echo "End of configuration questions."
13373 : back to where it started
13374 if test -d ../UU; then
13378 : configuration may be patched via a 'config.over' file
13379 if $test -f config.over; then
13382 rp='I see a config.over file. Do you wish to load it?'
13385 n*) echo "OK, I'll ignore it.";;
13387 echo "Configuration override changes have been loaded."
13392 : in case they want portability, strip down executable paths
13393 case "$d_portable" in
13396 echo "Stripping down executable paths..." >&4
13397 for file in $loclist $trylist; do
13399 eval $file=`basename $temp`
13404 : create config.sh file
13406 echo "Creating config.sh..." >&4
13407 $spitshell <<EOT >config.sh
13410 # This file was produced by running the Configure script. It holds all the
13411 # definitions figured out by Configure. Should you modify one of these values,
13412 # do not forget to propagate your changes by running "Configure -der". You may
13413 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13416 # Package name : $package
13417 # Source directory : $src
13418 # Configuration time: $cf_time
13419 # Configured by : $cf_by
13420 # Target system : $myuname
13430 Revision='$Revision'
13437 alignbytes='$alignbytes'
13438 ansi2knr='$ansi2knr'
13439 aphostname='$aphostname'
13440 apiversion='$apiversion'
13443 archlibexp='$archlibexp'
13444 archname64='$archname64'
13445 archname='$archname'
13446 archobjs='$archobjs'
13451 bincompat5005='$bincompat5005'
13455 byteorder='$byteorder'
13457 castflags='$castflags'
13460 cccdlflags='$cccdlflags'
13461 ccdlflags='$ccdlflags'
13463 ccsymbols='$ccsymbols'
13465 cf_email='$cf_email'
13470 clocktype='$clocktype'
13472 compress='$compress'
13473 contains='$contains'
13477 cpp_stuff='$cpp_stuff'
13478 cppccsymbols='$cppccsymbols'
13479 cppflags='$cppflags'
13481 cppminus='$cppminus'
13483 cppstdin='$cppstdin'
13484 cppsymbols='$cppsymbols'
13485 crosscompile='$crosscompile'
13486 cryptlib='$cryptlib'
13488 d_Gconvert='$d_Gconvert'
13489 d_PRIEldbl='$d_PRIEldbl'
13490 d_PRIFldbl='$d_PRIFldbl'
13491 d_PRIGldbl='$d_PRIGldbl'
13492 d_PRIX64='$d_PRIX64'
13493 d_PRId64='$d_PRId64'
13494 d_PRIeldbl='$d_PRIeldbl'
13495 d_PRIfldbl='$d_PRIfldbl'
13496 d_PRIgldbl='$d_PRIgldbl'
13497 d_PRIi64='$d_PRIi64'
13498 d_PRIo64='$d_PRIo64'
13499 d_PRIu64='$d_PRIu64'
13500 d_PRIx64='$d_PRIx64'
13501 d_access='$d_access'
13502 d_accessx='$d_accessx'
13504 d_archlib='$d_archlib'
13507 d_attribut='$d_attribut'
13510 d_bincompat5005='$d_bincompat5005'
13512 d_bsdgetpgrp='$d_bsdgetpgrp'
13513 d_bsdsetpgrp='$d_bsdsetpgrp'
13515 d_casti32='$d_casti32'
13516 d_castneg='$d_castneg'
13517 d_charvspr='$d_charvspr'
13519 d_chroot='$d_chroot'
13520 d_chsize='$d_chsize'
13521 d_closedir='$d_closedir'
13522 d_cmsghdr_s='$d_cmsghdr_s'
13526 d_cuserid='$d_cuserid'
13527 d_dbl_dig='$d_dbl_dig'
13528 d_dbmclose64='$d_dbmclose64'
13529 d_dbminit64='$d_dbminit64'
13530 d_delete64='$d_delete64'
13531 d_difftime='$d_difftime'
13532 d_dirent64_s='$d_dirent64_s'
13533 d_dirnamlen='$d_dirnamlen'
13534 d_dlerror='$d_dlerror'
13535 d_dlopen='$d_dlopen'
13536 d_dlsymun='$d_dlsymun'
13537 d_dosuid='$d_dosuid'
13538 d_drand48proto='$d_drand48proto'
13540 d_eaccess='$d_eaccess'
13541 d_endgrent='$d_endgrent'
13542 d_endhent='$d_endhent'
13543 d_endnent='$d_endnent'
13544 d_endpent='$d_endpent'
13545 d_endpwent='$d_endpwent'
13546 d_endsent='$d_endsent'
13547 d_endspent='$d_endspent'
13548 d_eofnblk='$d_eofnblk'
13549 d_eunice='$d_eunice'
13550 d_fchmod='$d_fchmod'
13551 d_fchown='$d_fchown'
13553 d_fd_macros='$d_fd_macros'
13554 d_fd_set='$d_fd_set'
13555 d_fds_bits='$d_fds_bits'
13556 d_fetch64='$d_fetch64'
13557 d_fgetpos64='$d_fgetpos64'
13558 d_fgetpos='$d_fgetpos'
13559 d_firstkey64='$d_firstkey64'
13560 d_flexfnam='$d_flexfnam'
13561 d_flock64_s='$d_flock64_s'
13563 d_fopen64='$d_fopen64'
13565 d_fpathconf='$d_fpathconf'
13566 d_freopen64='$d_freopen64'
13567 d_fseek64='$d_fseek64'
13568 d_fseeko64='$d_fseeko64'
13569 d_fseeko='$d_fseeko'
13570 d_fsetpos64='$d_fsetpos64'
13571 d_fsetpos='$d_fsetpos'
13572 d_fstat64='$d_fstat64'
13573 d_fstatfs='$d_fstatfs'
13574 d_fstatvfs='$d_fstatvfs'
13575 d_ftell64='$d_ftell64'
13576 d_ftello64='$d_ftello64'
13577 d_ftello='$d_ftello'
13579 d_ftruncate64='$d_ftruncate64'
13580 d_getgrent='$d_getgrent'
13581 d_getgrps='$d_getgrps'
13582 d_gethbyaddr='$d_gethbyaddr'
13583 d_gethbyname='$d_gethbyname'
13584 d_gethent='$d_gethent'
13585 d_gethname='$d_gethname'
13586 d_gethostprotos='$d_gethostprotos'
13587 d_getlogin='$d_getlogin'
13588 d_getmntent='$d_getmntent'
13589 d_getnbyaddr='$d_getnbyaddr'
13590 d_getnbyname='$d_getnbyname'
13591 d_getnent='$d_getnent'
13592 d_getnetprotos='$d_getnetprotos'
13593 d_getpbyname='$d_getpbyname'
13594 d_getpbynumber='$d_getpbynumber'
13595 d_getpent='$d_getpent'
13596 d_getpgid='$d_getpgid'
13597 d_getpgrp2='$d_getpgrp2'
13598 d_getpgrp='$d_getpgrp'
13599 d_getppid='$d_getppid'
13600 d_getprior='$d_getprior'
13601 d_getprotoprotos='$d_getprotoprotos'
13602 d_getpwent='$d_getpwent'
13603 d_getsbyname='$d_getsbyname'
13604 d_getsbyport='$d_getsbyport'
13605 d_getsent='$d_getsent'
13606 d_getservprotos='$d_getservprotos'
13607 d_getspent='$d_getspent'
13608 d_getspnam='$d_getspnam'
13609 d_gettimeod='$d_gettimeod'
13610 d_gnulibc='$d_gnulibc'
13611 d_grpasswd='$d_grpasswd'
13612 d_hasmntopt='$d_hasmntopt'
13615 d_inetaton='$d_inetaton'
13616 d_ino64_t='$d_ino64_t'
13617 d_int64t='$d_int64t'
13618 d_iovec_s='$d_iovec_s'
13619 d_isascii='$d_isascii'
13620 d_killpg='$d_killpg'
13621 d_lchown='$d_lchown'
13623 d_llseek='$d_llseek'
13624 d_locconv='$d_locconv'
13625 d_lockf64='$d_lockf64'
13627 d_longdbl='$d_longdbl'
13628 d_longlong='$d_longlong'
13629 d_lseek64='$d_lseek64'
13630 d_lstat64='$d_lstat64'
13632 d_madvise='$d_madvise'
13634 d_mbstowcs='$d_mbstowcs'
13635 d_mbtowc='$d_mbtowc'
13636 d_memchr='$d_memchr'
13637 d_memcmp='$d_memcmp'
13638 d_memcpy='$d_memcpy'
13639 d_memmove='$d_memmove'
13640 d_memset='$d_memset'
13642 d_mkfifo='$d_mkfifo'
13643 d_mktime='$d_mktime'
13645 d_mprotect='$d_mprotect'
13647 d_msg_ctrunc='$d_msg_ctrunc'
13648 d_msg_dontroute='$d_msg_dontroute'
13649 d_msg_oob='$d_msg_oob'
13650 d_msg_peek='$d_msg_peek'
13651 d_msg_proxy='$d_msg_proxy'
13652 d_msgctl='$d_msgctl'
13653 d_msgget='$d_msgget'
13654 d_msghdr_s='$d_msghdr_s'
13655 d_msgrcv='$d_msgrcv'
13656 d_msgsnd='$d_msgsnd'
13658 d_munmap='$d_munmap'
13659 d_mymalloc='$d_mymalloc'
13660 d_nextkey64='$d_nextkey64'
13662 d_off64_t='$d_off64_t'
13663 d_offset_t='$d_offset_t'
13664 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13665 d_oldpthreads='$d_oldpthreads'
13666 d_oldsock='$d_oldsock'
13668 d_open64='$d_open64'
13669 d_opendir64='$d_opendir64'
13670 d_pathconf='$d_pathconf'
13672 d_phostname='$d_phostname'
13675 d_portable='$d_portable'
13676 d_pthread_yield='$d_pthread_yield'
13678 d_pwchange='$d_pwchange'
13679 d_pwclass='$d_pwclass'
13680 d_pwcomment='$d_pwcomment'
13681 d_pwexpire='$d_pwexpire'
13682 d_pwgecos='$d_pwgecos'
13683 d_pwpasswd='$d_pwpasswd'
13684 d_pwquota='$d_pwquota'
13685 d_readdir64='$d_readdir64'
13686 d_readdir='$d_readdir'
13687 d_readlink='$d_readlink'
13689 d_recvmsg='$d_recvmsg'
13690 d_rename='$d_rename'
13691 d_rewinddir='$d_rewinddir'
13693 d_safebcpy='$d_safebcpy'
13694 d_safemcpy='$d_safemcpy'
13695 d_sanemcmp='$d_sanemcmp'
13696 d_sched_yield='$d_sched_yield'
13697 d_scm_rights='$d_scm_rights'
13698 d_seekdir64='$d_seekdir64'
13699 d_seekdir='$d_seekdir'
13700 d_select='$d_select'
13702 d_semctl='$d_semctl'
13703 d_semctl_semid_ds='$d_semctl_semid_ds'
13704 d_semctl_semun='$d_semctl_semun'
13705 d_semget='$d_semget'
13707 d_sendmsg='$d_sendmsg'
13708 d_setegid='$d_setegid'
13709 d_seteuid='$d_seteuid'
13710 d_setgrent='$d_setgrent'
13711 d_setgrps='$d_setgrps'
13712 d_sethent='$d_sethent'
13713 d_setlinebuf='$d_setlinebuf'
13714 d_setlocale='$d_setlocale'
13715 d_setnent='$d_setnent'
13716 d_setpent='$d_setpent'
13717 d_setpgid='$d_setpgid'
13718 d_setpgrp2='$d_setpgrp2'
13719 d_setpgrp='$d_setpgrp'
13720 d_setprior='$d_setprior'
13721 d_setpwent='$d_setpwent'
13722 d_setregid='$d_setregid'
13723 d_setresgid='$d_setresgid'
13724 d_setresuid='$d_setresuid'
13725 d_setreuid='$d_setreuid'
13726 d_setrgid='$d_setrgid'
13727 d_setruid='$d_setruid'
13728 d_setsent='$d_setsent'
13729 d_setsid='$d_setsid'
13730 d_setspent='$d_setspent'
13731 d_setvbuf='$d_setvbuf'
13735 d_shmatprototype='$d_shmatprototype'
13736 d_shmctl='$d_shmctl'
13738 d_shmget='$d_shmget'
13739 d_sigaction='$d_sigaction'
13740 d_sigsetjmp='$d_sigsetjmp'
13741 d_socket='$d_socket'
13742 d_sockpair='$d_sockpair'
13743 d_stat64='$d_stat64'
13744 d_statblks='$d_statblks'
13745 d_statfs='$d_statfs'
13746 d_statfsflags='$d_statfsflags'
13747 d_statvfs='$d_statvfs'
13748 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13749 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13750 d_stdio_stream_array='$d_stdio_stream_array'
13751 d_stdiobase='$d_stdiobase'
13752 d_stdstdio='$d_stdstdio'
13753 d_store64='$d_store64'
13754 d_strchr='$d_strchr'
13755 d_strcoll='$d_strcoll'
13756 d_strctcpy='$d_strctcpy'
13757 d_strerrm='$d_strerrm'
13758 d_strerror='$d_strerror'
13759 d_strtod='$d_strtod'
13760 d_strtol='$d_strtol'
13761 d_strtoul='$d_strtoul'
13762 d_strtoull='$d_strtoull'
13763 d_strxfrm='$d_strxfrm'
13764 d_suidsafe='$d_suidsafe'
13765 d_symlink='$d_symlink'
13766 d_syscall='$d_syscall'
13767 d_sysconf='$d_sysconf'
13768 d_sysernlst='$d_sysernlst'
13769 d_syserrlst='$d_syserrlst'
13770 d_system='$d_system'
13771 d_tcgetpgrp='$d_tcgetpgrp'
13772 d_tcsetpgrp='$d_tcsetpgrp'
13773 d_telldir64='$d_telldir64'
13774 d_telldir='$d_telldir'
13775 d_telldirproto='$d_telldirproto'
13778 d_tmpfile64='$d_tmpfile64'
13779 d_truncate64='$d_truncate64'
13780 d_truncate='$d_truncate'
13781 d_tzname='$d_tzname'
13784 d_union_semun='$d_union_semun'
13785 d_vendorlib='$d_vendorlib'
13787 d_void_closedir='$d_void_closedir'
13788 d_voidsig='$d_voidsig'
13789 d_voidtty='$d_voidtty'
13790 d_volatile='$d_volatile'
13791 d_vprintf='$d_vprintf'
13793 d_waitpid='$d_waitpid'
13794 d_wcstombs='$d_wcstombs'
13795 d_wctomb='$d_wctomb'
13796 d_writev='$d_writev'
13799 db_hashtype='$db_hashtype'
13800 db_prefixtype='$db_prefixtype'
13801 defvoidused='$defvoidused'
13802 direntrytype='$direntrytype'
13805 doublesize='$doublesize'
13807 dynamic_ext='$dynamic_ext'
13813 eunicefix='$eunicefix'
13816 extensions='$extensions'
13817 fflushNULL='$fflushNULL'
13818 fflushall='$fflushall'
13820 firstmakefile='$firstmakefile'
13822 fpostype='$fpostype'
13823 freetype='$freetype'
13825 full_csh='$full_csh'
13826 full_sed='$full_sed'
13827 gccversion='$gccversion'
13831 groupcat='$groupcat'
13832 groupstype='$groupstype'
13835 h_sysfile='$h_sysfile'
13839 i_arpainet='$i_arpainet'
13840 i_bsdioctl='$i_bsdioctl'
13843 i_dirent='$i_dirent'
13850 i_inttypes='$i_inttypes'
13851 i_limits='$i_limits'
13852 i_locale='$i_locale'
13853 i_machcthr='$i_machcthr'
13854 i_malloc='$i_malloc'
13856 i_memory='$i_memory'
13857 i_mntent='$i_mntent'
13860 i_neterrno='$i_neterrno'
13861 i_netinettcp='$i_netinettcp'
13864 i_pthread='$i_pthread'
13866 i_rpcsvcdbm='$i_rpcsvcdbm'
13869 i_shadow='$i_shadow'
13871 i_stdarg='$i_stdarg'
13872 i_stddef='$i_stddef'
13873 i_stdlib='$i_stdlib'
13874 i_string='$i_string'
13875 i_sysaccess='$i_sysaccess'
13876 i_sysdir='$i_sysdir'
13877 i_sysfile='$i_sysfile'
13878 i_sysfilio='$i_sysfilio'
13880 i_sysioctl='$i_sysioctl'
13881 i_sysmman='$i_sysmman'
13882 i_sysmount='$i_sysmount'
13883 i_sysndir='$i_sysndir'
13884 i_sysparam='$i_sysparam'
13885 i_sysresrc='$i_sysresrc'
13886 i_syssecrt='$i_syssecrt'
13887 i_sysselct='$i_sysselct'
13888 i_syssockio='$i_syssockio'
13889 i_sysstat='$i_sysstat'
13890 i_sysstatvfs='$i_sysstatvfs'
13891 i_systime='$i_systime'
13892 i_systimek='$i_systimek'
13893 i_systimes='$i_systimes'
13894 i_systypes='$i_systypes'
13895 i_sysuio='$i_sysuio'
13897 i_syswait='$i_syswait'
13898 i_termio='$i_termio'
13899 i_termios='$i_termios'
13901 i_unistd='$i_unistd'
13903 i_values='$i_values'
13904 i_varargs='$i_varargs'
13905 i_varhdr='$i_varhdr'
13907 ignore_versioned_solibs='$ignore_versioned_solibs'
13910 installarchlib='$installarchlib'
13911 installbin='$installbin'
13912 installman1dir='$installman1dir'
13913 installman3dir='$installman3dir'
13914 installprefix='$installprefix'
13915 installprefixexp='$installprefixexp'
13916 installprivlib='$installprivlib'
13917 installscript='$installscript'
13918 installsitearch='$installsitearch'
13919 installsitelib='$installsitelib'
13920 installstyle='$installstyle'
13921 installusrbinperl='$installusrbinperl'
13922 installvendorlib='$installvendorlib'
13924 known_extensions='$known_extensions'
13928 lddlflags='$lddlflags'
13930 ldlibpthname='$ldlibpthname'
13937 libswanted='$libswanted'
13943 locincpth='$locincpth'
13944 loclibpth='$loclibpth'
13945 longdblsize='$longdblsize'
13946 longlongsize='$longlongsize'
13947 longsize='$longsize'
13951 lseeksize='$lseeksize'
13952 lseektype='$lseektype'
13956 make_set_make='$make_set_make'
13957 mallocobj='$mallocobj'
13958 mallocsrc='$mallocsrc'
13959 malloctype='$malloctype'
13961 man1direxp='$man1direxp'
13964 man3direxp='$man3direxp'
13968 mips_type='$mips_type'
13970 mmaptype='$mmaptype'
13972 modetype='$modetype'
13974 multiarch='$multiarch'
13976 myarchname='$myarchname'
13977 mydomain='$mydomain'
13978 myhostname='$myhostname'
13981 netdb_hlen_type='$netdb_hlen_type'
13982 netdb_host_type='$netdb_host_type'
13983 netdb_name_type='$netdb_name_type'
13984 netdb_net_type='$netdb_net_type'
13987 nm_so_opt='$nm_so_opt'
13988 nonxs_ext='$nonxs_ext'
13990 o_nonblock='$o_nonblock'
13992 old_pthread_create_joinable='$old_pthread_create_joinable'
13993 optimize='$optimize'
13994 orderlib='$orderlib'
14000 patchlevel='$patchlevel'
14001 path_sep='$path_sep'
14003 perladmin='$perladmin'
14004 perlpath='$perlpath'
14006 phostname='$phostname'
14012 prefixexp='$prefixexp'
14014 privlibexp='$privlibexp'
14015 prototype='$prototype'
14017 randbits='$randbits'
14018 randfunc='$randfunc'
14019 randseedtype='$randseedtype'
14021 rd_nodata='$rd_nodata'
14025 sPRIEldbl='$sPRIEldbl'
14026 sPRIFldbl='$sPRIFldbl'
14027 sPRIGldbl='$sPRIGldbl'
14030 sPRIeldbl='$sPRIeldbl'
14031 sPRIfldbl='$sPRIfldbl'
14032 sPRIgldbl='$sPRIgldbl'
14037 sched_yield='$sched_yield'
14038 scriptdir='$scriptdir'
14039 scriptdirexp='$scriptdirexp'
14041 seedfunc='$seedfunc'
14042 selectminbits='$selectminbits'
14043 selecttype='$selecttype'
14044 sendmail='$sendmail'
14047 sharpbang='$sharpbang'
14048 shmattype='$shmattype'
14049 shortsize='$shortsize'
14052 sig_count='$sig_count'
14053 sig_name='$sig_name'
14054 sig_name_init='$sig_name_init'
14056 sig_num_init='$sig_num_init'
14057 signal_t='$signal_t'
14058 sitearch='$sitearch'
14059 sitearchexp='$sitearchexp'
14061 sitelibexp='$sitelibexp'
14062 siteprefix='$siteprefix'
14063 siteprefixexp='$siteprefixexp'
14064 sizetype='$sizetype'
14069 sockethdr='$sockethdr'
14070 socketlib='$socketlib'
14072 spackage='$spackage'
14073 spitshell='$spitshell'
14076 ssizetype='$ssizetype'
14077 startperl='$startperl'
14079 static_ext='$static_ext'
14081 stdio_base='$stdio_base'
14082 stdio_bufsiz='$stdio_bufsiz'
14083 stdio_cnt='$stdio_cnt'
14084 stdio_filbuf='$stdio_filbuf'
14085 stdio_ptr='$stdio_ptr'
14086 stdio_stream_array='$stdio_stream_array'
14089 subversion='$subversion'
14096 timeincl='$timeincl'
14097 timetype='$timetype'
14105 use64bits='$use64bits'
14107 uselongdouble='$uselongdouble'
14108 usemultiplicity='$usemultiplicity'
14109 usemymalloc='$usemymalloc'
14111 useopcode='$useopcode'
14112 useperlio='$useperlio'
14113 useposix='$useposix'
14115 useshrplib='$useshrplib'
14116 usesocks='$usesocks'
14117 usethreads='$usethreads'
14118 usevendorprefix='$usevendorprefix'
14119 usevfork='$usevfork'
14122 vendorlib='$vendorlib'
14123 vendorlibexp='$vendorlibexp'
14124 vendorprefix='$vendorprefix'
14125 vendorprefixexp='$vendorprefixexp'
14128 voidflags='$voidflags'
14134 : Add in command line options if available
14135 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14137 : add special variables
14138 $test -f $src/patchlevel.h && \
14139 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14140 echo "CONFIGDOTSH=true" >>config.sh
14142 : propagate old symbols
14143 if $test -f UU/config.sh; then
14144 <UU/config.sh sort | uniq >UU/oldconfig.sh
14145 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14146 sort | uniq -u >UU/oldsyms
14147 set X `cat UU/oldsyms`
14153 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14155 echo "# Variables propagated from previous config.sh file." >>config.sh
14156 for sym in `cat UU/oldsyms`; do
14157 echo " Propagating $hint variable "'$'"$sym..."
14158 eval 'tmp="$'"${sym}"'"'
14160 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14166 : Finish up by extracting the .SH files
14180 If you'd like to make any changes to the config.sh file before I begin
14181 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14184 rp="Press return or use a shell escape to edit config.sh:"
14189 *) : in case they cannot read
14190 sh 1>&4 -c "$ans";;
14195 : if this fails, just run all the .SH files by hand
14202 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14209 Now you need to generate make dependencies by running "$make depend".
14210 You might prefer to run it in background: "$make depend > makedepend.out &"
14211 It can take a while, so you might not want to run it right now.
14216 rp="Run $make depend now?"
14220 $make depend && echo "Now you must run a $make."
14223 echo "You must run '$make depend' then '$make'."
14226 elif test -f [Mm]akefile; then
14228 echo "Now you must run a $make."
14233 if $test -f Policy.sh; then
14236 If you compile $package on a different machine or from a different object
14237 directory, copy the Policy.sh file from this object directory to the
14238 new one before you run Configure -- this will help you with most of
14239 the policy defaults.
14243 if $test -f config.msg; then
14244 echo "Hmm. I also noted the following information while running:"
14246 $cat config.msg >&4
14249 $rm -f kit*isdone ark*isdone