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 Sat Aug 14 02:00:00 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=''
690 ignore_versioned_solibs=''
820 d_stdio_stream_array=''
821 stdio_stream_array=''
855 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
858 : We must find out about Eunice early
860 if test -f /etc/unixtovms; then
861 eunicefix=/etc/unixtovms
863 if test -f /etc/unixtovms.exe; then
864 eunicefix=/etc/unixtovms.exe
868 : Possible local include directories to search.
869 : Set locincpth to "" in a hint file to defeat local include searches.
870 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
871 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
873 : no include file wanted by default
876 : list of known cpp symbols, sorted alphabetically
877 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
878 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
879 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
880 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
881 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
882 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
883 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
884 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
885 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
886 al="$al VMS Xenix286"
887 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
888 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
889 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
890 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
891 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
892 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
893 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
894 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
895 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
896 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
897 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
898 al="$al __SVR4_2__ __UMAXV__"
899 al="$al ____386BSD____ __alpha __alpha__ __amiga"
900 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
901 al="$al __host_mips__"
902 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
903 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
904 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
905 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
906 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
907 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
908 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
909 al="$al __mc88100 __mc88100__ __mips __mips__"
910 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
911 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
912 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
913 al="$al _host_mips _mips _unix"
914 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
915 al="$al apollo ardent att386 att3b"
916 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
917 al="$al cadmus clipper concurrent convex cray ctix"
918 al="$al dmert encore gcos gcx gimpel gould"
919 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
920 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
921 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
922 al="$al i186 i286 i386 i486 i8086"
923 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
924 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
925 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
926 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
927 al="$al mc88000 mc88100 merlin mert mips mvs n16"
928 al="$al ncl_el ncl_mr"
929 al="$al news1500 news1700 news1800 news1900 news3700"
930 al="$al news700 news800 news900 ns16000 ns32000"
931 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
932 al="$al parisc pc532 pdp11 plexus posix pyr"
933 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
934 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
935 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
936 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
937 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
938 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
941 : Trailing extension. Override this in a hint file, if needed.
943 : Extra object files, if any, needed on this platform.
946 : change the next line if compiling for Xenix/286 on Xenix/386
947 xlibpth='/usr/lib/386 /lib/386'
949 : Possible local library directories to search.
950 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
951 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
953 : general looking path for locating libraries
954 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
955 glibpth="$glibpth /lib /usr/lib $xlibpth"
956 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
957 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
959 : Private path used by Configure to find libraries. Its value
960 : is prepended to libpth. This variable takes care of special
961 : machines, like the mips. Usually, it should be empty.
964 : default library list
966 : some systems want to use only the non-versioned libso:s
967 ignore_versioned_solibs=''
968 : full support for void wanted by default
971 : set useposix=false in your hint file to disable the POSIX extension.
973 : set useopcode=false in your hint file to disable the Opcode extension.
975 : set usemultiplicity on the Configure command line to enable multiplicity.
976 : set usesocks on the Configure command line to enable socks.
977 : set usethreads on the Configure command line to enable threads.
978 : List of libraries we want.
979 : If anyone needs -lnet, put it in a hint file.
980 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
981 libswanted="$libswanted dld ld sun m c cposix posix"
982 libswanted="$libswanted ndir dir crypt sec"
983 libswanted="$libswanted ucb bsd BSD PW x"
984 : We probably want to search /usr/shlib before most other libraries.
985 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
986 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
987 glibpth="/usr/shlib $glibpth"
988 : Do not use vfork unless overridden by a hint file.
991 : Find the basic shell for Bourne shell scripts
995 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
998 if test -f "$xxx"; then
1001 : Build up a list and do a single loop so we can 'break' out.
1002 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1003 for xxx in sh bash ksh pdksh ash; do
1005 try="$try ${p}/${xxx}"
1009 if test -f "$xxx"; then
1012 elif test -f "$xxx.exe"; then
1023 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1025 Usually it's in /bin/sh. How did you even get this far?
1026 Please contact me (Perl Maintainers) at perlbug@perl.com and
1027 we'll try to straighten this all out.
1033 : see if sh knows # comments
1034 if `$sh -c '#' >/dev/null 2>&1`; then
1038 test -f $xcat || xcat=/usr/bin/cat
1043 if test -s today; then
1046 echo "#! $xcat" > try
1050 if test -s today; then
1058 echo "Your $sh doesn't grok # comments--I will strip them later on."
1061 echo "exec grep -v '^[ ]*#'" >spitshell
1063 $eunicefix spitshell
1064 spitshell=`pwd`/spitshell
1066 echo "I presume that if # doesn't work, #! won't work either!"
1071 : figure out how to guarantee sh startup
1073 '') startsh=${sharpbang}${sh} ;;
1085 : echo "Yup, it does."
1087 echo "Hmm... '$startsh' does not guarantee sh startup..."
1088 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1093 : Save command line options in file UU/cmdline.opt for later use in
1094 : generating config.sh.
1095 cat > cmdline.opt <<EOSH
1096 # Configure command line arguments.
1103 cat >>cmdline.opt <<EOSH
1104 config_arg$argn='$arg'
1106 argn=`expr $argn + 1`
1109 : produce awk script to parse command line options
1110 cat >options.awk <<'EOF'
1112 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1114 len = length(optstr);
1115 for (i = 1; i <= len; i++) {
1116 c = substr(optstr, i, 1);
1117 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1128 if (substr(str, 1, 1) != "-") {
1129 printf("'%s'\n", str);
1133 for (i = 2; i <= len; i++) {
1134 c = substr(str, i, 1);
1136 printf("-%s\n", substr(str, i));
1142 printf("'%s'\n", substr(str, i + 1));
1155 : process the command line options
1156 set X `for arg in "$@"; do echo "X$arg"; done |
1157 sed -e s/X// | awk -f options.awk`
1162 : set up default values
1173 cat >optdef.sh <<EOS
1179 while test $# -gt 0; do
1181 -d) shift; fastread=yes;;
1182 -e) shift; alldone=cont;;
1186 if test -r "$1"; then
1189 echo "$me: cannot read config file $1." >&2
1194 -h) shift; error=true;;
1195 -r) shift; reuseval=true;;
1196 -s) shift; silent=true; realsilent=true;;
1197 -E) shift; alldone=exit;;
1198 -K) shift; knowitall=true;;
1199 -O) shift; override=true;;
1200 -S) shift; silent=true; extractsh=true;;
1205 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1206 echo "$me: ignoring -D $1" >&2
1209 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1210 *) echo "$1='define'" >> optdef.sh;;
1217 *=) echo "$1" >> optdef.sh;;
1219 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1220 echo "$me: ignoring -U $1" >&2
1222 *) echo "$1='undef'" >> optdef.sh;;
1226 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1229 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1237 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1238 [-U symbol] [-U symbol=]
1239 -d : use defaults for all answers.
1240 -e : go on without questioning past the production of config.sh.
1241 -f : specify an alternate default configuration file.
1242 -h : print this help message and exit (with an error status).
1243 -r : reuse C symbols value if possible (skips costly nm extraction).
1244 -s : silent mode, only echoes questions and essential information.
1245 -D : define symbol to have some value:
1246 -D symbol symbol gets the value 'define'
1247 -D symbol=value symbol gets the value 'value'
1248 -E : stop at the end of questions, after having produced config.sh.
1249 -K : do not use unless you know what you are doing.
1250 -O : let -D and -U override definitions from loaded configuration file.
1251 -S : perform variable substitutions on all .SH files (can mix with -f)
1252 -U : undefine symbol:
1253 -U symbol symbol gets the value 'undef'
1254 -U symbol= symbol gets completely empty
1255 -V : print version number and exit (with a zero status).
1262 case "$fastread$alldone" in
1265 if test ! -t 0; then
1266 echo "Say 'sh Configure', not 'sh <Configure'"
1274 true) exec 1>/dev/null;;
1277 : run the defines and the undefines, if any, but leave the file out there...
1283 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1284 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1285 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1286 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1287 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1290 : Some greps do not return status, grrr.
1291 echo "grimblepritz" >grimble
1292 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1294 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1300 : the following should work in any shell
1304 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1305 cat >contains <<'EOSS'
1306 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1311 : Find the path to the source tree
1314 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1317 *) src=`cd ../$src && pwd` ;;
1330 if test -f $rsrc/Configure && \
1331 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1333 : found it, so we are ok.
1336 for src in . .. ../.. ../../.. ../../../..; do
1337 if test -f ../$src/Configure && \
1338 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1349 Sorry, I can't seem to locate the source dir for $package. Please start
1350 Configure with an explicit path -- i.e. /some/path/Configure.
1358 echo "Sources for $package found in \"$src\"." >&4
1362 : script used to extract .SH files with variable substitutions
1363 cat >extract <<'EOS'
1365 echo "Doing variable substitutions on .SH files..."
1366 if test -f $src/MANIFEST; then
1367 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1369 echo "(Looking for .SH files under the source directory.)"
1370 set x `(cd $src; find . -name "*.SH" -print)`
1374 0) set x `(cd $src; echo *.SH)`; shift;;
1376 if test ! -f $src/$1; then
1382 while test $name; do
1383 if test ! -d "$name"; then
1384 create="$name $create";
1385 name=`echo $name | sed -e "s|^[^/]*$||"`;
1386 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1391 for file in $create; do
1400 dir=`expr X$file : 'X\(.*\)/'`
1401 file=`expr X$file : 'X.*/\(.*\)'`
1402 (cd $dir && . ./$file)
1412 dir=`expr X$file : 'X\(.*\)/'`
1413 file=`expr X$file : 'X.*/\(.*\)'`
1414 (set x $dir; shift; eval $mkdir_p)
1424 if test -f $src/config_h.SH; then
1425 if test ! -f config.h; then
1426 : oops, they left it out of MANIFEST, probably, so do it anyway.
1432 : extract files and exit if asked to do so
1433 case "$extractsh" in
1435 case "$realsilent" in
1439 case "$config_sh" in
1440 '') config_sh='config.sh';;
1443 echo "Fetching answers from $config_sh..."
1446 test "$override" && . ./optdef.sh
1455 : Eunice requires " " instead of "", can you believe it
1458 echo "Beginning of configuration questions for $package."
1460 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1462 : first determine how to suppress newline on echo command
1464 echo "Checking echo to see how to suppress newlines..."
1465 (echo "hi there\c" ; echo " ") >.echotmp
1466 if $contains c .echotmp >/dev/null 2>&1 ; then
1477 echo $n "The star should be here-->$c"
1481 : Now test for existence of everything in MANIFEST
1483 if test -f $rsrc/MANIFEST; then
1484 echo "First let's make sure your kit is complete. Checking..." >&4
1485 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1488 for filelist in x??; do
1489 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1491 if test -s missing; then
1495 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1497 You have the option of continuing the configuration process, despite the
1498 distinct possibility that your kit is damaged, by typing 'y'es. If you
1499 do, don't blame me if something goes wrong. I advise you to type 'n'o
1500 and contact the author (perlbug@perl.com).
1503 echo $n "Continue? [n] $c" >&4
1507 echo "Continuing..." >&4
1511 echo "ABORTING..." >&4
1516 echo "Looks good..."
1519 echo "There is no MANIFEST file. I hope your kit is complete !"
1524 : Find the appropriate value for a newline for tr
1525 if test -n "$DJGPP"; then
1528 if test X"$trnl" = X; then
1529 case "`echo foo|tr '\n' x 2>/dev/null`" in
1533 if test X"$trnl" = X; then
1534 case "`echo foo|tr '\012' x 2>/dev/null`" in
1535 foox) trnl='\012' ;;
1538 if test X"$trnl" = X; then
1541 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1547 : compute the number of columns on the terminal for proper question formatting
1552 : set up the echo used in my read
1553 myecho="case \"\$xxxm\" in
1554 '') echo $n \"\$rp $c\" >&4;;
1556 '') echo $n \"[\$xxxm] $c\";;
1558 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1560 echo $n \"[\$xxxm] $c\" >&4
1562 echo $n \"\$rp [\$xxxm] $c\" >&4
1568 : now set up to do reads with possible shell escape and default assignment
1574 case "\$fastread" in
1575 yes) case "\$dflt" in
1578 case "\$silent-\$rp" in
1583 *) case "\$silent" in
1584 true) case "\$rp" in
1589 while expr "X\$ans" : "X!" >/dev/null; do
1593 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1601 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1610 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1615 echo "(OK, I'll run with -d after this question.)" >&4
1618 echo "*** Sorry, \$1 not supported yet." >&4
1628 echo "*** Substitution done -- please confirm."
1630 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1635 echo "*** Error -- try again."
1642 case "\$ans\$xxxm\$nostick" in
1654 : create .config dir to save info across Configure sessions
1655 test -d ../.config || mkdir ../.config
1656 cat >../.config/README <<EOF
1657 This directory created by Configure to save information that should
1658 persist across sessions for $package.
1660 You may safely delete it if you wish.
1663 : general instructions
1666 user=`(logname) 2>/dev/null`
1668 '') user=`whoami 2>&1`;;
1670 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1673 rp='Would you like to see the instructions?'
1684 This installation shell script will examine your system and ask you questions
1685 to determine how the perl5 package should be installed. If you get
1686 stuck on a question, you may use a ! shell escape to start a subshell or
1687 execute a command. Many of the questions will have default answers in square
1688 brackets; typing carriage return will give you the default.
1690 On some of the questions which ask for file or directory names you are allowed
1691 to use the ~name construct to specify the login directory belonging to "name",
1692 even if you don't have a shell which knows about that. Questions where this is
1693 allowed will be marked "(~name ok)".
1697 dflt='Type carriage return to continue'
1701 The prompter used in this script allows you to use shell variables and
1702 backticks in your answers. You may use $1, $2, etc... to refer to the words
1703 in the default answer, as if the default line was a set of arguments given to a
1704 script shell. This means you may also use $* to repeat the whole default line,
1705 so you do not have to re-type everything to add something to the default.
1707 Everytime there is a substitution, you will have to confirm. If there is an
1708 error (e.g. an unmatched backtick), the default answer will remain unchanged
1709 and you will be prompted again.
1711 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1712 the questions and use the computed defaults (or the previous answers if there
1713 was already a config.sh file). Type 'Configure -h' for a list of options.
1714 You may also start interactively and then answer '& -d' at any prompt to turn
1715 on the non-interactive behaviour for the remainder of the execution.
1721 Much effort has been expended to ensure that this shell script will run on any
1722 Unix system. If despite that it blows up on yours, your best bet is to edit
1723 Configure and run it again. If you can't run Configure for some reason,
1724 you'll have to generate a config.sh file by hand. Whatever problems you
1725 have, let me (perlbug@perl.com) know how I blew it.
1727 This installation script affects things in two ways:
1729 1) it may do direct variable substitutions on some of the files included
1731 2) it builds a config.h file for inclusion in C programs. You may edit
1732 any of these files as the need arises after running this script.
1734 If you make a mistake on a question, there is no easy way to back up to it
1735 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1736 files. Configure will offer to let you do this before it runs the SH files.
1739 dflt='Type carriage return to continue'
1741 case "$firsttime" in
1742 true) echo $user >>../.config/instruct;;
1746 : find out where common programs are
1748 echo "Locating common programs..." >&4
1761 if test -d \$dir/\$thing; then
1767 for thisthing in \$dir/\$thing; do
1768 : just loop through to pick last item
1770 if test -f \$thisthing; then
1773 elif test -f \$dir/\$thing.exe; then
1774 if test -n "$DJGPP"; then
1775 echo \$dir/\$thing.exe
1777 : on Eunice apparently
1827 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1828 pth="$pth /lib /usr/lib"
1829 for file in $loclist; do
1833 if test -f "$xxx"; then
1836 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1837 xxx=`./loc $file $file $pth`
1840 '') xxx=`./loc $file $file $pth`;;
1841 *) xxx=`./loc $xxx $xxx $pth`;;
1847 echo $file is in $xxx.
1850 echo $file is in $xxx.
1853 echo "I don't know where '$file' is, and my life depends on it." >&4
1854 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1860 echo "Don't worry if any of the following aren't found..."
1862 for file in $trylist; do
1866 if test -f "$xxx"; then
1869 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1870 xxx=`./loc $file $file $pth`
1873 '') xxx=`./loc $file $file $pth`;;
1874 *) xxx=`./loc $xxx $xxx $pth`;;
1880 echo $file is in $xxx.
1883 echo $file is in $xxx.
1886 echo "I don't see $file out there, $say."
1893 echo "Substituting grep for egrep."
1899 echo "Substituting cp for ln."
1905 echo "Hopefully test is built into your sh."
1908 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1909 echo "Using the test built into your sh."
1917 echo "Hopefully echo is built into your sh."
1922 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1923 $echo $n "hi there$c" >foo1
1924 echo $n "hi there$c" >foo2
1925 if cmp foo1 foo2 >/dev/null 2>&1; then
1926 echo "They are compatible. In fact, they may be identical."
1933 They are not compatible! You are probably running ksh on a non-USG system.
1934 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1935 have echo built in and we may have to run some Bourne shell scripts. That
1936 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1939 $echo $n "The star should be here-->$c"
1946 : determine whether symbolic links are supported
1949 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1950 echo "Symbolic links are supported." >&4
1953 echo "Symbolic links are NOT supported." >&4
1958 : see whether [:lower:] and [:upper:] are supported character classes
1960 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1962 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1966 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1967 # (0xc9 and 0xd1), therefore that is a nice testing point.
1968 if test "X$up" = X -o "X$low" = X; then
1969 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1975 if test "X$up" = X -o "X$low" = X; then
1976 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1982 if test "X$up" = X -o "X$low" = X; then
1983 case "`echo IJ | od -x 2>/dev/null`" in
1985 echo "Hey, this might be EBCDIC." >&4
1986 if test "X$up" = X -o "X$low" = X; then
1987 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1988 ij) up='[A-IJ-RS-Z]'
1993 if test "X$up" = X -o "X$low" = X; then
1994 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2004 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2006 echo "Using $up and $low to convert case." >&4
2009 echo "I don't know how to translate letters from upper to lower case." >&4
2010 echo "Your tr is not acting any way I know of." >&4
2014 : set up the translation script tr, must be called with ./tr of course
2018 '[A-Z][a-z]') exec $tr '$up' '$low';;
2019 '[a-z][A-Z]') exec $tr '$low' '$up';;
2026 : Try to determine whether config.sh was made on this system
2027 case "$config_sh" in
2029 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2030 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2031 # because the A-Z/a-z are not consecutive.
2032 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2033 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2034 newmyuname="$myuname"
2036 case "$knowitall" in
2038 if test -f ../config.sh; then
2039 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2040 eval "`grep myuname= ../config.sh`"
2042 if test "X$myuname" = "X$newmyuname"; then
2050 : Get old answers from old config file if Configure was run on the
2051 : same system, otherwise use the hints.
2054 if test -f config.sh; then
2056 rp="I see a config.sh file. Shall I use it to set the defaults?"
2059 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2060 *) echo "Fetching default answers from your old config.sh file..." >&4
2068 : Older versions did not always set $sh. Catch re-use of such
2077 if test ! -f config.sh; then
2080 First time through, eh? I have some defaults handy for some systems
2081 that need some extra help getting the Configure answers right:
2084 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2086 : Half the following guesses are probably wrong... If you have better
2087 : tests or hints, please send them to perlbug@perl.com
2088 : The metaconfig authors would also appreciate a copy...
2089 $test -f /irix && osname=irix
2090 $test -f /xenix && osname=sco_xenix
2091 $test -f /dynix && osname=dynix
2092 $test -f /dnix && osname=dnix
2093 $test -f /lynx.os && osname=lynxos
2094 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2095 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2096 $test -f /bin/mips && /bin/mips && osname=mips
2097 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2098 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2099 $test -d /usr/apollo/bin && osname=apollo
2100 $test -f /etc/saf/_sactab && osname=svr4
2101 $test -d /usr/include/minix && osname=minix
2102 if $test -d /MachTen -o -d /MachTen_Folder; then
2104 if $test -x /sbin/version; then
2105 osvers=`/sbin/version | $awk '{print $2}' |
2106 $sed -e 's/[A-Za-z]$//'`
2107 elif $test -x /usr/etc/version; then
2108 osvers=`/usr/etc/version | $awk '{print $2}' |
2109 $sed -e 's/[A-Za-z]$//'`
2114 $test -f /sys/posix.dll &&
2115 $test -f /usr/bin/what &&
2116 set X `/usr/bin/what /sys/posix.dll` &&
2117 $test "$3" = UWIN &&
2120 if $test -f $uname; then
2128 umips) osname=umips ;;
2131 [23]100) osname=mips ;;
2132 next*) osname=next ;;
2134 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2135 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2138 elif $test -f /etc/kconfig; then
2140 if test "$lns" = "$ln -s"; then
2142 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2144 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2151 if test -n "$DJGPP"; then
2160 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2162 'not found') osvers="$4"."$3" ;;
2163 '<3240'|'<>3240') osvers=3.2.0 ;;
2164 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2165 '=3250'|'>3250') osvers=3.2.5 ;;
2169 *dc.osx) osname=dcosx
2175 domainos) osname=apollo
2181 dynixptx*) osname=dynixptx
2182 osvers=`echo "$4"|sed 's/^v//'`
2184 freebsd) osname=freebsd
2186 genix) osname=genix ;;
2188 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2204 netbsd*) osname=netbsd
2207 news-os) osvers="$3"
2209 4*) osname=newsos4 ;;
2213 bsd386) osname=bsd386
2216 POSIX-BC | posix-bc ) osname=posix-bc
2219 powerux | power_ux | powermax_os | powermaxos | \
2220 powerunix | power_unix) osname=powerux
2223 next*) osname=next ;;
2224 solaris) osname=solaris
2226 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2233 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2237 titanos) osname=titanos
2246 ultrix) osname=ultrix
2249 osf1|mls+) case "$5" in
2252 osvers=`echo "$3" | sed 's/^[xvt]//'`
2254 hp*) osname=hp_osf1 ;;
2255 mips) osname=mips_osf1 ;;
2264 $2) case "$osname" in
2268 : svr4.x or possibly later
2278 if test -f /stand/boot ; then
2279 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2280 if test -n "$INITPROG" -a -f "$INITPROG"; then
2281 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2282 if test -n "$isesix"; then
2290 *) if test -f /etc/systemid; then
2292 set `echo $3 | $sed 's/\./ /g'` $4
2293 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2295 elif $test -f $src/hints/sco_$1_$2.sh; then
2297 elif $test -f $src/hints/sco_$1.sh; then
2302 '') : Still unknown. Probably a generic Sys V.
2311 *) case "$osname" in
2312 '') : Still unknown. Probably a generic BSD.
2320 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2321 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2322 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2325 $rm -f UU/kernel.what
2326 elif test -d c:/.; then
2333 : Now look for a hint file osname_osvers, unless one has been
2334 : specified already.
2337 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2338 : Also try without trailing minor version numbers.
2339 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2340 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2341 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2342 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2345 *) case "$osvers" in
2348 *) if $test -f $src/hints/$file.sh ; then
2350 elif $test -f $src/hints/$xfile.sh ; then
2352 elif $test -f $src/hints/$xxfile.sh ; then
2354 elif $test -f $src/hints/$xxxfile.sh ; then
2356 elif $test -f $src/hints/$xxxxfile.sh ; then
2358 elif $test -f "$src/hints/${osname}.sh" ; then
2367 if $test -f Policy.sh ; then
2370 none) dflt="Policy" ;;
2371 *) dflt="Policy $dflt" ;;
2376 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2380 if $test -f Policy.sh ; then
2383 There's also a Policy hint file available, which should make the
2384 site-specific (policy) questions easier to answer.
2391 You may give one or more space-separated answers, or "none" if appropriate.
2392 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2393 is a good thing. DO NOT give a wrong version or a wrong OS.
2397 rp="Which of these apply, if any?"
2400 for file in $tans; do
2401 if $test X$file = XPolicy -a -f Policy.sh; then
2403 $cat Policy.sh >> UU/config.sh
2404 elif $test -f $src/hints/$file.sh; then
2405 . $src/hints/$file.sh
2406 $cat $src/hints/$file.sh >> UU/config.sh
2407 elif $test X$tans = X -o X$tans = Xnone ; then
2410 : Give one chance to correct a possible typo.
2411 echo "$file.sh does not exist"
2413 rp="hint to use instead?"
2415 for file in $ans; do
2416 if $test -f "$src/hints/$file.sh"; then
2417 . $src/hints/$file.sh
2418 $cat $src/hints/$file.sh >> UU/config.sh
2419 elif $test X$ans = X -o X$ans = Xnone ; then
2422 echo "$file.sh does not exist -- ignored."
2429 : Remember our hint file for later.
2430 if $test -f "$src/hints/$file.sh" ; then
2440 echo "Fetching default answers from $config_sh..." >&4
2444 cp $config_sh config.sh 2>/dev/null
2454 test "$override" && . ./optdef.sh
2455 myuname="$newmyuname"
2457 : Restore computed paths
2458 for file in $loclist $trylist; do
2459 eval $file="\$_$file"
2464 Configure uses the operating system name and version to set some defaults.
2465 The default value is probably right if the name rings a bell. Otherwise,
2466 since spelling matters for me, either accept the default or answer "none"
2473 ''|' '|none) dflt=none ;;
2474 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2477 *) dflt="$osname" ;;
2479 rp="Operating system name?"
2483 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2489 ''|' '|none) dflt=none ;;
2490 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2491 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2493 ''|' ') dflt=none ;;
2498 *) dflt="$osvers" ;;
2500 rp="Operating system version?"
2507 : who configured the system
2508 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2509 cf_by=`(logname) 2>/dev/null`
2512 cf_by=`(whoami) 2>/dev/null`
2514 "") cf_by=unknown ;;
2518 : set up the script used to warn in case of inconsistency
2525 echo "*** WHOA THERE!!! ***" >&4
2526 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2527 rp=" Keep the $hint value?"
2530 y) td=$was; tu=$was;;
2534 : function used to set $1 to $val
2535 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2537 $define$undef) . ./whoa; eval "$var=\$td";;
2538 $undef$define) . ./whoa; eval "$var=\$tu";;
2539 *) eval "$var=$val";;
2544 Perl can be built to take advantage of threads, on some systems.
2545 To do so, Configure must be run with -Dusethreads.
2547 Note that threading is a highly experimental feature, and
2548 some known race conditions still remain. If you choose to try
2549 it, be very sure to not actually deploy it for production
2550 purposes. README.threads has more details, and is required
2551 reading if you enable threads.
2553 case "$usethreads" in
2554 $define|true|[yY]*) dflt='y';;
2557 rp='Build a threading Perl?'
2560 y|Y) val="$define" ;;
2566 case "$d_oldpthreads" in
2567 '') : Configure tests would be welcome here. For now, assume undef.
2569 *) val="$d_oldpthreads" ;;
2575 case "$usethreads" in
2576 "$define"|true|[yY]*)
2577 : Look for a hint-file generated 'call-back-unit'. If the
2578 : user has specified that a threading perl is to be built,
2579 : we may need to set or change some other defaults.
2580 if $test -f usethreads.cbu; then
2581 echo "Your platform has some specific hints for threaded builds, using them..."
2585 (Your platform doesn't have any specific hints for threaded builds.
2586 Assuming POSIX threads, then.)
2594 Perl can be built so that multiple Perl interpreters can coexist
2595 within the same Perl executable. To do so, Configure must be run with
2598 Normally you do not need this and you should answer no.
2601 case "$usemultiplicity" in
2602 $define|true|[yY]*) dflt='y';;
2605 rp='Build Perl for multiplicity?'
2608 y|Y) val="$define" ;;
2614 : determine where manual pages are on this system
2618 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2619 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2620 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2621 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2622 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2623 sysman=`./loc . /usr/man/man1 $syspath`
2626 if $test -d "$sysman"; then
2627 echo "System manual is in $sysman." >&4
2629 echo "Could not find manual pages in source form." >&4
2632 : see what memory models we can support
2635 $cat >pdp11.c <<'EOP'
2644 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2645 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2646 dflt='unsplit split'
2648 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2651 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2656 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2659 if $test -d /lib/large || $test -d /usr/lib/large; then
2662 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2671 Some systems have different model sizes. On most systems they are called
2672 small, medium, large, and huge. On the PDP11 they are called unsplit and
2673 split. If your system doesn't support different memory models, say "none".
2674 If you wish to force everything to one memory model, say "none" here and
2675 put the appropriate flags later when it asks you for other cc and ld flags.
2676 Venix systems may wish to put "none" and let the compiler figure things out.
2677 (In the following question multiple model names should be space separated.)
2679 The default for most systems is "none".
2682 rp="Which memory models are supported?"
2697 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2698 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2705 rp="What flag indicates separate I and D space?"
2713 *large*|*small*|*medium*|*huge*)
2720 rp="What flag indicates large model?"
2730 *huge*) case "$huge" in
2734 rp="What flag indicates huge model?"
2744 *medium*) case "$medium" in
2748 rp="What flag indicates medium model?"
2755 *) medium="$large";;
2758 *small*) case "$small" in
2762 rp="What flag indicates small model?"
2773 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2776 $rm -f pdp11.* pdp11
2778 : make some quick guesses about what we are up against
2780 $echo $n "Hmm... $c"
2790 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2791 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2793 echo "Looks kind of like an OSF/1 system, but we'll see..."
2795 elif test `echo abc | tr a-z A-Z` = Abc ; then
2796 xxx=`./loc addbib blurfl $pth`
2797 if $test -f $xxx; then
2798 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2802 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2803 echo "Looks kind of like an extended USG system, but we'll see..."
2805 echo "Looks kind of like a USG system, but we'll see..."
2809 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2810 echo "Looks kind of like a BSD system, but we'll see..."
2814 echo "Looks kind of like a Version 7 system, but we'll see..."
2817 case "$eunicefix" in
2820 There is, however, a strange, musty smell in the air that reminds me of
2821 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2825 : it so happens the Eunice I know will not run shell scripts in Unix format
2829 echo "Congratulations. You aren't running Eunice."
2833 : Detect OS2. The p_ variable is set above in the Head.U unit.
2838 I have the feeling something is not exactly right, however...don't tell me...
2839 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2844 if test -f /xenix; then
2845 echo "Actually, this looks more like a XENIX system..."
2850 echo "It's not Xenix..."
2855 if test -f /venix; then
2856 echo "Actually, this looks more like a VENIX system..."
2863 echo "Nor is it Venix..."
2866 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2867 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2870 : see if we need a special compiler
2878 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2879 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2893 On some older systems the default C compiler will not resolve multiple global
2894 references that happen to have the same name. On some such systems the "Mcc"
2895 command may be used to force these to be resolved. On other systems a "cc -M"
2896 command is required. (Note that the -M flag on other systems indicates a
2897 memory model to use!) If you have the Gnu C compiler, you might wish to use
2903 rp="Use which C compiler?"
2911 rp="Use which C compiler?"
2915 : Look for a hint-file generated 'call-back-unit'. Now that the
2916 : user has specified the compiler, we may need to set or change some
2918 if $test -f cc.cbu; then
2922 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2923 $cat >gccvers.c <<EOM
2928 printf("%s\n", __VERSION__);
2930 printf("%s\n", "1");
2936 if $cc -o gccvers gccvers.c; then
2937 gccversion=`./gccvers`
2938 case "$gccversion" in
2939 '') echo "You are not using GNU cc." ;;
2940 *) echo "You are using GNU cc $gccversion." ;;
2944 echo "*** WHOA THERE!!! ***" >&4
2945 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2946 case "$knowitall" in
2948 echo " You'd better start hunting for one and let me know about it." >&4
2954 case "$gccversion" in
2955 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2960 Perl can be built to take advantage of explicit 64-bit interfaces,
2961 on some systems. To do so, Configure must be run with -Duse64bits.
2963 If this doesn't make any sense to you, just accept the default 'n'.
2965 case "$use64bits" in
2966 $define|true|[yY]*) dflt='y';;
2969 rp='Try to use explicit 64-bit interfaces, if available?'
2982 case "$archname64" in
2983 '') archname64='' ;; # not a typo
2986 case "$use64bits" in
2987 "$define"|true|[yY]*)
2988 : Look for a hint-file generated 'call-back-unit'. If the
2989 : user has specified that a 64 bit perl is to be built,
2990 : we may need to set or change some other defaults.
2991 if $test -f use64bits.cbu; then
2992 echo "Your platform has some specific hints for 64-bit builds, using them..."
2996 (Your platform doesn't have any specific hints for 64-bit builds.
2997 This is probably okay, especially if your system is a true 64-bit system.)
2999 case "$gccversion" in
3002 But since you seem to be using gcc,
3003 I will now add -DUSE_LONG_LONG to the compilation flags.
3005 ccflags="$ccflags -DUSE_LONG_LONG"
3012 : determine the architecture name
3014 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3015 tarch=`arch`"-$osname"
3016 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3017 if uname -m > tmparch 2>&1 ; then
3018 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3019 -e 's/$/'"-$osname/" tmparch`
3027 case "$myarchname" in
3030 echo "(Your architecture name used to be $myarchname.)"
3037 *) dflt="$archname";;
3039 rp='What is your architecture name'
3042 case "$usethreads" in
3044 echo "Threads selected." >&4
3046 *-thread*) echo "...and architecture name already has -thread." >&4
3048 *) archname="$archname-thread"
3049 echo "...setting architecture name to $archname." >&4
3054 case "$usemultiplicity" in
3056 echo "Multiplicity selected." >&4
3058 *-multi*) echo "...and architecture name already has -multi." >&4
3060 *) archname="$archname-multi"
3061 echo "...setting architecture name to $archname." >&4
3066 case "$use64bits" in
3068 echo "Explicit 64-bitness selected." >&4
3069 case "$archname64" in
3074 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3076 *) archname="$archname-$archname64"
3077 echo "...setting architecture name to $archname." >&4
3084 : decide how portable to be. Allow command line overrides.
3085 case "$d_portable" in
3087 *) d_portable="$define" ;;
3090 : set up shell script to do ~ expansion
3096 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3099 if $test -f /bin/csh; then
3100 /bin/csh -f -c "glob \$1"
3105 name=\`$expr x\$1 : '..\([^/]*\)'\`
3106 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3107 if $test ! -d "\$dir"; then
3109 echo "\$me: can't locate home directory for: \$name" >&2
3114 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3130 : now set up to get a file name
3134 cat <<'EOSC' >>getfile
3150 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3151 fn=`echo $fn | sed 's/(.*)//'`
3157 loc_file=`expr $fn : '.*:\(.*\)'`
3158 fn=`expr $fn : '\(.*\):.*'`
3166 */*) fullpath=true;;
3175 *e*) exp_file=true;;
3178 *p*) nopath_ok=true;;
3183 *d*) type='Directory';;
3184 *l*) type='Locate';;
3189 Locate) what='File';;
3194 case "$d_portable" in
3202 while test "$type"; do
3207 true) rp="$rp (~name ok)";;
3210 if test -f UU/getfile.ok && \
3211 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3230 value=`UU/filexp $ans`
3233 if test "$ans" != "$value"; then
3234 echo "(That expands to $value on this system.)"
3248 /*) value="$ansexp" ;;
3253 echo "I shall only accept a full path name, as in /bin/ls." >&4
3254 echo "Use a ! shell escape if you wish to check pathnames." >&4
3257 echo "Please give a full path name, starting with slash." >&4
3260 echo "Note that using ~name is ok provided it expands well." >&4
3273 for fp in $gfpth; do
3274 if test "X$fp" = X.; then
3279 if test -f "$pf"; then
3281 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3283 echo "($value is not a plain file, but that's ok.)"
3286 if test X"$type" = X; then
3293 for fp in $gfpth; do
3294 if test "X$fp" = X.; then
3299 if test -d "$pf"; then
3307 if test -d "$ansexp"; then
3308 echo "(Looking for $loc_file in directory $value.)"
3309 value="$value/$loc_file"
3310 ansexp="$ansexp/$loc_file"
3312 if test -f "$ansexp"; then
3315 case "$nopath_ok" in
3316 true) case "$value" in
3318 *) echo "Assuming $value will be in people's path."
3334 if test "$fastread" = yes; then
3339 rp="$what $value doesn't exist. Use that name anyway?"
3358 test "X$gfpthkeep" != Xy && gfpth=""
3361 : determine root of directory hierarchy where package will be installed.
3364 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3372 By default, $package will be installed in $dflt/bin, manual pages
3373 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3374 installation directories. Typically this is something like /usr/local.
3375 If you wish to have binaries under /usr/bin but other parts of the
3376 installation under /usr/local, that's ok: you will be prompted
3377 separately for each of the installation directories, the prefix being
3378 only used to set the defaults.
3382 rp='Installation prefix to use?'
3390 *) oldprefix="$prefix";;
3400 $define|true) afs=true ;;
3401 $undef|false) afs=false ;;
3402 *) if test -d /afs; then
3410 echo "AFS may be running... I'll be extra cautious then..." >&4
3412 echo "AFS does not seem to be running..." >&4
3415 : determine installation prefix for where package is to be installed.
3419 Since you are running AFS, I need to distinguish the directory in which
3420 files will reside from the directory in which they are installed (and from
3421 which they are presumably copied to the former directory by occult means).
3424 case "$installprefix" in
3425 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3426 *) dflt="$installprefix";;
3431 In some special cases, particularly when building $package for distribution,
3432 it is convenient to distinguish between the directory in which files should
3433 be installed from the directory ($prefix) in which they
3434 will eventually reside. For most users, these two directories are the same.
3437 case "$installprefix" in
3439 *) dflt=$installprefix;;
3443 rp='What installation prefix should I use for installing files?'
3445 installprefix="$ans"
3446 installprefixexp="$ansexp"
3448 : set the prefixit variable, to compute a suitable default value
3449 prefixit='case "$3" in
3451 case "$oldprefix" in
3452 "") eval "$1=\"\$$2\"";;
3459 ""|" ") eval "$1=\"\$$2\"";;
3465 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3467 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3468 /*-$oldprefix/*|\~*-$oldprefix/*)
3469 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3470 *) eval "$1=\"\$$2\"";;
3474 : set the base revision
3477 : get the patchlevel
3479 echo "Getting the current patchlevel..." >&4
3480 if $test -r $rsrc/patchlevel.h;then
3481 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3482 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3487 $echo $n "(You have $package" $c
3490 *) $echo $n " $baserev" $c ;;
3492 $echo $n " patchlevel $patchlevel" $c
3493 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3496 if test 0 -eq "$subversion"; then
3497 version=`LC_ALL=C; export LC_ALL; \
3498 echo $baserev $patchlevel | \
3499 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3501 version=`LC_ALL=C; export LC_ALL; \
3502 echo $baserev $patchlevel $subversion | \
3503 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3505 : Figure out perl API version. Perhaps this should be in patchlevel.h
3506 if test "$subversion" -lt 50; then
3507 apiversion=`LC_ALL=C; export LC_ALL; \
3508 LANGUAGE=C; export LANGUAGE; \
3509 echo $baserev $patchlevel | \
3510 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3512 apiversion="$version"
3515 : determine installation style
3516 : For now, try to deduce it from prefix unless it is already set.
3517 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3518 case "$installstyle" in
3519 '') case "$prefix" in
3520 *perl*) dflt='lib';;
3521 *) dflt='lib/perl5' ;;
3524 *) dflt='lib/perl5' ;;
3526 : Probably not worth prompting for this since we prompt for all
3527 : the directories individually, and the prompt would be too long and
3531 : determine where private library files go
3532 : Usual default is /usr/local/lib/perl5/$version.
3533 : Also allow things like /opt/perl/lib/$version, since
3534 : /opt/perl/lib/perl5... would be redundant.
3535 : The default "style" setting is made in installstyle.U
3536 case "$installstyle" in
3537 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3538 *) set dflt privlib lib/$version ;;
3543 There are some auxiliary files for $package that need to be put into a
3544 private library directory that is accessible by everyone.
3548 rp='Pathname where the private library files will reside?'
3551 privlibexp="$ansexp"
3552 : Change installation prefix, if necessary.
3553 if $test X"$prefix" != X"$installprefix"; then
3554 installprivlib=`echo $privlibexp | sed 's#^$prefix#$installprefix#'`
3556 installprivlib="$privlibexp"
3559 : set the prefixup variable, to restore leading tilda escape
3560 prefixup='case "$prefixexp" in
3562 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3565 : determine where public architecture dependent libraries go
3568 : privlib default is /usr/local/lib/$package/$version
3569 : archlib default is /usr/local/lib/$package/$version/$archname
3570 : privlib may have an optional trailing /share.
3571 tdflt=`echo $privlib | $sed 's,/share$,,'`
3572 tdflt=$tdflt/$archname
3581 $spackage contains architecture-dependent library files. If you are
3582 sharing libraries in a heterogeneous environment, you might store
3583 these files in a separate location. Otherwise, you can just include
3584 them with the rest of the public library files.
3588 rp='Where do you want to put the public architecture-dependent libraries?'
3591 archlibexp="$ansexp"
3592 if $test X"$archlib" = X"$privlib"; then
3597 : Change installation prefix, if necessary.
3598 if $test X"$prefix" != X"$installprefix"; then
3599 installarchlib=`echo $archlibexp | sed 's#^$prefix#$installprefix#'`
3601 installarchlib="$archlibexp"
3605 : Binary compatibility with 5.005 is not possible for builds
3606 : with advanced features
3607 case "$usethreads$usemultiplicity" in
3609 bincompat5005="$undef"
3610 d_bincompat5005="$undef"
3614 Perl 5.006 can be compiled for binary compatibility with 5.005.
3615 If you decide to do so, you will be able to continue using most
3616 of the extensions that were compiled for Perl 5.005.
3619 case "$bincompat5005$d_bincompat5005" in
3620 *"$undef"*) dflt=n ;;
3623 rp='Binary compatibility with Perl 5.005?'
3626 y*) val="$define" ;;
3631 case "$d_bincompat5005" in
3633 bincompat5005="$define"
3635 *) bincompat5005="$undef"
3636 d_bincompat5005="$undef"
3643 : see if setuid scripts can be secure
3646 Some kernels have a bug that prevents setuid #! scripts from being
3647 secure. Some sites have disabled setuid #! scripts because of this.
3649 First let's decide if your kernel supports secure setuid #! scripts.
3650 (If setuid #! scripts would be secure but have been disabled anyway,
3651 don't say that they are secure if asked.)
3656 if $test -d /dev/fd; then
3657 echo "#!$ls" >reflect
3658 chmod +x,u+s reflect
3659 ./reflect >flect 2>&1
3660 if $contains "/dev/fd" flect >/dev/null; then
3661 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3665 If you are not sure if they are secure, I can check but I'll need a
3666 username and password different from the one you are using right now.
3667 If you don't have such a username or don't want me to test, simply
3671 rp='Other username to test security of setuid scripts with?'
3676 case "$d_suidsafe" in
3677 '') echo "I'll assume setuid scripts are *not* secure." >&4
3680 echo "Well, the $hint value is *not* secure." >&4
3682 *) echo "Well, the $hint value *is* secure." >&4
3687 $rm -f reflect flect
3688 echo "#!$ls" >reflect
3689 chmod +x,u+s reflect
3692 echo '"su" will (probably) prompt you for '"$ans's password."
3693 su $ans -c './reflect >flect'
3694 if $contains "/dev/fd" flect >/dev/null; then
3695 echo "Okay, it looks like setuid scripts are secure." >&4
3698 echo "I don't think setuid scripts are secure." >&4
3703 rp='Does your kernel have *secure* setuid scripts?'
3706 [yY]*) val="$define";;
3711 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3712 echo "(That's for file descriptors, not floppy disks.)"
3718 $rm -f reflect flect
3720 : now see if they want to do setuid emulation
3723 case "$d_suidsafe" in
3726 echo "No need to emulate SUID scripts since they are secure here." >& 4
3730 Some systems have disabled setuid scripts, especially systems where
3731 setuid scripts cannot be secure. On systems where setuid scripts have
3732 been disabled, the setuid/setgid bits on scripts are currently
3733 useless. It is possible for $package to detect those bits and emulate
3734 setuid/setgid in a secure fashion. This emulation will only work if
3735 setuid scripts have been disabled in your kernel.
3739 "$define") dflt=y ;;
3742 rp="Do you want to do setuid/setgid emulation?"
3745 [yY]*) val="$define";;
3753 : What should the include directory be ?
3755 $echo $n "Hmm... $c"
3759 if $test -f /bin/mips && /bin/mips; then
3760 echo "Looks like a MIPS system..."
3761 $cat >usr.c <<'EOCP'
3762 #ifdef SYSTYPE_BSD43
3766 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3767 dflt='/bsd43/usr/include'
3771 mips_type='System V'
3773 $rm -f usr.c usr.out
3774 echo "and you're compiling with the $mips_type compiler and libraries."
3778 echo "Doesn't look like a MIPS system."
3788 case "$xxx_prompt" in
3791 rp='Where are the include files you want to use?'
3799 : see how we invoke the C preprocessor
3801 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3802 cat <<'EOT' >testcpp.c
3808 if test ! -f cppstdin; then
3809 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3810 # AIX cc -E doesn't show the absolute headerfile
3811 # locations but we'll cheat by using the -M flag.
3812 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
3814 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3817 echo "Keeping your $hint cppstdin wrapper."
3820 wrapper=`pwd`/cppstdin
3824 if $test "X$cppstdin" != "X" && \
3825 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3826 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3828 echo "You used to use $cppstdin $cppminus so we'll use that again."
3830 '') echo "But let's see if we can live without a wrapper..." ;;
3832 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3835 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3838 echo "(However, $cpprun $cpplast does not work, let's see...)"
3846 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3853 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3854 $cc -E <testcpp.c >testcpp.out 2>&1; \
3855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3856 echo "Yup, it does."
3859 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3860 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3862 echo "Yup, it does."
3865 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3866 $cc -P <testcpp.c >testcpp.out 2>&1; \
3867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3868 echo "Yipee, that works!"
3871 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3872 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3874 echo "At long last!"
3877 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3878 $cpp <testcpp.c >testcpp.out 2>&1; \
3879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3883 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3884 $cpp - <testcpp.c >testcpp.out 2>&1; \
3885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3886 echo "Hooray, it works! I was beginning to wonder."
3889 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3890 $wrapper <testcpp.c >testcpp.out 2>&1; \
3891 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3897 rp="No dice. I can't find a C preprocessor. Name one:"
3901 $x_cpp <testcpp.c >testcpp.out 2>&1
3902 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3903 echo "OK, that will do." >&4
3905 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3920 echo "Perhaps can we force $cc -E using a wrapper..."
3921 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3928 echo "Nope, we'll have to live without it..."
3942 "$wrapper"|'cppstdin') ;;
3943 *) $rm -f $wrapper;;
3945 $rm -f testcpp.c testcpp.out
3947 : Set private lib path
3950 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3955 '') dlist="$loclibpth $plibpth $glibpth";;
3956 *) dlist="$libpth";;
3959 : Now check and see which directories actually exist, avoiding duplicates
3963 if $test -d $xxx; then
3966 *) libpth="$libpth $xxx";;
3972 Some systems have incompatible or broken versions of libraries. Among
3973 the directories listed in the question below, please remove any you
3974 know not to be holding relevant libraries, and add any that are needed.
3975 Say "none" for none.
3986 rp="Directories to use for library searches?"
3993 : compute shared library extension
3996 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4006 On some systems, shared libraries may be available. Answer 'none' if
4007 you want to suppress searching of shared libraries for the remaining
4008 of this configuration.
4011 rp='What is the file extension used for shared libraries?'
4015 : Define several unixisms.
4016 : Hints files or command line option can be used to override them.
4017 : The convoluted testing is in case hints files set either the old
4020 '') case "$exe_ext" in
4022 *) _exe="$exe_ext" ;;
4027 '') case "$lib_ext" in
4034 '') case "$obj_ext" in
4041 '') case "$path_sep" in
4052 : Which makefile gets called first. This is used by make depend.
4053 case "$firstmakefile" in
4054 '') firstmakefile='makefile';;
4059 Perl can be built to use the SOCKS proxy protocol library. To do so,
4060 Configure must be run with -Dusesocks.
4062 Normally you do not need this and you should answer no.
4066 $define|true|[yY]*) dflt='y';;
4069 rp='Build Perl for SOCKS?'
4072 y|Y) val="$define" ;;
4078 : Looking for optional libraries
4080 echo "Checking for optional libraries..." >&4
4085 case "$libswanted" in
4086 '') libswanted='c_s';;
4090 libswanted="$libswanted socks5 socks5_sh"
4093 for thislib in $libswanted; do
4095 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4096 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4097 echo "Found -l$thislib (shared)."
4100 *) dflt="$dflt -l$thislib";;
4102 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4103 echo "Found -l$thislib (shared)."
4106 *) dflt="$dflt -l$thislib";;
4108 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4109 echo "Found -l$thislib."
4112 *) dflt="$dflt -l$thislib";;
4114 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4115 echo "Found -l$thislib."
4118 *) dflt="$dflt -l$thislib";;
4120 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4121 echo "Found -l${thislib}_s."
4124 *) dflt="$dflt -l${thislib}_s";;
4126 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4127 echo "Found -l$thislib."
4130 *) dflt="$dflt -l$thislib";;
4133 echo "No -l$thislib."
4144 ' '|'') dflt='none';;
4149 In order to compile $package on your machine, a number of libraries
4150 are usually needed. Include any other special libraries here as well.
4151 Say "none" for none. The default list is almost always right.
4155 rp="What libraries to use?"
4162 : determine optimize, if desired, or use for debug flag also
4164 ' '|$undef) dflt='none';;
4166 *) dflt="$optimize";;
4170 Some C compilers have problems with their optimizers. By default, $package
4171 compiles with the -O flag to use the optimizer. Alternately, you might want
4172 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4173 systems). Either flag can be specified here. To use neither flag, specify
4177 rp="What optimizer/debugger flag should be used?"
4181 'none') optimize=" ";;
4185 : We will not override a previous value, but we might want to
4186 : augment a hint file
4189 case "$gccversion" in
4190 1*) dflt='-fpcc-struct-return' ;;
4193 *-g*) dflt="$dflt -DDEBUGGING";;
4195 case "$gccversion" in
4196 2*) if test -d /etc/conf/kconfig.d &&
4197 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4206 case "$mips_type" in
4207 *BSD*|'') inclwanted="$locincpth $usrinc";;
4208 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4210 for thisincl in $inclwanted; do
4211 if $test -d $thisincl; then
4212 if $test x$thisincl != x$usrinc; then
4215 *) dflt="$dflt -I$thisincl";;
4221 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4223 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4231 *) dflt="$dflt -D$2";;
4235 set signal.h LANGUAGE_C; eval $inctest
4239 ccflags="$ccflags -DSOCKS"
4244 none|recommended) dflt="$ccflags $dflt" ;;
4245 *) dflt="$ccflags";;
4253 Your C compiler may want other flags. For this question you should include
4254 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4255 but you should NOT include libraries or ld flags like -lwhatever. If you
4256 want $package to honor its debug switch, you should include -DDEBUGGING here.
4257 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4259 To use no flags, specify the word "none".
4265 rp="Any additional cc flags?"
4272 : the following weeds options from ccflags that are of no interest to cpp
4274 case "$gccversion" in
4275 1*) cppflags="$cppflags -D__GNUC__"
4277 case "$mips_type" in
4279 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4285 echo "Let me guess what the preprocessor flags are..." >&4
4299 *) ftry="$previous $flag";;
4301 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4302 >cpp1.out 2>/dev/null && \
4303 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4304 >cpp2.out 2>/dev/null && \
4305 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4306 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4308 cppflags="$cppflags $ftry"
4318 *-*) echo "They appear to be: $cppflags";;
4320 $rm -f cpp.c cpp?.out
4324 : flags used in final linking phase
4326 '') if ./venix; then
4332 *-posix*) dflt="$dflt -posix" ;;
4335 *) dflt="$ldflags";;
4338 : Try to guess additional flags to pick up local libraries.
4339 for thislibdir in $libpth; do
4340 case " $loclibpth " in
4343 *"-L$thislibdir "*) ;;
4344 *) dflt="$dflt -L$thislibdir" ;;
4356 Your C linker may need flags. For this question you should
4357 include -L/whatever and any other flags used by the C linker, but you
4358 should NOT include libraries like -lwhatever.
4360 Make sure you include the appropriate -L/path flags if your C linker
4361 does not normally search all of the directories you specified above,
4364 To use no flags, specify the word "none".
4368 rp="Any additional ld flags (NOT including libraries)?"
4374 rmlist="$rmlist pdp11"
4378 echo "Checking your choice of C compiler and flags for coherency..." >&4
4379 $cat > try.c <<'EOF'
4381 int main() { printf("Ok\n"); exit(0); }
4383 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4385 $cat >try.msg <<'EOM'
4386 I've tried to compile and run the following simple program:
4389 $cat try.c >> try.msg
4391 $cat >> try.msg <<EOM
4398 and I got the following output:
4402 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4403 if sh -c './try' >>try.msg 2>&1; then
4407 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4410 cat >> try.msg <<'EOQS'
4411 If $libs contains -lsfio, and sfio is mis-configured, then it
4412 sometimes (apparently) runs and exits with a 0 status, but with no
4413 output! It may have to do with sfio's use of _exit vs. exit.
4416 rp="You have a big problem. Shall I abort Configure"
4423 echo "The program compiled OK, but exited with status $?." >>try.msg
4424 rp="You have a problem. Shall I abort Configure"
4428 echo "I can't compile the test program." >>try.msg
4429 rp="You have a BIG problem. Shall I abort Configure"
4435 case "$knowitall" in
4437 echo "(The supplied flags or libraries might be incorrect.)"
4445 *) echo "Ok. Stopping Configure." >&4
4450 n) echo "OK, that should do.";;
4452 $rm -f try try.* core
4454 : determine filename position in cpp output
4456 echo "Computing filename position in cpp output for #include directives..." >&4
4457 echo '#include <stdio.h>' > foo.c
4460 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4461 $grep '^[ ]*#.*stdio\.h' | \
4462 while read cline; do
4465 while $test \$# -gt 0; do
4466 if $test -r \`echo \$1 | $tr -d '"'\`; then
4471 pos=\`expr \$pos + 1\`
4483 *) pos="${fieldn}th";;
4485 echo "Your cpp writes the filename in the $pos field of the line."
4487 : locate header file
4492 for usrincdir in $usrinc
4494 if test -f \$usrincdir/\$wanted; then
4495 echo "\$usrincdir/\$wanted"
4499 awkprg='{ print \$$fieldn }'
4500 echo "#include <\$wanted>" > foo\$\$.c
4501 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4502 $grep "^[ ]*#.*\$wanted" | \
4503 while read cline; do
4504 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4506 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4507 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4512 # status = 0: grep returned 0 lines, case statement not executed
4513 # status = 1: headerfile found
4514 # status = 2: while loop executed, no headerfile found
4518 if test \$status -eq 1; then
4525 : define an alternate in-header-list? function
4526 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4527 cont=true; xxf="echo \"<\$1> found.\" >&4";
4528 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4529 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4531 case $# in 4) instead=instead;; *) instead="at last";; esac;
4532 while $test "$cont"; do
4534 var=$2; eval "was=\$$2";
4535 if $test "$xxx" && $test -r "$xxx";
4537 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4540 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4541 set $yyy; shift; shift; yyy=$@;
4542 case $# in 0) cont="";;
4543 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4544 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4545 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4546 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4550 do set $yyy; var=$2; eval "was=\$$2";
4551 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4552 set $yyy; shift; shift; yyy=$@;
4555 : see if this is a malloc.h system
4556 set malloc.h i_malloc
4559 : see if stdlib is available
4560 set stdlib.h i_stdlib
4563 : determine which malloc to compile in
4565 case "$usemymalloc" in
4566 ''|[yY]*|true|$define) dflt='y' ;;
4569 rp="Do you wish to attempt to use the malloc that comes with $package?"
4575 mallocsrc='malloc.c'
4576 mallocobj="malloc$_o"
4577 d_mymalloc="$define"
4580 : Remove malloc from list of libraries to use
4581 echo "Removing unneeded -lmalloc from library list" >&4
4582 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4585 echo "libs = $libs" >&4
4597 : compute the return types of malloc and free
4599 $cat >malloc.c <<END
4603 #include <sys/types.h>
4617 case "$malloctype" in
4619 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4626 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4630 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4637 echo "Your system uses $freetype free(), it would seem." >&4
4641 The installation process will also create a directory for
4642 vendor-supplied add-ons. Vendors who supply perl with their system
4643 may find it convenient to place all vendor-supplied files in this
4644 directory rather than in the main distribution directory. This will
4645 ease upgrades between binary-compatible maintenance versions of perl.
4647 Of course you may also use these directories in whatever way you see
4648 fit. For example, you might use them to access modules shared over a
4649 company-wide network.
4651 The default answer should be fine for most people.
4652 This causes further questions about vendor add-ons to be skipped
4653 and no vendor-specific directories will be configured for perl.
4656 rp='Do you want to configure vendor-specific add-on directories?'
4657 case "$usevendorprefix" in
4658 define|true|[yY]*) dflt=y ;;
4664 rp='Installation prefix to use for vendor-supplied add-ons?'
4665 case "$vendorprefix" in
4667 *) dflt=$vendorprefix ;;
4671 case "$vendorprefix" in
4675 *) oldvendorprefix="$prefix";;
4679 usevendorprefix="$define"
4681 vendorprefixexp="$ansexp"
4683 *) usevendorprefix="$undef"
4689 case "$vendorprefix" in
4690 '') d_vendorlib="$undef"
4694 *) d_vendorlib="$define"
4695 : determine where vendor-supplied modules go.
4696 : Usual default is /usr/local/lib/perl5/vendor_perl
4697 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4698 case "$installstyle" in
4699 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4700 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4703 rp='Pathname for the vendor-supplied library files?'
4706 vendorlibexp="$ansexp"
4707 : Change installation prefix, if necessary.
4708 if $test X"$prefix" != X"$installprefix"; then
4709 installvendorlib=`echo $vendorlibexp | $sed 's#^$prefix#$installprefix#'`
4711 installvendorlib="$vendorlibexp"
4716 : Cruising for prototypes
4718 echo "Checking out function prototypes..." >&4
4719 $cat >prototype.c <<'EOCP'
4720 int main(int argc, char *argv[]) {
4723 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4724 echo "Your C compiler appears to support function prototypes."
4727 echo "Your C compiler doesn't seem to understand function prototypes."
4734 case "$prototype" in
4736 *) ansi2knr='ansi2knr'
4741 This version of $package can only be compiled by a compiler that
4742 understands function prototypes. Unfortunately, your C compiler
4744 doesn't seem to understand them. Sorry about that.
4746 If GNU cc is available for your system, perhaps you could try that instead.
4748 Eventually, we hope to support building Perl with pre-ANSI compilers.
4749 If you would like to help in that effort, please contact <perlbug@perl.org>.
4751 Aborting Configure now.
4757 : determine where public executables go
4762 rp='Pathname where the public executables will reside?'
4764 if $test "X$ansexp" != "X$binexp"; then
4769 : Change installation prefix, if necessary.
4770 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4771 if $test X"$prefix" != X"$installprefix"; then
4772 installbin=`echo $binexp | sed 's#^$prefix#$installprefix#'`
4774 installbin="$binexp"
4777 : determine whether to install perl also as /usr/bin/perl
4780 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4782 Many scripts expect to perl to be installed as /usr/bin/perl.
4783 I can install the perl you are about to compile also as /usr/bin/perl
4784 (in addition to $installbin/perl).
4786 case "$installusrbinperl" in
4787 "$undef"|[nN]*) dflt='n';;
4790 rp="Do you want to install perl as /usr/bin/perl?"
4793 [yY]*) val="$define";;
4799 set installusrbinperl
4802 : define a shorthand compile call
4806 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4807 : define a shorthand compile call for compilations that should be ok.
4811 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4814 echo "Checking for GNU C Library..." >&4
4815 cat >gnulibc.c <<EOM
4827 if eval $compile_ok && ./gnulibc; then
4829 echo "You are using the GNU C Library"
4832 echo "You are not using the GNU C Library"
4838 : see if nm is to be used to determine whether a symbol is defined or not
4842 case "$d_gnulibc" in
4845 echo "nm probably won't work on the GNU C Library." >&4
4851 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4853 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4854 echo "'nm' won't be sufficient on this sytem." >&4
4860 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4861 if $test $dflt -gt 20; then
4871 true|$define) dflt=y;;
4878 I can use $nm to extract the symbols from your C libraries. This
4879 is a time consuming task which may generate huge output on the disk (up
4880 to 3 megabytes) but that should make the symbols extraction faster. The
4881 alternative is to skip the 'nm' extraction part and to compile a small
4882 test program instead to determine whether each symbol is present. If
4883 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4884 this may be the best solution.
4886 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4889 rp="Shall I use $nm to extract C symbols from the libraries?"
4892 [Nn]*) usenm=false;;
4901 : nm options which may be necessary
4903 '') if $test -f /mach_boot; then
4905 elif $test -d /usr/ccs/lib; then
4906 nm_opt='-p' # Solaris (and SunOS?)
4907 elif $test -f /dgux; then
4909 elif $test -f /lib64/rld; then
4910 nm_opt='-p' # 64-bit Irix
4916 : nm options which may be necessary for shared libraries but illegal
4917 : for archive libraries. Thank you, Linux.
4918 case "$nm_so_opt" in
4919 '') case "$myuname" in
4921 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4922 nm_so_opt='--dynamic'
4931 : get list of predefined functions in a handy place
4936 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4943 *) for thislib in $libs; do
4946 : Handle C library specially below.
4949 thislib=`echo $thislib | $sed -e 's/^-l//'`
4950 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4952 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4954 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4956 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4958 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4960 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4962 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4967 libnames="$libnames $try"
4969 *) libnames="$libnames $thislib" ;;
4978 for xxx in $libpth; do
4979 $test -r $1 || set $xxx/libc.$so
4980 : The messy sed command sorts on library version numbers.
4982 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4983 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4985 s/[0-9][0-9]*/0000&/g
4986 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4989 sort | $sed -e 's/^.* //'`
4992 $test -r $1 || set /usr/ccs/lib/libc.$so
4993 $test -r $1 || set /lib/libsys_s$_a
4999 if $test -r "$1"; then
5000 echo "Your (shared) C library seems to be in $1."
5002 elif $test -r /lib/libc && $test -r /lib/clib; then
5003 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5005 libc='/lib/clib /lib/libc'
5006 if $test -r /lib/syslib; then
5007 echo "(Your math library is in /lib/syslib.)"
5008 libc="$libc /lib/syslib"
5010 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5011 echo "Your C library seems to be in $libc, as you said before."
5012 elif $test -r $incpath/usr/lib/libc$_a; then
5013 libc=$incpath/usr/lib/libc$_a;
5014 echo "Your C library seems to be in $libc. That's fine."
5015 elif $test -r /lib/libc$_a; then
5017 echo "Your C library seems to be in $libc. You're normal."
5019 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5021 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5022 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5023 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5025 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5027 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5030 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5032 if $test -r "$tans"; then
5033 echo "Your C library seems to be in $tans, of all places."
5039 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5043 If the guess above is wrong (which it might be if you're using a strange
5044 compiler, or your machine supports multiple models), you can override it here.
5049 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5051 I can't seem to find your C library. I've looked in the following places:
5054 $sed 's/^/ /' libpath
5057 None of these seems to contain your C library. I need to get its name...
5062 rp='Where is your C library?'
5067 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5068 set X `cat libnames`
5071 case $# in 1) xxx=file; esac
5072 echo "Extracting names from the following $xxx for later perusal:" >&4
5074 $sed 's/^/ /' libnames >&4
5076 $echo $n "This may take a while...$c" >&4
5080 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5081 *) $nm $nm_opt $file 2>/dev/null;;
5086 $grep fprintf libc.tmp > libc.ptf
5087 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5088 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5090 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5092 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5094 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5096 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5098 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5100 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5102 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5104 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5106 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5108 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5110 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5112 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5114 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5115 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5117 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5119 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5121 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5123 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5125 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5127 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5129 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5131 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5133 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5135 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5137 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5139 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5141 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5143 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5145 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5148 $nm -p $* 2>/dev/null >libc.tmp
5149 $grep fprintf libc.tmp > libc.ptf
5150 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5151 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5157 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5159 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5160 for thisname in $libnames $libc; do
5161 $ar t $thisname >>libc.tmp
5163 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5165 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5166 # Repeat libc to extract forwarders to DLL entries too
5167 for thisname in $libnames $libc; do
5168 $ar tv $thisname >>libc.tmp
5169 # Revision 50 of EMX has bug in $ar.
5170 # it will not extract forwarders to DLL entries
5171 # Use emximp which will extract exactly them.
5172 emximp -o tmp.imp $thisname \
5174 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5175 < tmp.imp >>libc.tmp
5178 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5181 echo "$ar didn't seem to work right." >&4
5182 echo "Maybe this is a Cray...trying bld instead..." >&4
5183 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5185 for thisname in $libnames; do
5187 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5188 $ar t $thisname >>libc.tmp
5192 echo "That didn't work either. Giving up." >&4
5199 if $test -f /lib/syscalls.exp; then
5201 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5202 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5206 $rm -f libnames libpath
5208 : see if dld is available
5212 : is a C symbol defined?
5215 -v) tf=libc.tmp; tc=""; tdc="";;
5216 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5217 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5220 case "$reuseval-$4" in
5222 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5228 if $contains $tlook $tf >/dev/null 2>&1;
5233 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5234 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5242 $define) tval=true;;
5248 : define an is-in-libc? function
5249 inlibc='echo " "; td=$define; tu=$undef;
5250 sym=$1; var=$2; eval "was=\$$2";
5252 case "$reuseval$was" in
5262 echo "$sym() found." >&4;
5263 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5265 echo "$sym() NOT found." >&4;
5266 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5270 $define) echo "$sym() found." >&4;;
5271 *) echo "$sym() NOT found." >&4;;
5275 : see if dlopen exists
5282 : determine which dynamic loading, if any, to compile in
5284 dldir="ext/DynaLoader"
5297 $define) dflt='y' ;;
5300 $define) dflt='y' ;;
5302 : Does a dl_xxx.xs file exist for this operating system
5303 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5306 rp="Do you wish to use dynamic loading?"
5313 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5314 dflt="$dldir/dl_${osname}.xs"
5315 elif $test "$d_dlopen" = "$define" ; then
5316 dflt="$dldir/dl_dlopen.xs"
5317 elif $test "$i_dld" = "$define" ; then
5318 dflt="$dldir/dl_dld.xs"
5323 *) dflt="$dldir/$dlsrc"
5326 echo "The following dynamic loading files are available:"
5327 : Can not go over to $dldir because getfile has path hard-coded in.
5328 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5329 rp="Source file to use for dynamic loading"
5335 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5339 Some systems may require passing special flags to $cc -c to
5340 compile modules that will be used to create a shared library.
5341 To use no flags, say "none".
5344 case "$cccdlflags" in
5345 '') case "$gccversion" in
5346 '') case "$osname" in
5348 next) dflt='none' ;;
5349 irix*) dflt='-KPIC' ;;
5350 svr4*|esix*|solaris) dflt='-KPIC' ;;
5351 sunos) dflt='-pic' ;;
5355 *) case "$osname" in
5356 svr4*|esix*|solaris) dflt='-fPIC' ;;
5361 *) dflt="$cccdlflags" ;;
5363 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5366 none) cccdlflags=' ' ;;
5367 *) cccdlflags="$ans" ;;
5372 Some systems use ld to create libraries that can be dynamically loaded,
5373 while other systems (such as those using ELF) use $cc.
5377 '') $cat >try.c <<'EOM'
5378 /* Test for whether ELF binaries are produced */
5383 int i = open("a.out",O_RDONLY);
5386 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5387 exit(0); /* succeed (yes, it's ELF) */
5392 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5394 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5398 echo "I'll use ld to build dynamic libraries."
5407 rp="What command should be used to create dynamic libraries?"
5413 Some systems may require passing special flags to $ld to create a
5414 library that can be dynamically loaded. If your ld flags include
5415 -L/other/path options to locate libraries outside your loader's normal
5416 search path, you may need to specify those -L options here as well. To
5417 use no flags, say "none".
5420 case "$lddlflags" in
5421 '') case "$osname" in
5422 beos) dflt='-nostart' ;;
5424 linux|irix*) dflt='-shared' ;;
5425 next) dflt='none' ;;
5426 solaris) dflt='-G' ;;
5427 sunos) dflt='-assert nodefinitions' ;;
5428 svr4*|esix*) dflt="-G $ldflags" ;;
5432 *) dflt="$lddlflags" ;;
5435 : Try to guess additional flags to pick up local libraries.
5436 : Be careful not to append to a plain 'none'
5440 for thisflag in $ldflags; do
5445 *) dflt="$dflt $thisflag" ;;
5452 ''|' ') dflt='none' ;;
5455 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5458 none) lddlflags=' ' ;;
5459 *) lddlflags="$ans" ;;
5464 Some systems may require passing special flags to $cc to indicate that
5465 the resulting executable will use dynamic linking. To use no flags,
5469 case "$ccdlflags" in
5470 '') case "$osname" in
5471 hpux) dflt='-Wl,-E' ;;
5472 linux) dflt='-rdynamic' ;;
5473 next) dflt='none' ;;
5474 sunos) dflt='none' ;;
5478 *) dflt="$ccdlflags" ;;
5480 rp="Any special flags to pass to $cc to use dynamic loading?"
5483 none) ccdlflags=' ' ;;
5484 *) ccdlflags="$ans" ;;
5498 # No dynamic loading being used, so don't bother even to prompt.
5501 *) case "$useshrplib" in
5502 '') case "$osname" in
5503 svr4*|dgux|dynixptx|esix|powerux|beos)
5505 also='Building a shared libperl is required for dynamic loading to work on your system.'
5510 also='Building a shared libperl is needed for MAB support.'
5528 The perl executable is normally obtained by linking perlmain.c with
5529 libperl${_a}, any static extensions (usually just DynaLoader), and
5530 any other libraries needed on this system (such as -lm, etc.). Since
5531 your system supports dynamic loading, it is probably possible to build
5532 a shared libperl.$so. If you will have more than one executable linked
5533 to libperl.$so, this will significantly reduce the size of each
5534 executable, but it may have a noticeable affect on performance. The
5535 default is probably sensible for your system.
5539 rp="Build a shared libperl.$so (y/n)"
5543 useshrplib='true' ;;
5544 *) useshrplib='false' ;;
5549 case "$useshrplib" in
5553 # Figure out a good name for libperl.so. Since it gets stored in
5554 # a version-specific architecture-dependent library, the version
5555 # number isn't really that important, except for making cc/ld happy.
5557 # A name such as libperl.so.3.1
5558 majmin="libperl.$so.$patchlevel.$subversion"
5559 # A name such as libperl.so.301
5560 majonly=`echo $patchlevel $subversion |
5561 $awk '{printf "%d%02d", $1, $2}'`
5562 majonly=libperl.$so.$majonly
5563 # I'd prefer to keep the os-specific stuff here to a minimum, and
5564 # rely on figuring it out from the naming of libc.
5565 case "${osname}${osvers}" in
5568 # XXX How handle the --version stuff for MAB?
5570 linux*) # ld won't link with a bare -lperl otherwise.
5573 *) # Try to guess based on whether libc has major.minor.
5575 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5576 *libc.$so.[0-9]*) dflt=$majonly ;;
5577 *) dflt=libperl.$so ;;
5587 I need to select a good name for the shared libperl. If your system uses
5588 library names with major and minor numbers, then you might want something
5589 like $majmin. Alternatively, if your system uses a single version
5590 number for shared libraries, then you might want to use $majonly.
5591 Or, your system might be quite happy with a simple libperl.$so.
5593 Since the shared libperl will get installed into a version-specific
5594 architecture-dependent directory, the version number of the shared perl
5595 library probably isn't important, so the default should be o.k.
5598 rp='What name do you want to give to the shared libperl?'
5601 echo "Ok, I'll use $libperl"
5604 libperl="libperl${_a}"
5608 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5612 WARNING: Use of the shrpdir variable for the installation location of
5613 the shared $libperl is not supported. It was never documented and
5614 will not work in this version. Let me (perlbug@perl.com)
5615 know of any problems this may cause.
5621 But your current setting of $shrpdir is
5622 the default anyway, so it's harmless.
5627 Further, your current attempted setting of $shrpdir
5628 conflicts with the value of $archlibexp/CORE
5629 that installperl will use.
5636 # How will the perl executable find the installed shared $libperl?
5637 # Add $xxx to ccdlflags.
5638 # If we can't figure out a command-line option, use $shrpenv to
5639 # set env LD_RUN_PATH. The main perl makefile uses this.
5640 shrpdir=$archlibexp/CORE
5643 if "$useshrplib"; then
5646 # We'll set it in Makefile.SH...
5652 xxx="-Wl,-R$shrpdir"
5654 linux|irix*|dec_osf)
5655 xxx="-Wl,-rpath,$shrpdir"
5658 # next doesn't like the default...
5661 # beos doesn't like the default, either.
5664 # hpux doesn't like the default, either.
5665 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5668 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5674 # Only add $xxx if it isn't already in ccdlflags.
5675 case " $ccdlflags " in
5677 *) ccdlflags="$ccdlflags $xxx"
5680 Adding $xxx to the flags
5681 passed to $ld so that the perl executable will find the
5682 installed shared $libperl.
5690 # Fix ccdlflags in AIX for building external extensions.
5691 # (For building Perl itself bare -bE:perl.exp is needed,
5692 # Makefile.SH takes care of this.)
5694 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5696 # Respect a hint or command-line value.
5698 '') shrpenv="$tmp_shrpenv" ;;
5700 case "$ldlibpthname" in
5701 '') ldlibpthname=LD_LIBRARY_PATH ;;
5702 none) ldlibpthname='' ;;
5705 : determine where manual pages go
5706 set man1dir man1dir none
5710 $spackage has manual pages available in source form.
5714 echo "However, you don't have nroff, so they're probably useless to you."
5716 '') man1dir="none";;
5719 echo "If you don't want the manual sources installed, answer 'none'."
5724 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5725 lookpath="$lookpath $prefixexp/man/p_man/man1"
5726 lookpath="$lookpath $prefixexp/man/u_man/man1"
5727 lookpath="$lookpath $prefixexp/man/man.1"
5729 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5730 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5740 rp="Where do the main $spackage manual pages (source) go?"
5742 if $test "X$man1direxp" != "X$ansexp"; then
5746 man1direxp="$ansexp"
5752 : Change installation prefix, if necessary.
5753 if $test X"$prefix" != X"$installprefix"; then
5754 installman1dir=`echo $man1direxp | $sed 's#^$prefix#$installprefix#'`
5756 installman1dir="$man1direxp"
5759 : What suffix to use on installed man pages
5766 rp="What suffix should be used for the main $spackage man pages?"
5768 '') case "$man1dir" in
5782 *) dflt="$man1ext";;
5789 : see if we can have long filenames
5791 rmlist="$rmlist /tmp/cf$$"
5792 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5793 first=123456789abcdef
5794 second=/tmp/cf$$/$first
5795 $rm -f $first $second
5796 if (echo hi >$first) 2>/dev/null; then
5797 if $test -f 123456789abcde; then
5798 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5801 if (echo hi >$second) 2>/dev/null; then
5802 if $test -f /tmp/cf$$/123456789abcde; then
5804 That's peculiar... You can have filenames longer than 14 characters, but only
5805 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5806 I shall consider your system cannot support long filenames at all.
5810 echo 'You can have filenames longer than 14 characters.' >&4
5815 How confusing! Some of your filesystems are sane enough to allow filenames
5816 longer than 14 characters but some others like /tmp can't even think about them.
5817 So, for now on, I shall assume your kernel does not allow them at all.
5824 You can't have filenames longer than 14 chars. You can't even think about them!
5830 $rm -rf /tmp/cf$$ 123456789abcde*
5832 : determine where library module manual pages go
5833 set man3dir man3dir none
5837 $spackage has manual pages for many of the library modules.
5843 However, you don't have nroff, so they're probably useless to you.
5846 '') man3dir="none";;
5850 case "$d_flexfnam" in
5853 However, your system can't handle the long file names like File::Basename.3.
5856 '') man3dir="none";;
5860 echo "If you don't want the manual sources installed, answer 'none'."
5861 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5863 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5864 if $test -d "$privlib/man/man3"; then
5867 WARNING: Previous versions of perl installed man3 pages into
5868 $privlib/man/man3. This version will suggest a
5869 new default of $dflt.
5873 rp='Do you wish to preserve the old behavior?(y/n)'
5876 y*) dflt="$privlib/man/man3" ;;
5882 *) dflt="$man3dir" ;;
5886 rp="Where do the $package library man pages (source) go?"
5889 man3direxp="$ansexp"
5895 : Change installation prefix, if necessary.
5896 if $test X"$prefix" != X"$installprefix"; then
5897 installman3dir=`echo $man3direxp | $sed 's#^$prefix#$installprefix#'`
5899 installman3dir="$man3direxp"
5902 : What suffix to use on installed man pages
5908 rp="What suffix should be used for the $package library man pages?"
5910 '') case "$man3dir" in
5924 *) dflt="$man3ext";;
5931 : see if we have to deal with yellow pages, now NIS.
5932 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5933 if $test -f /usr/etc/nibindd; then
5935 echo "I'm fairly confident you're on a NeXT."
5937 rp='Do you get the hosts file via NetInfo?'
5946 y*) hostcat='nidump hosts .';;
5947 *) case "$hostcat" in
5948 nidump*) hostcat='';;
5958 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5966 rp='Are you getting the hosts file via yellow pages?'
5969 y*) hostcat='ypcat hosts';;
5970 *) hostcat='cat /etc/hosts';;
5976 '') hostcat='cat /etc/hosts';;
5979 '') groupcat='cat /etc/group';;
5982 '') passcat='cat /etc/passwd';;
5985 : now get the host name
5987 echo "Figuring out host name..." >&4
5988 case "$myhostname" in
5990 echo 'Maybe "hostname" will work...'
5991 if tans=`sh -c hostname 2>&1` ; then
5999 if $test "$cont"; then
6001 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6002 if tans=`cat /etc/systemid 2>&1` ; then
6004 phostname='cat /etc/systemid'
6005 echo "Whadyaknow. Xenix always was a bit strange..."
6008 elif $test -r /etc/systemid; then
6009 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6012 if $test "$cont"; then
6013 echo 'No, maybe "uuname -l" will work...'
6014 if tans=`sh -c 'uuname -l' 2>&1` ; then
6016 phostname='uuname -l'
6018 echo 'Strange. Maybe "uname -n" will work...'
6019 if tans=`sh -c 'uname -n' 2>&1` ; then
6021 phostname='uname -n'
6023 echo 'Oh well, maybe I can mine it out of whoami.h...'
6024 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6025 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6026 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6028 case "$myhostname" in
6029 '') echo "Does this machine have an identity crisis or something?"
6032 echo "Well, you said $myhostname before..."
6033 phostname='echo $myhostname';;
6039 : you do not want to know about this
6044 if $test "$myhostname" ; then
6046 rp='Your host name appears to be "'$myhostname'".'" Right?"
6054 : bad guess or no guess
6055 while $test "X$myhostname" = X ; do
6057 rp="Please type the (one word) name of your host:"
6062 : translate upper to lower if necessary
6063 case "$myhostname" in
6065 echo "(Normalizing case in your host name)"
6066 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6070 case "$myhostname" in
6072 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6073 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6074 echo "(Trimming domain name from host name--host name is now $myhostname)"
6076 *) case "$mydomain" in
6079 test "X$hostcat" = "Xypcat hosts" &&
6080 ypmatch "$myhostname" hosts 2>/dev/null |\
6081 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6084 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6085 /[ ]$myhostname[ . ]/p" > hosts
6088 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6089 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6090 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6091 hosts | $sort | $uniq | \
6092 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6093 case `$echo X$dflt` in
6094 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6097 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6102 tans=`./loc resolv.conf X /etc /usr/etc`
6103 if $test -f "$tans"; then
6104 echo "(Attempting domain name extraction from $tans)"
6105 dflt=.`$sed -n -e 's/ / /g' \
6106 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6107 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6109 .) dflt=.`$sed -n -e 's/ / /g' \
6110 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6111 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6118 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6119 dflt=.`sh -c domainname 2>/dev/null`
6122 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6127 .) echo "(Lost all hope -- silly guess then)"
6133 *) dflt="$mydomain";;
6137 rp="What is your domain name?"
6147 : translate upper to lower if necessary
6150 echo "(Normalizing case in your domain name)"
6151 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6155 : a little sanity check here
6156 case "$phostname" in
6159 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6160 $myhostname$mydomain|$myhostname) ;;
6162 case "$phostname" in
6164 echo "(That doesn't agree with your whoami.h file, by the way.)"
6167 echo "(That doesn't agree with your $phostname command, by the way.)"
6177 I need to get your e-mail address in Internet format if possible, i.e.
6178 something like user@host.domain. Please answer accurately since I have
6179 no easy means to double check it. The default value provided below
6180 is most probably close to the reality but may not be valid from outside
6181 your organization...
6185 while test "$cont"; do
6187 '') dflt="$cf_by@$myhostname$mydomain";;
6188 *) dflt="$cf_email";;
6190 rp='What is your e-mail address?'
6196 rp='Address does not look like an Internet one. Use it anyway?'
6212 If you or somebody else will be maintaining perl at your site, please
6213 fill in the correct e-mail address here so that they may be contacted
6214 if necessary. Currently, the "perlbug" program included with perl
6215 will send mail to this address in addition to perlbug@perl.com. You may
6216 enter "none" for no administrator.
6219 case "$perladmin" in
6220 '') dflt="$cf_email";;
6221 *) dflt="$perladmin";;
6223 rp='Perl administrator e-mail address'
6227 : figure out how to guarantee perl startup
6228 case "$startperl" in
6230 case "$sharpbang" in
6234 I can use the #! construct to start perl on your system. This will
6235 make startup of perl scripts faster, but may cause problems if you
6236 want to share those scripts and perl is not in a standard place
6237 ($binexp/perl) on all your platforms. The alternative is to force
6238 a shell by starting the script with a single ':' character.
6242 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6245 none) startperl=": # use perl";;
6246 *) startperl="#!$ans"
6247 if $test 30 -lt `echo "$ans" | wc -c`; then
6250 WARNING: Some systems limit the #! command to 32 characters.
6251 If you experience difficulty running Perl scripts with #!, try
6252 installing Perl in a directory with a shorter pathname.
6258 *) startperl=": # use perl"
6263 echo "I'll use $startperl to start perl scripts."
6265 : figure best path for perl in scripts
6268 perlpath="$binexp/perl"
6269 case "$startperl" in
6274 I will use the "eval 'exec'" idiom to start Perl on your system.
6275 I can use the full path of your Perl binary for this purpose, but
6276 doing so may cause problems if you want to share those scripts and
6277 Perl is not always in a standard place ($binexp/perl).
6281 rp="What path shall I use in \"eval 'exec'\"?"
6288 case "$startperl" in
6290 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6293 : determine where public executable scripts go
6294 set scriptdir scriptdir
6296 case "$scriptdir" in
6299 : guess some guesses
6300 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6301 $test -d /usr/share/bin && dflt=/usr/share/bin
6302 $test -d /usr/local/script && dflt=/usr/local/script
6303 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6304 $test -d $prefixexp/script && dflt=$prefixexp/script
6308 *) dflt="$scriptdir"
6313 Some installations have a separate directory just for executable scripts so
6314 that they can mount it across multiple architectures but keep the scripts in
6315 one spot. You might, for example, have a subdirectory of /usr/share for this.
6316 Or you might just lump your scripts in with all your other executables.
6320 rp='Where do you keep publicly executable scripts?'
6322 if $test "X$ansexp" != "X$scriptdirexp"; then
6326 scriptdirexp="$ansexp"
6327 : Change installation prefix, if necessary.
6328 if $test X"$prefix" != X"$installprefix"; then
6329 installscript=`echo $scriptdirexp | sed 's#^$prefix#$installprefix#'`
6331 installscript="$scriptdirexp"
6336 After $package is installed, you may wish to install various
6337 add-on modules and utilities. Typically, these add-ons will
6338 be installed under $prefix with the rest
6339 of this package. However, you may wish to install such add-ons
6340 elsewhere under a different prefix.
6342 If you do not wish to put everything under a single prefix, that's
6343 ok. You will be prompted for the individual locations; this siteprefix
6344 is only used to suggest the defaults.
6346 The default should be fine for most people.
6350 rp='Installation prefix to use for add-on modules and utilities?'
6351 : XXX Here might be another good place for an installstyle setting.
6352 case "$siteprefix" in
6354 *) dflt=$siteprefix ;;
6358 case "$siteprefix" in
6363 *) oldsiteprefix="$prefix";;
6368 siteprefixexp="$ansexp"
6370 : determine where site specific libraries go.
6371 : Usual default is /usr/local/lib/perl5/site_perl
6372 : The default "style" setting is made in installstyle.U
6373 : XXX No longer works with Prefixit stuff.
6374 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6375 case "$installstyle" in
6376 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6377 *) dflt=$siteprefix/lib/site_$prog ;;
6381 The installation process will create a directory for
6382 site-specific extensions and modules. Most users find it convenient
6383 to place all site-specific files in this directory rather than in the
6384 main distribution directory.
6388 rp='Pathname for the site-specific library files?'
6391 sitelibexp="$ansexp"
6392 : Change installation prefix, if necessary.
6393 if $test X"$prefix" != X"$installprefix"; then
6394 installsitelib=`echo $sitelibexp | sed 's#^$prefix#$installprefix#'`
6396 installsitelib="$sitelibexp"
6399 : determine where site specific architecture-dependent libraries go.
6400 : sitelib default is /usr/local/lib/perl5/site_perl/
6401 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6402 : sitelib may have an optional trailing /share.
6403 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6404 tdflt="$tdflt/$apiversion/$archname"
6405 set sitearch sitearch none
6408 '') dflt="$tdflt" ;;
6409 *) dflt="$sitearch" ;;
6413 The installation process will also create a directory for
6414 architecture-dependent site-specific extensions and modules.
6418 rp='Pathname for the site-specific architecture-dependent library files?'
6421 sitearchexp="$ansexp"
6422 : Change installation prefix, if necessary.
6423 if $test X"$prefix" != X"$installprefix"; then
6424 installsitearch=`echo $sitearchexp | sed 's#^$prefix#$installprefix#'`
6426 installsitearch="$sitearchexp"
6431 Perl can be built to take advantage of long doubles which
6432 (if available) may give more accuracy and range for floating point
6433 numbers. To do so, Configure must be run with -Duselongdouble.
6435 If this doesn't make any sense to you, just accept the default 'n'.
6437 case "$uselongdouble" in
6438 $define|true|[yY]*) dflt='y';;
6441 rp='Try to use long doubles if available?'
6446 ccflags="$ccflags -DUSE_LONG_DOUBLE"
6455 case "$uselongdouble" in
6456 "$define"|true|[yY]*)
6457 : Look for a hint-file generated 'call-back-unit'. If the
6458 : user has specified that long doubles should be used,
6459 : we may need to set or change some other defaults.
6460 if $test -f uselongdouble.cbu; then
6461 echo "Your platform has some specific hints for long doubles, using them..."
6462 . ./uselongdouble.cbu
6465 (Your platform doesn't have any specific hints for long doubles.)
6473 Previous version of $package used the standard IO mechanisms as defined
6474 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6475 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6476 the default. This abstraction layer can use AT&T's sfio (if you already
6477 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6478 problems with some extension modules. Using PerlIO with stdio is safe,
6479 but it is slower than plain stdio and therefore is not the default.
6481 If this doesn't make any sense to you, just accept the default 'n'.
6483 case "$useperlio" in
6484 $define|true|[yY]*) dflt='y';;
6487 rp='Use the experimental PerlIO abstraction layer?'
6494 echo "Ok, doing things the stdio way"
6501 : Check how to convert floats to strings.
6502 if test "X$d_Gconvert" = X; then
6504 echo "Checking for an efficient way to convert floats to strings."
6507 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6508 char *myname = "gconvert";
6511 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6512 char *myname = "gcvt";
6515 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6516 char *myname = "sprintf";
6522 checkit(expect, got)
6526 if (strcmp(expect, got)) {
6527 printf("%s oddity: Expected %s, got %s\n",
6528 myname, expect, got);
6538 /* This must be 1st test on (which?) platform */
6539 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6540 Gconvert(0.1, 8, 0, buf);
6541 checkit("0.1", buf);
6543 Gconvert(1.0, 8, 0, buf);
6546 Gconvert(0.0, 8, 0, buf);
6549 Gconvert(-1.0, 8, 0, buf);
6552 /* Some Linux gcvt's give 1.e+5 here. */
6553 Gconvert(100000.0, 8, 0, buf);
6554 checkit("100000", buf);
6556 /* Some Linux gcvt's give -1.e+5 here. */
6557 Gconvert(-100000.0, 8, 0, buf);
6558 checkit("-100000", buf);
6563 case "$d_Gconvert" in
6564 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6565 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6566 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6567 *) xxx_list='gconvert gcvt sprintf' ;;
6570 for xxx_convert in $xxx_list; do
6571 echo "Trying $xxx_convert"
6573 set try -DTRY_$xxx_convert
6574 if eval $compile; then
6575 echo "$xxx_convert" found. >&4
6577 echo "I'll use $xxx_convert to convert floats into a string." >&4
6580 echo "...But $xxx_convert didn't work as I expected."
6583 echo "$xxx_convert NOT found." >&4
6587 case "$xxx_convert" in
6588 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6589 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6590 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6594 : see if inttypes.h is available
6595 : we want a real compile instead of Inhdr because some systems
6596 : have an inttypes.h which includes non-existent headers
6599 #include <inttypes.h>
6601 static int32_t foo32 = 0x12345678;
6605 if eval $compile; then
6606 echo "<inttypes.h> found." >&4
6609 echo "<inttypes.h> NOT found." >&4
6617 case "$use64bits" in
6620 echo $n "Checking to see if your system supports int64_t...$c" >&4
6622 #include <sys/types.h>
6623 #$i_inttypes I_INTTYPES
6625 #include <inttypes.h>
6627 int64_t foo() { int64_t x; x = 7; return x; }
6629 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6631 echo " Yup, it does." >&4
6634 echo " Nope, it doesn't." >&4
6645 : check for lengths of integral types
6649 echo "Checking to see how big your integers are..." >&4
6650 $cat >intsize.c <<'EOCP'
6654 printf("intsize=%d;\n", sizeof(int));
6655 printf("longsize=%d;\n", sizeof(long));
6656 printf("shortsize=%d;\n", sizeof(short));
6661 if eval $compile_ok && ./intsize > /dev/null; then
6663 echo "Your integers are $intsize bytes long."
6664 echo "Your long integers are $longsize bytes long."
6665 echo "Your short integers are $shortsize bytes long."
6669 Help! I can't compile and run the intsize test program: please enlighten me!
6670 (This is probably a misconfiguration in your system or libraries, and
6671 you really ought to fix it. Still, I'll try anyway.)
6675 rp="What is the size of an integer (in bytes)?"
6679 rp="What is the size of a long integer (in bytes)?"
6683 rp="What is the size of a short integer (in bytes)?"
6689 $rm -f intsize intsize.*
6691 : check for long long
6693 echo $n "Checking to see if your system supports long long...$c" >&4
6694 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6695 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6697 echo " Yup, it does." >&4
6700 echo " Nope, it doesn't." >&4
6706 : check for length of long long
6707 case "${d_longlong}${longlongsize}" in
6710 $echo $n "Checking to see how big your long longs are...$c" >&4
6711 $cat >try.c <<'EOCP'
6715 printf("%d\n", sizeof(long long));
6719 if eval $compile_ok; then
6720 longlongsize=`./try`
6721 $echo " $longlongsize bytes." >&4
6725 echo "(I can't seem to compile the test program. Guessing...)"
6726 rp="What is the size of a long long (in bytes)?"
6730 if $test "X$longsize" = "X$longlongsize"; then
6731 echo "(That isn't any different from an ordinary long.)"
6739 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6741 echo "Checking how to print 64-bit integers..." >&4
6743 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6745 $cat >try.c <<'EOCP'
6746 #include <sys/types.h>
6749 int q = 12345678901;
6754 if eval $compile; then
6758 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6759 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6760 echo "We will use %d."
6766 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6768 $cat >try.c <<'EOCP'
6769 #include <sys/types.h>
6772 long q = 12345678901;
6777 if eval $compile; then
6781 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6782 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6783 echo "We will use %ld."
6789 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6791 $cat >try.c <<'EOCP'
6792 #include <sys/types.h>
6793 #include <inttypes.h>
6796 int64_t q = 12345678901;
6797 printf("%" PRId64 "\n", q);
6801 if eval $compile; then
6805 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6806 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6807 echo "We will use the C9X style."
6813 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6815 $cat >try.c <<'EOCP'
6816 #include <sys/types.h>
6819 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6820 printf("%lld\n", q);
6824 if eval $compile; then
6828 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6829 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6830 echo "We will use the %lld style."
6836 if $test X"$sPRId64" = X -a X"$quad" != X; then
6838 #include <sys/types.h>
6841 $quad q = 12345678901;
6846 if eval $compile; then
6850 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6851 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6852 echo "We will use %lld."
6858 if $test X"$sPRId64" = X -a X"$quad" != X; then
6860 #include <sys/types.h>
6863 $quad q = 12345678901;
6868 if eval $compile; then
6872 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6873 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6874 echo "We will use %qd."
6880 if $test X"$sPRId64" = X; then
6881 echo "Cannot figure out how to print 64-bit integers." >&4
6886 fi # intsize -o longsize -o d_int64t -o d_longlong
6889 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6890 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6892 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6893 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6897 : check for length of double
6899 case "$doublesize" in
6901 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6902 $cat >try.c <<'EOCP'
6906 printf("%d\n", sizeof(double));
6910 if eval $compile_ok; then
6912 $echo " $doublesize bytes." >&4
6915 echo "(I can't seem to compile the test program. Guessing...)"
6916 rp="What is the size of a double precision number (in bytes)?"
6924 : check for long doubles
6926 echo $n "Checking to see if your system supports long doubles...$c" >&4
6927 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6928 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6930 echo " Yup, it does." >&4
6933 echo " Nope, it doesn't." >&4
6939 : check for length of long double
6940 case "${d_longdbl}${longdblsize}" in
6943 $echo $n "Checking to see how big your long doubles are...$c" >&4
6944 $cat >try.c <<'EOCP'
6948 printf("%d\n", sizeof(long double));
6952 if eval $compile; then
6954 $echo " $longdblsize bytes." >&4
6958 echo "(I can't seem to compile the test program. Guessing...)" >&4
6959 rp="What is the size of a long double (in bytes)?"
6963 if $test "X$doublesize" = "X$longdblsize"; then
6964 echo "(That isn't any different from an ordinary double.)"
6972 if $test X"$d_longdbl" = X"$define"; then
6974 echo "Checking how to print long doubles..." >&4
6976 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6977 $cat >try.c <<'EOCP'
6978 #include <sys/types.h>
6982 printf("%.3f\n", d);
6986 if eval $compile; then
6990 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6991 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6992 echo "We will use %f."
6998 if $test X"$sPRIfldbl" = X; then
6999 $cat >try.c <<'EOCP'
7000 #include <sys/types.h>
7003 long double d = 123.456;
7004 printf("%.3llf\n", d);
7008 if eval $compile; then
7012 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7013 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7014 echo "We will use %llf."
7020 if $test X"$sPRIfldbl" = X; then
7021 $cat >try.c <<'EOCP'
7022 #include <sys/types.h>
7025 long double d = 123.456;
7026 printf("%.3Lf\n", d);
7030 if eval $compile; then
7034 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7035 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7036 echo "We will use %Lf."
7042 if $test X"$sPRIfldbl" = X; then
7043 $cat >try.c <<'EOCP'
7044 #include <sys/types.h>
7047 long double d = 123.456;
7048 printf("%.3lf\n", d);
7052 if eval $compile; then
7056 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7057 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7058 echo "We will use %lf."
7064 if $test X"$sPRIfldbl" = X; then
7065 echo "Cannot figure out how to print long doubles." >&4
7072 case "$sPRIfldbl" in
7073 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7074 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7076 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7077 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7081 : Initialize h_fcntl
7084 : Initialize h_sysfile
7087 : access call always available on UNIX
7091 : locate the flags for 'access()'
7095 $cat >access.c <<'EOCP'
7096 #include <sys/types.h>
7101 #include <sys/file.h>
7110 : check sys/file.h first, no particular reason here
7111 if $test `./findhdr sys/file.h` && \
7112 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7114 echo "<sys/file.h> defines the *_OK access constants." >&4
7115 elif $test `./findhdr fcntl.h` && \
7116 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7118 echo "<fcntl.h> defines the *_OK access constants." >&4
7119 elif $test `./findhdr unistd.h` && \
7120 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7121 echo "<unistd.h> defines the *_OK access constants." >&4
7123 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7129 : see if accessx exists
7130 set accessx d_accessx
7133 : see if alarm exists
7137 : see if atolf exists
7141 : see if atoll exists
7145 : Look for GNU-cc style attribute checking
7147 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7148 $cat >attrib.c <<'EOCP'
7150 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7152 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7153 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7154 echo "Your C compiler doesn't fully support __attribute__."
7157 echo "Your C compiler supports __attribute__."
7161 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7168 : see if bcmp exists
7172 : see if bcopy exists
7176 : see if this is a unistd.h system
7177 set unistd.h i_unistd
7180 : see if getpgrp exists
7181 set getpgrp d_getpgrp
7184 case "$d_getpgrp" in
7187 echo "Checking to see which flavor of getpgrp is in use..."
7190 #include <sys/types.h>
7192 # include <unistd.h>
7196 if (getuid() == 0) {
7197 printf("(I see you are running Configure as super-user...)\n");
7201 if (getpgrp(1) == 0)
7210 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7211 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7213 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7214 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7217 echo "I can't seem to compile and run the test program."
7219 xxx="a USG one, i.e. you use getpgrp()."
7221 # SVR4 systems can appear rather BSD-ish.
7224 xxx="a BSD one, i.e. you use getpgrp(pid)."
7228 xxx="probably a USG one, i.e. you use getpgrp()."
7233 echo "Assuming your getpgrp is $xxx" >&4
7242 : see if setpgrp exists
7243 set setpgrp d_setpgrp
7246 case "$d_setpgrp" in
7249 echo "Checking to see which flavor of setpgrp is in use..."
7252 #include <sys/types.h>
7254 # include <unistd.h>
7258 if (getuid() == 0) {
7259 printf("(I see you are running Configure as super-user...)\n");
7263 if (-1 == setpgrp(1, 1))
7266 if (setpgrp() != -1)
7272 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7273 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7275 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7276 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7279 echo "(I can't seem to compile and run the test program.)"
7281 xxx="a USG one, i.e. you use setpgrp()."
7283 # SVR4 systems can appear rather BSD-ish.
7286 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7290 xxx="probably a USG one, i.e. you use setpgrp()."
7295 echo "Assuming your setpgrp is $xxx" >&4
7303 : see if bzero exists
7307 : see if signal is declared as pointer to function returning int or void
7309 xxx=`./findhdr signal.h`
7310 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7311 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7312 echo "You have int (*signal())() instead of void." >&4
7314 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7315 echo "You have void (*signal())()." >&4
7317 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7318 echo "You have int (*signal())() instead of void." >&4
7320 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7321 echo "You have void (*signal())()." >&4
7324 case "$d_voidsig" in
7326 echo "I can't determine whether signal handler returns void or int..." >&4
7328 rp="What type does your signal handler return?"
7335 echo "As you already told me, signal handler returns void." >&4
7338 *) echo "As you already told me, signal handler returns int." >&4
7345 case "$d_voidsig" in
7346 "$define") signal_t="void";;
7351 : check for ability to cast large floats to 32-bit ints.
7353 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7354 if $test "$intsize" -ge 4; then
7361 #include <sys/types.h>
7363 $signal_t blech(s) int s; { exit(3); }
7370 signal(SIGFPE, blech);
7372 /* Don't let compiler optimize the test away. Store the number
7373 in a writable string for gcc to pass to sscanf under HP/UX.
7375 sprintf(str, "2147483647");
7376 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7380 /* x86 processors will probably give 0x8000 0000, which is a
7381 sign change. We don't want that. We want to mimic SPARC
7382 behavior here, which is to preserve the sign and give
7385 if (i32 != ($xxx) f)
7391 if eval $compile_ok; then
7395 echo "(I can't seem to compile the test program--assuming it can't)"
7403 echo "Nope, it can't."
7410 : check for ability to cast negative floats to unsigned
7412 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7415 #include <sys/types.h>
7417 $signal_t blech(s) int s; { exit(7); }
7418 $signal_t blech_in_list(s) int s; { exit(4); }
7419 unsigned long dummy_long(p) unsigned long p; { return p; }
7420 unsigned int dummy_int(p) unsigned int p; { return p; }
7421 unsigned short dummy_short(p) unsigned short p; { return p; }
7425 unsigned long along;
7427 unsigned short ashort;
7431 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7432 a direct f = -123. assignment. gcc-2.8.0 reportedly
7433 optimized the whole file away
7435 /* Store the number in a writable string for gcc to pass to
7438 sprintf(str, "-123");
7439 sscanf(str, "%lf", &f); /* f = -123.; */
7441 signal(SIGFPE, blech);
7442 along = (unsigned long)f;
7443 aint = (unsigned int)f;
7444 ashort = (unsigned short)f;
7445 if (along != (unsigned long)-123)
7447 if (aint != (unsigned int)-123)
7449 if (ashort != (unsigned short)-123)
7451 sprintf(str, "1073741824.");
7452 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7455 along = (unsigned long)f;
7456 if (along != 0x80000000)
7460 along = (unsigned long)f;
7461 if (along != 0x7fffffff)
7465 along = (unsigned long)f;
7466 if (along != 0x80000001)
7470 signal(SIGFPE, blech_in_list);
7471 sprintf(str, "123.");
7472 sscanf(str, "%lf", &f); /* f = 123.; */
7473 along = dummy_long((unsigned long)f);
7474 aint = dummy_int((unsigned int)f);
7475 ashort = dummy_short((unsigned short)f);
7476 if (along != (unsigned long)123)
7478 if (aint != (unsigned int)123)
7480 if (ashort != (unsigned short)123)
7487 if eval $compile_ok; then
7491 echo "(I can't seem to compile the test program--assuming it can't)"
7494 case "$castflags" in
7499 echo "Nope, it can't."
7506 : see if vprintf exists
7508 if set vprintf val -f d_vprintf; eval $csym; $val; then
7509 echo 'vprintf() found.' >&4
7511 $cat >vprintf.c <<'EOF'
7512 #include <varargs.h>
7514 int main() { xxx("foo"); }
7523 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7527 if eval $compile && ./vprintf; then
7528 echo "Your vsprintf() returns (int)." >&4
7531 echo "Your vsprintf() returns (char*)." >&4
7535 echo 'vprintf() NOT found.' >&4
7545 : see if chown exists
7549 : see if chroot exists
7553 : see if chsize exists
7557 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7558 while $test $# -ge 2; do
7560 $define) echo "#include <$2>";;
7564 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7565 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7574 : see if this is a sys/uio.h system
7575 set sys/uio.h i_sysuio
7578 echo "Checking to see if your system supports struct iovec..." >&4
7579 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7581 case "$d_iovec_s" in
7582 "$define") echo "Yup, it does." >&4
7584 *) echo "Nope, it doesn't." >&4
7590 : see whether socket exists
7592 $echo $n "Hmm... $c" >&4
7593 if set socket val -f d_socket; eval $csym; $val; then
7594 echo "Looks like you have Berkeley networking support." >&4
7596 if set setsockopt val -f; eval $csym; $val; then
7599 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7603 if $contains socklib libc.list >/dev/null 2>&1; then
7604 echo "Looks like you have Berkeley networking support." >&4
7606 : we will have to assume that it supports the 4.2 BSD interface
7609 echo "You don't have Berkeley networking in libc$_a..." >&4
7610 if test "X$d_socket" = "X$define"; then
7611 echo "...but you seem to believe that you have sockets." >&4
7613 for net in net socket
7615 if test -f /usr/lib/lib$net$_a; then
7616 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7617 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7618 if $contains socket libc.list >/dev/null 2>&1; then
7623 echo "...but the Wollongong group seems to have hacked it in." >&4
7624 sockethdr="-I/usr/netinclude"
7627 echo "Found Berkeley sockets interface in lib$net." >& 4
7628 if $contains setsockopt libc.list >/dev/null 2>&1; then
7631 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7638 if test "X$d_socket" != "X$define"; then
7639 echo "or anywhere else I see." >&4
7647 : see if socketpair exists
7648 set socketpair d_sockpair
7653 echo "Checking the availability of certain socket constants..." >& 4
7654 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7655 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7657 #include <sys/types.h>
7658 #include <sys/socket.h>
7664 set try; if eval $compile; then
7667 set d_${enum}; eval $setvar
7671 set sendmsg d_sendmsg
7674 set recvmsg d_recvmsg
7678 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7679 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7681 case "$d_msghdr_s" in
7682 "$define") echo "Yup, it does." >&4
7684 *) echo "Nope, it doesn't." >&4
7688 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7689 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7691 case "$d_cmsghdr_s" in
7692 "$define") echo "Yup, it does." >&4
7694 *) echo "Nope, it doesn't." >&4
7698 : check for const keyword
7700 echo 'Checking to see if your C compiler knows about "const"...' >&4
7701 $cat >const.c <<'EOCP'
7702 typedef struct spug { int drokk; } spug;
7709 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7711 echo "Yup, it does."
7714 echo "Nope, it doesn't."
7719 : see if crypt exists
7721 if set crypt val -f d_crypt; eval $csym; $val; then
7722 echo 'crypt() found.' >&4
7726 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7727 if $test -z "$cryptlib"; then
7728 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7732 if $test -z "$cryptlib"; then
7733 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7737 if $test -z "$cryptlib"; then
7738 cryptlib=`./loc libcrypt$_a "" $libpth`
7742 if $test -z "$cryptlib"; then
7743 echo 'crypt() NOT found.' >&4
7752 : get csh whereabouts
7754 'csh') val="$undef" ;;
7759 : Respect a hint or command line value for full_csh.
7761 '') full_csh=$csh ;;
7764 : see if cuserid exists
7765 set cuserid d_cuserid
7768 : see if this is a limits.h system
7769 set limits.h i_limits
7772 : see if this is a float.h system
7776 : See if number of significant digits in a double precision number is known
7778 $cat >dbl_dig.c <<EOM
7788 printf("Contains DBL_DIG");
7791 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7792 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7793 echo "DBL_DIG found." >&4
7796 echo "DBL_DIG NOT found." >&4
7803 : see if difftime exists
7804 set difftime d_difftime
7807 : see if this is a dirent system
7809 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7811 echo "<dirent.h> found." >&4
7814 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7815 echo "<sys/dir.h> found." >&4
7818 xinc=`./findhdr sys/ndir.h`
7820 echo "<dirent.h> NOT found." >&4
7825 : Look for type of directory structure.
7827 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7829 case "$direntrytype" in
7832 $define) guess1='struct dirent' ;;
7833 *) guess1='struct direct' ;;
7836 *) guess1="$direntrytype"
7841 'struct dirent') guess2='struct direct' ;;
7842 *) guess2='struct dirent' ;;
7845 if $contains "$guess1" try.c >/dev/null 2>&1; then
7846 direntrytype="$guess1"
7847 echo "Your directory entries are $direntrytype." >&4
7848 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7849 direntrytype="$guess2"
7850 echo "Your directory entries seem to be $direntrytype." >&4
7852 echo "I don't recognize your system's directory entries." >&4
7853 rp="What type is used for directory entries on this system?"
7861 : see if the directory entry stores field length
7863 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7864 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7865 echo "Good, your directory entry keeps length information in d_namlen." >&4
7868 echo "Your directory entry does not know about the d_namlen field." >&4
7875 : see if dlerror exists
7878 set dlerror d_dlerror
7882 : see if dlfcn is available
7890 On a few systems, the dynamically loaded modules that perl generates and uses
7891 will need a different extension than shared libs. The default will probably
7899 rp='What is the extension of dynamically loaded modules'
7908 : Check if dlsym need a leading underscore
7914 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7915 $cat >dyna.c <<'EOM'
7924 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7926 #include <sys/types.h>
7940 int mode = RTLD_LAZY ;
7942 handle = dlopen("./dyna.$dlext", mode) ;
7943 if (handle == NULL) {
7948 symbol = dlsym(handle, "fred") ;
7949 if (symbol == NULL) {
7950 /* try putting a leading underscore */
7951 symbol = dlsym(handle, "_fred") ;
7952 if (symbol == NULL) {
7965 : Call the object file tmp-dyna.o in case dlext=o.
7966 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7967 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7968 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7969 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7972 1) echo "Test program failed using dlopen." >&4
7973 echo "Perhaps you should not use dynamic loading." >&4;;
7974 2) echo "Test program failed using dlsym." >&4
7975 echo "Perhaps you should not use dynamic loading." >&4;;
7976 3) echo "dlsym needs a leading underscore" >&4
7978 4) echo "dlsym doesn't need a leading underscore." >&4;;
7981 echo "I can't compile and run the test program." >&4
7982 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7987 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7992 hasproto='varname=$1; func=$2; shift; shift;
7993 while $test $# -ge 2; do
7995 $define) echo "#include <$2>";;
7999 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8000 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8001 echo "$func() prototype found.";
8004 echo "$func() prototype NOT found.";
8009 $rm -f try.c tryout.c'
8011 : see if prototype for drand48 is available
8013 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8016 : see if dup2 exists
8020 : see if eaccess exists
8021 set eaccess d_eaccess
8024 : see if endgrent exists
8025 set endgrent d_endgrent
8028 : see if endhostent exists
8029 set endhostent d_endhent
8032 : see if endnetent exists
8033 set endnetent d_endnent
8036 : see if endprotoent exists
8037 set endprotoent d_endpent
8040 : see if endpwent exists
8041 set endpwent d_endpwent
8044 : see if endservent exists
8045 set endservent d_endsent
8048 : see if endspent exists
8049 set endspent d_endspent
8052 : Locate the flags for 'open()'
8054 $cat >open3.c <<'EOCP'
8055 #include <sys/types.h>
8060 #include <sys/file.h>
8071 : check sys/file.h first to get FREAD on Sun
8072 if $test `./findhdr sys/file.h` && \
8073 set open3 -DI_SYS_FILE && eval $compile; then
8075 echo "<sys/file.h> defines the O_* constants..." >&4
8077 echo "and you have the 3 argument form of open()." >&4
8080 echo "but not the 3 argument form of open(). Oh, well." >&4
8083 elif $test `./findhdr fcntl.h` && \
8084 set open3 -DI_FCNTL && eval $compile; then
8086 echo "<fcntl.h> defines the O_* constants..." >&4
8088 echo "and you have the 3 argument form of open()." >&4
8091 echo "but not the 3 argument form of open(). Oh, well." >&4
8096 echo "I can't find the O_* constant definitions! You got problems." >&4
8102 : check for non-blocking I/O stuff
8103 case "$h_sysfile" in
8104 true) echo "#include <sys/file.h>" > head.c;;
8107 true) echo "#include <fcntl.h>" > head.c;;
8108 *) echo "#include <sys/fcntl.h>" > head.c;;
8113 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8114 case "$o_nonblock" in
8117 $cat >>try.c <<'EOCP'
8120 printf("O_NONBLOCK\n");
8124 printf("O_NDELAY\n");
8128 printf("FNDELAY\n");
8135 if eval $compile_ok; then
8137 case "$o_nonblock" in
8138 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8139 *) echo "Seems like we can use $o_nonblock.";;
8142 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8145 *) echo "Using $hint value $o_nonblock.";;
8147 $rm -f try try.* .out core
8150 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8156 #include <sys/types.h>
8158 #define MY_O_NONBLOCK $o_nonblock
8159 #ifndef errno /* XXX need better Configure test */
8162 $signal_t blech(x) int x; { exit(3); }
8164 $cat >> try.c <<'EOCP'
8172 pipe(pd); /* Down: child -> parent */
8173 pipe(pu); /* Up: parent -> child */
8176 close(pd[1]); /* Parent reads from pd[0] */
8177 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8178 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8180 signal(SIGALRM, blech);
8182 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8184 sprintf(string, "%d\n", ret);
8185 write(2, string, strlen(string));
8188 if (errno == EAGAIN) {
8194 if (errno == EWOULDBLOCK)
8195 printf("EWOULDBLOCK\n");
8198 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8199 sleep(2); /* Give it time to close our pipe */
8201 ret = read(pd[0], buf, 1); /* Should read EOF */
8203 sprintf(string, "%d\n", ret);
8204 write(3, string, strlen(string));
8208 close(pd[0]); /* We write to pd[1] */
8209 close(pu[1]); /* We read from pu[0] */
8210 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8211 close(pd[1]); /* Pipe pd is now fully closed! */
8212 exit(0); /* Bye bye, thank you for playing! */
8216 if eval $compile_ok; then
8217 echo "$startsh" >mtry
8218 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8220 ./mtry >/dev/null 2>&1
8222 0) eagain=`$cat try.out`;;
8223 1) echo "Could not perform non-blocking setting!";;
8224 2) echo "I did a successful read() for something that was not there!";;
8225 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8226 *) echo "Something terribly wrong happened during testing.";;
8228 rd_nodata=`$cat try.ret`
8229 echo "A read() system call with no data present returns $rd_nodata."
8230 case "$rd_nodata" in
8233 echo "(That's peculiar, fixing that to be -1.)"
8239 echo "Forcing errno EAGAIN on read() with no data available."
8243 echo "Your read() sets errno to $eagain when no data is available."
8246 status=`$cat try.err`
8248 0) echo "And it correctly returns 0 to signal EOF.";;
8249 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8250 *) echo "However, your read() returns '$status' on EOF??";;
8253 if test "$status" = "$rd_nodata"; then
8254 echo "WARNING: you can't distinguish between EOF and no data!"
8258 echo "I can't compile the test program--assuming errno EAGAIN will do."
8265 echo "Using $hint value $eagain."
8266 echo "Your read() returns $rd_nodata when no data is present."
8267 case "$d_eofnblk" in
8268 "$define") echo "And you can see EOF because read() returns 0.";;
8269 "$undef") echo "But you can't see EOF status from read() returned value.";;
8271 echo "(Assuming you can't see EOF status from read anyway.)"
8277 $rm -f try try.* .out core head.c mtry
8279 : see if fchmod exists
8283 : see if fchown exists
8287 : see if this is an fcntl system
8291 : see if sys/select.h has to be included
8292 set sys/select.h i_sysselct
8295 : see if we should include time.h, sys/time.h, or both
8297 if test "X$timeincl" = X; then
8298 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8299 $echo $n "I'm now running the test program...$c"
8300 $cat >try.c <<'EOCP'
8301 #include <sys/types.h>
8306 #ifdef SYSTIMEKERNEL
8309 #include <sys/time.h>
8312 #include <sys/select.h>
8321 struct timezone tzp;
8323 if (foo.tm_sec == foo.tm_sec)
8326 if (bar.tv_sec == bar.tv_sec)
8333 for s_timezone in '-DS_TIMEZONE' ''; do
8335 for s_timeval in '-DS_TIMEVAL' ''; do
8336 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8337 for i_time in '' '-DI_TIME'; do
8338 for i_systime in '-DI_SYSTIME' ''; do
8341 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8342 if eval $compile; then
8343 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8347 $echo $n "Succeeded with $flags$c"
8359 *SYSTIMEKERNEL*) i_systimek="$define"
8360 timeincl=`./findhdr sys/time.h`
8361 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8362 *) i_systimek="$undef";;
8365 *I_TIME*) i_time="$define"
8366 timeincl=`./findhdr time.h`" $timeincl"
8367 echo "We'll include <time.h>." >&4;;
8368 *) i_time="$undef";;
8371 *I_SYSTIME*) i_systime="$define"
8372 timeincl=`./findhdr sys/time.h`" $timeincl"
8373 echo "We'll include <sys/time.h>." >&4;;
8374 *) i_systime="$undef";;
8379 : check for fd_set items
8382 Checking to see how well your C compiler handles fd_set and friends ...
8384 $cat >fd_set.c <<EOCP
8385 #$i_systime I_SYS_TIME
8386 #$i_sysselct I_SYS_SELECT
8387 #$d_socket HAS_SOCKET
8388 #include <sys/types.h>
8390 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8393 #include <sys/time.h>
8396 #include <sys/select.h>
8405 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8412 set fd_set -DTRYBITS
8413 if eval $compile; then
8414 d_fds_bits="$define"
8416 echo "Well, your system knows about the normal fd_set typedef..." >&4
8418 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8419 d_fd_macros="$define"
8422 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8424 d_fd_macros="$undef"
8428 Hmm, your compiler has some difficulty with fd_set. Checking further...
8431 if eval $compile; then
8434 echo "Well, your system has some sort of fd_set available..." >&4
8436 echo "and you have the normal fd_set macros." >&4
8437 d_fd_macros="$define"
8440 but not the normal fd_set macros! Gross! More work for me...
8442 d_fd_macros="$undef"
8445 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8448 d_fd_macros="$undef"
8453 : see if fgetpos exists
8454 set fgetpos d_fgetpos
8457 : see if flock exists
8461 : see if fork exists
8465 : see if pathconf exists
8466 set pathconf d_pathconf
8469 : see if fpathconf exists
8470 set fpathconf d_fpathconf
8474 : see if llseek exists
8480 echo $n "Checking to see if your system supports off64_t...$c" >&4
8482 #include <sys/types.h>
8484 off64_t foo() { off64_t x; x = 7; return x; }'
8486 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8488 echo " Yup, it does." >&4
8491 echo " Nope, it doesn't." >&4
8497 : check for fpos64_t
8499 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8501 #include <sys/stdio.h>
8502 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8504 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8506 echo " Yup, it does." >&4
8509 echo " Nope, it doesn't." >&4
8515 : see if fseeko exists
8519 : see if fsetpos exists
8520 set fsetpos d_fsetpos
8524 if $test X"$use64bits" = X"$define"; then
8525 : see if fgetpos64 exists
8526 set fgetpos64 d_fgetpos64
8529 : see if fopen64 exists
8530 set freopen64 d_fopen64
8533 : see if freopen64 exists
8534 set freopen64 d_freopen64
8537 : see if fseek64 exists
8538 set fseek64 d_fseek64
8541 : see if fseeko64 exists
8542 set fseeko64 d_fseeko64
8545 : see if fsetpos64 exists
8546 set fsetpos64 d_fsetpos64
8549 : see if ftell64 exists
8550 set ftell64 d_ftell64
8553 : see if ftello64 exists
8554 set ftello64 d_ftello64
8557 : see if tmpfile64 exists
8558 set tmpfile64 d_tmpfile64
8562 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8569 : see if this is a sys/param system
8570 set sys/param.h i_sysparam
8573 : see if this is a sys/mount.h system
8574 set sys/mount.h i_sysmount
8578 : see if statfs exists
8582 : see if fstatfs exists
8583 set fstatfs d_fstatfs
8586 : see if statfs knows about mount flags
8587 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8591 : see if statvfs exists
8592 set statvfs d_statvfs
8595 : see if fstatvfs exists
8596 set fstatvfs d_fstatvfs
8600 : see if ftello exists
8604 : see if getgrent exists
8605 set getgrent d_getgrent
8608 : see if gethostbyaddr exists
8609 set gethostbyaddr d_gethbyaddr
8612 : see if gethostbyname exists
8613 set gethostbyname d_gethbyname
8616 : see if gethostent exists
8617 set gethostent d_gethent
8620 : see how we will look up host name
8623 if set gethostname val -f d_gethname; eval $csym; $val; then
8624 echo 'gethostname() found.' >&4
8625 d_gethname="$define"
8628 if set uname val -f d_uname; eval $csym; $val; then
8631 uname() was found, but you're running xenix, and older versions of xenix
8632 have a broken uname(). If you don't really know whether your xenix is old
8633 enough to have a broken system call, use the default answer.
8640 rp='Is your uname() broken?'
8643 n*) d_uname="$define"; call=uname;;
8646 echo 'uname() found.' >&4
8653 case "$d_gethname" in
8654 '') d_gethname="$undef";;
8657 '') d_uname="$undef";;
8659 case "$d_uname$d_gethname" in
8664 Every now and then someone has a $call() that lies about the hostname
8665 but can't be fixed for political or economic reasons. If you wish, I can
8666 pretend $call() isn't there and maybe compute hostname at run-time
8667 thanks to the '$phostname' command.
8670 rp="Shall I ignore $call() from now on?"
8673 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8676 case "$phostname" in
8678 *) case "$aphostname" in
8684 file=`./loc $file $file $pth`
8685 aphostname=`echo $file $*`
8690 case "$d_uname$d_gethname" in
8693 case "$phostname" in
8695 echo "There will be no way for $package to get your hostname." >&4;;
8697 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8701 case "$d_phostname" in
8702 '') d_phostname="$undef";;
8705 : see if this is a netdb.h system
8709 : see if prototypes for various gethostxxx netdb.h functions are available
8711 set d_gethostprotos gethostent $i_netdb netdb.h
8714 : see if getlogin exists
8715 set getlogin d_getlogin
8718 : see if getmntent exists
8719 set getmntent d_getmntent
8722 : see if getnetbyaddr exists
8723 set getnetbyaddr d_getnbyaddr
8726 : see if getnetbyname exists
8727 set getnetbyname d_getnbyname
8730 : see if getnetent exists
8731 set getnetent d_getnent
8734 : see if prototypes for various getnetxxx netdb.h functions are available
8736 set d_getnetprotos getnetent $i_netdb netdb.h
8740 : see if getprotobyname exists
8741 set getprotobyname d_getpbyname
8744 : see if getprotobynumber exists
8745 set getprotobynumber d_getpbynumber
8748 : see if getprotoent exists
8749 set getprotoent d_getpent
8752 : see if getpgid exists
8753 set getpgid d_getpgid
8756 : see if getpgrp2 exists
8757 set getpgrp2 d_getpgrp2
8760 : see if getppid exists
8761 set getppid d_getppid
8764 : see if getpriority exists
8765 set getpriority d_getprior
8768 : see if prototypes for various getprotoxxx netdb.h functions are available
8770 set d_getprotoprotos getprotoent $i_netdb netdb.h
8773 : see if getpwent exists
8774 set getpwent d_getpwent
8778 : see if getservbyname exists
8779 set getservbyname d_getsbyname
8782 : see if getservbyport exists
8783 set getservbyport d_getsbyport
8786 : see if getservent exists
8787 set getservent d_getsent
8790 : see if prototypes for various getservxxx netdb.h functions are available
8792 set d_getservprotos getservent $i_netdb netdb.h
8795 : see if getspent exists
8796 set getspent d_getspent
8799 : see if getspnam exists
8800 set getspnam d_getspnam
8803 : see if gettimeofday or ftime exists
8804 set gettimeofday d_gettimeod
8806 case "$d_gettimeod" in
8812 val="$undef"; set d_ftime; eval $setvar
8815 case "$d_gettimeod$d_ftime" in
8818 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8822 : see if this is an grp system
8828 xxx=`./findhdr grp.h`
8829 $cppstdin $cppflags $cppminus < $xxx >$$.h
8831 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8843 set d_grpasswd; eval $setvar
8847 : see if hasmntopt exists
8848 set hasmntopt d_hasmntopt
8851 : see if this is a netinet/in.h or sys/in.h system
8852 set netinet/in.h i_niin sys/in.h i_sysin
8855 : see if arpa/inet.h has to be included
8856 set arpa/inet.h i_arpainet
8859 : see if htonl --and friends-- exists
8864 : Maybe they are macros.
8869 #include <sys/types.h>
8870 #$i_niin I_NETINET_IN
8872 #$i_arpainet I_ARPA_INET
8874 #include <netinet/in.h>
8880 #include <arpa/inet.h>
8883 printf("Defined as a macro.");
8886 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8887 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8889 echo "But it seems to be defined as a macro." >&4
8897 : see which of string.h or strings.h is needed
8899 strings=`./findhdr string.h`
8900 if $test "$strings" && $test -r "$strings"; then
8901 echo "Using <string.h> instead of <strings.h>." >&4
8905 strings=`./findhdr strings.h`
8906 if $test "$strings" && $test -r "$strings"; then
8907 echo "Using <strings.h> instead of <string.h>." >&4
8909 echo "No string header found -- You'll surely have problems." >&4
8915 "$undef") strings=`./findhdr strings.h`;;
8916 *) strings=`./findhdr string.h`;;
8921 if set index val -f; eval $csym; $val; then
8922 if set strchr val -f d_strchr; eval $csym; $val; then
8923 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8926 echo "strchr() found." >&4
8930 echo "index() found." >&4
8935 echo "index() found." >&4
8938 if set strchr val -f d_strchr; eval $csym; $val; then
8941 echo "strchr() found." >&4
8943 echo "No index() or strchr() found!" >&4
8948 set d_strchr; eval $setvar
8950 set d_index; eval $setvar
8952 : check whether inet_aton exists
8953 set inet_aton d_inetaton
8958 $cat >isascii.c <<'EOCP'
8970 if eval $compile; then
8971 echo "isascii() found." >&4
8974 echo "isascii() NOT found." >&4
8981 : see if killpg exists
8985 : see if lchown exists
8987 $cat > try.c <<'EOCP'
8988 /* System header to define __stub macros and hopefully few prototypes,
8989 which can conflict with char lchown(); below. */
8991 /* Override any gcc2 internal prototype to avoid an error. */
8992 /* We use char because int might match the return type of a gcc2
8993 builtin and then its argument prototype would still apply. */
8996 /* The GNU C library defines this for functions which it implements
8997 to always fail with ENOSYS. Some functions are actually named
8998 something starting with __ and the normal name is an alias. */
8999 #if defined (__stub_lchown) || defined (__stub___lchown)
9007 if eval $compile; then
9008 $echo "lchown() found." >&4
9011 $echo "lchown() NOT found." >&4
9017 : see if link exists
9021 : see if localeconv exists
9022 set localeconv d_locconv
9025 : see if lockf exists
9029 : see if lstat exists
9033 : see if madvise exists
9034 set madvise d_madvise
9037 : see if mblen exists
9041 : see if mbstowcs exists
9042 set mbstowcs d_mbstowcs
9045 : see if mbtowc exists
9049 : see if memchr exists
9053 : see if memcmp exists
9057 : see if memcpy exists
9061 : see if memmove exists
9062 set memmove d_memmove
9065 : see if memset exists
9069 : see if mkdir exists
9073 : see if mkfifo exists
9077 : see if mktime exists
9081 : see if this is a sys/mman.h system
9082 set sys/mman.h i_sysmman
9085 : see if mmap exists
9088 : see what shmat returns
9089 : default to something harmless
9091 case "$i_sysmman$d_mmap" in
9093 $cat >mmap.c <<'END'
9094 #include <sys/mman.h>
9097 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9102 echo "and it returns ($mmaptype)." >&4
9108 : see if mprotect exists
9109 set mprotect d_mprotect
9112 : see if msgctl exists
9116 : see if msgget exists
9120 : see if msgsnd exists
9124 : see if msgrcv exists
9128 : see how much of the 'msg*(2)' library is present.
9131 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9132 *"$undef"*) h_msg=false;;
9136 case "`ipcs 2>&1`" in
9137 "SVID messages"*"not configured"*)
9138 echo "Your $osname does not have the msg*(2) configured." >&4
9153 : we could also check for sys/ipc.h ...
9154 if $h_msg && $test `./findhdr sys/msg.h`; then
9155 echo "You have the full msg*(2) library." >&4
9158 echo "You don't have the full msg*(2) library." >&4
9164 : see if msync exists
9168 : see if munmap exists
9172 : see if nice exists
9176 : see if POSIX threads are available
9177 if test "X$usethreads" = "X$define"; then
9178 set pthread.h i_pthread
9186 : how to create joinable pthreads
9187 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9189 echo "Checking what constant to use for creating joinable pthreads..." >&4
9190 $cat >try.c <<'EOCP'
9191 #include <pthread.h>
9193 int detachstate = JOINABLE;
9196 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9197 if eval $compile; then
9198 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9199 val="$undef" # Yes, undef.
9200 set d_old_pthread_create_joinable
9203 set old_pthread_create_joinable
9206 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9207 if eval $compile; then
9208 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9210 set d_old_pthread_create_joinable
9212 val=PTHREAD_CREATE_UNDETACHED
9213 set old_pthread_create_joinable
9216 set try -DJOINABLE=__UNDETACHED
9217 if eval $compile; then
9218 echo "You seem to use __UNDETACHED." >&4
9220 set d_old_pthread_create_joinable
9223 set old_pthread_create_joinable
9226 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9228 set d_old_pthread_create_joinable
9231 set old_pthread_create_joinable
9238 d_old_pthread_create_joinable="$undef"
9239 old_pthread_create_joinable=""
9242 : see if pause exists
9246 : see if pipe exists
9250 : see if poll exists
9255 : see whether the various POSIXish _yields exist
9257 #include <pthread.h>
9263 #ifdef PTHREAD_YIELD
9266 #ifdef PTHREAD_YIELD_NULL
9267 pthread_yield(NULL);
9273 : see if sched_yield exists
9274 set try -DSCHED_YIELD
9275 if eval $compile; then
9277 sched_yield='sched_yield()'
9281 case "$usethreads" in
9284 $define) echo 'sched_yield() found.' >&4 ;;
9285 *) echo 'sched_yield() NOT found.' >&4 ;;
9291 : see if pthread_yield exists
9292 set try -DPTHREAD_YIELD
9293 if eval $compile; then
9295 case "$sched_yield" in
9296 '') sched_yield='pthread_yield()' ;;
9299 set try -DPTHREAD_YIELD_NULL
9300 if eval $compile; then
9302 case "$sched_yield" in
9303 '') sched_yield='pthread_yield(NULL)' ;;
9309 case "$usethreads" in
9312 $define) echo 'pthread_yield() found.' >&4 ;;
9313 *) echo 'pthread_yield() NOT found.' >&4 ;;
9320 case "$sched_yield" in
9321 '') sched_yield=undef ;;
9326 : see if this is a pwd.h system
9332 xxx=`./findhdr pwd.h`
9333 $cppstdin $cppflags $cppminus < $xxx >$$.h
9335 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9343 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9351 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9359 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9367 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9375 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9383 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9391 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9403 set d_pwquota; eval $setvar
9404 set d_pwage; eval $setvar
9405 set d_pwchange; eval $setvar
9406 set d_pwclass; eval $setvar
9407 set d_pwexpire; eval $setvar
9408 set d_pwcomment; eval $setvar
9409 set d_pwgecos; eval $setvar
9410 set d_pwpasswd; eval $setvar
9414 : see if readdir and friends exist
9415 set readdir d_readdir
9417 set seekdir d_seekdir
9419 set telldir d_telldir
9421 set rewinddir d_rewinddir
9424 : see if readlink exists
9425 set readlink d_readlink
9428 : see if readv exists
9432 : see if rename exists
9436 : see if rmdir exists
9440 : see if memory.h is available.
9445 : See if it conflicts with string.h
9451 $cppstdin $cppflags $cppminus < $strings > mem.h
9452 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9454 echo "We won't be including <memory.h>."
9464 : can bcopy handle overlapping blocks?
9469 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9476 $cat >>try.c <<'EOCP'
9479 # include <memory.h>
9482 # include <stdlib.h>
9485 # include <string.h>
9487 # include <strings.h>
9490 # include <unistd.h> /* Needed for NetBSD */
9494 char buf[128], abc[128];
9500 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9502 for (align = 7; align >= 0; align--) {
9503 for (len = 36; len; len--) {
9506 for (off = 1; off <= len; off++) {
9507 bcopy(b, b+off, len);
9508 bcopy(b+off, b, len);
9509 if (bcmp(b, abc, len))
9518 if eval $compile_ok; then
9519 if ./try 2>/dev/null; then
9523 echo "It can't, sorry."
9524 case "$d_memmove" in
9525 "$define") echo "But that's Ok since you have memmove()." ;;
9529 echo "(I can't compile the test program, so we'll assume not...)"
9530 case "$d_memmove" in
9531 "$define") echo "But that's Ok since you have memmove()." ;;
9536 $rm -f try.* try core
9540 : can memcpy handle overlapping blocks?
9545 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9552 $cat >>try.c <<'EOCP'
9555 # include <memory.h>
9558 # include <stdlib.h>
9561 # include <string.h>
9563 # include <strings.h>
9566 # include <unistd.h> /* Needed for NetBSD */
9570 char buf[128], abc[128];
9576 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9577 try to store the string in read-only memory. */
9578 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9580 for (align = 7; align >= 0; align--) {
9581 for (len = 36; len; len--) {
9583 memcpy(b, abc, len);
9584 for (off = 1; off <= len; off++) {
9585 memcpy(b+off, b, len);
9586 memcpy(b, b+off, len);
9587 if (memcmp(b, abc, len))
9596 if eval $compile_ok; then
9597 if ./try 2>/dev/null; then
9601 echo "It can't, sorry."
9602 case "$d_memmove" in
9603 "$define") echo "But that's Ok since you have memmove()." ;;
9607 echo "(I can't compile the test program, so we'll assume not...)"
9608 case "$d_memmove" in
9609 "$define") echo "But that's Ok since you have memmove()." ;;
9614 $rm -f try.* try core
9618 : can memcmp be trusted to compare relative magnitude?
9623 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9630 $cat >>try.c <<'EOCP'
9633 # include <memory.h>
9636 # include <stdlib.h>
9639 # include <string.h>
9641 # include <strings.h>
9644 # include <unistd.h> /* Needed for NetBSD */
9650 if ((a < b) && memcmp(&a, &b, 1) < 0)
9656 if eval $compile_ok; then
9657 if ./try 2>/dev/null; then
9661 echo "No, it can't (it uses signed chars)."
9664 echo "(I can't compile the test program, so we'll assume not...)"
9668 $rm -f try.* try core
9672 : see if select exists
9676 : see if semctl exists
9680 : see if semget exists
9684 : see if semop exists
9688 : see how much of the 'sem*(2)' library is present.
9691 case "$d_semctl$d_semget$d_semop" in
9692 *"$undef"*) h_sem=false;;
9696 case "`ipcs 2>&1`" in
9697 "SVID messages"*"not configured"*)
9698 echo "Your $osname does not have the sem*(2) configured." >&4
9711 : we could also check for sys/ipc.h ...
9712 if $h_sem && $test `./findhdr sys/sem.h`; then
9713 echo "You have the full sem*(2) library." >&4
9716 echo "You don't have the full sem*(2) library." >&4
9722 : see whether sys/sem.h defines union semun
9724 $cat > try.c <<'END'
9725 #include <sys/types.h>
9726 #include <sys/ipc.h>
9727 #include <sys/sem.h>
9728 int main () { union semun semun; semun.buf = 0; }
9731 if eval $compile; then
9732 echo "You have union semun in <sys/sem.h>." >&4
9735 echo "You do not have union semun in <sys/sem.h>." >&4
9738 $rm -f try try.c try.h
9742 : see how to do semctl IPC_STAT
9745 : see whether semctl IPC_STAT can use union semun
9750 # define S_IRUSR S_IREAD
9751 # define S_IWUSR S_IWRITE
9752 # define S_IXUSR S_IEXEC
9754 # define S_IRUSR 0400
9755 # define S_IWUSR 0200
9756 # define S_IXUSR 0100
9758 # define S_IRGRP (S_IRUSR>>3)
9759 # define S_IWGRP (S_IWUSR>>3)
9760 # define S_IXGRP (S_IXUSR>>3)
9761 # define S_IROTH (S_IRUSR>>6)
9762 # define S_IWOTH (S_IWUSR>>6)
9763 # define S_IXOTH (S_IXUSR>>6)
9766 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9767 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9768 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9773 #include <sys/types.h>
9774 #include <sys/ipc.h>
9775 #include <sys/sem.h>
9776 #include <sys/stat.h>
9783 #$d_union_semun HAS_UNION_SEMUN
9786 #ifndef HAS_UNION_SEMUN
9789 struct semid_ds *buf;
9790 unsigned short *array;
9796 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9797 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9799 struct semid_ds argbuf;
9802 st = semctl(sem, 0, IPC_STAT, arg);
9806 # endif /* IPC_STAT */
9807 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9809 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9810 # endif /* IPC_RMID */
9811 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9813 #endif /* IPC_PRIVATE && ... */
9814 printf("semget failed: errno = %d\n", errno);
9820 if eval $compile; then
9823 semun) val="$define" ;;
9829 case "$d_semctl_semun" in
9831 echo "You can use union semun for semctl IPC_STAT." >&4
9834 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9839 : see whether semctl IPC_STAT can use struct semid_ds pointer
9840 $cat > try.c <<'END'
9841 #include <sys/types.h>
9842 #include <sys/ipc.h>
9843 #include <sys/sem.h>
9844 #include <sys/stat.h>
9852 struct semid_ds arg;
9855 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9856 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9859 st = semctl(sem, 0, IPC_STAT, &arg);
9861 printf("semid_ds\n");
9863 # endif /* IPC_STAT */
9864 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9866 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9867 # endif /* IPC_RMID */
9868 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9870 #endif /* IPC_PRIVATE && ... */
9871 printf("semget failed: errno = %d\n", errno);
9878 if eval $compile; then
9881 semid_ds) val="$define" ;;
9885 set d_semctl_semid_ds
9887 case "$d_semctl_semid_ds" in
9889 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9891 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9898 # We do not have the full sem*(2) library, so assume we can not
9904 set d_semctl_semid_ds
9909 : see if setegid exists
9910 set setegid d_setegid
9913 : see if seteuid exists
9914 set seteuid d_seteuid
9917 : see if setgrent exists
9918 set setgrent d_setgrent
9921 : see if sethostent exists
9922 set sethostent d_sethent
9925 : see if setlinebuf exists
9926 set setlinebuf d_setlinebuf
9929 : see if setlocale exists
9930 set setlocale d_setlocale
9933 : see if setnetent exists
9934 set setnetent d_setnent
9937 : see if setprotoent exists
9938 set setprotoent d_setpent
9941 : see if setpgid exists
9942 set setpgid d_setpgid
9945 : see if setpgrp2 exists
9946 set setpgrp2 d_setpgrp2
9949 : see if setpriority exists
9950 set setpriority d_setprior
9953 : see if setpwent exists
9954 set setpwent d_setpwent
9957 : see if setregid exists
9958 set setregid d_setregid
9960 set setresgid d_setresgid
9963 : see if setreuid exists
9964 set setreuid d_setreuid
9966 set setresuid d_setresuid
9969 : see if setrgid exists
9970 set setrgid d_setrgid
9973 : see if setruid exists
9974 set setruid d_setruid
9977 : see if setservent exists
9978 set setservent d_setsent
9981 : see if setsid exists
9985 : see if setspent exists
9986 set setspent d_setspent
9989 : see if setvbuf exists
9990 set setvbuf d_setvbuf
9993 : see if sfio.h is available
9998 : see if sfio library is available
10009 : Ok, but do we want to use it.
10013 true|$define|[yY]*) dflt='y';;
10016 echo "$package can use the sfio library, but it is experimental."
10017 rp="You seem to have sfio available, do you want to try using it?"
10021 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10023 : Remove sfio from list of libraries to use
10024 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10027 echo "libs = $libs" >&4
10031 *) case "$usesfio" in
10032 true|$define|[yY]*)
10033 echo "Sorry, cannot find sfio on this machine" >&4
10034 echo "Ignoring your setting of usesfio=$usesfio" >&4
10042 $define) usesfio='true';;
10043 *) usesfio='false';;
10046 : see if shmctl exists
10047 set shmctl d_shmctl
10050 : see if shmget exists
10051 set shmget d_shmget
10054 : see if shmat exists
10057 : see what shmat returns
10060 $cat >shmat.c <<'END'
10061 #include <sys/shm.h>
10064 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10069 echo "and it returns ($shmattype)." >&4
10070 : see if a prototype for shmat is available
10071 xxx=`./findhdr sys/shm.h`
10072 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10073 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10084 set d_shmatprototype
10087 : see if shmdt exists
10091 : see how much of the 'shm*(2)' library is present.
10094 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10095 *"$undef"*) h_shm=false;;
10099 case "`ipcs 2>&1`" in
10100 "SVID shared memory"*"not configured"*)
10101 echo "Your $osname does not have the shm*(2) configured." >&4
10104 set shmctl d_shmctl
10106 set shmget d_shmget
10116 : we could also check for sys/ipc.h ...
10117 if $h_shm && $test `./findhdr sys/shm.h`; then
10118 echo "You have the full shm*(2) library." >&4
10121 echo "You don't have the full shm*(2) library." >&4
10128 : see if we have sigaction
10129 if set sigaction val -f d_sigaction; eval $csym; $val; then
10130 echo 'sigaction() found.' >&4
10131 $cat > try.c <<'EOP'
10133 #include <sys/types.h>
10134 #include <signal.h>
10137 struct sigaction act, oact;
10141 if eval $compile_ok; then
10144 echo "But you don't seem to have a useable struct sigaction." >&4
10148 echo 'sigaction NOT found.' >&4
10151 set d_sigaction; eval $setvar
10152 $rm -f try try$_o try.c
10154 : see if sigsetjmp exists
10156 case "$d_sigsetjmp" in
10158 $cat >try.c <<'EOP'
10159 #include <setjmp.h>
10164 if (sigsetjmp(env,1))
10167 siglongjmp(env, 1);
10172 if eval $compile; then
10173 if ./try >/dev/null 2>&1; then
10174 echo "POSIX sigsetjmp found." >&4
10178 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10184 echo "sigsetjmp not found." >&4
10188 *) val="$d_sigsetjmp"
10189 case "$d_sigsetjmp" in
10190 $define) echo "POSIX sigsetjmp found." >&4;;
10191 $undef) echo "sigsetjmp not found." >&4;;
10199 : see if sys/stat.h is available
10200 set sys/stat.h i_sysstat
10203 : see if stat knows about block sizes
10205 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10208 : see if _ptr and _cnt from stdio act std
10210 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10211 echo "(Looks like you have stdio.h from Linux.)"
10212 case "$stdio_ptr" in
10213 '') stdio_ptr='((fp)->_IO_read_ptr)'
10216 *) ptr_lval=$d_stdio_ptr_lval;;
10218 case "$stdio_cnt" in
10219 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10222 *) cnt_lval=$d_stdio_cnt_lval;;
10224 case "$stdio_base" in
10225 '') stdio_base='((fp)->_IO_read_base)';;
10227 case "$stdio_bufsiz" in
10228 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10231 case "$stdio_ptr" in
10232 '') stdio_ptr='((fp)->_ptr)'
10235 *) ptr_lval=$d_stdio_ptr_lval;;
10237 case "$stdio_cnt" in
10238 '') stdio_cnt='((fp)->_cnt)'
10241 *) cnt_lval=$d_stdio_cnt_lval;;
10243 case "$stdio_base" in
10244 '') stdio_base='((fp)->_base)';;
10246 case "$stdio_bufsiz" in
10247 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10250 : test whether _ptr and _cnt really work
10251 echo "Checking how std your stdio is..." >&4
10254 #define FILE_ptr(fp) $stdio_ptr
10255 #define FILE_cnt(fp) $stdio_cnt
10257 FILE *fp = fopen("try.c", "r");
10260 18 <= FILE_cnt(fp) &&
10261 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10269 if eval $compile; then
10271 echo "Your stdio acts pretty std."
10274 echo "Your stdio isn't very std."
10277 echo "Your stdio doesn't appear very std."
10283 : Can _ptr be used as an lvalue?
10284 case "$d_stdstdio$ptr_lval" in
10285 $define$define) val=$define ;;
10288 set d_stdio_ptr_lval
10291 : Can _cnt be used as an lvalue?
10292 case "$d_stdstdio$cnt_lval" in
10293 $define$define) val=$define ;;
10296 set d_stdio_cnt_lval
10299 : see if _base is also standard
10301 case "$d_stdstdio" in
10305 #define FILE_base(fp) $stdio_base
10306 #define FILE_bufsiz(fp) $stdio_bufsiz
10308 FILE *fp = fopen("try.c", "r");
10311 19 <= FILE_bufsiz(fp) &&
10312 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10319 if eval $compile; then
10321 echo "And its _base field acts std."
10324 echo "But its _base field isn't std."
10327 echo "However, it seems to be lacking the _base field."
10336 Checking how to access stdio streams by file descriptor number...
10338 case "$stdio_stream_array" in
10339 '') $cat >try.c <<EOCP
10342 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10346 for s in _iob __iob __sF
10348 set try -DSTDIO_STREAM_ARRAY=$s
10349 if eval $compile; then
10350 case "`./try$exe_ext`" in
10351 yes) stdio_stream_array=$s; break ;;
10355 $rm -f try.* try$exe_ext
10357 case "$stdio_stream_array" in
10359 I can't figure out how to access stdio streams by file descriptor number.
10361 d_stdio_stream_array="$undef"
10364 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10366 d_stdio_stream_array="$define"
10370 : see if strcoll exists
10371 set strcoll d_strcoll
10374 : check for structure copying
10376 echo "Checking to see if your C compiler can copy structs..." >&4
10377 $cat >try.c <<'EOCP'
10387 if $cc -c try.c >/dev/null 2>&1 ; then
10389 echo "Yup, it can."
10392 echo "Nope, it can't."
10398 : see if strerror and/or sys_errlist[] exist
10400 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10401 if set strerror val -f d_strerror; eval $csym; $val; then
10402 echo 'strerror() found.' >&4
10403 d_strerror="$define"
10404 d_strerrm='strerror(e)'
10405 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10406 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10407 d_syserrlst="$define"
10409 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10410 d_syserrlst="$undef"
10412 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10413 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10414 echo 'strerror() found in string header.' >&4
10415 d_strerror="$define"
10416 d_strerrm='strerror(e)'
10417 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10418 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10419 d_syserrlst="$define"
10421 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10422 d_syserrlst="$undef"
10424 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10425 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10426 d_strerror="$undef"
10427 d_syserrlst="$define"
10428 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10430 echo 'strerror() and sys_errlist[] NOT found.' >&4
10431 d_strerror="$undef"
10432 d_syserrlst="$undef"
10433 d_strerrm='"unknown"'
10437 : see if strtod exists
10438 set strtod d_strtod
10441 : see if strtol exists
10442 set strtol d_strtol
10445 : see if strtoul exists
10446 set strtoul d_strtoul
10449 : see if strtoull exists
10450 set strtoull d_strtoull
10453 : see if strxfrm exists
10454 set strxfrm d_strxfrm
10457 : see if symlink exists
10458 set symlink d_symlink
10461 : see if syscall exists
10462 set syscall d_syscall
10465 : see if sysconf exists
10466 set sysconf d_sysconf
10469 : see if system exists
10470 set system d_system
10473 : see if tcgetpgrp exists
10474 set tcgetpgrp d_tcgetpgrp
10477 : see if tcsetpgrp exists
10478 set tcsetpgrp d_tcsetpgrp
10481 : see if sys/types.h has to be included
10482 set sys/types.h i_systypes
10485 : see if prototype for telldir is available
10487 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10490 : define an is-a-typedef? function
10491 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10493 "") inclist="sys/types.h";;
10495 eval "varval=\$$var";
10499 for inc in $inclist; do
10500 echo "#include <$inc>" >>temp.c;
10502 echo "#ifdef $type" >> temp.c;
10503 echo "printf(\"We have $type\");" >> temp.c;
10504 echo "#endif" >> temp.c;
10505 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10506 if $contains $type temp.E >/dev/null 2>&1; then
10507 eval "$var=\$type";
10512 *) eval "$var=\$varval";;
10515 : define an is-a-typedef? function that prompts if the type is not available.
10516 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10518 "") inclist="sys/types.h";;
10520 eval "varval=\$$var";
10524 for inc in $inclist; do
10525 echo "#include <$inc>" >>temp.c;
10527 echo "#ifdef $type" >> temp.c;
10528 echo "printf(\"We have $type\");" >> temp.c;
10529 echo "#endif" >> temp.c;
10530 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10532 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10533 if $contains $type temp.E >/dev/null 2>&1; then
10534 echo "$type found." >&4;
10535 eval "$var=\$type";
10537 echo "$type NOT found." >&4;
10543 *) eval "$var=\$varval";;
10546 : see if this is a sys/times.h system
10547 set sys/times.h i_systimes
10550 : see if times exists
10552 if set times val -f d_times; eval $csym; $val; then
10553 echo 'times() found.' >&4
10556 case "$i_systimes" in
10557 "$define") inc='sys/times.h';;
10559 rp="What is the type returned by times() on this system?"
10560 set clock_t clocktype long stdio.h sys/types.h $inc
10563 echo 'times() NOT found, hope that will do.' >&4
10568 : see if truncate exists
10569 set truncate d_truncate
10572 : see if tzname[] exists
10574 if set tzname val -a d_tzname; eval $csym; $val; then
10576 echo 'tzname[] found.' >&4
10579 echo 'tzname[] NOT found.' >&4
10584 : see if umask exists
10588 : backward compatibility for d_hvfork
10589 if test X$d_hvfork != X; then
10590 d_vfork="$d_hvfork"
10593 : see if there is a vfork
10598 : Ok, but do we want to use it. vfork is reportedly unreliable in
10599 : perl on Solaris 2.x, and probably elsewhere.
10603 case "$usevfork" in
10609 Perl can only use a vfork() that doesn't suffer from strict
10610 restrictions on calling functions or modifying global data in
10611 the child. For example, glibc-2.1 contains such a vfork()
10612 that is unsuitable. If your system provides a proper fork()
10613 call, chances are that you do NOT want perl to use vfork().
10616 rp="Do you still want to use vfork()?"
10621 echo "Ok, we won't use vfork()."
10630 $define) usevfork='true';;
10631 *) usevfork='false';;
10634 : see if this is an sysdir system
10635 set sys/dir.h i_sysdir
10638 : see if this is an sysndir system
10639 set sys/ndir.h i_sysndir
10642 : see if closedir exists
10643 set closedir d_closedir
10646 case "$d_closedir" in
10649 echo "Checking whether closedir() returns a status..." >&4
10650 cat > closedir.c <<EOM
10651 #$i_dirent I_DIRENT /**/
10652 #$i_sysdir I_SYS_DIR /**/
10653 #$i_sysndir I_SYS_NDIR /**/
10654 #$i_systypes I_SYS_TYPES /**/
10656 #if defined(I_SYS_TYPES)
10657 #include <sys/types.h>
10659 #if defined(I_DIRENT)
10660 #include <dirent.h>
10661 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10662 #include <sys/dir.h>
10666 #include <sys/ndir.h>
10670 #include <ndir.h> /* may be wrong in the future */
10672 #include <sys/dir.h>
10677 int main() { return closedir(opendir(".")); }
10680 if eval $compile_ok; then
10681 if ./closedir > /dev/null 2>&1 ; then
10682 echo "Yes, it does."
10685 echo "No, it doesn't."
10689 echo "(I can't seem to compile the test program--assuming it doesn't)"
10697 set d_void_closedir
10700 : check for volatile keyword
10702 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10703 $cat >try.c <<'EOCP'
10706 typedef struct _goo_struct goo_struct;
10707 goo_struct * volatile goo = ((goo_struct *)0);
10708 struct _goo_struct {
10713 typedef unsigned short foo_t;
10714 char *volatile foo;
10716 volatile foo_t blech;
10720 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10722 echo "Yup, it does."
10725 echo "Nope, it doesn't."
10731 : see if there is a wait4
10735 : see if waitpid exists
10736 set waitpid d_waitpid
10739 : see if wcstombs exists
10740 set wcstombs d_wcstombs
10743 : see if wctomb exists
10744 set wctomb d_wctomb
10747 : see if writev exists
10748 set writev d_writev
10751 : preserve RCS keywords in files with variable substitution, grrr
10756 Revision='$Revision'
10758 case "$crosscompile" in
10759 ''|[nN]*) crosscompile="$undef" ;;
10763 next|rhapsody) multiarch="$define" ;;
10765 case "$multiarch" in
10766 ''|[nN]*) multiarch="$undef" ;;
10769 : check for alignment requirements
10771 case "$crosscompile$multiarch" in
10774 You seem to be either cross-compiling or doing a multiarchitecture build,
10775 skipping the memory alignment check.
10778 case "$alignbytes" in
10779 '') alignbytes=8 ;;
10783 case "$alignbytes" in
10784 '') echo "Checking alignment constraints..." >&4
10785 $cat >try.c <<'EOCP'
10792 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10796 if eval $compile_ok; then
10800 echo "(I can't seem to compile the test program...)"
10803 *) dflt="$alignbytes"
10806 rp="Doubles must be aligned on a how-many-byte boundary?"
10814 : check for ordering of bytes in a long
10816 case "$crosscompile$multiarch" in
10819 You seem to be either cross-compiling or doing a multiarchitecture build,
10820 skipping the byteorder check.
10826 case "$byteorder" in
10829 In the following, larger digits indicate more significance. A big-endian
10830 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10831 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10832 machines may have weird orders like 3412. A Cray will report 87654321,
10833 an Alpha will report 12345678. If the test program works the default is
10835 I'm now running the test program...
10837 $cat >try.c <<'EOCP'
10844 char c[sizeof(long)];
10847 if (sizeof(long) > 4)
10848 u.l = (0x08070605L << 32) | 0x04030201L;
10851 for (i = 0; i < sizeof(long); i++)
10852 printf("%c", u.c[i]+'0');
10859 if eval $compile && ./try > /dev/null; then
10862 [1-4][1-4][1-4][1-4]|12345678|87654321)
10863 echo "(The test program ran ok.)"
10864 echo "byteorder=$dflt"
10867 ????|????????) echo "(The test program ran ok.)" ;;
10868 *) echo "(The test program didn't run right for some reason.)" ;;
10873 (I can't seem to compile the test program. Guessing big-endian...)
10876 case "$xxx_prompt" in
10878 rp="What is the order of bytes in a long?"
10892 : how do we catenate cpp tokens here?
10894 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10895 $cat >cpp_stuff.c <<'EOCP'
10896 #define RCAT(a,b)a/**/b
10897 #define ACAT(a,b)a ## b
10901 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10902 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10903 echo "Oh! Smells like ANSI's been here." >&4
10904 echo "We can catify or stringify, separately or together!"
10906 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10907 echo "Ah, yes! The good old days!" >&4
10908 echo "However, in the good old days we don't know how to stringify and"
10909 echo "catify at the same time."
10913 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10914 to have to edit the values of CAT[2-5] in config.h...
10916 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10920 : see if this is a db.h system
10926 : Check db version.
10928 echo "Checking Berkeley DB version ..." >&4
10934 #include <sys/types.h>
10939 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10940 int Major, Minor, Patch ;
10941 unsigned long Version ;
10942 (void)db_version(&Major, &Minor, &Patch) ;
10943 printf("You have Berkeley DB Version 2 or greater\n");
10945 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10946 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10947 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10948 Major, Minor, Patch) ;
10950 /* check that db.h & libdb are compatible */
10951 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10952 printf("db.h and libdb are incompatible\n") ;
10956 printf("db.h and libdb are compatible\n") ;
10958 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10959 + DB_VERSION_PATCH ;
10961 /* needs to be >= 2.3.4 */
10962 if (Version < 2003004) {
10963 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10964 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10970 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10971 printf("You have Berkeley DB Version 1\n");
10972 exit(0); /* DB version < 2: the coast is clear. */
10974 exit(1); /* <db.h> not Berkeley DB? */
10980 if eval $compile && ./try; then
10981 echo 'Looks OK.' >&4
10983 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10987 : Remove db from list of libraries to use
10988 echo "Removing unusable -ldb from library list" >&4
10989 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10992 echo "libs = $libs" >&4
11002 : Check the return type needed for hash
11004 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11010 #include <sys/types.h>
11013 #ifndef DB_VERSION_MAJOR
11014 u_int32_t hash_cb (ptr, size)
11022 info.hash = hash_cb;
11026 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11027 if $contains warning try.out >>/dev/null 2>&1 ; then
11030 db_hashtype='u_int32_t'
11033 : XXX Maybe we should just give up here.
11034 db_hashtype=u_int32_t
11036 echo "Help: I can't seem to compile the db test program." >&4
11037 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11040 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11042 *) db_hashtype=u_int32_t
11047 : Check the return type needed for prefix
11049 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11055 #include <sys/types.h>
11058 #ifndef DB_VERSION_MAJOR
11059 size_t prefix_cb (key1, key2)
11067 info.prefix = prefix_cb;
11071 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11072 if $contains warning try.out >>/dev/null 2>&1 ; then
11073 db_prefixtype='int'
11075 db_prefixtype='size_t'
11078 db_prefixtype='size_t'
11079 : XXX Maybe we should just give up here.
11081 echo "Help: I can't seem to compile the db test program." >&4
11082 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11085 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11087 *) db_prefixtype='size_t'
11091 : check for void type
11093 echo "Checking to see how well your C compiler groks the void type..." >&4
11094 case "$voidflags" in
11096 $cat >try.c <<'EOCP'
11102 extern void moo(); /* function returning void */
11103 void (*goo)(); /* ptr to func returning void */
11105 void *hue; /* generic ptr */
11118 int main() { sub(); }
11120 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11121 voidflags=$defvoidused
11122 echo "Good. It appears to support void to the level $package wants.">&4
11123 if $contains warning .out >/dev/null 2>&1; then
11124 echo "However, you might get some warnings that look like this:"
11128 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11129 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11130 echo "It supports 1..."
11131 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11132 echo "It also supports 2..."
11133 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11135 echo "And it supports 4 but not 8 definitely."
11137 echo "It doesn't support 4..."
11138 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11140 echo "But it supports 8."
11143 echo "Neither does it support 8."
11147 echo "It does not support 2..."
11148 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11150 echo "But it supports 4 and 8."
11152 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11154 echo "And it supports 4 but has not heard about 8."
11156 echo "However it supports 8 but not 4."
11161 echo "There is no support at all for void."
11166 case "$voidflags" in
11168 *) $cat >&4 <<'EOM'
11169 Support flag bits are:
11170 1: basic void declarations.
11171 2: arrays of pointers to functions returning void.
11172 4: operations between pointers to and addresses of void functions.
11173 8: generic void pointers.
11176 rp="Your void support flags add up to what?"
11184 : How can we generate normalized random numbers ?
11186 echo "Looking for a random number function..." >&4
11187 case "$randfunc" in
11189 if set drand48 val -f; eval $csym; $val; then
11191 echo "Good, found drand48()." >&4
11192 elif set random val -f; eval $csym; $val; then
11194 echo "OK, found random()." >&4
11197 echo "Yick, looks like I have to use rand()." >&4
11208 *-Dmy_rand=*|*-Dmy_srand=*)
11209 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11210 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11211 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11212 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11216 while $test "$cont"; do
11217 rp="Use which function to generate random numbers?"
11219 if $test "$ans" = "$dflt"; then
11225 if set $ans val -f; eval $csym; $val; then
11229 rp="I cannot find function $ans. Use that name anyway?"
11238 case "$randfunc" in
11240 drand01="drand48()"
11246 case "$randbits" in
11248 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11250 #$i_unistd I_UNISTD
11251 #$i_stdlib I_STDLIB
11254 # include <unistd.h>
11257 # include <stdlib.h>
11262 register unsigned long tmp;
11263 register unsigned long max = 0L;
11265 for (i = 1000; i; i--) {
11266 tmp = (unsigned long) $randfunc();
11267 if (tmp > max) max = tmp;
11269 for (i = 0; max; i++)
11275 if eval $compile_ok; then
11279 echo "(I can't seem to compile the test program...)"
11286 rp="How many bits does your $randfunc() function produce?"
11290 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11291 seedfunc="s$randfunc"
11292 randseedtype=unsigned
11296 rp="How many bits does your $randfunc() function produce?"
11299 seedfunc="s$randfunc"
11300 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11301 if set $seedfunc val -f; eval $csym; $val; then
11302 echo "(Using $seedfunc() to seed random generator)"
11304 echo "(Warning: no $seedfunc() to seed random generator)"
11307 randseedtype=unsigned
11315 echo "Determining whether or not we are on an EBCDIC system..." >&4
11316 $cat >tebcdic.c <<'EOM'
11319 if ('M'==0xd4) return 0;
11326 if eval $compile_ok; then
11328 echo "You have EBCDIC." >&4
11331 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11334 echo "I'm unable to compile the test program." >&4
11335 echo "I'll assume ASCII or some ISO Latin." >&4
11337 $rm -f tebcdic.c tebcdic
11343 Checking how to flush all pending stdio output...
11345 # I only know how to find the first 32 possibly open files on SunOS.
11346 # See also hints/sunos_4_1.sh and util.c --AD
11348 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11350 $cat >>try.c <<EOCP
11352 #$i_unistd I_UNISTD
11354 # include <unistd.h>
11356 #$d_sysconf HAS_SYSCONF
11357 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11358 #ifdef HAS_STDIO_STREAM_ARRAY
11359 # define STDIO_STREAM_ARRAY $stdio_stream_array
11362 FILE* p = fopen("try.out", "w");
11366 # ifdef TRY_FPRINTF
11370 #ifdef TRY_FFLUSH_NULL
11373 #ifdef TRY_FFLUSH_ALL
11375 long open_max = -1;
11376 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11377 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11379 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11380 open_max = sysconf(_SC_OPEN_MAX);
11383 open_max = FOPEN_MAX;
11386 open_max = OPEN_MAX;
11395 # ifdef HAS_STDIO_STREAM_ARRAY
11396 if (open_max > 0) {
11398 for (i = 0; i < open_max; i++)
11399 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11400 STDIO_STREAM_ARRAY[i]._file < open_max &&
11401 STDIO_STREAM_ARRAY[i]._flag)
11402 fflush(&STDIO_STREAM_ARRAY[i]);
11410 : first we have to find out how _not_ to flush
11411 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11413 set try -DTRY_FPUTC
11414 if eval $compile; then
11416 ./try$exe_ext 2>/dev/null
11417 if $test ! -s try.out -a "X$?" = X42; then
11423 set try -DTRY_FPRINTF
11425 if eval $compile; then
11427 ./try$exe_ext 2>/dev/null
11428 if $test ! -s try.out -a "X$?" = X42; then
11429 output=-DTRY_FPRINTF
11435 : check for fflush NULL behaviour
11436 case "$fflushNULL" in
11437 '') set try -DTRY_FFLUSH_NULL $output
11438 if eval $compile; then
11440 ./try$exe_ext 2>/dev/null
11442 if $test -s try.out -a "X$code" = X42; then
11443 fflushNULL="`$cat try.out`"
11445 if $test "X$code" != X42; then
11447 (If this test failed, don't worry, we'll try another method shortly.)
11452 $rm -f core try.core core.try.*
11453 case "$fflushNULL" in
11455 Your fflush(NULL) works okay.
11457 fflushNULL="$define"
11460 Your fflush(NULL) isn't working (contrary to ANSI C).
11462 fflushNULL="$undef"
11465 Cannot figure out whether your fflush(NULL) works or not.
11466 I'm assuming it doesn't (contrary to ANSI C).
11468 fflushNULL="$undef"
11472 $define|true|[yY]*)
11473 fflushNULL="$define"
11476 fflushNULL="$undef"
11479 : check explicit looping only if NULL did not work
11480 case "$fflushNULL" in
11482 : check for fflush all behaviour
11483 case "$fflushall" in
11484 '') set try -DTRY_FFLUSH_ALL $output
11485 if eval $compile; then
11487 (Now testing the other method--but note that also this may fail.)
11490 ./try$exe_ext 2>/dev/null
11491 if $test -s try.out -a "X$?" = X42; then
11492 fflushall="`$cat try.out`"
11495 $rm -f core try.core core.try.*
11496 case "$fflushall" in
11498 Whew. Flushing explicitly all the stdio streams works.
11500 fflushall="$define"
11503 Sigh. Flushing explicitly all the stdio streams doesn't work.
11508 Cannot figure out whether flushing stdio streams explicitly works or not.
11509 I'm assuming it doesn't.
11515 "$define"|true|[yY]*)
11516 fflushall="$define"
11523 *) fflushall="$undef"
11526 case "$fflushNULL$fflushall" in
11529 I cannot figure out how to flush pending stdio output.
11533 $rm -f try.* try$exe_ext
11535 : see what type file positions are declared as in the library
11536 rp="What is the type for file position used by fsetpos()?"
11537 set fpos_t fpostype long stdio.h sys/types.h
11540 : Store the full pathname to the ar program for use in the C program
11541 : Respect a hint or command line value for full_ar.
11546 : Store the full pathname to the sed program for use in the C program
11549 : see what type gids are declared as in the kernel
11551 echo "Looking for the type for group ids returned by getgid()."
11552 set gid_t gidtype xxx stdio.h sys/types.h
11556 xxx=`./findhdr sys/user.h`
11557 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11559 unsigned) dflt="$1 $2" ;;
11563 *) dflt="$gidtype";;
11566 gid_t) echo "gid_t found." ;;
11567 *) rp="What is the type for group ids returned by getgid()?"
11573 : see if getgroups exists
11574 set getgroups d_getgrps
11577 : see if setgroups exists
11578 set setgroups d_setgrps
11582 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11584 case "$d_getgrps$d_setgrps" in
11586 case "$groupstype" in
11587 '') dflt="$gidtype" ;;
11588 *) dflt="$groupstype" ;;
11591 What type of pointer is the second argument to getgroups() and setgroups()?
11592 Usually this is the same as group ids, $gidtype, but not always.
11595 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11599 *) groupstype="$gidtype";;
11602 : see what type lseek is declared as in the kernel
11603 rp="What is the type used for lseek's offset on this system?"
11604 set off_t lseektype long stdio.h sys/types.h
11608 $echo $n "Checking to see how big your file offsets are...$c" >&4
11610 #include <sys/types.h>
11614 printf("%d\n", sizeof($lseektype));
11618 if eval $compile_ok; then
11620 $echo " $lseeksize bytes." >&4
11624 echo "(I can't seem to compile the test program. Guessing...)"
11625 rp="What is the size of your file offsets (in bytes)?"
11632 echo "Checking if your $make program sets \$(MAKE)..." >&4
11633 case "$make_set_make" in
11635 $sed 's/^X //' > testmake.mak << 'EOF'
11637 X @echo 'maketemp="$(MAKE)"'
11639 case "`$make -f testmake.mak 2>/dev/null`" in
11640 *maketemp=*) make_set_make='#' ;;
11641 *) make_set_make="MAKE=$make" ;;
11643 $rm -f testmake.mak
11646 case "$make_set_make" in
11647 '#') echo "Yup, it does.";;
11648 *) echo "Nope, it doesn't.";;
11651 : see what type is used for mode_t
11652 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11653 set mode_t modetype int stdio.h sys/types.h
11656 : define a fucntion to check prototypes
11657 $cat > protochk <<EOSH
11660 optimize="$optimize"
11662 prototype="$prototype"
11667 $cat >> protochk <<'EOSH'
11672 while test $# -ge 2; do
11674 $define) echo "#include <$2>" >> try.c ;;
11675 literal) echo "$2" >> try.c ;;
11679 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11680 cat >> try.c <<'EOCP'
11681 #ifdef CAN_PROTOTYPE
11682 #define _(args) args
11687 echo "$foo" >> try.c
11688 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11689 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11695 $eunicefix protochk
11697 : see what type is used for size_t
11698 rp="What is the type used for the length parameter for string functions?"
11699 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11702 : check for type of arguments to gethostbyaddr.
11703 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11704 case "$d_gethbyaddr" in
11708 Checking to see what type of arguments are accepted by gethostbyaddr().
11710 hdrs="$define sys/types.h
11711 $d_socket sys/socket.h
11712 $i_niin netinet/in.h
11714 $i_unistd unistd.h"
11715 : The first arg can 'char *' or 'void *'
11716 : The second arg is some of integral type
11717 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11718 for yyy in size_t long int; do
11719 case "$netdb_host_type" in
11720 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11721 if ./protochk "$try" $hdrs; then
11722 echo "Your system accepts $xxx for the first arg."
11723 echo "...and $yyy for the second arg."
11724 netdb_host_type="$xxx"
11725 netdb_hlen_type="$yyy"
11731 : In case none of those worked, prompt the user.
11732 case "$netdb_host_type" in
11733 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11736 netdb_host_type=$ans
11737 rp='What is the type for the 2nd argument to gethostbyaddr?'
11740 netdb_hlen_type=$ans
11744 *) : no gethostbyaddr, so pick harmless defaults
11745 netdb_host_type='char *'
11746 netdb_hlen_type="$sizetype"
11749 # Remove the "const" if needed. -- but then we'll have a
11751 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11754 : check for type of argument to gethostbyname.
11755 if test "X$netdb_name_type" = X ; then
11756 case "$d_gethbyname" in
11760 Checking to see what type of argument is accepted by gethostbyname().
11762 hdrs="$define sys/types.h
11763 $d_socket sys/socket.h
11764 $i_niin netinet/in.h
11766 $i_unistd unistd.h"
11767 for xxx in "const char *" "char *"; do
11768 case "$netdb_name_type" in
11769 '') try="extern struct hostent *gethostbyname($xxx);"
11770 if ./protochk "$try" $hdrs; then
11771 echo "Your system accepts $xxx."
11772 netdb_name_type="$xxx"
11777 : In case none of those worked, prompt the user.
11778 case "$netdb_name_type" in
11779 '') rp='What is the type for the 1st argument to gethostbyname?'
11782 netdb_name_type=$ans
11786 *) : no gethostbyname, so pick harmless default
11787 netdb_name_type='char *'
11792 : check for type of 1st argument to getnetbyaddr.
11793 if test "X$netdb_net_type" = X ; then
11794 case "$d_getnbyaddr" in
11798 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11800 hdrs="$define sys/types.h
11801 $d_socket sys/socket.h
11802 $i_niin netinet/in.h
11804 $i_unistd unistd.h"
11805 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11806 case "$netdb_net_type" in
11807 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11808 if ./protochk "$try" $hdrs; then
11809 echo "Your system accepts $xxx."
11810 netdb_net_type="$xxx"
11815 : In case none of those worked, prompt the user.
11816 case "$netdb_net_type" in
11817 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11820 netdb_net_type=$ans
11824 *) : no getnetbyaddr, so pick harmless default
11825 netdb_net_type='long'
11829 : locate the preferred pager for this system
11843 '') dflt=/usr/ucb/more;;
11850 rp='What pager is used on your system?'
11854 : see what type pids are declared as in the kernel
11855 rp="What is the type of process ids on this system?"
11856 set pid_t pidtype int stdio.h sys/types.h
11859 : check for length of pointer
11863 $echo $n "Checking to see how big your pointers are...$c" >&4
11864 if test "$voidflags" -gt 7; then
11865 echo '#define VOID_PTR char *' > try.c
11867 echo '#define VOID_PTR void *' > try.c
11869 $cat >>try.c <<'EOCP'
11873 printf("%d\n", sizeof(VOID_PTR));
11878 if eval $compile_ok; then
11880 $echo " $ptrsize bytes." >&4
11883 echo "(I can't seem to compile the test program. Guessing...)" >&4
11884 rp="What is the size of a pointer (in bytes)?"
11892 : see if ar generates random libraries by itself
11894 echo "Checking how to generate random libraries on your machine..." >&4
11895 echo 'int bar1() { return bar2(); }' > bar1.c
11896 echo 'int bar2() { return 2; }' > bar2.c
11897 $cat > foo.c <<'EOP'
11898 int main() { printf("%d\n", bar1()); exit(0); }
11900 $cc $ccflags -c bar1.c >/dev/null 2>&1
11901 $cc $ccflags -c bar2.c >/dev/null 2>&1
11902 $cc $ccflags -c foo.c >/dev/null 2>&1
11903 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11904 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11905 ./foobar >/dev/null 2>&1; then
11906 echo "$ar appears to generate random libraries itself."
11909 elif $ar ts bar$_a >/dev/null 2>&1 &&
11910 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11911 ./foobar >/dev/null 2>&1; then
11912 echo "a table of contents needs to be added with '$ar ts'."
11919 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11920 $test -f $ranlib || ranlib=''
11923 if $test -n "$ranlib"; then
11924 echo "your system has '$ranlib'; we'll use that."
11927 echo "your system doesn't seem to support random libraries"
11928 echo "so we'll use lorder and tsort to order the libraries."
11935 : check for type of arguments to select.
11936 case "$selecttype" in
11937 '') case "$d_select" in
11940 Checking to see what type of arguments are accepted by select().
11942 hdrs="$define sys/types.h
11943 $i_systime sys/time.h
11944 $i_sysselct sys/select.h
11945 $d_socket sys/socket.h"
11946 : The first arg can be int, unsigned, or size_t
11947 : The last arg may or may not be 'const'
11949 : void pointer has been seen but using that
11950 : breaks the selectminbits test
11951 for xxx in 'fd_set *' 'int *'; do
11952 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11953 for tmo in 'struct timeval *' 'const struct timeval *'; do
11955 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11956 if ./protochk "$try" $hdrs; then
11957 echo "Your system accepts $xxx."
11966 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11967 case "$d_fd_set" in
11968 $define) dflt="fd_set *" ;;
11977 *) : no select, so pick a harmless default
11984 : check for the select 'width'
11985 case "$selectminbits" in
11986 '') case "$d_select" in
11990 Checking to see on how many bits at a time your select() operates...
11993 #include <sys/types.h>
11995 #$i_systime I_SYS_TIME
11996 #$i_systimek I_SYS_TIME_KERNEL
12001 # ifdef I_SYS_TIME_KERNEL
12004 # include <sys/time.h>
12005 # ifdef I_SYS_TIME_KERNEL
12009 #$i_sysselct I_SYS_SELECT
12010 #ifdef I_SYS_SELECT
12011 #include <sys/select.h>
12013 #$d_socket HAS_SOCKET
12015 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12019 #define S sizeof(*(b))
12021 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12022 #define NBITS (NBYTES * 8)
12031 fp = fopen("try.c", "r");
12037 b = ($selecttype)s;
12038 for (i = 0; i < NBITS; i++)
12042 select(fd + 1, b, 0, 0, &t);
12043 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12044 printf("%d\n", i + 1);
12049 if eval $compile_ok; then
12050 selectminbits=`./try`
12051 case "$selectminbits" in
12053 Cannot figure out on how many bits at a time your select() operates.
12054 I'll play safe and guess it is 32 bits.
12060 *) bits="$selectminbits bits" ;;
12062 echo "Your select() operates on $bits at a time." >&4
12064 rp='What is the minimum number of bits your select() operates on?'
12065 case "$byteorder" in
12066 1234|12345678) dflt=32 ;;
12071 selectminbits="$val"
12075 *) : no select, so pick a harmless default
12082 : Trace out the files included by signal.h, then look for SIGxxx names.
12083 : Remove SIGARRAYSIZE used by HPUX.
12084 : Remove SIGSTKSIZE used by Linux.
12085 : Remove SIGSTKSZ used by Posix.
12086 : Remove SIGTYP void lines used by OS2.
12087 xxx=`echo '#include <signal.h>' |
12088 $cppstdin $cppminus $cppflags 2>/dev/null |
12089 $grep '^[ ]*#.*include' |
12090 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12091 : Check this list of files to be sure we have parsed the cpp output ok.
12092 : This will also avoid potentially non-existent files, such
12095 for xx in $xxx /dev/null ; do
12096 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12098 : If we have found no files, at least try signal.h
12099 case "$xxxfiles" in
12100 '') xxxfiles=`./findhdr signal.h` ;;
12103 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12104 print substr($2, 4, 20)
12106 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12107 print substr($3, 4, 20)
12109 : Append some common names just in case the awk scan failed.
12110 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12111 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12112 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12113 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12114 : generate a few handy files for later
12115 $cat > signal.c <<'EOCP'
12116 #include <sys/types.h>
12117 #include <signal.h>
12121 /* Strange style to avoid deeply-nested #if/#else/#endif */
12124 # define NSIG (_NSIG)
12130 # define NSIG (SIGMAX+1)
12136 # define NSIG (SIG_MAX+1)
12142 # define NSIG (MAXSIG+1)
12148 # define NSIG (MAX_SIG+1)
12153 # ifdef SIGARRAYSIZE
12154 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12160 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12164 /* Default to some arbitrary number that's big enough to get most
12165 of the common signals.
12171 printf("NSIG %d\n", NSIG);
12177 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12179 printf "#ifdef SIG"; printf $1; printf "\n"
12180 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12181 printf $1; printf ");\n"
12185 printf "#endif /* JUST_NSIG */\n";
12189 $cat >signal.awk <<'EOP'
12190 BEGIN { ndups = 0 }
12191 $1 ~ /^NSIG$/ { nsig = $2 }
12192 ($1 !~ /^NSIG$/) && (NF == 2) {
12193 if ($2 > maxsig) { maxsig = $2 }
12194 if (sig_name[$2]) {
12195 dup_name[ndups] = $1
12196 dup_num[ndups] = $2
12208 printf("NSIG %d\n", nsig);
12209 for (n = 1; n < nsig; n++) {
12211 printf("%s %d\n", sig_name[n], sig_num[n])
12214 printf("NUM%d %d\n", n, n)
12217 for (n = 0; n < ndups; n++) {
12218 printf("%s %d\n", dup_name[n], dup_num[n])
12222 $cat >signal_cmd <<EOS
12224 if $test -s signal.lst; then
12225 echo "Using your existing signal.lst file"
12230 $cat >>signal_cmd <<'EOS'
12233 if eval $compile_ok; then
12234 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12236 echo "(I can't seem be able to compile the whole test program)" >&4
12237 echo "(I'll try it in little pieces.)" >&4
12238 set signal -DJUST_NSIG
12239 if eval $compile_ok; then
12240 ./signal$_exe > signal.nsg
12243 echo "I can't seem to figure out how many signals you have." >&4
12244 echo "Guessing 50." >&4
12245 echo 'NSIG 50' > signal.nsg
12247 : Now look at all the signal names, one at a time.
12248 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12249 $cat > signal.c <<EOCP
12250 #include <sys/types.h>
12251 #include <signal.h>
12254 printf("$xx %d\n", SIG${xx});
12259 if eval $compile; then
12260 echo "SIG${xx} found."
12261 ./signal$_exe >> signal.ls1
12263 echo "SIG${xx} NOT found."
12266 if $test -s signal.ls1; then
12267 $cat signal.nsg signal.ls1 |
12268 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12272 if $test -s signal.lst; then
12275 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12276 echo 'kill -l' >signal
12277 set X `csh -f <signal`
12281 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12283 echo $@ | $tr ' ' $trnl | \
12284 $awk '{ printf "%s %d\n", $1, ++s; }
12285 END { printf "NSIG %d\n", ++s }' >signal.lst
12287 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12289 chmod a+x signal_cmd
12290 $eunicefix signal_cmd
12292 : generate list of signal names
12294 case "$sig_name_init" in
12296 *) case "$sig_num_init" in
12297 ''|*,*) doinit=yes ;;
12302 echo "Generating a list of signal names and numbers..." >&4
12304 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12305 sig_name=`$awk 'BEGIN { printf "ZERO " }
12306 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12307 sig_num=`$awk 'BEGIN { printf "0 " }
12308 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12309 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12310 !/^NSIG/ { printf "\"%s\", ", $1 }
12311 END { printf "0\n" }' signal.lst`
12312 sig_num_init=`$awk 'BEGIN { printf "0, " }
12313 !/^NSIG/ { printf "%d, ", $2}
12314 END { printf "0\n"}' signal.lst`
12317 echo "The following $sig_count signals are available:"
12319 echo $sig_name | $awk \
12320 'BEGIN { linelen = 0 }
12322 for (i = 1; i <= NF; i++) {
12323 name = "SIG" $i " "
12324 linelen = linelen + length(name)
12325 if (linelen > 70) {
12327 linelen = length(name)
12333 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12335 : see what type is used for signed size_t
12336 set ssize_t ssizetype int stdio.h sys/types.h
12339 $cat > ssize.c <<EOM
12341 #include <sys/types.h>
12342 #define Size_t $sizetype
12343 #define SSize_t $dflt
12346 if (sizeof(Size_t) == sizeof(SSize_t))
12348 else if (sizeof(Size_t) == sizeof(int))
12357 if eval $compile_ok && ./ssize > /dev/null; then
12358 ssizetype=`./ssize`
12359 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12362 Help! I can't compile and run the ssize_t test program: please enlighten me!
12363 (This is probably a misconfiguration in your system or libraries, and
12364 you really ought to fix it. Still, I'll try anyway.)
12366 I need a type that is the same size as $sizetype, but is guaranteed to
12367 be signed. Common values are ssize_t, int and long.
12370 rp="What signed type is the same size as $sizetype?"
12374 $rm -f ssize ssize.*
12376 : see what type of char stdio uses.
12378 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12379 echo "Your stdio uses unsigned chars." >&4
12380 stdchar="unsigned char"
12382 echo "Your stdio uses signed chars." >&4
12386 : see if time exists
12388 if test "X$d_time" = X -o X"$timetype" = X; then
12389 if set time val -f d_time; eval $csym; $val; then
12390 echo 'time() found.' >&4
12392 rp="What is the type returned by time() on this system?"
12393 set time_t timetype long stdio.h sys/types.h
12396 echo 'time() not found, hope that will do.' >&4
12404 : see what type uids are declared as in the kernel
12406 echo "Looking for the type for user ids returned by getuid()."
12407 set uid_t uidtype xxx stdio.h sys/types.h
12411 xxx=`./findhdr sys/user.h`
12412 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12414 unsigned) dflt="$1 $2" ;;
12418 *) dflt="$uidtype";;
12421 uid_t) echo "uid_t found." ;;
12422 *) rp="What is the type for user ids returned by getuid()?"
12428 : see if dbm.h is available
12429 : see if dbmclose exists
12430 set dbmclose d_dbmclose
12433 case "$d_dbmclose" in
12443 *) set rpcsvc/dbm.h i_rpcsvcdbm
12448 *) echo "We won't be including <dbm.h>"
12458 : see if this is a sys/file.h system
12463 : do we need to include sys/file.h ?
12467 if $h_sysfile; then
12469 echo "We'll be including <sys/file.h>." >&4
12472 echo "We won't be including <sys/file.h>." >&4
12482 : see if fcntl.h is there
12487 : see if we can include fcntl.h
12493 echo "We'll be including <fcntl.h>." >&4
12496 if $h_sysfile; then
12497 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12499 echo "We won't be including <fcntl.h>." >&4
12511 : see if locale.h is available
12512 set locale.h i_locale
12515 : see if mach cthreads are available
12516 if test "X$usethreads" = "X$define"; then
12517 set mach/cthreads.h i_machcthr
12520 i_machcthr="$undef"
12525 : see if this is a math.h system
12529 : see if this is a mntent.h system
12530 set mntent.h i_mntent
12533 : see if ndbm.h is available
12538 : see if dbm_open exists
12539 set dbm_open d_dbm_open
12541 case "$d_dbm_open" in
12544 echo "We won't be including <ndbm.h>"
12553 : see if net/errno.h is available
12555 set net/errno.h val
12558 : Unfortunately, it causes problems on some systems. Arrgh.
12561 cat > try.c <<'EOM'
12564 #include <net/errno.h>
12570 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12571 echo "We'll be including <net/errno.h>." >&4
12573 echo "We won't be including <net/errno.h>." >&4
12582 : see if netinet/tcp.h is available
12583 set netinet/tcp.h i_netinettcp
12586 : see if this is a poll.h system
12590 : get C preprocessor symbols handy
12592 $echo $n "Hmm... $c"
12593 echo $al | $tr ' ' $trnl >Cppsym.know
12594 $cat <<EOSS >Cppsym
12602 case "\$list\$#" in
12605 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12607 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12610 unknown="\$unknown \$sym"
12620 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12622 exit 0; _ _ _ _\1\\ \1\\
12625 echo "exit 1; _ _ _" >>Cppsym\$\$
12626 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12628 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12634 $rm -f Cppsym\$\$ Cppsym2\$\$
12639 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12641 : now check the C compiler for additional symbols
12642 postprocess_cc_v=''
12644 aix) postprocess_cc_v="|$tr , ' '" ;;
12651 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12654 -D*) echo "\$i" | $sed 's/^-D//';;
12655 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12660 postprocess_cc_v=''
12663 ./ccsym > ccsym1.raw
12664 if $test -s ccsym1.raw; then
12665 $sort ccsym1.raw | $uniq >ccsym.raw
12667 mv ccsym1.raw ccsym.raw
12670 $awk '/\=/ { print $0; next }
12671 { print $0"=1" }' ccsym.raw >ccsym.list
12672 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12673 $comm -13 ccsym.true ccsym.list >ccsym.own
12674 $comm -12 ccsym.true ccsym.list >ccsym.com
12675 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12677 if $test -z ccsym.raw; then
12678 echo "Your C compiler doesn't seem to define any symbols!" >&4
12680 echo "However, your C preprocessor defines the following symbols:"
12683 cppsymbols=`$cat Cppsym.true`
12684 cppsymbols=`echo $cppsymbols`
12685 cppccsymbols="$cppsymbols"
12687 if $test -s ccsym.com; then
12688 echo "Your C compiler and pre-processor define these symbols:"
12689 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12692 cppccsymbols=`$cat ccsym.com`
12693 cppccsymbols=`echo $cppccsymbols`
12694 $test "$silent" || sleep 1
12696 if $test -s ccsym.cpp; then
12697 $test "$also" && echo " "
12698 echo "Your C pre-processor ${also}defines the following symbols:"
12699 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12701 cppsymbols=`$cat ccsym.cpp`
12702 cppsymbols=`echo $cppsymbols`
12703 $test "$silent" || sleep 1
12705 if $test -s ccsym.own; then
12706 $test "$also" && echo " "
12707 echo "Your C compiler ${also}defines the following cpp symbols:"
12708 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12709 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12710 ccsymbols=`$cat ccsym.own`
12711 ccsymbols=`echo $ccsymbols`
12712 $test "$silent" || sleep 1
12717 : see if this is a termio system
12721 if $test `./findhdr termios.h`; then
12722 set tcsetattr i_termios
12728 "$define") echo "You have POSIX termios.h... good!" >&4;;
12729 *) if ./Cppsym pyr; then
12730 case "`/bin/universe`" in
12731 ucb) if $test `./findhdr sgtty.h`; then
12733 echo "<sgtty.h> found." >&4
12735 echo "System is pyramid with BSD universe."
12736 echo "<sgtty.h> not found--you could have problems." >&4
12738 *) if $test `./findhdr termio.h`; then
12740 echo "<termio.h> found." >&4
12742 echo "System is pyramid with USG universe."
12743 echo "<termio.h> not found--you could have problems." >&4
12747 if $test `./findhdr termio.h`; then
12748 echo "<termio.h> found." >&4
12750 elif $test `./findhdr sgtty.h`; then
12751 echo "<sgtty.h> found." >&4
12754 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12757 if $test `./findhdr sgtty.h`; then
12758 echo "<sgtty.h> found." >&4
12760 elif $test `./findhdr termio.h`; then
12761 echo "<termio.h> found." >&4
12764 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12768 set i_termio; eval $setvar
12769 val=$val2; set i_sgtty; eval $setvar
12770 val=$val3; set i_termios; eval $setvar
12772 : see if this is a shadow.h system
12773 set shadow.h i_shadow
12776 : see if this is a socks.h system
12777 set socks.h i_socks
12780 : see if stdarg is available
12782 if $test `./findhdr stdarg.h`; then
12783 echo "<stdarg.h> found." >&4
12786 echo "<stdarg.h> NOT found." >&4
12790 : see if varags is available
12792 if $test `./findhdr varargs.h`; then
12793 echo "<varargs.h> found." >&4
12795 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12798 : set up the varargs testing programs
12799 $cat > varargs.c <<EOP
12801 #include <stdarg.h>
12804 #include <varargs.h>
12808 int f(char *p, ...)
12822 p = va_arg(ap, char *);
12827 $cat > varargs <<EOP
12829 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12838 : now check which varargs header should be included
12843 if `./varargs I_STDARG`; then
12845 elif `./varargs I_VARARGS`; then
12850 if `./varargs I_VARARGS`; then
12857 echo "I could not find the definition for va_dcl... You have problems..." >&4
12858 val="$undef"; set i_stdarg; eval $setvar
12859 val="$undef"; set i_varargs; eval $setvar
12864 case "$i_varhdr" in
12866 val="$define"; set i_stdarg; eval $setvar
12867 val="$undef"; set i_varargs; eval $setvar
12870 val="$undef"; set i_stdarg; eval $setvar
12871 val="$define"; set i_varargs; eval $setvar
12874 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12878 : see if stddef is available
12879 set stddef.h i_stddef
12882 : see if sys/access.h is available
12883 set sys/access.h i_sysaccess
12886 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12887 set sys/filio.h i_sysfilio
12890 if $test `./findhdr sys/ioctl.h`; then
12892 echo '<sys/ioctl.h> found.' >&4
12895 if $test $i_sysfilio = "$define"; then
12896 echo '<sys/ioctl.h> NOT found.' >&4
12898 $test $i_sgtty = "$define" && xxx="sgtty.h"
12899 $test $i_termio = "$define" && xxx="termio.h"
12900 $test $i_termios = "$define" && xxx="termios.h"
12901 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12907 : see if sys/resource.h has to be included
12908 set sys/resource.h i_sysresrc
12911 : see if sys/security.h is available
12912 set sys/security.h i_syssecrt
12915 : see if this is a sys/statvfs.h system
12916 set sys/statvfs.h i_sysstatvfs
12919 : see if this is a sys/un.h system
12920 set sys/un.h i_sysun
12923 : see if this is a syswait system
12924 set sys/wait.h i_syswait
12927 : see if this is an utime system
12928 set utime.h i_utime
12931 : see if this is a values.h system
12932 set values.h i_values
12935 : see if this is a vfork system
12938 set vfork.h i_vfork
12946 : see if gdbm.h is available
12951 : see if gdbm_open exists
12952 set gdbm_open d_gdbm_open
12954 case "$d_gdbm_open" in
12957 echo "We won't be including <gdbm.h>"
12967 echo "Looking for extensions..." >&4
12968 : If we are using the old config.sh, known_extensions may contain
12969 : old or inaccurate or duplicate values.
12970 known_extensions=''
12971 nonxs_extensions=''
12972 : We do not use find because it might not be available.
12973 : We do not just use MANIFEST because the user may have dropped
12974 : some additional extensions into the source tree and expect them
12977 : Function to recursively find available extensions, ignoring DynaLoader
12978 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
12982 DynaLoader|dynaload) ;;
12984 if $test -f $xxx/$xxx.xs; then
12985 known_extensions="$known_extensions $1$xxx";
12986 elif $test -f $xxx/Makefile.PL; then
12987 nonxs_extensions="$nonxs_extensions $1$xxx";
12989 if $test -d $xxx -a $# -lt 10; then
12992 eval $find_extensions;
13004 eval $find_extensions
13005 set X $nonxs_extensions
13007 nonxs_extensions="$*"
13008 set X $known_extensions
13010 known_extensions="$*"
13013 : Now see which are supported on this system.
13015 for xxx in $known_extensions ; do
13019 $define) avail_ext="$avail_ext $xxx" ;;
13022 GDBM_File|gdbm_fil)
13024 $define) avail_ext="$avail_ext $xxx" ;;
13027 NDBM_File|ndbm_fil)
13029 $define) avail_ext="$avail_ext $xxx" ;;
13032 ODBM_File|odbm_fil)
13033 case "${i_dbm}${i_rpcsvcdbm}" in
13034 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13038 case "$useposix" in
13039 true|define|y) avail_ext="$avail_ext $xxx" ;;
13043 case "$useopcode" in
13044 true|define|y) avail_ext="$avail_ext $xxx" ;;
13048 case "$d_socket" in
13049 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13053 case "$usethreads" in
13054 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13058 : XXX Do we need a useipcsysv variable here
13059 case "${d_msg}${d_sem}${d_shm}" in
13060 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13063 *) avail_ext="$avail_ext $xxx"
13072 : Now see which nonxs extensions are supported on this system.
13073 : For now assume all are.
13075 for xxx in $nonxs_extensions ; do
13077 *) nonxs_ext="$nonxs_ext $xxx"
13089 A number of extensions are supplied with $package. You may choose to
13090 compile these extensions for dynamic loading (the default), compile
13091 them into the $package executable (static loading), or not include
13092 them at all. Answer "none" to include no extensions.
13093 Note that DynaLoader is always built and need not be mentioned here.
13096 case "$dynamic_ext" in
13097 '') dflt="$avail_ext" ;;
13098 *) dflt="$dynamic_ext"
13099 # Perhaps we are reusing an old out-of-date config.sh.
13102 if test X"$dynamic_ext" != X"$avail_ext"; then
13104 NOTICE: Your previous config.sh list may be incorrect.
13105 The extensions now available to you are
13107 but the default list from your previous config.sh is
13119 rp="What extensions do you wish to load dynamically?"
13122 none) dynamic_ext=' ' ;;
13123 *) dynamic_ext="$ans" ;;
13126 case "$static_ext" in
13128 : Exclude those already listed in dynamic linking
13130 for xxx in $avail_ext; do
13131 case " $dynamic_ext " in
13133 *) dflt="$dflt $xxx" ;;
13140 *) dflt="$static_ext"
13147 rp="What extensions do you wish to load statically?"
13150 none) static_ext=' ' ;;
13151 *) static_ext="$ans" ;;
13156 A number of extensions are supplied with $package. Answer "none"
13157 to include no extensions.
13158 Note that DynaLoader is always built and need not be mentioned here.
13161 case "$static_ext" in
13162 '') dflt="$avail_ext" ;;
13163 *) dflt="$static_ext"
13164 # Perhaps we are reusing an old out-of-date config.sh.
13167 if test X"$static_ext" != X"$avail_ext"; then
13169 NOTICE: Your previous config.sh list may be incorrect.
13170 The extensions now available to you are
13172 but the default list from your previous config.sh is
13181 : Exclude those that are not xs extensions
13185 rp="What extensions do you wish to include?"
13188 none) static_ext=' ' ;;
13189 *) static_ext="$ans" ;;
13194 set X $dynamic_ext $static_ext $nonxs_ext
13198 : Remove build directory name from cppstdin so it can be used from
13199 : either the present location or the final installed location.
13201 : Get out of the UU directory to get correct path name.
13203 case "$cppstdin" in
13205 echo "Stripping down cppstdin path name"
13211 : end of configuration questions
13213 echo "End of configuration questions."
13216 : back to where it started
13217 if test -d ../UU; then
13221 : configuration may be patched via a 'config.over' file
13222 if $test -f config.over; then
13225 rp='I see a config.over file. Do you wish to load it?'
13228 n*) echo "OK, I'll ignore it.";;
13230 echo "Configuration override changes have been loaded."
13235 : in case they want portability, strip down executable paths
13236 case "$d_portable" in
13239 echo "Stripping down executable paths..." >&4
13240 for file in $loclist $trylist; do
13242 eval $file=`basename $temp`
13247 : create config.sh file
13249 echo "Creating config.sh..." >&4
13250 $spitshell <<EOT >config.sh
13253 # This file was produced by running the Configure script. It holds all the
13254 # definitions figured out by Configure. Should you modify one of these values,
13255 # do not forget to propagate your changes by running "Configure -der". You may
13256 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13259 # Package name : $package
13260 # Source directory : $src
13261 # Configuration time: $cf_time
13262 # Configured by : $cf_by
13263 # Target system : $myuname
13273 Revision='$Revision'
13280 alignbytes='$alignbytes'
13281 ansi2knr='$ansi2knr'
13282 aphostname='$aphostname'
13283 apiversion='$apiversion'
13286 archlibexp='$archlibexp'
13287 archname64='$archname64'
13288 archname='$archname'
13289 archobjs='$archobjs'
13294 bincompat5005='$bincompat5005'
13298 byteorder='$byteorder'
13300 castflags='$castflags'
13303 cccdlflags='$cccdlflags'
13304 ccdlflags='$ccdlflags'
13306 ccsymbols='$ccsymbols'
13308 cf_email='$cf_email'
13313 clocktype='$clocktype'
13315 compress='$compress'
13316 contains='$contains'
13320 cpp_stuff='$cpp_stuff'
13321 cppccsymbols='$cppccsymbols'
13322 cppflags='$cppflags'
13324 cppminus='$cppminus'
13326 cppstdin='$cppstdin'
13327 cppsymbols='$cppsymbols'
13328 crosscompile='$crosscompile'
13329 cryptlib='$cryptlib'
13331 d_Gconvert='$d_Gconvert'
13332 d_PRIEldbl='$d_PRIEldbl'
13333 d_PRIFldbl='$d_PRIFldbl'
13334 d_PRIGldbl='$d_PRIGldbl'
13335 d_PRIX64='$d_PRIX64'
13336 d_PRId64='$d_PRId64'
13337 d_PRIeldbl='$d_PRIeldbl'
13338 d_PRIfldbl='$d_PRIfldbl'
13339 d_PRIgldbl='$d_PRIgldbl'
13340 d_PRIi64='$d_PRIi64'
13341 d_PRIo64='$d_PRIo64'
13342 d_PRIu64='$d_PRIu64'
13343 d_PRIx64='$d_PRIx64'
13344 d_access='$d_access'
13345 d_accessx='$d_accessx'
13347 d_archlib='$d_archlib'
13350 d_attribut='$d_attribut'
13353 d_bincompat5005='$d_bincompat5005'
13355 d_bsdgetpgrp='$d_bsdgetpgrp'
13356 d_bsdsetpgrp='$d_bsdsetpgrp'
13358 d_casti32='$d_casti32'
13359 d_castneg='$d_castneg'
13360 d_charvspr='$d_charvspr'
13362 d_chroot='$d_chroot'
13363 d_chsize='$d_chsize'
13364 d_closedir='$d_closedir'
13365 d_cmsghdr_s='$d_cmsghdr_s'
13369 d_cuserid='$d_cuserid'
13370 d_dbl_dig='$d_dbl_dig'
13371 d_difftime='$d_difftime'
13372 d_dirnamlen='$d_dirnamlen'
13373 d_dlerror='$d_dlerror'
13374 d_dlopen='$d_dlopen'
13375 d_dlsymun='$d_dlsymun'
13376 d_dosuid='$d_dosuid'
13377 d_drand48proto='$d_drand48proto'
13379 d_eaccess='$d_eaccess'
13380 d_endgrent='$d_endgrent'
13381 d_endhent='$d_endhent'
13382 d_endnent='$d_endnent'
13383 d_endpent='$d_endpent'
13384 d_endpwent='$d_endpwent'
13385 d_endsent='$d_endsent'
13386 d_endspent='$d_endspent'
13387 d_eofnblk='$d_eofnblk'
13388 d_eunice='$d_eunice'
13389 d_fchmod='$d_fchmod'
13390 d_fchown='$d_fchown'
13392 d_fd_macros='$d_fd_macros'
13393 d_fd_set='$d_fd_set'
13394 d_fds_bits='$d_fds_bits'
13395 d_fgetpos64='$d_fgetpos64'
13396 d_fgetpos='$d_fgetpos'
13397 d_flexfnam='$d_flexfnam'
13399 d_fopen64='$d_fopen64'
13401 d_fpathconf='$d_fpathconf'
13402 d_fpos64_t='$d_fpos64_t'
13403 d_freopen64='$d_freopen64'
13404 d_fseek64='$d_fseek64'
13405 d_fseeko64='$d_fseeko64'
13406 d_fseeko='$d_fseeko'
13407 d_fsetpos64='$d_fsetpos64'
13408 d_fsetpos='$d_fsetpos'
13409 d_fstatfs='$d_fstatfs'
13410 d_fstatvfs='$d_fstatvfs'
13411 d_ftell64='$d_ftell64'
13412 d_ftello64='$d_ftello64'
13413 d_ftello='$d_ftello'
13415 d_getgrent='$d_getgrent'
13416 d_getgrps='$d_getgrps'
13417 d_gethbyaddr='$d_gethbyaddr'
13418 d_gethbyname='$d_gethbyname'
13419 d_gethent='$d_gethent'
13420 d_gethname='$d_gethname'
13421 d_gethostprotos='$d_gethostprotos'
13422 d_getlogin='$d_getlogin'
13423 d_getmntent='$d_getmntent'
13424 d_getnbyaddr='$d_getnbyaddr'
13425 d_getnbyname='$d_getnbyname'
13426 d_getnent='$d_getnent'
13427 d_getnetprotos='$d_getnetprotos'
13428 d_getpbyname='$d_getpbyname'
13429 d_getpbynumber='$d_getpbynumber'
13430 d_getpent='$d_getpent'
13431 d_getpgid='$d_getpgid'
13432 d_getpgrp2='$d_getpgrp2'
13433 d_getpgrp='$d_getpgrp'
13434 d_getppid='$d_getppid'
13435 d_getprior='$d_getprior'
13436 d_getprotoprotos='$d_getprotoprotos'
13437 d_getpwent='$d_getpwent'
13438 d_getsbyname='$d_getsbyname'
13439 d_getsbyport='$d_getsbyport'
13440 d_getsent='$d_getsent'
13441 d_getservprotos='$d_getservprotos'
13442 d_getspent='$d_getspent'
13443 d_getspnam='$d_getspnam'
13444 d_gettimeod='$d_gettimeod'
13445 d_gnulibc='$d_gnulibc'
13446 d_grpasswd='$d_grpasswd'
13447 d_hasmntopt='$d_hasmntopt'
13450 d_inetaton='$d_inetaton'
13451 d_int64t='$d_int64t'
13452 d_iovec_s='$d_iovec_s'
13453 d_isascii='$d_isascii'
13454 d_killpg='$d_killpg'
13455 d_lchown='$d_lchown'
13457 d_llseek='$d_llseek'
13458 d_locconv='$d_locconv'
13460 d_longdbl='$d_longdbl'
13461 d_longlong='$d_longlong'
13463 d_madvise='$d_madvise'
13465 d_mbstowcs='$d_mbstowcs'
13466 d_mbtowc='$d_mbtowc'
13467 d_memchr='$d_memchr'
13468 d_memcmp='$d_memcmp'
13469 d_memcpy='$d_memcpy'
13470 d_memmove='$d_memmove'
13471 d_memset='$d_memset'
13473 d_mkfifo='$d_mkfifo'
13474 d_mktime='$d_mktime'
13476 d_mprotect='$d_mprotect'
13478 d_msg_ctrunc='$d_msg_ctrunc'
13479 d_msg_dontroute='$d_msg_dontroute'
13480 d_msg_oob='$d_msg_oob'
13481 d_msg_peek='$d_msg_peek'
13482 d_msg_proxy='$d_msg_proxy'
13483 d_msgctl='$d_msgctl'
13484 d_msgget='$d_msgget'
13485 d_msghdr_s='$d_msghdr_s'
13486 d_msgrcv='$d_msgrcv'
13487 d_msgsnd='$d_msgsnd'
13489 d_munmap='$d_munmap'
13490 d_mymalloc='$d_mymalloc'
13492 d_off64_t='$d_off64_t'
13493 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13494 d_oldpthreads='$d_oldpthreads'
13495 d_oldsock='$d_oldsock'
13497 d_pathconf='$d_pathconf'
13499 d_phostname='$d_phostname'
13502 d_portable='$d_portable'
13503 d_pthread_yield='$d_pthread_yield'
13505 d_pwchange='$d_pwchange'
13506 d_pwclass='$d_pwclass'
13507 d_pwcomment='$d_pwcomment'
13508 d_pwexpire='$d_pwexpire'
13509 d_pwgecos='$d_pwgecos'
13510 d_pwpasswd='$d_pwpasswd'
13511 d_pwquota='$d_pwquota'
13512 d_readdir='$d_readdir'
13513 d_readlink='$d_readlink'
13515 d_recvmsg='$d_recvmsg'
13516 d_rename='$d_rename'
13517 d_rewinddir='$d_rewinddir'
13519 d_safebcpy='$d_safebcpy'
13520 d_safemcpy='$d_safemcpy'
13521 d_sanemcmp='$d_sanemcmp'
13522 d_sched_yield='$d_sched_yield'
13523 d_scm_rights='$d_scm_rights'
13524 d_seekdir='$d_seekdir'
13525 d_select='$d_select'
13527 d_semctl='$d_semctl'
13528 d_semctl_semid_ds='$d_semctl_semid_ds'
13529 d_semctl_semun='$d_semctl_semun'
13530 d_semget='$d_semget'
13532 d_sendmsg='$d_sendmsg'
13533 d_setegid='$d_setegid'
13534 d_seteuid='$d_seteuid'
13535 d_setgrent='$d_setgrent'
13536 d_setgrps='$d_setgrps'
13537 d_sethent='$d_sethent'
13538 d_setlinebuf='$d_setlinebuf'
13539 d_setlocale='$d_setlocale'
13540 d_setnent='$d_setnent'
13541 d_setpent='$d_setpent'
13542 d_setpgid='$d_setpgid'
13543 d_setpgrp2='$d_setpgrp2'
13544 d_setpgrp='$d_setpgrp'
13545 d_setprior='$d_setprior'
13546 d_setpwent='$d_setpwent'
13547 d_setregid='$d_setregid'
13548 d_setresgid='$d_setresgid'
13549 d_setresuid='$d_setresuid'
13550 d_setreuid='$d_setreuid'
13551 d_setrgid='$d_setrgid'
13552 d_setruid='$d_setruid'
13553 d_setsent='$d_setsent'
13554 d_setsid='$d_setsid'
13555 d_setspent='$d_setspent'
13556 d_setvbuf='$d_setvbuf'
13560 d_shmatprototype='$d_shmatprototype'
13561 d_shmctl='$d_shmctl'
13563 d_shmget='$d_shmget'
13564 d_sigaction='$d_sigaction'
13565 d_sigsetjmp='$d_sigsetjmp'
13566 d_socket='$d_socket'
13567 d_sockpair='$d_sockpair'
13568 d_statblks='$d_statblks'
13569 d_statfs='$d_statfs'
13570 d_statfsflags='$d_statfsflags'
13571 d_statvfs='$d_statvfs'
13572 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13573 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13574 d_stdio_stream_array='$d_stdio_stream_array'
13575 d_stdiobase='$d_stdiobase'
13576 d_stdstdio='$d_stdstdio'
13577 d_strchr='$d_strchr'
13578 d_strcoll='$d_strcoll'
13579 d_strctcpy='$d_strctcpy'
13580 d_strerrm='$d_strerrm'
13581 d_strerror='$d_strerror'
13582 d_strtod='$d_strtod'
13583 d_strtol='$d_strtol'
13584 d_strtoul='$d_strtoul'
13585 d_strtoull='$d_strtoull'
13586 d_strxfrm='$d_strxfrm'
13587 d_suidsafe='$d_suidsafe'
13588 d_symlink='$d_symlink'
13589 d_syscall='$d_syscall'
13590 d_sysconf='$d_sysconf'
13591 d_sysernlst='$d_sysernlst'
13592 d_syserrlst='$d_syserrlst'
13593 d_system='$d_system'
13594 d_tcgetpgrp='$d_tcgetpgrp'
13595 d_tcsetpgrp='$d_tcsetpgrp'
13596 d_telldir='$d_telldir'
13597 d_telldirproto='$d_telldirproto'
13600 d_tmpfile64='$d_tmpfile64'
13601 d_truncate='$d_truncate'
13602 d_tzname='$d_tzname'
13605 d_union_semun='$d_union_semun'
13606 d_vendorlib='$d_vendorlib'
13608 d_void_closedir='$d_void_closedir'
13609 d_voidsig='$d_voidsig'
13610 d_voidtty='$d_voidtty'
13611 d_volatile='$d_volatile'
13612 d_vprintf='$d_vprintf'
13614 d_waitpid='$d_waitpid'
13615 d_wcstombs='$d_wcstombs'
13616 d_wctomb='$d_wctomb'
13617 d_writev='$d_writev'
13620 db_hashtype='$db_hashtype'
13621 db_prefixtype='$db_prefixtype'
13622 defvoidused='$defvoidused'
13623 direntrytype='$direntrytype'
13626 doublesize='$doublesize'
13628 dynamic_ext='$dynamic_ext'
13634 eunicefix='$eunicefix'
13637 extensions='$extensions'
13638 fflushNULL='$fflushNULL'
13639 fflushall='$fflushall'
13641 firstmakefile='$firstmakefile'
13643 fpostype='$fpostype'
13644 freetype='$freetype'
13646 full_csh='$full_csh'
13647 full_sed='$full_sed'
13648 gccversion='$gccversion'
13652 groupcat='$groupcat'
13653 groupstype='$groupstype'
13656 h_sysfile='$h_sysfile'
13660 i_arpainet='$i_arpainet'
13661 i_bsdioctl='$i_bsdioctl'
13664 i_dirent='$i_dirent'
13671 i_inttypes='$i_inttypes'
13672 i_limits='$i_limits'
13673 i_locale='$i_locale'
13674 i_machcthr='$i_machcthr'
13675 i_malloc='$i_malloc'
13677 i_memory='$i_memory'
13678 i_mntent='$i_mntent'
13681 i_neterrno='$i_neterrno'
13682 i_netinettcp='$i_netinettcp'
13685 i_pthread='$i_pthread'
13687 i_rpcsvcdbm='$i_rpcsvcdbm'
13690 i_shadow='$i_shadow'
13692 i_stdarg='$i_stdarg'
13693 i_stddef='$i_stddef'
13694 i_stdlib='$i_stdlib'
13695 i_string='$i_string'
13696 i_sysaccess='$i_sysaccess'
13697 i_sysdir='$i_sysdir'
13698 i_sysfile='$i_sysfile'
13699 i_sysfilio='$i_sysfilio'
13701 i_sysioctl='$i_sysioctl'
13702 i_sysmman='$i_sysmman'
13703 i_sysmount='$i_sysmount'
13704 i_sysndir='$i_sysndir'
13705 i_sysparam='$i_sysparam'
13706 i_sysresrc='$i_sysresrc'
13707 i_syssecrt='$i_syssecrt'
13708 i_sysselct='$i_sysselct'
13709 i_syssockio='$i_syssockio'
13710 i_sysstat='$i_sysstat'
13711 i_sysstatvfs='$i_sysstatvfs'
13712 i_systime='$i_systime'
13713 i_systimek='$i_systimek'
13714 i_systimes='$i_systimes'
13715 i_systypes='$i_systypes'
13716 i_sysuio='$i_sysuio'
13718 i_syswait='$i_syswait'
13719 i_termio='$i_termio'
13720 i_termios='$i_termios'
13722 i_unistd='$i_unistd'
13724 i_values='$i_values'
13725 i_varargs='$i_varargs'
13726 i_varhdr='$i_varhdr'
13728 ignore_versioned_solibs='$ignore_versioned_solibs'
13731 installarchlib='$installarchlib'
13732 installbin='$installbin'
13733 installman1dir='$installman1dir'
13734 installman3dir='$installman3dir'
13735 installprefix='$installprefix'
13736 installprefixexp='$installprefixexp'
13737 installprivlib='$installprivlib'
13738 installscript='$installscript'
13739 installsitearch='$installsitearch'
13740 installsitelib='$installsitelib'
13741 installstyle='$installstyle'
13742 installusrbinperl='$installusrbinperl'
13743 installvendorlib='$installvendorlib'
13745 known_extensions='$known_extensions'
13749 lddlflags='$lddlflags'
13751 ldlibpthname='$ldlibpthname'
13758 libswanted='$libswanted'
13764 locincpth='$locincpth'
13765 loclibpth='$loclibpth'
13766 longdblsize='$longdblsize'
13767 longlongsize='$longlongsize'
13768 longsize='$longsize'
13772 lseeksize='$lseeksize'
13773 lseektype='$lseektype'
13777 make_set_make='$make_set_make'
13778 mallocobj='$mallocobj'
13779 mallocsrc='$mallocsrc'
13780 malloctype='$malloctype'
13782 man1direxp='$man1direxp'
13785 man3direxp='$man3direxp'
13789 mips_type='$mips_type'
13791 mmaptype='$mmaptype'
13793 modetype='$modetype'
13795 multiarch='$multiarch'
13797 myarchname='$myarchname'
13798 mydomain='$mydomain'
13799 myhostname='$myhostname'
13802 netdb_hlen_type='$netdb_hlen_type'
13803 netdb_host_type='$netdb_host_type'
13804 netdb_name_type='$netdb_name_type'
13805 netdb_net_type='$netdb_net_type'
13808 nm_so_opt='$nm_so_opt'
13809 nonxs_ext='$nonxs_ext'
13811 o_nonblock='$o_nonblock'
13813 old_pthread_create_joinable='$old_pthread_create_joinable'
13814 optimize='$optimize'
13815 orderlib='$orderlib'
13821 patchlevel='$patchlevel'
13822 path_sep='$path_sep'
13824 perladmin='$perladmin'
13825 perlpath='$perlpath'
13827 phostname='$phostname'
13833 prefixexp='$prefixexp'
13835 privlibexp='$privlibexp'
13836 prototype='$prototype'
13838 randbits='$randbits'
13839 randfunc='$randfunc'
13840 randseedtype='$randseedtype'
13842 rd_nodata='$rd_nodata'
13846 sPRIEldbl='$sPRIEldbl'
13847 sPRIFldbl='$sPRIFldbl'
13848 sPRIGldbl='$sPRIGldbl'
13851 sPRIeldbl='$sPRIeldbl'
13852 sPRIfldbl='$sPRIfldbl'
13853 sPRIgldbl='$sPRIgldbl'
13858 sched_yield='$sched_yield'
13859 scriptdir='$scriptdir'
13860 scriptdirexp='$scriptdirexp'
13862 seedfunc='$seedfunc'
13863 selectminbits='$selectminbits'
13864 selecttype='$selecttype'
13865 sendmail='$sendmail'
13868 sharpbang='$sharpbang'
13869 shmattype='$shmattype'
13870 shortsize='$shortsize'
13873 sig_count='$sig_count'
13874 sig_name='$sig_name'
13875 sig_name_init='$sig_name_init'
13877 sig_num_init='$sig_num_init'
13878 signal_t='$signal_t'
13879 sitearch='$sitearch'
13880 sitearchexp='$sitearchexp'
13882 sitelibexp='$sitelibexp'
13883 siteprefix='$siteprefix'
13884 siteprefixexp='$siteprefixexp'
13885 sizetype='$sizetype'
13890 sockethdr='$sockethdr'
13891 socketlib='$socketlib'
13893 spackage='$spackage'
13894 spitshell='$spitshell'
13897 ssizetype='$ssizetype'
13898 startperl='$startperl'
13900 static_ext='$static_ext'
13902 stdio_base='$stdio_base'
13903 stdio_bufsiz='$stdio_bufsiz'
13904 stdio_cnt='$stdio_cnt'
13905 stdio_filbuf='$stdio_filbuf'
13906 stdio_ptr='$stdio_ptr'
13907 stdio_stream_array='$stdio_stream_array'
13910 subversion='$subversion'
13917 timeincl='$timeincl'
13918 timetype='$timetype'
13926 use64bits='$use64bits'
13928 uselongdouble='$uselongdouble'
13929 usemultiplicity='$usemultiplicity'
13930 usemymalloc='$usemymalloc'
13932 useopcode='$useopcode'
13933 useperlio='$useperlio'
13934 useposix='$useposix'
13936 useshrplib='$useshrplib'
13937 usesocks='$usesocks'
13938 usethreads='$usethreads'
13939 usevendorprefix='$usevendorprefix'
13940 usevfork='$usevfork'
13943 vendorlib='$vendorlib'
13944 vendorlibexp='$vendorlibexp'
13945 vendorprefix='$vendorprefix'
13946 vendorprefixexp='$vendorprefixexp'
13949 voidflags='$voidflags'
13955 : Add in command line options if available
13956 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13958 : add special variables
13959 $test -f $src/patchlevel.h && \
13960 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13961 echo "CONFIGDOTSH=true" >>config.sh
13963 : propagate old symbols
13964 if $test -f UU/config.sh; then
13965 <UU/config.sh sort | uniq >UU/oldconfig.sh
13966 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13967 sort | uniq -u >UU/oldsyms
13968 set X `cat UU/oldsyms`
13974 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13976 echo "# Variables propagated from previous config.sh file." >>config.sh
13977 for sym in `cat UU/oldsyms`; do
13978 echo " Propagating $hint variable "'$'"$sym..."
13979 eval 'tmp="$'"${sym}"'"'
13981 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13987 : Finish up by extracting the .SH files
14001 If you'd like to make any changes to the config.sh file before I begin
14002 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14005 rp="Press return or use a shell escape to edit config.sh:"
14010 *) : in case they cannot read
14011 sh 1>&4 -c "$ans";;
14016 : if this fails, just run all the .SH files by hand
14023 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14030 Now you need to generate make dependencies by running "$make depend".
14031 You might prefer to run it in background: "$make depend > makedepend.out &"
14032 It can take a while, so you might not want to run it right now.
14037 rp="Run $make depend now?"
14041 $make depend && echo "Now you must run a $make."
14044 echo "You must run '$make depend' then '$make'."
14047 elif test -f [Mm]akefile; then
14049 echo "Now you must run a $make."
14054 if $test -f Policy.sh; then
14057 If you compile $package on a different machine or from a different object
14058 directory, copy the Policy.sh file from this object directory to the
14059 new one before you run Configure -- this will help you with most of
14060 the policy defaults.
14064 if $test -f config.msg; then
14065 echo "Hmm. I also noted the following information while running:"
14067 $cat config.msg >&4
14070 $rm -f kit*isdone ark*isdone