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:03:17 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?'
6444 y|Y) val="$define" ;;
6450 case "$uselongdouble" in
6451 "$define"|true|[yY]*)
6452 : Look for a hint-file generated 'call-back-unit'. If the
6453 : user has specified that long doubles should be used,
6454 : we may need to set or change some other defaults.
6455 if $test -f uselongdouble.cbu; then
6456 echo "Your platform has some specific hints for long doubles, using them..."
6457 . ./uselongdouble.cbu
6460 (Your platform doesn't have any specific hints for long doubles.)
6468 Previous version of $package used the standard IO mechanisms as defined
6469 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6470 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6471 the default. This abstraction layer can use AT&T's sfio (if you already
6472 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6473 problems with some extension modules. Using PerlIO with stdio is safe,
6474 but it is slower than plain stdio and therefore is not the default.
6476 If this doesn't make any sense to you, just accept the default 'n'.
6478 case "$useperlio" in
6479 $define|true|[yY]*) dflt='y';;
6482 rp='Use the experimental PerlIO abstraction layer?'
6489 echo "Ok, doing things the stdio way"
6496 : Check how to convert floats to strings.
6497 if test "X$d_Gconvert" = X; then
6499 echo "Checking for an efficient way to convert floats to strings."
6502 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6503 char *myname = "gconvert";
6506 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6507 char *myname = "gcvt";
6510 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6511 char *myname = "sprintf";
6517 checkit(expect, got)
6521 if (strcmp(expect, got)) {
6522 printf("%s oddity: Expected %s, got %s\n",
6523 myname, expect, got);
6533 /* This must be 1st test on (which?) platform */
6534 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6535 Gconvert(0.1, 8, 0, buf);
6536 checkit("0.1", buf);
6538 Gconvert(1.0, 8, 0, buf);
6541 Gconvert(0.0, 8, 0, buf);
6544 Gconvert(-1.0, 8, 0, buf);
6547 /* Some Linux gcvt's give 1.e+5 here. */
6548 Gconvert(100000.0, 8, 0, buf);
6549 checkit("100000", buf);
6551 /* Some Linux gcvt's give -1.e+5 here. */
6552 Gconvert(-100000.0, 8, 0, buf);
6553 checkit("-100000", buf);
6558 case "$d_Gconvert" in
6559 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6560 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6561 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6562 *) xxx_list='gconvert gcvt sprintf' ;;
6565 for xxx_convert in $xxx_list; do
6566 echo "Trying $xxx_convert"
6568 set try -DTRY_$xxx_convert
6569 if eval $compile; then
6570 echo "$xxx_convert" found. >&4
6572 echo "I'll use $xxx_convert to convert floats into a string." >&4
6575 echo "...But $xxx_convert didn't work as I expected."
6578 echo "$xxx_convert NOT found." >&4
6582 case "$xxx_convert" in
6583 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6584 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6585 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6589 : see if inttypes.h is available
6590 : we want a real compile instead of Inhdr because some systems
6591 : have an inttypes.h which includes non-existent headers
6594 #include <inttypes.h>
6596 static int32_t foo32 = 0x12345678;
6600 if eval $compile; then
6601 echo "<inttypes.h> found." >&4
6604 echo "<inttypes.h> NOT found." >&4
6612 case "$use64bits" in
6615 echo $n "Checking to see if your system supports int64_t...$c" >&4
6617 #include <sys/types.h>
6618 #$i_inttypes I_INTTYPES
6620 #include <inttypes.h>
6622 int64_t foo() { int64_t x; x = 7; return x; }
6624 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6626 echo " Yup, it does." >&4
6629 echo " Nope, it doesn't." >&4
6640 : check for lengths of integral types
6644 echo "Checking to see how big your integers are..." >&4
6645 $cat >intsize.c <<'EOCP'
6649 printf("intsize=%d;\n", sizeof(int));
6650 printf("longsize=%d;\n", sizeof(long));
6651 printf("shortsize=%d;\n", sizeof(short));
6656 if eval $compile_ok && ./intsize > /dev/null; then
6658 echo "Your integers are $intsize bytes long."
6659 echo "Your long integers are $longsize bytes long."
6660 echo "Your short integers are $shortsize bytes long."
6664 Help! I can't compile and run the intsize test program: please enlighten me!
6665 (This is probably a misconfiguration in your system or libraries, and
6666 you really ought to fix it. Still, I'll try anyway.)
6670 rp="What is the size of an integer (in bytes)?"
6674 rp="What is the size of a long integer (in bytes)?"
6678 rp="What is the size of a short integer (in bytes)?"
6684 $rm -f intsize intsize.*
6686 : check for long long
6688 echo $n "Checking to see if your system supports long long...$c" >&4
6689 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6690 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6692 echo " Yup, it does." >&4
6695 echo " Nope, it doesn't." >&4
6701 : check for length of long long
6702 case "${d_longlong}${longlongsize}" in
6705 $echo $n "Checking to see how big your long longs are...$c" >&4
6706 $cat >try.c <<'EOCP'
6710 printf("%d\n", sizeof(long long));
6714 if eval $compile_ok; then
6715 longlongsize=`./try`
6716 $echo " $longlongsize bytes." >&4
6720 echo "(I can't seem to compile the test program. Guessing...)"
6721 rp="What is the size of a long long (in bytes)?"
6725 if $test "X$longsize" = "X$longlongsize"; then
6726 echo "(That isn't any different from an ordinary long.)"
6734 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6736 echo "Checking how to print 64-bit integers..." >&4
6738 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6740 $cat >try.c <<'EOCP'
6741 #include <sys/types.h>
6744 int q = 12345678901;
6749 if eval $compile; then
6753 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6754 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6755 echo "We will use %d."
6761 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6763 $cat >try.c <<'EOCP'
6764 #include <sys/types.h>
6767 long q = 12345678901;
6772 if eval $compile; then
6776 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6777 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6778 echo "We will use %ld."
6784 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6786 $cat >try.c <<'EOCP'
6787 #include <sys/types.h>
6788 #include <inttypes.h>
6791 int64_t q = 12345678901;
6792 printf("%" PRId64 "\n", q);
6796 if eval $compile; then
6800 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6801 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6802 echo "We will use the C9X style."
6808 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6810 $cat >try.c <<'EOCP'
6811 #include <sys/types.h>
6814 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6815 printf("%lld\n", q);
6819 if eval $compile; then
6823 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6824 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6825 echo "We will use the %lld style."
6831 if $test X"$sPRId64" = X -a X"$quad" != X; then
6833 #include <sys/types.h>
6836 $quad q = 12345678901;
6841 if eval $compile; then
6845 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6846 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6847 echo "We will use %lld."
6853 if $test X"$sPRId64" = X -a X"$quad" != X; then
6855 #include <sys/types.h>
6858 $quad q = 12345678901;
6863 if eval $compile; then
6867 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6868 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6869 echo "We will use %qd."
6875 if $test X"$sPRId64" = X; then
6876 echo "Cannot figure out how to print 64-bit integers." >&4
6881 fi # intsize -o longsize -o d_int64t -o d_longlong
6884 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6885 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6887 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6888 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6892 : check for length of double
6894 case "$doublesize" in
6896 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6897 $cat >try.c <<'EOCP'
6901 printf("%d\n", sizeof(double));
6905 if eval $compile_ok; then
6907 $echo " $doublesize bytes." >&4
6910 echo "(I can't seem to compile the test program. Guessing...)"
6911 rp="What is the size of a double precision number (in bytes)?"
6919 : check for long doubles
6921 echo $n "Checking to see if your system supports long doubles...$c" >&4
6922 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6923 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6925 echo " Yup, it does." >&4
6928 echo " Nope, it doesn't." >&4
6934 : check for length of long double
6935 case "${d_longdbl}${longdblsize}" in
6938 $echo $n "Checking to see how big your long doubles are...$c" >&4
6939 $cat >try.c <<'EOCP'
6943 printf("%d\n", sizeof(long double));
6947 if eval $compile; then
6949 $echo " $longdblsize bytes." >&4
6953 echo "(I can't seem to compile the test program. Guessing...)" >&4
6954 rp="What is the size of a long double (in bytes)?"
6958 if $test "X$doublesize" = "X$longdblsize"; then
6959 echo "(That isn't any different from an ordinary double.)"
6967 if $test X"$d_longdbl" = X"$define"; then
6969 echo "Checking how to print long doubles..." >&4
6971 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6972 $cat >try.c <<'EOCP'
6973 #include <sys/types.h>
6977 printf("%.3f\n", d);
6981 if eval $compile; then
6985 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6986 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6987 echo "We will use %f."
6993 if $test X"$sPRIfldbl" = X; then
6994 $cat >try.c <<'EOCP'
6995 #include <sys/types.h>
6998 long double d = 123.456;
6999 printf("%.3llf\n", d);
7003 if eval $compile; then
7007 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7008 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7009 echo "We will use %llf."
7015 if $test X"$sPRIfldbl" = X; then
7016 $cat >try.c <<'EOCP'
7017 #include <sys/types.h>
7020 long double d = 123.456;
7021 printf("%.3Lf\n", d);
7025 if eval $compile; then
7029 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7030 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7031 echo "We will use %Lf."
7037 if $test X"$sPRIfldbl" = X; then
7038 $cat >try.c <<'EOCP'
7039 #include <sys/types.h>
7042 long double d = 123.456;
7043 printf("%.3lf\n", d);
7047 if eval $compile; then
7051 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7052 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7053 echo "We will use %lf."
7059 if $test X"$sPRIfldbl" = X; then
7060 echo "Cannot figure out how to print long doubles." >&4
7067 case "$sPRIfldbl" in
7068 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7069 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7071 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7072 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7076 : Initialize h_fcntl
7079 : Initialize h_sysfile
7082 : access call always available on UNIX
7086 : locate the flags for 'access()'
7090 $cat >access.c <<'EOCP'
7091 #include <sys/types.h>
7096 #include <sys/file.h>
7105 : check sys/file.h first, no particular reason here
7106 if $test `./findhdr sys/file.h` && \
7107 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7109 echo "<sys/file.h> defines the *_OK access constants." >&4
7110 elif $test `./findhdr fcntl.h` && \
7111 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7113 echo "<fcntl.h> defines the *_OK access constants." >&4
7114 elif $test `./findhdr unistd.h` && \
7115 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7116 echo "<unistd.h> defines the *_OK access constants." >&4
7118 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7124 : see if accessx exists
7125 set accessx d_accessx
7128 : see if alarm exists
7132 : see if atolf exists
7136 : see if atoll exists
7140 : Look for GNU-cc style attribute checking
7142 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7143 $cat >attrib.c <<'EOCP'
7145 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7147 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7148 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7149 echo "Your C compiler doesn't fully support __attribute__."
7152 echo "Your C compiler supports __attribute__."
7156 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7163 : see if bcmp exists
7167 : see if bcopy exists
7171 : see if this is a unistd.h system
7172 set unistd.h i_unistd
7175 : see if getpgrp exists
7176 set getpgrp d_getpgrp
7179 case "$d_getpgrp" in
7182 echo "Checking to see which flavor of getpgrp is in use..."
7185 #include <sys/types.h>
7187 # include <unistd.h>
7191 if (getuid() == 0) {
7192 printf("(I see you are running Configure as super-user...)\n");
7196 if (getpgrp(1) == 0)
7205 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7206 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7208 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7209 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7212 echo "I can't seem to compile and run the test program."
7214 xxx="a USG one, i.e. you use getpgrp()."
7216 # SVR4 systems can appear rather BSD-ish.
7219 xxx="a BSD one, i.e. you use getpgrp(pid)."
7223 xxx="probably a USG one, i.e. you use getpgrp()."
7228 echo "Assuming your getpgrp is $xxx" >&4
7237 : see if setpgrp exists
7238 set setpgrp d_setpgrp
7241 case "$d_setpgrp" in
7244 echo "Checking to see which flavor of setpgrp is in use..."
7247 #include <sys/types.h>
7249 # include <unistd.h>
7253 if (getuid() == 0) {
7254 printf("(I see you are running Configure as super-user...)\n");
7258 if (-1 == setpgrp(1, 1))
7261 if (setpgrp() != -1)
7267 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7268 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7270 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7271 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7274 echo "(I can't seem to compile and run the test program.)"
7276 xxx="a USG one, i.e. you use setpgrp()."
7278 # SVR4 systems can appear rather BSD-ish.
7281 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7285 xxx="probably a USG one, i.e. you use setpgrp()."
7290 echo "Assuming your setpgrp is $xxx" >&4
7298 : see if bzero exists
7302 : see if signal is declared as pointer to function returning int or void
7304 xxx=`./findhdr signal.h`
7305 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7306 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7307 echo "You have int (*signal())() instead of void." >&4
7309 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7310 echo "You have void (*signal())()." >&4
7312 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7313 echo "You have int (*signal())() instead of void." >&4
7315 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7316 echo "You have void (*signal())()." >&4
7319 case "$d_voidsig" in
7321 echo "I can't determine whether signal handler returns void or int..." >&4
7323 rp="What type does your signal handler return?"
7330 echo "As you already told me, signal handler returns void." >&4
7333 *) echo "As you already told me, signal handler returns int." >&4
7340 case "$d_voidsig" in
7341 "$define") signal_t="void";;
7346 : check for ability to cast large floats to 32-bit ints.
7348 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7349 if $test "$intsize" -ge 4; then
7356 #include <sys/types.h>
7358 $signal_t blech(s) int s; { exit(3); }
7365 signal(SIGFPE, blech);
7367 /* Don't let compiler optimize the test away. Store the number
7368 in a writable string for gcc to pass to sscanf under HP/UX.
7370 sprintf(str, "2147483647");
7371 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7375 /* x86 processors will probably give 0x8000 0000, which is a
7376 sign change. We don't want that. We want to mimic SPARC
7377 behavior here, which is to preserve the sign and give
7380 if (i32 != ($xxx) f)
7386 if eval $compile_ok; then
7390 echo "(I can't seem to compile the test program--assuming it can't)"
7398 echo "Nope, it can't."
7405 : check for ability to cast negative floats to unsigned
7407 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7410 #include <sys/types.h>
7412 $signal_t blech(s) int s; { exit(7); }
7413 $signal_t blech_in_list(s) int s; { exit(4); }
7414 unsigned long dummy_long(p) unsigned long p; { return p; }
7415 unsigned int dummy_int(p) unsigned int p; { return p; }
7416 unsigned short dummy_short(p) unsigned short p; { return p; }
7420 unsigned long along;
7422 unsigned short ashort;
7426 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7427 a direct f = -123. assignment. gcc-2.8.0 reportedly
7428 optimized the whole file away
7430 /* Store the number in a writable string for gcc to pass to
7433 sprintf(str, "-123");
7434 sscanf(str, "%lf", &f); /* f = -123.; */
7436 signal(SIGFPE, blech);
7437 along = (unsigned long)f;
7438 aint = (unsigned int)f;
7439 ashort = (unsigned short)f;
7440 if (along != (unsigned long)-123)
7442 if (aint != (unsigned int)-123)
7444 if (ashort != (unsigned short)-123)
7446 sprintf(str, "1073741824.");
7447 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7450 along = (unsigned long)f;
7451 if (along != 0x80000000)
7455 along = (unsigned long)f;
7456 if (along != 0x7fffffff)
7460 along = (unsigned long)f;
7461 if (along != 0x80000001)
7465 signal(SIGFPE, blech_in_list);
7466 sprintf(str, "123.");
7467 sscanf(str, "%lf", &f); /* f = 123.; */
7468 along = dummy_long((unsigned long)f);
7469 aint = dummy_int((unsigned int)f);
7470 ashort = dummy_short((unsigned short)f);
7471 if (along != (unsigned long)123)
7473 if (aint != (unsigned int)123)
7475 if (ashort != (unsigned short)123)
7482 if eval $compile_ok; then
7486 echo "(I can't seem to compile the test program--assuming it can't)"
7489 case "$castflags" in
7494 echo "Nope, it can't."
7501 : see if vprintf exists
7503 if set vprintf val -f d_vprintf; eval $csym; $val; then
7504 echo 'vprintf() found.' >&4
7506 $cat >vprintf.c <<'EOF'
7507 #include <varargs.h>
7509 int main() { xxx("foo"); }
7518 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7522 if eval $compile && ./vprintf; then
7523 echo "Your vsprintf() returns (int)." >&4
7526 echo "Your vsprintf() returns (char*)." >&4
7530 echo 'vprintf() NOT found.' >&4
7540 : see if chown exists
7544 : see if chroot exists
7548 : see if chsize exists
7552 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7553 while $test $# -ge 2; do
7555 $define) echo "#include <$2>";;
7559 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7560 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7569 : see if this is a sys/uio.h system
7570 set sys/uio.h i_sysuio
7573 echo "Checking to see if your system supports struct iovec..." >&4
7574 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7576 case "$d_iovec_s" in
7577 "$define") echo "Yup, it does." >&4
7579 *) echo "Nope, it doesn't." >&4
7585 : see whether socket exists
7587 $echo $n "Hmm... $c" >&4
7588 if set socket val -f d_socket; eval $csym; $val; then
7589 echo "Looks like you have Berkeley networking support." >&4
7591 if set setsockopt val -f; eval $csym; $val; then
7594 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7598 if $contains socklib libc.list >/dev/null 2>&1; then
7599 echo "Looks like you have Berkeley networking support." >&4
7601 : we will have to assume that it supports the 4.2 BSD interface
7604 echo "You don't have Berkeley networking in libc$_a..." >&4
7605 if test "X$d_socket" = "X$define"; then
7606 echo "...but you seem to believe that you have sockets." >&4
7608 for net in net socket
7610 if test -f /usr/lib/lib$net$_a; then
7611 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7612 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7613 if $contains socket libc.list >/dev/null 2>&1; then
7618 echo "...but the Wollongong group seems to have hacked it in." >&4
7619 sockethdr="-I/usr/netinclude"
7622 echo "Found Berkeley sockets interface in lib$net." >& 4
7623 if $contains setsockopt libc.list >/dev/null 2>&1; then
7626 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7633 if test "X$d_socket" != "X$define"; then
7634 echo "or anywhere else I see." >&4
7642 : see if socketpair exists
7643 set socketpair d_sockpair
7648 echo "Checking the availability of certain socket constants..." >& 4
7649 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7650 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7652 #include <sys/types.h>
7653 #include <sys/socket.h>
7659 set try; if eval $compile; then
7662 set d_${enum}; eval $setvar
7666 set sendmsg d_sendmsg
7669 set recvmsg d_recvmsg
7673 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7674 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7676 case "$d_msghdr_s" in
7677 "$define") echo "Yup, it does." >&4
7679 *) echo "Nope, it doesn't." >&4
7683 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7684 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7686 case "$d_cmsghdr_s" in
7687 "$define") echo "Yup, it does." >&4
7689 *) echo "Nope, it doesn't." >&4
7693 : check for const keyword
7695 echo 'Checking to see if your C compiler knows about "const"...' >&4
7696 $cat >const.c <<'EOCP'
7697 typedef struct spug { int drokk; } spug;
7704 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7706 echo "Yup, it does."
7709 echo "Nope, it doesn't."
7714 : see if crypt exists
7716 if set crypt val -f d_crypt; eval $csym; $val; then
7717 echo 'crypt() found.' >&4
7721 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7722 if $test -z "$cryptlib"; then
7723 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7727 if $test -z "$cryptlib"; then
7728 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7732 if $test -z "$cryptlib"; then
7733 cryptlib=`./loc libcrypt$_a "" $libpth`
7737 if $test -z "$cryptlib"; then
7738 echo 'crypt() NOT found.' >&4
7747 : get csh whereabouts
7749 'csh') val="$undef" ;;
7754 : Respect a hint or command line value for full_csh.
7756 '') full_csh=$csh ;;
7759 : see if cuserid exists
7760 set cuserid d_cuserid
7763 : see if this is a limits.h system
7764 set limits.h i_limits
7767 : see if this is a float.h system
7771 : See if number of significant digits in a double precision number is known
7773 $cat >dbl_dig.c <<EOM
7783 printf("Contains DBL_DIG");
7786 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7787 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7788 echo "DBL_DIG found." >&4
7791 echo "DBL_DIG NOT found." >&4
7798 : see if difftime exists
7799 set difftime d_difftime
7802 : see if this is a dirent system
7804 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7806 echo "<dirent.h> found." >&4
7809 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7810 echo "<sys/dir.h> found." >&4
7813 xinc=`./findhdr sys/ndir.h`
7815 echo "<dirent.h> NOT found." >&4
7820 : Look for type of directory structure.
7822 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7824 case "$direntrytype" in
7827 $define) guess1='struct dirent' ;;
7828 *) guess1='struct direct' ;;
7831 *) guess1="$direntrytype"
7836 'struct dirent') guess2='struct direct' ;;
7837 *) guess2='struct dirent' ;;
7840 if $contains "$guess1" try.c >/dev/null 2>&1; then
7841 direntrytype="$guess1"
7842 echo "Your directory entries are $direntrytype." >&4
7843 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7844 direntrytype="$guess2"
7845 echo "Your directory entries seem to be $direntrytype." >&4
7847 echo "I don't recognize your system's directory entries." >&4
7848 rp="What type is used for directory entries on this system?"
7856 : see if the directory entry stores field length
7858 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7859 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7860 echo "Good, your directory entry keeps length information in d_namlen." >&4
7863 echo "Your directory entry does not know about the d_namlen field." >&4
7870 : see if dlerror exists
7873 set dlerror d_dlerror
7877 : see if dlfcn is available
7885 On a few systems, the dynamically loaded modules that perl generates and uses
7886 will need a different extension than shared libs. The default will probably
7894 rp='What is the extension of dynamically loaded modules'
7903 : Check if dlsym need a leading underscore
7909 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7910 $cat >dyna.c <<'EOM'
7919 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7921 #include <sys/types.h>
7935 int mode = RTLD_LAZY ;
7937 handle = dlopen("./dyna.$dlext", mode) ;
7938 if (handle == NULL) {
7943 symbol = dlsym(handle, "fred") ;
7944 if (symbol == NULL) {
7945 /* try putting a leading underscore */
7946 symbol = dlsym(handle, "_fred") ;
7947 if (symbol == NULL) {
7960 : Call the object file tmp-dyna.o in case dlext=o.
7961 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7962 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7963 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7964 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7967 1) echo "Test program failed using dlopen." >&4
7968 echo "Perhaps you should not use dynamic loading." >&4;;
7969 2) echo "Test program failed using dlsym." >&4
7970 echo "Perhaps you should not use dynamic loading." >&4;;
7971 3) echo "dlsym needs a leading underscore" >&4
7973 4) echo "dlsym doesn't need a leading underscore." >&4;;
7976 echo "I can't compile and run the test program." >&4
7977 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7982 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7987 hasproto='varname=$1; func=$2; shift; shift;
7988 while $test $# -ge 2; do
7990 $define) echo "#include <$2>";;
7994 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7995 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7996 echo "$func() prototype found.";
7999 echo "$func() prototype NOT found.";
8004 $rm -f try.c tryout.c'
8006 : see if prototype for drand48 is available
8008 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8011 : see if dup2 exists
8015 : see if eaccess exists
8016 set eaccess d_eaccess
8019 : see if endgrent exists
8020 set endgrent d_endgrent
8023 : see if endhostent exists
8024 set endhostent d_endhent
8027 : see if endnetent exists
8028 set endnetent d_endnent
8031 : see if endprotoent exists
8032 set endprotoent d_endpent
8035 : see if endpwent exists
8036 set endpwent d_endpwent
8039 : see if endservent exists
8040 set endservent d_endsent
8043 : see if endspent exists
8044 set endspent d_endspent
8047 : Locate the flags for 'open()'
8049 $cat >open3.c <<'EOCP'
8050 #include <sys/types.h>
8055 #include <sys/file.h>
8066 : check sys/file.h first to get FREAD on Sun
8067 if $test `./findhdr sys/file.h` && \
8068 set open3 -DI_SYS_FILE && eval $compile; then
8070 echo "<sys/file.h> defines the O_* constants..." >&4
8072 echo "and you have the 3 argument form of open()." >&4
8075 echo "but not the 3 argument form of open(). Oh, well." >&4
8078 elif $test `./findhdr fcntl.h` && \
8079 set open3 -DI_FCNTL && eval $compile; then
8081 echo "<fcntl.h> defines the O_* constants..." >&4
8083 echo "and you have the 3 argument form of open()." >&4
8086 echo "but not the 3 argument form of open(). Oh, well." >&4
8091 echo "I can't find the O_* constant definitions! You got problems." >&4
8097 : check for non-blocking I/O stuff
8098 case "$h_sysfile" in
8099 true) echo "#include <sys/file.h>" > head.c;;
8102 true) echo "#include <fcntl.h>" > head.c;;
8103 *) echo "#include <sys/fcntl.h>" > head.c;;
8108 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8109 case "$o_nonblock" in
8112 $cat >>try.c <<'EOCP'
8115 printf("O_NONBLOCK\n");
8119 printf("O_NDELAY\n");
8123 printf("FNDELAY\n");
8130 if eval $compile_ok; then
8132 case "$o_nonblock" in
8133 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8134 *) echo "Seems like we can use $o_nonblock.";;
8137 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8140 *) echo "Using $hint value $o_nonblock.";;
8142 $rm -f try try.* .out core
8145 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8151 #include <sys/types.h>
8153 #define MY_O_NONBLOCK $o_nonblock
8154 #ifndef errno /* XXX need better Configure test */
8157 $signal_t blech(x) int x; { exit(3); }
8159 $cat >> try.c <<'EOCP'
8167 pipe(pd); /* Down: child -> parent */
8168 pipe(pu); /* Up: parent -> child */
8171 close(pd[1]); /* Parent reads from pd[0] */
8172 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8173 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8175 signal(SIGALRM, blech);
8177 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8179 sprintf(string, "%d\n", ret);
8180 write(2, string, strlen(string));
8183 if (errno == EAGAIN) {
8189 if (errno == EWOULDBLOCK)
8190 printf("EWOULDBLOCK\n");
8193 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8194 sleep(2); /* Give it time to close our pipe */
8196 ret = read(pd[0], buf, 1); /* Should read EOF */
8198 sprintf(string, "%d\n", ret);
8199 write(3, string, strlen(string));
8203 close(pd[0]); /* We write to pd[1] */
8204 close(pu[1]); /* We read from pu[0] */
8205 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8206 close(pd[1]); /* Pipe pd is now fully closed! */
8207 exit(0); /* Bye bye, thank you for playing! */
8211 if eval $compile_ok; then
8212 echo "$startsh" >mtry
8213 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8215 ./mtry >/dev/null 2>&1
8217 0) eagain=`$cat try.out`;;
8218 1) echo "Could not perform non-blocking setting!";;
8219 2) echo "I did a successful read() for something that was not there!";;
8220 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8221 *) echo "Something terribly wrong happened during testing.";;
8223 rd_nodata=`$cat try.ret`
8224 echo "A read() system call with no data present returns $rd_nodata."
8225 case "$rd_nodata" in
8228 echo "(That's peculiar, fixing that to be -1.)"
8234 echo "Forcing errno EAGAIN on read() with no data available."
8238 echo "Your read() sets errno to $eagain when no data is available."
8241 status=`$cat try.err`
8243 0) echo "And it correctly returns 0 to signal EOF.";;
8244 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8245 *) echo "However, your read() returns '$status' on EOF??";;
8248 if test "$status" = "$rd_nodata"; then
8249 echo "WARNING: you can't distinguish between EOF and no data!"
8253 echo "I can't compile the test program--assuming errno EAGAIN will do."
8260 echo "Using $hint value $eagain."
8261 echo "Your read() returns $rd_nodata when no data is present."
8262 case "$d_eofnblk" in
8263 "$define") echo "And you can see EOF because read() returns 0.";;
8264 "$undef") echo "But you can't see EOF status from read() returned value.";;
8266 echo "(Assuming you can't see EOF status from read anyway.)"
8272 $rm -f try try.* .out core head.c mtry
8274 : see if fchmod exists
8278 : see if fchown exists
8282 : see if this is an fcntl system
8286 : see if sys/select.h has to be included
8287 set sys/select.h i_sysselct
8290 : see if we should include time.h, sys/time.h, or both
8292 if test "X$timeincl" = X; then
8293 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8294 $echo $n "I'm now running the test program...$c"
8295 $cat >try.c <<'EOCP'
8296 #include <sys/types.h>
8301 #ifdef SYSTIMEKERNEL
8304 #include <sys/time.h>
8307 #include <sys/select.h>
8316 struct timezone tzp;
8318 if (foo.tm_sec == foo.tm_sec)
8321 if (bar.tv_sec == bar.tv_sec)
8328 for s_timezone in '-DS_TIMEZONE' ''; do
8330 for s_timeval in '-DS_TIMEVAL' ''; do
8331 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8332 for i_time in '' '-DI_TIME'; do
8333 for i_systime in '-DI_SYSTIME' ''; do
8336 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8337 if eval $compile; then
8338 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8342 $echo $n "Succeeded with $flags$c"
8354 *SYSTIMEKERNEL*) i_systimek="$define"
8355 timeincl=`./findhdr sys/time.h`
8356 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8357 *) i_systimek="$undef";;
8360 *I_TIME*) i_time="$define"
8361 timeincl=`./findhdr time.h`" $timeincl"
8362 echo "We'll include <time.h>." >&4;;
8363 *) i_time="$undef";;
8366 *I_SYSTIME*) i_systime="$define"
8367 timeincl=`./findhdr sys/time.h`" $timeincl"
8368 echo "We'll include <sys/time.h>." >&4;;
8369 *) i_systime="$undef";;
8374 : check for fd_set items
8377 Checking to see how well your C compiler handles fd_set and friends ...
8379 $cat >fd_set.c <<EOCP
8380 #$i_systime I_SYS_TIME
8381 #$i_sysselct I_SYS_SELECT
8382 #$d_socket HAS_SOCKET
8383 #include <sys/types.h>
8385 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8388 #include <sys/time.h>
8391 #include <sys/select.h>
8400 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8407 set fd_set -DTRYBITS
8408 if eval $compile; then
8409 d_fds_bits="$define"
8411 echo "Well, your system knows about the normal fd_set typedef..." >&4
8413 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8414 d_fd_macros="$define"
8417 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8419 d_fd_macros="$undef"
8423 Hmm, your compiler has some difficulty with fd_set. Checking further...
8426 if eval $compile; then
8429 echo "Well, your system has some sort of fd_set available..." >&4
8431 echo "and you have the normal fd_set macros." >&4
8432 d_fd_macros="$define"
8435 but not the normal fd_set macros! Gross! More work for me...
8437 d_fd_macros="$undef"
8440 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8443 d_fd_macros="$undef"
8448 : see if fgetpos exists
8449 set fgetpos d_fgetpos
8452 : see if flock exists
8456 : see if fork exists
8460 : see if pathconf exists
8461 set pathconf d_pathconf
8464 : see if fpathconf exists
8465 set fpathconf d_fpathconf
8469 : see if llseek exists
8475 echo $n "Checking to see if your system supports off64_t...$c" >&4
8477 #include <sys/types.h>
8479 off64_t foo() { off64_t x; x = 7; return x; }'
8481 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8483 echo " Yup, it does." >&4
8486 echo " Nope, it doesn't." >&4
8492 : check for fpos64_t
8494 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8496 #include <sys/stdio.h>
8497 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8499 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8501 echo " Yup, it does." >&4
8504 echo " Nope, it doesn't." >&4
8510 : see if fseeko exists
8514 : see if fsetpos exists
8515 set fsetpos d_fsetpos
8519 if $test X"$use64bits" = X"$define"; then
8520 : see if fgetpos64 exists
8521 set fgetpos64 d_fgetpos64
8524 : see if fopen64 exists
8525 set freopen64 d_fopen64
8528 : see if freopen64 exists
8529 set freopen64 d_freopen64
8532 : see if fseek64 exists
8533 set fseek64 d_fseek64
8536 : see if fseeko64 exists
8537 set fseeko64 d_fseeko64
8540 : see if fsetpos64 exists
8541 set fsetpos64 d_fsetpos64
8544 : see if ftell64 exists
8545 set ftell64 d_ftell64
8548 : see if ftello64 exists
8549 set ftello64 d_ftello64
8552 : see if tmpfile64 exists
8553 set tmpfile64 d_tmpfile64
8557 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8564 : see if this is a sys/param system
8565 set sys/param.h i_sysparam
8568 : see if this is a sys/mount.h system
8569 set sys/mount.h i_sysmount
8573 : see if statfs exists
8577 : see if fstatfs exists
8578 set fstatfs d_fstatfs
8581 : see if statfs knows about mount flags
8582 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8586 : see if statvfs exists
8587 set statvfs d_statvfs
8590 : see if fstatvfs exists
8591 set fstatvfs d_fstatvfs
8595 : see if ftello exists
8599 : see if getgrent exists
8600 set getgrent d_getgrent
8603 : see if gethostbyaddr exists
8604 set gethostbyaddr d_gethbyaddr
8607 : see if gethostbyname exists
8608 set gethostbyname d_gethbyname
8611 : see if gethostent exists
8612 set gethostent d_gethent
8615 : see how we will look up host name
8618 if set gethostname val -f d_gethname; eval $csym; $val; then
8619 echo 'gethostname() found.' >&4
8620 d_gethname="$define"
8623 if set uname val -f d_uname; eval $csym; $val; then
8626 uname() was found, but you're running xenix, and older versions of xenix
8627 have a broken uname(). If you don't really know whether your xenix is old
8628 enough to have a broken system call, use the default answer.
8635 rp='Is your uname() broken?'
8638 n*) d_uname="$define"; call=uname;;
8641 echo 'uname() found.' >&4
8648 case "$d_gethname" in
8649 '') d_gethname="$undef";;
8652 '') d_uname="$undef";;
8654 case "$d_uname$d_gethname" in
8659 Every now and then someone has a $call() that lies about the hostname
8660 but can't be fixed for political or economic reasons. If you wish, I can
8661 pretend $call() isn't there and maybe compute hostname at run-time
8662 thanks to the '$phostname' command.
8665 rp="Shall I ignore $call() from now on?"
8668 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8671 case "$phostname" in
8673 *) case "$aphostname" in
8679 file=`./loc $file $file $pth`
8680 aphostname=`echo $file $*`
8685 case "$d_uname$d_gethname" in
8688 case "$phostname" in
8690 echo "There will be no way for $package to get your hostname." >&4;;
8692 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8696 case "$d_phostname" in
8697 '') d_phostname="$undef";;
8700 : see if this is a netdb.h system
8704 : see if prototypes for various gethostxxx netdb.h functions are available
8706 set d_gethostprotos gethostent $i_netdb netdb.h
8709 : see if getlogin exists
8710 set getlogin d_getlogin
8713 : see if getmntent exists
8714 set getmntent d_getmntent
8717 : see if getnetbyaddr exists
8718 set getnetbyaddr d_getnbyaddr
8721 : see if getnetbyname exists
8722 set getnetbyname d_getnbyname
8725 : see if getnetent exists
8726 set getnetent d_getnent
8729 : see if prototypes for various getnetxxx netdb.h functions are available
8731 set d_getnetprotos getnetent $i_netdb netdb.h
8735 : see if getprotobyname exists
8736 set getprotobyname d_getpbyname
8739 : see if getprotobynumber exists
8740 set getprotobynumber d_getpbynumber
8743 : see if getprotoent exists
8744 set getprotoent d_getpent
8747 : see if getpgid exists
8748 set getpgid d_getpgid
8751 : see if getpgrp2 exists
8752 set getpgrp2 d_getpgrp2
8755 : see if getppid exists
8756 set getppid d_getppid
8759 : see if getpriority exists
8760 set getpriority d_getprior
8763 : see if prototypes for various getprotoxxx netdb.h functions are available
8765 set d_getprotoprotos getprotoent $i_netdb netdb.h
8768 : see if getpwent exists
8769 set getpwent d_getpwent
8773 : see if getservbyname exists
8774 set getservbyname d_getsbyname
8777 : see if getservbyport exists
8778 set getservbyport d_getsbyport
8781 : see if getservent exists
8782 set getservent d_getsent
8785 : see if prototypes for various getservxxx netdb.h functions are available
8787 set d_getservprotos getservent $i_netdb netdb.h
8790 : see if getspent exists
8791 set getspent d_getspent
8794 : see if getspnam exists
8795 set getspnam d_getspnam
8798 : see if gettimeofday or ftime exists
8799 set gettimeofday d_gettimeod
8801 case "$d_gettimeod" in
8807 val="$undef"; set d_ftime; eval $setvar
8810 case "$d_gettimeod$d_ftime" in
8813 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8817 : see if this is an grp system
8823 xxx=`./findhdr grp.h`
8824 $cppstdin $cppflags $cppminus < $xxx >$$.h
8826 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8838 set d_grpasswd; eval $setvar
8842 : see if hasmntopt exists
8843 set hasmntopt d_hasmntopt
8846 : see if this is a netinet/in.h or sys/in.h system
8847 set netinet/in.h i_niin sys/in.h i_sysin
8850 : see if arpa/inet.h has to be included
8851 set arpa/inet.h i_arpainet
8854 : see if htonl --and friends-- exists
8859 : Maybe they are macros.
8864 #include <sys/types.h>
8865 #$i_niin I_NETINET_IN
8867 #$i_arpainet I_ARPA_INET
8869 #include <netinet/in.h>
8875 #include <arpa/inet.h>
8878 printf("Defined as a macro.");
8881 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8882 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8884 echo "But it seems to be defined as a macro." >&4
8892 : see which of string.h or strings.h is needed
8894 strings=`./findhdr string.h`
8895 if $test "$strings" && $test -r "$strings"; then
8896 echo "Using <string.h> instead of <strings.h>." >&4
8900 strings=`./findhdr strings.h`
8901 if $test "$strings" && $test -r "$strings"; then
8902 echo "Using <strings.h> instead of <string.h>." >&4
8904 echo "No string header found -- You'll surely have problems." >&4
8910 "$undef") strings=`./findhdr strings.h`;;
8911 *) strings=`./findhdr string.h`;;
8916 if set index val -f; eval $csym; $val; then
8917 if set strchr val -f d_strchr; eval $csym; $val; then
8918 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8921 echo "strchr() found." >&4
8925 echo "index() found." >&4
8930 echo "index() found." >&4
8933 if set strchr val -f d_strchr; eval $csym; $val; then
8936 echo "strchr() found." >&4
8938 echo "No index() or strchr() found!" >&4
8943 set d_strchr; eval $setvar
8945 set d_index; eval $setvar
8947 : check whether inet_aton exists
8948 set inet_aton d_inetaton
8953 $cat >isascii.c <<'EOCP'
8965 if eval $compile; then
8966 echo "isascii() found." >&4
8969 echo "isascii() NOT found." >&4
8976 : see if killpg exists
8980 : see if lchown exists
8982 $cat > try.c <<'EOCP'
8983 /* System header to define __stub macros and hopefully few prototypes,
8984 which can conflict with char lchown(); below. */
8986 /* Override any gcc2 internal prototype to avoid an error. */
8987 /* We use char because int might match the return type of a gcc2
8988 builtin and then its argument prototype would still apply. */
8991 /* The GNU C library defines this for functions which it implements
8992 to always fail with ENOSYS. Some functions are actually named
8993 something starting with __ and the normal name is an alias. */
8994 #if defined (__stub_lchown) || defined (__stub___lchown)
9002 if eval $compile; then
9003 $echo "lchown() found." >&4
9006 $echo "lchown() NOT found." >&4
9012 : see if link exists
9016 : see if localeconv exists
9017 set localeconv d_locconv
9020 : see if lockf exists
9024 : see if lstat exists
9028 : see if madvise exists
9029 set madvise d_madvise
9032 : see if mblen exists
9036 : see if mbstowcs exists
9037 set mbstowcs d_mbstowcs
9040 : see if mbtowc exists
9044 : see if memchr exists
9048 : see if memcmp exists
9052 : see if memcpy exists
9056 : see if memmove exists
9057 set memmove d_memmove
9060 : see if memset exists
9064 : see if mkdir exists
9068 : see if mkfifo exists
9072 : see if mktime exists
9076 : see if this is a sys/mman.h system
9077 set sys/mman.h i_sysmman
9080 : see if mmap exists
9083 : see what shmat returns
9084 : default to something harmless
9086 case "$i_sysmman$d_mmap" in
9088 $cat >mmap.c <<'END'
9089 #include <sys/mman.h>
9092 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9097 echo "and it returns ($mmaptype)." >&4
9103 : see if mprotect exists
9104 set mprotect d_mprotect
9107 : see if msgctl exists
9111 : see if msgget exists
9115 : see if msgsnd exists
9119 : see if msgrcv exists
9123 : see how much of the 'msg*(2)' library is present.
9126 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9127 *"$undef"*) h_msg=false;;
9131 case "`ipcs 2>&1`" in
9132 "SVID messages"*"not configured"*)
9133 echo "Your $osname does not have the msg*(2) configured." >&4
9148 : we could also check for sys/ipc.h ...
9149 if $h_msg && $test `./findhdr sys/msg.h`; then
9150 echo "You have the full msg*(2) library." >&4
9153 echo "You don't have the full msg*(2) library." >&4
9159 : see if msync exists
9163 : see if munmap exists
9167 : see if nice exists
9171 : see if POSIX threads are available
9172 if test "X$usethreads" = "X$define"; then
9173 set pthread.h i_pthread
9181 : how to create joinable pthreads
9182 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9184 echo "Checking what constant to use for creating joinable pthreads..." >&4
9185 $cat >try.c <<'EOCP'
9186 #include <pthread.h>
9188 int detachstate = JOINABLE;
9191 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9192 if eval $compile; then
9193 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9194 val="$undef" # Yes, undef.
9195 set d_old_pthread_create_joinable
9198 set old_pthread_create_joinable
9201 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9202 if eval $compile; then
9203 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9205 set d_old_pthread_create_joinable
9207 val=PTHREAD_CREATE_UNDETACHED
9208 set old_pthread_create_joinable
9211 set try -DJOINABLE=__UNDETACHED
9212 if eval $compile; then
9213 echo "You seem to use __UNDETACHED." >&4
9215 set d_old_pthread_create_joinable
9218 set old_pthread_create_joinable
9221 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9223 set d_old_pthread_create_joinable
9226 set old_pthread_create_joinable
9233 d_old_pthread_create_joinable="$undef"
9234 old_pthread_create_joinable=""
9237 : see if pause exists
9241 : see if pipe exists
9245 : see if poll exists
9250 : see whether the various POSIXish _yields exist
9252 #include <pthread.h>
9258 #ifdef PTHREAD_YIELD
9261 #ifdef PTHREAD_YIELD_NULL
9262 pthread_yield(NULL);
9268 : see if sched_yield exists
9269 set try -DSCHED_YIELD
9270 if eval $compile; then
9272 sched_yield='sched_yield()'
9276 case "$usethreads" in
9279 $define) echo 'sched_yield() found.' >&4 ;;
9280 *) echo 'sched_yield() NOT found.' >&4 ;;
9286 : see if pthread_yield exists
9287 set try -DPTHREAD_YIELD
9288 if eval $compile; then
9290 case "$sched_yield" in
9291 '') sched_yield='pthread_yield()' ;;
9294 set try -DPTHREAD_YIELD_NULL
9295 if eval $compile; then
9297 case "$sched_yield" in
9298 '') sched_yield='pthread_yield(NULL)' ;;
9304 case "$usethreads" in
9307 $define) echo 'pthread_yield() found.' >&4 ;;
9308 *) echo 'pthread_yield() NOT found.' >&4 ;;
9315 case "$sched_yield" in
9316 '') sched_yield=undef ;;
9321 : see if this is a pwd.h system
9327 xxx=`./findhdr pwd.h`
9328 $cppstdin $cppflags $cppminus < $xxx >$$.h
9330 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9338 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9346 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9354 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9362 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9370 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9378 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9386 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9398 set d_pwquota; eval $setvar
9399 set d_pwage; eval $setvar
9400 set d_pwchange; eval $setvar
9401 set d_pwclass; eval $setvar
9402 set d_pwexpire; eval $setvar
9403 set d_pwcomment; eval $setvar
9404 set d_pwgecos; eval $setvar
9405 set d_pwpasswd; eval $setvar
9409 : see if readdir and friends exist
9410 set readdir d_readdir
9412 set seekdir d_seekdir
9414 set telldir d_telldir
9416 set rewinddir d_rewinddir
9419 : see if readlink exists
9420 set readlink d_readlink
9423 : see if readv exists
9427 : see if rename exists
9431 : see if rmdir exists
9435 : see if memory.h is available.
9440 : See if it conflicts with string.h
9446 $cppstdin $cppflags $cppminus < $strings > mem.h
9447 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9449 echo "We won't be including <memory.h>."
9459 : can bcopy handle overlapping blocks?
9464 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9471 $cat >>try.c <<'EOCP'
9474 # include <memory.h>
9477 # include <stdlib.h>
9480 # include <string.h>
9482 # include <strings.h>
9485 # include <unistd.h> /* Needed for NetBSD */
9489 char buf[128], abc[128];
9495 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9497 for (align = 7; align >= 0; align--) {
9498 for (len = 36; len; len--) {
9501 for (off = 1; off <= len; off++) {
9502 bcopy(b, b+off, len);
9503 bcopy(b+off, b, len);
9504 if (bcmp(b, abc, len))
9513 if eval $compile_ok; then
9514 if ./try 2>/dev/null; then
9518 echo "It can't, sorry."
9519 case "$d_memmove" in
9520 "$define") echo "But that's Ok since you have memmove()." ;;
9524 echo "(I can't compile the test program, so we'll assume not...)"
9525 case "$d_memmove" in
9526 "$define") echo "But that's Ok since you have memmove()." ;;
9531 $rm -f try.* try core
9535 : can memcpy handle overlapping blocks?
9540 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9547 $cat >>try.c <<'EOCP'
9550 # include <memory.h>
9553 # include <stdlib.h>
9556 # include <string.h>
9558 # include <strings.h>
9561 # include <unistd.h> /* Needed for NetBSD */
9565 char buf[128], abc[128];
9571 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9572 try to store the string in read-only memory. */
9573 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9575 for (align = 7; align >= 0; align--) {
9576 for (len = 36; len; len--) {
9578 memcpy(b, abc, len);
9579 for (off = 1; off <= len; off++) {
9580 memcpy(b+off, b, len);
9581 memcpy(b, b+off, len);
9582 if (memcmp(b, abc, len))
9591 if eval $compile_ok; then
9592 if ./try 2>/dev/null; then
9596 echo "It can't, sorry."
9597 case "$d_memmove" in
9598 "$define") echo "But that's Ok since you have memmove()." ;;
9602 echo "(I can't compile the test program, so we'll assume not...)"
9603 case "$d_memmove" in
9604 "$define") echo "But that's Ok since you have memmove()." ;;
9609 $rm -f try.* try core
9613 : can memcmp be trusted to compare relative magnitude?
9618 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9625 $cat >>try.c <<'EOCP'
9628 # include <memory.h>
9631 # include <stdlib.h>
9634 # include <string.h>
9636 # include <strings.h>
9639 # include <unistd.h> /* Needed for NetBSD */
9645 if ((a < b) && memcmp(&a, &b, 1) < 0)
9651 if eval $compile_ok; then
9652 if ./try 2>/dev/null; then
9656 echo "No, it can't (it uses signed chars)."
9659 echo "(I can't compile the test program, so we'll assume not...)"
9663 $rm -f try.* try core
9667 : see if select exists
9671 : see if semctl exists
9675 : see if semget exists
9679 : see if semop exists
9683 : see how much of the 'sem*(2)' library is present.
9686 case "$d_semctl$d_semget$d_semop" in
9687 *"$undef"*) h_sem=false;;
9691 case "`ipcs 2>&1`" in
9692 "SVID messages"*"not configured"*)
9693 echo "Your $osname does not have the sem*(2) configured." >&4
9706 : we could also check for sys/ipc.h ...
9707 if $h_sem && $test `./findhdr sys/sem.h`; then
9708 echo "You have the full sem*(2) library." >&4
9711 echo "You don't have the full sem*(2) library." >&4
9717 : see whether sys/sem.h defines union semun
9719 $cat > try.c <<'END'
9720 #include <sys/types.h>
9721 #include <sys/ipc.h>
9722 #include <sys/sem.h>
9723 int main () { union semun semun; semun.buf = 0; }
9726 if eval $compile; then
9727 echo "You have union semun in <sys/sem.h>." >&4
9730 echo "You do not have union semun in <sys/sem.h>." >&4
9733 $rm -f try try.c try.h
9737 : see how to do semctl IPC_STAT
9740 : see whether semctl IPC_STAT can use union semun
9745 # define S_IRUSR S_IREAD
9746 # define S_IWUSR S_IWRITE
9747 # define S_IXUSR S_IEXEC
9749 # define S_IRUSR 0400
9750 # define S_IWUSR 0200
9751 # define S_IXUSR 0100
9753 # define S_IRGRP (S_IRUSR>>3)
9754 # define S_IWGRP (S_IWUSR>>3)
9755 # define S_IXGRP (S_IXUSR>>3)
9756 # define S_IROTH (S_IRUSR>>6)
9757 # define S_IWOTH (S_IWUSR>>6)
9758 # define S_IXOTH (S_IXUSR>>6)
9761 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9762 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9763 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9768 #include <sys/types.h>
9769 #include <sys/ipc.h>
9770 #include <sys/sem.h>
9771 #include <sys/stat.h>
9778 #$d_union_semun HAS_UNION_SEMUN
9781 #ifndef HAS_UNION_SEMUN
9784 struct semid_ds *buf;
9785 unsigned short *array;
9791 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9792 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9794 struct semid_ds argbuf;
9797 st = semctl(sem, 0, IPC_STAT, arg);
9801 # endif /* IPC_STAT */
9802 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9804 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9805 # endif /* IPC_RMID */
9806 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9808 #endif /* IPC_PRIVATE && ... */
9809 printf("semget failed: errno = %d\n", errno);
9815 if eval $compile; then
9818 semun) val="$define" ;;
9824 case "$d_semctl_semun" in
9826 echo "You can use union semun for semctl IPC_STAT." >&4
9829 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9834 : see whether semctl IPC_STAT can use struct semid_ds pointer
9835 $cat > try.c <<'END'
9836 #include <sys/types.h>
9837 #include <sys/ipc.h>
9838 #include <sys/sem.h>
9839 #include <sys/stat.h>
9847 struct semid_ds arg;
9850 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9851 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9854 st = semctl(sem, 0, IPC_STAT, &arg);
9856 printf("semid_ds\n");
9858 # endif /* IPC_STAT */
9859 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9861 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9862 # endif /* IPC_RMID */
9863 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9865 #endif /* IPC_PRIVATE && ... */
9866 printf("semget failed: errno = %d\n", errno);
9873 if eval $compile; then
9876 semid_ds) val="$define" ;;
9880 set d_semctl_semid_ds
9882 case "$d_semctl_semid_ds" in
9884 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9886 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9893 # We do not have the full sem*(2) library, so assume we can not
9899 set d_semctl_semid_ds
9904 : see if setegid exists
9905 set setegid d_setegid
9908 : see if seteuid exists
9909 set seteuid d_seteuid
9912 : see if setgrent exists
9913 set setgrent d_setgrent
9916 : see if sethostent exists
9917 set sethostent d_sethent
9920 : see if setlinebuf exists
9921 set setlinebuf d_setlinebuf
9924 : see if setlocale exists
9925 set setlocale d_setlocale
9928 : see if setnetent exists
9929 set setnetent d_setnent
9932 : see if setprotoent exists
9933 set setprotoent d_setpent
9936 : see if setpgid exists
9937 set setpgid d_setpgid
9940 : see if setpgrp2 exists
9941 set setpgrp2 d_setpgrp2
9944 : see if setpriority exists
9945 set setpriority d_setprior
9948 : see if setpwent exists
9949 set setpwent d_setpwent
9952 : see if setregid exists
9953 set setregid d_setregid
9955 set setresgid d_setresgid
9958 : see if setreuid exists
9959 set setreuid d_setreuid
9961 set setresuid d_setresuid
9964 : see if setrgid exists
9965 set setrgid d_setrgid
9968 : see if setruid exists
9969 set setruid d_setruid
9972 : see if setservent exists
9973 set setservent d_setsent
9976 : see if setsid exists
9980 : see if setspent exists
9981 set setspent d_setspent
9984 : see if setvbuf exists
9985 set setvbuf d_setvbuf
9988 : see if sfio.h is available
9993 : see if sfio library is available
10004 : Ok, but do we want to use it.
10008 true|$define|[yY]*) dflt='y';;
10011 echo "$package can use the sfio library, but it is experimental."
10012 rp="You seem to have sfio available, do you want to try using it?"
10016 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10018 : Remove sfio from list of libraries to use
10019 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10022 echo "libs = $libs" >&4
10026 *) case "$usesfio" in
10027 true|$define|[yY]*)
10028 echo "Sorry, cannot find sfio on this machine" >&4
10029 echo "Ignoring your setting of usesfio=$usesfio" >&4
10037 $define) usesfio='true';;
10038 *) usesfio='false';;
10041 : see if shmctl exists
10042 set shmctl d_shmctl
10045 : see if shmget exists
10046 set shmget d_shmget
10049 : see if shmat exists
10052 : see what shmat returns
10055 $cat >shmat.c <<'END'
10056 #include <sys/shm.h>
10059 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10064 echo "and it returns ($shmattype)." >&4
10065 : see if a prototype for shmat is available
10066 xxx=`./findhdr sys/shm.h`
10067 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10068 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10079 set d_shmatprototype
10082 : see if shmdt exists
10086 : see how much of the 'shm*(2)' library is present.
10089 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10090 *"$undef"*) h_shm=false;;
10094 case "`ipcs 2>&1`" in
10095 "SVID shared memory"*"not configured"*)
10096 echo "Your $osname does not have the shm*(2) configured." >&4
10099 set shmctl d_shmctl
10101 set shmget d_shmget
10111 : we could also check for sys/ipc.h ...
10112 if $h_shm && $test `./findhdr sys/shm.h`; then
10113 echo "You have the full shm*(2) library." >&4
10116 echo "You don't have the full shm*(2) library." >&4
10123 : see if we have sigaction
10124 if set sigaction val -f d_sigaction; eval $csym; $val; then
10125 echo 'sigaction() found.' >&4
10126 $cat > try.c <<'EOP'
10128 #include <sys/types.h>
10129 #include <signal.h>
10132 struct sigaction act, oact;
10136 if eval $compile_ok; then
10139 echo "But you don't seem to have a useable struct sigaction." >&4
10143 echo 'sigaction NOT found.' >&4
10146 set d_sigaction; eval $setvar
10147 $rm -f try try$_o try.c
10149 : see if sigsetjmp exists
10151 case "$d_sigsetjmp" in
10153 $cat >try.c <<'EOP'
10154 #include <setjmp.h>
10159 if (sigsetjmp(env,1))
10162 siglongjmp(env, 1);
10167 if eval $compile; then
10168 if ./try >/dev/null 2>&1; then
10169 echo "POSIX sigsetjmp found." >&4
10173 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10179 echo "sigsetjmp not found." >&4
10183 *) val="$d_sigsetjmp"
10184 case "$d_sigsetjmp" in
10185 $define) echo "POSIX sigsetjmp found." >&4;;
10186 $undef) echo "sigsetjmp not found." >&4;;
10194 : see if sys/stat.h is available
10195 set sys/stat.h i_sysstat
10198 : see if stat knows about block sizes
10200 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10203 : see if _ptr and _cnt from stdio act std
10205 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10206 echo "(Looks like you have stdio.h from Linux.)"
10207 case "$stdio_ptr" in
10208 '') stdio_ptr='((fp)->_IO_read_ptr)'
10211 *) ptr_lval=$d_stdio_ptr_lval;;
10213 case "$stdio_cnt" in
10214 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10217 *) cnt_lval=$d_stdio_cnt_lval;;
10219 case "$stdio_base" in
10220 '') stdio_base='((fp)->_IO_read_base)';;
10222 case "$stdio_bufsiz" in
10223 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10226 case "$stdio_ptr" in
10227 '') stdio_ptr='((fp)->_ptr)'
10230 *) ptr_lval=$d_stdio_ptr_lval;;
10232 case "$stdio_cnt" in
10233 '') stdio_cnt='((fp)->_cnt)'
10236 *) cnt_lval=$d_stdio_cnt_lval;;
10238 case "$stdio_base" in
10239 '') stdio_base='((fp)->_base)';;
10241 case "$stdio_bufsiz" in
10242 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10245 : test whether _ptr and _cnt really work
10246 echo "Checking how std your stdio is..." >&4
10249 #define FILE_ptr(fp) $stdio_ptr
10250 #define FILE_cnt(fp) $stdio_cnt
10252 FILE *fp = fopen("try.c", "r");
10255 18 <= FILE_cnt(fp) &&
10256 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10264 if eval $compile; then
10266 echo "Your stdio acts pretty std."
10269 echo "Your stdio isn't very std."
10272 echo "Your stdio doesn't appear very std."
10278 : Can _ptr be used as an lvalue?
10279 case "$d_stdstdio$ptr_lval" in
10280 $define$define) val=$define ;;
10283 set d_stdio_ptr_lval
10286 : Can _cnt be used as an lvalue?
10287 case "$d_stdstdio$cnt_lval" in
10288 $define$define) val=$define ;;
10291 set d_stdio_cnt_lval
10294 : see if _base is also standard
10296 case "$d_stdstdio" in
10300 #define FILE_base(fp) $stdio_base
10301 #define FILE_bufsiz(fp) $stdio_bufsiz
10303 FILE *fp = fopen("try.c", "r");
10306 19 <= FILE_bufsiz(fp) &&
10307 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10314 if eval $compile; then
10316 echo "And its _base field acts std."
10319 echo "But its _base field isn't std."
10322 echo "However, it seems to be lacking the _base field."
10331 Checking how to access stdio streams by file descriptor number...
10333 case "$stdio_stream_array" in
10334 '') $cat >try.c <<EOCP
10337 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10341 for s in _iob __iob __sF
10343 set try -DSTDIO_STREAM_ARRAY=$s
10344 if eval $compile; then
10345 case "`./try$exe_ext`" in
10346 yes) stdio_stream_array=$s; break ;;
10350 $rm -f try.* try$exe_ext
10352 case "$stdio_stream_array" in
10354 I can't figure out how to access stdio streams by file descriptor number.
10356 d_stdio_stream_array="$undef"
10359 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10361 d_stdio_stream_array="$define"
10365 : see if strcoll exists
10366 set strcoll d_strcoll
10369 : check for structure copying
10371 echo "Checking to see if your C compiler can copy structs..." >&4
10372 $cat >try.c <<'EOCP'
10382 if $cc -c try.c >/dev/null 2>&1 ; then
10384 echo "Yup, it can."
10387 echo "Nope, it can't."
10393 : see if strerror and/or sys_errlist[] exist
10395 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10396 if set strerror val -f d_strerror; eval $csym; $val; then
10397 echo 'strerror() found.' >&4
10398 d_strerror="$define"
10399 d_strerrm='strerror(e)'
10400 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10401 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10402 d_syserrlst="$define"
10404 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10405 d_syserrlst="$undef"
10407 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10408 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10409 echo 'strerror() found in string header.' >&4
10410 d_strerror="$define"
10411 d_strerrm='strerror(e)'
10412 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10413 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10414 d_syserrlst="$define"
10416 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10417 d_syserrlst="$undef"
10419 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10420 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10421 d_strerror="$undef"
10422 d_syserrlst="$define"
10423 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10425 echo 'strerror() and sys_errlist[] NOT found.' >&4
10426 d_strerror="$undef"
10427 d_syserrlst="$undef"
10428 d_strerrm='"unknown"'
10432 : see if strtod exists
10433 set strtod d_strtod
10436 : see if strtol exists
10437 set strtol d_strtol
10440 : see if strtoul exists
10441 set strtoul d_strtoul
10444 : see if strtoull exists
10445 set strtoull d_strtoull
10448 : see if strxfrm exists
10449 set strxfrm d_strxfrm
10452 : see if symlink exists
10453 set symlink d_symlink
10456 : see if syscall exists
10457 set syscall d_syscall
10460 : see if sysconf exists
10461 set sysconf d_sysconf
10464 : see if system exists
10465 set system d_system
10468 : see if tcgetpgrp exists
10469 set tcgetpgrp d_tcgetpgrp
10472 : see if tcsetpgrp exists
10473 set tcsetpgrp d_tcsetpgrp
10476 : see if sys/types.h has to be included
10477 set sys/types.h i_systypes
10480 : see if prototype for telldir is available
10482 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10485 : define an is-a-typedef? function
10486 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10488 "") inclist="sys/types.h";;
10490 eval "varval=\$$var";
10494 for inc in $inclist; do
10495 echo "#include <$inc>" >>temp.c;
10497 echo "#ifdef $type" >> temp.c;
10498 echo "printf(\"We have $type\");" >> temp.c;
10499 echo "#endif" >> temp.c;
10500 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10501 if $contains $type temp.E >/dev/null 2>&1; then
10502 eval "$var=\$type";
10507 *) eval "$var=\$varval";;
10510 : define an is-a-typedef? function that prompts if the type is not available.
10511 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10513 "") inclist="sys/types.h";;
10515 eval "varval=\$$var";
10519 for inc in $inclist; do
10520 echo "#include <$inc>" >>temp.c;
10522 echo "#ifdef $type" >> temp.c;
10523 echo "printf(\"We have $type\");" >> temp.c;
10524 echo "#endif" >> temp.c;
10525 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10527 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10528 if $contains $type temp.E >/dev/null 2>&1; then
10529 echo "$type found." >&4;
10530 eval "$var=\$type";
10532 echo "$type NOT found." >&4;
10538 *) eval "$var=\$varval";;
10541 : see if this is a sys/times.h system
10542 set sys/times.h i_systimes
10545 : see if times exists
10547 if set times val -f d_times; eval $csym; $val; then
10548 echo 'times() found.' >&4
10551 case "$i_systimes" in
10552 "$define") inc='sys/times.h';;
10554 rp="What is the type returned by times() on this system?"
10555 set clock_t clocktype long stdio.h sys/types.h $inc
10558 echo 'times() NOT found, hope that will do.' >&4
10563 : see if truncate exists
10564 set truncate d_truncate
10567 : see if tzname[] exists
10569 if set tzname val -a d_tzname; eval $csym; $val; then
10571 echo 'tzname[] found.' >&4
10574 echo 'tzname[] NOT found.' >&4
10579 : see if umask exists
10583 : backward compatibility for d_hvfork
10584 if test X$d_hvfork != X; then
10585 d_vfork="$d_hvfork"
10588 : see if there is a vfork
10593 : Ok, but do we want to use it. vfork is reportedly unreliable in
10594 : perl on Solaris 2.x, and probably elsewhere.
10598 case "$usevfork" in
10604 Perl can only use a vfork() that doesn't suffer from strict
10605 restrictions on calling functions or modifying global data in
10606 the child. For example, glibc-2.1 contains such a vfork()
10607 that is unsuitable. If your system provides a proper fork()
10608 call, chances are that you do NOT want perl to use vfork().
10611 rp="Do you still want to use vfork()?"
10616 echo "Ok, we won't use vfork()."
10625 $define) usevfork='true';;
10626 *) usevfork='false';;
10629 : see if this is an sysdir system
10630 set sys/dir.h i_sysdir
10633 : see if this is an sysndir system
10634 set sys/ndir.h i_sysndir
10637 : see if closedir exists
10638 set closedir d_closedir
10641 case "$d_closedir" in
10644 echo "Checking whether closedir() returns a status..." >&4
10645 cat > closedir.c <<EOM
10646 #$i_dirent I_DIRENT /**/
10647 #$i_sysdir I_SYS_DIR /**/
10648 #$i_sysndir I_SYS_NDIR /**/
10649 #$i_systypes I_SYS_TYPES /**/
10651 #if defined(I_SYS_TYPES)
10652 #include <sys/types.h>
10654 #if defined(I_DIRENT)
10655 #include <dirent.h>
10656 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10657 #include <sys/dir.h>
10661 #include <sys/ndir.h>
10665 #include <ndir.h> /* may be wrong in the future */
10667 #include <sys/dir.h>
10672 int main() { return closedir(opendir(".")); }
10675 if eval $compile_ok; then
10676 if ./closedir > /dev/null 2>&1 ; then
10677 echo "Yes, it does."
10680 echo "No, it doesn't."
10684 echo "(I can't seem to compile the test program--assuming it doesn't)"
10692 set d_void_closedir
10695 : check for volatile keyword
10697 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10698 $cat >try.c <<'EOCP'
10701 typedef struct _goo_struct goo_struct;
10702 goo_struct * volatile goo = ((goo_struct *)0);
10703 struct _goo_struct {
10708 typedef unsigned short foo_t;
10709 char *volatile foo;
10711 volatile foo_t blech;
10715 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10717 echo "Yup, it does."
10720 echo "Nope, it doesn't."
10726 : see if there is a wait4
10730 : see if waitpid exists
10731 set waitpid d_waitpid
10734 : see if wcstombs exists
10735 set wcstombs d_wcstombs
10738 : see if wctomb exists
10739 set wctomb d_wctomb
10742 : see if writev exists
10743 set writev d_writev
10746 : preserve RCS keywords in files with variable substitution, grrr
10751 Revision='$Revision'
10753 case "$crosscompile" in
10754 ''|[nN]*) crosscompile="$undef" ;;
10758 next|rhapsody) multiarch="$define" ;;
10760 case "$multiarch" in
10761 ''|[nN]*) multiarch="$undef" ;;
10764 : check for alignment requirements
10766 case "$crosscompile$multiarch" in
10769 You seem to be either cross-compiling or doing a multiarchitecture build,
10770 skipping the memory alignment check.
10773 case "$alignbytes" in
10774 '') alignbytes=8 ;;
10778 case "$alignbytes" in
10779 '') echo "Checking alignment constraints..." >&4
10780 $cat >try.c <<'EOCP'
10787 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10791 if eval $compile_ok; then
10795 echo "(I can't seem to compile the test program...)"
10798 *) dflt="$alignbytes"
10801 rp="Doubles must be aligned on a how-many-byte boundary?"
10809 : check for ordering of bytes in a long
10811 case "$crosscompile$multiarch" in
10814 You seem to be either cross-compiling or doing a multiarchitecture build,
10815 skipping the byteorder check.
10821 case "$byteorder" in
10824 In the following, larger digits indicate more significance. A big-endian
10825 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10826 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10827 machines may have weird orders like 3412. A Cray will report 87654321,
10828 an Alpha will report 12345678. If the test program works the default is
10830 I'm now running the test program...
10832 $cat >try.c <<'EOCP'
10839 char c[sizeof(long)];
10842 if (sizeof(long) > 4)
10843 u.l = (0x08070605L << 32) | 0x04030201L;
10846 for (i = 0; i < sizeof(long); i++)
10847 printf("%c", u.c[i]+'0');
10854 if eval $compile && ./try > /dev/null; then
10857 [1-4][1-4][1-4][1-4]|12345678|87654321)
10858 echo "(The test program ran ok.)"
10859 echo "byteorder=$dflt"
10862 ????|????????) echo "(The test program ran ok.)" ;;
10863 *) echo "(The test program didn't run right for some reason.)" ;;
10868 (I can't seem to compile the test program. Guessing big-endian...)
10871 case "$xxx_prompt" in
10873 rp="What is the order of bytes in a long?"
10887 : how do we catenate cpp tokens here?
10889 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10890 $cat >cpp_stuff.c <<'EOCP'
10891 #define RCAT(a,b)a/**/b
10892 #define ACAT(a,b)a ## b
10896 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10897 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10898 echo "Oh! Smells like ANSI's been here." >&4
10899 echo "We can catify or stringify, separately or together!"
10901 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10902 echo "Ah, yes! The good old days!" >&4
10903 echo "However, in the good old days we don't know how to stringify and"
10904 echo "catify at the same time."
10908 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10909 to have to edit the values of CAT[2-5] in config.h...
10911 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10915 : see if this is a db.h system
10921 : Check db version.
10923 echo "Checking Berkeley DB version ..." >&4
10929 #include <sys/types.h>
10934 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10935 int Major, Minor, Patch ;
10936 unsigned long Version ;
10937 (void)db_version(&Major, &Minor, &Patch) ;
10938 printf("You have Berkeley DB Version 2 or greater\n");
10940 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10941 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10942 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10943 Major, Minor, Patch) ;
10945 /* check that db.h & libdb are compatible */
10946 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10947 printf("db.h and libdb are incompatible\n") ;
10951 printf("db.h and libdb are compatible\n") ;
10953 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10954 + DB_VERSION_PATCH ;
10956 /* needs to be >= 2.3.4 */
10957 if (Version < 2003004) {
10958 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10959 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10965 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10966 printf("You have Berkeley DB Version 1\n");
10967 exit(0); /* DB version < 2: the coast is clear. */
10969 exit(1); /* <db.h> not Berkeley DB? */
10975 if eval $compile && ./try; then
10976 echo 'Looks OK.' >&4
10978 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10982 : Remove db from list of libraries to use
10983 echo "Removing unusable -ldb from library list" >&4
10984 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10987 echo "libs = $libs" >&4
10997 : Check the return type needed for hash
10999 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11005 #include <sys/types.h>
11008 #ifndef DB_VERSION_MAJOR
11009 u_int32_t hash_cb (ptr, size)
11017 info.hash = hash_cb;
11021 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11022 if $contains warning try.out >>/dev/null 2>&1 ; then
11025 db_hashtype='u_int32_t'
11028 : XXX Maybe we should just give up here.
11029 db_hashtype=u_int32_t
11031 echo "Help: I can't seem to compile the db test program." >&4
11032 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11035 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11037 *) db_hashtype=u_int32_t
11042 : Check the return type needed for prefix
11044 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11050 #include <sys/types.h>
11053 #ifndef DB_VERSION_MAJOR
11054 size_t prefix_cb (key1, key2)
11062 info.prefix = prefix_cb;
11066 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11067 if $contains warning try.out >>/dev/null 2>&1 ; then
11068 db_prefixtype='int'
11070 db_prefixtype='size_t'
11073 db_prefixtype='size_t'
11074 : XXX Maybe we should just give up here.
11076 echo "Help: I can't seem to compile the db test program." >&4
11077 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11080 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11082 *) db_prefixtype='size_t'
11086 : check for void type
11088 echo "Checking to see how well your C compiler groks the void type..." >&4
11089 case "$voidflags" in
11091 $cat >try.c <<'EOCP'
11097 extern void moo(); /* function returning void */
11098 void (*goo)(); /* ptr to func returning void */
11100 void *hue; /* generic ptr */
11113 int main() { sub(); }
11115 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11116 voidflags=$defvoidused
11117 echo "Good. It appears to support void to the level $package wants.">&4
11118 if $contains warning .out >/dev/null 2>&1; then
11119 echo "However, you might get some warnings that look like this:"
11123 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11124 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11125 echo "It supports 1..."
11126 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11127 echo "It also supports 2..."
11128 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11130 echo "And it supports 4 but not 8 definitely."
11132 echo "It doesn't support 4..."
11133 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11135 echo "But it supports 8."
11138 echo "Neither does it support 8."
11142 echo "It does not support 2..."
11143 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11145 echo "But it supports 4 and 8."
11147 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11149 echo "And it supports 4 but has not heard about 8."
11151 echo "However it supports 8 but not 4."
11156 echo "There is no support at all for void."
11161 case "$voidflags" in
11163 *) $cat >&4 <<'EOM'
11164 Support flag bits are:
11165 1: basic void declarations.
11166 2: arrays of pointers to functions returning void.
11167 4: operations between pointers to and addresses of void functions.
11168 8: generic void pointers.
11171 rp="Your void support flags add up to what?"
11179 : How can we generate normalized random numbers ?
11181 echo "Looking for a random number function..." >&4
11182 case "$randfunc" in
11184 if set drand48 val -f; eval $csym; $val; then
11186 echo "Good, found drand48()." >&4
11187 elif set random val -f; eval $csym; $val; then
11189 echo "OK, found random()." >&4
11192 echo "Yick, looks like I have to use rand()." >&4
11203 *-Dmy_rand=*|*-Dmy_srand=*)
11204 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11205 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11206 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11207 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11211 while $test "$cont"; do
11212 rp="Use which function to generate random numbers?"
11214 if $test "$ans" = "$dflt"; then
11220 if set $ans val -f; eval $csym; $val; then
11224 rp="I cannot find function $ans. Use that name anyway?"
11233 case "$randfunc" in
11235 drand01="drand48()"
11241 case "$randbits" in
11243 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11245 #$i_unistd I_UNISTD
11246 #$i_stdlib I_STDLIB
11249 # include <unistd.h>
11252 # include <stdlib.h>
11257 register unsigned long tmp;
11258 register unsigned long max = 0L;
11260 for (i = 1000; i; i--) {
11261 tmp = (unsigned long) $randfunc();
11262 if (tmp > max) max = tmp;
11264 for (i = 0; max; i++)
11270 if eval $compile_ok; then
11274 echo "(I can't seem to compile the test program...)"
11281 rp="How many bits does your $randfunc() function produce?"
11285 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11286 seedfunc="s$randfunc"
11287 randseedtype=unsigned
11291 rp="How many bits does your $randfunc() function produce?"
11294 seedfunc="s$randfunc"
11295 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11296 if set $seedfunc val -f; eval $csym; $val; then
11297 echo "(Using $seedfunc() to seed random generator)"
11299 echo "(Warning: no $seedfunc() to seed random generator)"
11302 randseedtype=unsigned
11310 echo "Determining whether or not we are on an EBCDIC system..." >&4
11311 $cat >tebcdic.c <<'EOM'
11314 if ('M'==0xd4) return 0;
11321 if eval $compile_ok; then
11323 echo "You have EBCDIC." >&4
11326 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11329 echo "I'm unable to compile the test program." >&4
11330 echo "I'll assume ASCII or some ISO Latin." >&4
11332 $rm -f tebcdic.c tebcdic
11338 Checking how to flush all pending stdio output...
11340 # I only know how to find the first 32 possibly open files on SunOS.
11341 # See also hints/sunos_4_1.sh and util.c --AD
11343 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11345 $cat >>try.c <<EOCP
11347 #$i_unistd I_UNISTD
11349 # include <unistd.h>
11351 #$d_sysconf HAS_SYSCONF
11352 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11353 #ifdef HAS_STDIO_STREAM_ARRAY
11354 # define STDIO_STREAM_ARRAY $stdio_stream_array
11357 FILE* p = fopen("try.out", "w");
11361 # ifdef TRY_FPRINTF
11365 #ifdef TRY_FFLUSH_NULL
11368 #ifdef TRY_FFLUSH_ALL
11370 long open_max = -1;
11371 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11372 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11374 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11375 open_max = sysconf(_SC_OPEN_MAX);
11378 open_max = FOPEN_MAX;
11381 open_max = OPEN_MAX;
11390 # ifdef HAS_STDIO_STREAM_ARRAY
11391 if (open_max > 0) {
11393 for (i = 0; i < open_max; i++)
11394 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11395 STDIO_STREAM_ARRAY[i]._file < open_max &&
11396 STDIO_STREAM_ARRAY[i]._flag)
11397 fflush(&STDIO_STREAM_ARRAY[i]);
11405 : first we have to find out how _not_ to flush
11406 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11408 set try -DTRY_FPUTC
11409 if eval $compile; then
11411 ./try$exe_ext 2>/dev/null
11412 if $test ! -s try.out -a "X$?" = X42; then
11418 set try -DTRY_FPRINTF
11420 if eval $compile; then
11422 ./try$exe_ext 2>/dev/null
11423 if $test ! -s try.out -a "X$?" = X42; then
11424 output=-DTRY_FPRINTF
11430 : check for fflush NULL behaviour
11431 case "$fflushNULL" in
11432 '') set try -DTRY_FFLUSH_NULL $output
11433 if eval $compile; then
11435 ./try$exe_ext 2>/dev/null
11437 if $test -s try.out -a "X$code" = X42; then
11438 fflushNULL="`$cat try.out`"
11440 if $test "X$code" != X42; then
11442 (If this test failed, don't worry, we'll try another method shortly.)
11447 $rm -f core try.core core.try.*
11448 case "$fflushNULL" in
11450 Your fflush(NULL) works okay.
11452 fflushNULL="$define"
11455 Your fflush(NULL) isn't working (contrary to ANSI C).
11457 fflushNULL="$undef"
11460 Cannot figure out whether your fflush(NULL) works or not.
11461 I'm assuming it doesn't (contrary to ANSI C).
11463 fflushNULL="$undef"
11467 $define|true|[yY]*)
11468 fflushNULL="$define"
11471 fflushNULL="$undef"
11474 : check explicit looping only if NULL did not work
11475 case "$fflushNULL" in
11477 : check for fflush all behaviour
11478 case "$fflushall" in
11479 '') set try -DTRY_FFLUSH_ALL $output
11480 if eval $compile; then
11482 (Now testing the other method--but note that also this may fail.)
11485 ./try$exe_ext 2>/dev/null
11486 if $test -s try.out -a "X$?" = X42; then
11487 fflushall="`$cat try.out`"
11490 $rm -f core try.core core.try.*
11491 case "$fflushall" in
11493 Whew. Flushing explicitly all the stdio streams works.
11495 fflushall="$define"
11498 Sigh. Flushing explicitly all the stdio streams doesn't work.
11503 Cannot figure out whether flushing stdio streams explicitly works or not.
11504 I'm assuming it doesn't.
11510 "$define"|true|[yY]*)
11511 fflushall="$define"
11518 *) fflushall="$undef"
11521 case "$fflushNULL$fflushall" in
11524 I cannot figure out how to flush pending stdio output.
11528 $rm -f try.* try$exe_ext
11530 : see what type file positions are declared as in the library
11531 rp="What is the type for file position used by fsetpos()?"
11532 set fpos_t fpostype long stdio.h sys/types.h
11535 : Store the full pathname to the ar program for use in the C program
11536 : Respect a hint or command line value for full_ar.
11541 : Store the full pathname to the sed program for use in the C program
11544 : see what type gids are declared as in the kernel
11546 echo "Looking for the type for group ids returned by getgid()."
11547 set gid_t gidtype xxx stdio.h sys/types.h
11551 xxx=`./findhdr sys/user.h`
11552 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11554 unsigned) dflt="$1 $2" ;;
11558 *) dflt="$gidtype";;
11561 gid_t) echo "gid_t found." ;;
11562 *) rp="What is the type for group ids returned by getgid()?"
11568 : see if getgroups exists
11569 set getgroups d_getgrps
11572 : see if setgroups exists
11573 set setgroups d_setgrps
11577 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11579 case "$d_getgrps$d_setgrps" in
11581 case "$groupstype" in
11582 '') dflt="$gidtype" ;;
11583 *) dflt="$groupstype" ;;
11586 What type of pointer is the second argument to getgroups() and setgroups()?
11587 Usually this is the same as group ids, $gidtype, but not always.
11590 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11594 *) groupstype="$gidtype";;
11597 : see what type lseek is declared as in the kernel
11598 rp="What is the type used for lseek's offset on this system?"
11599 set off_t lseektype long stdio.h sys/types.h
11603 $echo $n "Checking to see how big your file offsets are...$c" >&4
11605 #include <sys/types.h>
11609 printf("%d\n", sizeof($lseektype));
11613 if eval $compile_ok; then
11615 $echo " $lseeksize bytes." >&4
11619 echo "(I can't seem to compile the test program. Guessing...)"
11620 rp="What is the size of your file offsets (in bytes)?"
11627 echo "Checking if your $make program sets \$(MAKE)..." >&4
11628 case "$make_set_make" in
11630 $sed 's/^X //' > testmake.mak << 'EOF'
11632 X @echo 'maketemp="$(MAKE)"'
11634 case "`$make -f testmake.mak 2>/dev/null`" in
11635 *maketemp=*) make_set_make='#' ;;
11636 *) make_set_make="MAKE=$make" ;;
11638 $rm -f testmake.mak
11641 case "$make_set_make" in
11642 '#') echo "Yup, it does.";;
11643 *) echo "Nope, it doesn't.";;
11646 : see what type is used for mode_t
11647 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11648 set mode_t modetype int stdio.h sys/types.h
11651 : define a fucntion to check prototypes
11652 $cat > protochk <<EOSH
11655 optimize="$optimize"
11657 prototype="$prototype"
11662 $cat >> protochk <<'EOSH'
11667 while test $# -ge 2; do
11669 $define) echo "#include <$2>" >> try.c ;;
11670 literal) echo "$2" >> try.c ;;
11674 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11675 cat >> try.c <<'EOCP'
11676 #ifdef CAN_PROTOTYPE
11677 #define _(args) args
11682 echo "$foo" >> try.c
11683 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11684 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11690 $eunicefix protochk
11692 : see what type is used for size_t
11693 rp="What is the type used for the length parameter for string functions?"
11694 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11697 : check for type of arguments to gethostbyaddr.
11698 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11699 case "$d_gethbyaddr" in
11703 Checking to see what type of arguments are accepted by gethostbyaddr().
11705 hdrs="$define sys/types.h
11706 $d_socket sys/socket.h
11707 $i_niin netinet/in.h
11709 $i_unistd unistd.h"
11710 : The first arg can 'char *' or 'void *'
11711 : The second arg is some of integral type
11712 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11713 for yyy in size_t long int; do
11714 case "$netdb_host_type" in
11715 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11716 if ./protochk "$try" $hdrs; then
11717 echo "Your system accepts $xxx for the first arg."
11718 echo "...and $yyy for the second arg."
11719 netdb_host_type="$xxx"
11720 netdb_hlen_type="$yyy"
11726 : In case none of those worked, prompt the user.
11727 case "$netdb_host_type" in
11728 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11731 netdb_host_type=$ans
11732 rp='What is the type for the 2nd argument to gethostbyaddr?'
11735 netdb_hlen_type=$ans
11739 *) : no gethostbyaddr, so pick harmless defaults
11740 netdb_host_type='char *'
11741 netdb_hlen_type="$sizetype"
11744 # Remove the "const" if needed. -- but then we'll have a
11746 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11749 : check for type of argument to gethostbyname.
11750 if test "X$netdb_name_type" = X ; then
11751 case "$d_gethbyname" in
11755 Checking to see what type of argument is accepted by gethostbyname().
11757 hdrs="$define sys/types.h
11758 $d_socket sys/socket.h
11759 $i_niin netinet/in.h
11761 $i_unistd unistd.h"
11762 for xxx in "const char *" "char *"; do
11763 case "$netdb_name_type" in
11764 '') try="extern struct hostent *gethostbyname($xxx);"
11765 if ./protochk "$try" $hdrs; then
11766 echo "Your system accepts $xxx."
11767 netdb_name_type="$xxx"
11772 : In case none of those worked, prompt the user.
11773 case "$netdb_name_type" in
11774 '') rp='What is the type for the 1st argument to gethostbyname?'
11777 netdb_name_type=$ans
11781 *) : no gethostbyname, so pick harmless default
11782 netdb_name_type='char *'
11787 : check for type of 1st argument to getnetbyaddr.
11788 if test "X$netdb_net_type" = X ; then
11789 case "$d_getnbyaddr" in
11793 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11795 hdrs="$define sys/types.h
11796 $d_socket sys/socket.h
11797 $i_niin netinet/in.h
11799 $i_unistd unistd.h"
11800 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11801 case "$netdb_net_type" in
11802 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11803 if ./protochk "$try" $hdrs; then
11804 echo "Your system accepts $xxx."
11805 netdb_net_type="$xxx"
11810 : In case none of those worked, prompt the user.
11811 case "$netdb_net_type" in
11812 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11815 netdb_net_type=$ans
11819 *) : no getnetbyaddr, so pick harmless default
11820 netdb_net_type='long'
11824 : locate the preferred pager for this system
11838 '') dflt=/usr/ucb/more;;
11845 rp='What pager is used on your system?'
11849 : see what type pids are declared as in the kernel
11850 rp="What is the type of process ids on this system?"
11851 set pid_t pidtype int stdio.h sys/types.h
11854 : check for length of pointer
11858 $echo $n "Checking to see how big your pointers are...$c" >&4
11859 if test "$voidflags" -gt 7; then
11860 echo '#define VOID_PTR char *' > try.c
11862 echo '#define VOID_PTR void *' > try.c
11864 $cat >>try.c <<'EOCP'
11868 printf("%d\n", sizeof(VOID_PTR));
11873 if eval $compile_ok; then
11875 $echo " $ptrsize bytes." >&4
11878 echo "(I can't seem to compile the test program. Guessing...)" >&4
11879 rp="What is the size of a pointer (in bytes)?"
11887 : see if ar generates random libraries by itself
11889 echo "Checking how to generate random libraries on your machine..." >&4
11890 echo 'int bar1() { return bar2(); }' > bar1.c
11891 echo 'int bar2() { return 2; }' > bar2.c
11892 $cat > foo.c <<'EOP'
11893 int main() { printf("%d\n", bar1()); exit(0); }
11895 $cc $ccflags -c bar1.c >/dev/null 2>&1
11896 $cc $ccflags -c bar2.c >/dev/null 2>&1
11897 $cc $ccflags -c foo.c >/dev/null 2>&1
11898 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11899 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11900 ./foobar >/dev/null 2>&1; then
11901 echo "$ar appears to generate random libraries itself."
11904 elif $ar ts bar$_a >/dev/null 2>&1 &&
11905 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11906 ./foobar >/dev/null 2>&1; then
11907 echo "a table of contents needs to be added with '$ar ts'."
11914 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11915 $test -f $ranlib || ranlib=''
11918 if $test -n "$ranlib"; then
11919 echo "your system has '$ranlib'; we'll use that."
11922 echo "your system doesn't seem to support random libraries"
11923 echo "so we'll use lorder and tsort to order the libraries."
11930 : check for type of arguments to select.
11931 case "$selecttype" in
11932 '') case "$d_select" in
11935 Checking to see what type of arguments are accepted by select().
11937 hdrs="$define sys/types.h
11938 $i_systime sys/time.h
11939 $i_sysselct sys/select.h
11940 $d_socket sys/socket.h"
11941 : The first arg can be int, unsigned, or size_t
11942 : The last arg may or may not be 'const'
11944 : void pointer has been seen but using that
11945 : breaks the selectminbits test
11946 for xxx in 'fd_set *' 'int *'; do
11947 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11948 for tmo in 'struct timeval *' 'const struct timeval *'; do
11950 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11951 if ./protochk "$try" $hdrs; then
11952 echo "Your system accepts $xxx."
11961 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11962 case "$d_fd_set" in
11963 $define) dflt="fd_set *" ;;
11972 *) : no select, so pick a harmless default
11979 : check for the select 'width'
11980 case "$selectminbits" in
11981 '') case "$d_select" in
11985 Checking to see on how many bits at a time your select() operates...
11988 #include <sys/types.h>
11990 #$i_systime I_SYS_TIME
11991 #$i_systimek I_SYS_TIME_KERNEL
11996 # ifdef I_SYS_TIME_KERNEL
11999 # include <sys/time.h>
12000 # ifdef I_SYS_TIME_KERNEL
12004 #$i_sysselct I_SYS_SELECT
12005 #ifdef I_SYS_SELECT
12006 #include <sys/select.h>
12008 #$d_socket HAS_SOCKET
12010 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12014 #define S sizeof(*(b))
12016 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12017 #define NBITS (NBYTES * 8)
12026 fp = fopen("try.c", "r");
12032 b = ($selecttype)s;
12033 for (i = 0; i < NBITS; i++)
12037 select(fd + 1, b, 0, 0, &t);
12038 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12039 printf("%d\n", i + 1);
12044 if eval $compile_ok; then
12045 selectminbits=`./try`
12046 case "$selectminbits" in
12048 Cannot figure out on how many bits at a time your select() operates.
12049 I'll play safe and guess it is 32 bits.
12055 *) bits="$selectminbits bits" ;;
12057 echo "Your select() operates on $bits at a time." >&4
12059 rp='What is the minimum number of bits your select() operates on?'
12060 case "$byteorder" in
12061 1234|12345678) dflt=32 ;;
12066 selectminbits="$val"
12070 *) : no select, so pick a harmless default
12077 : Trace out the files included by signal.h, then look for SIGxxx names.
12078 : Remove SIGARRAYSIZE used by HPUX.
12079 : Remove SIGSTKSIZE used by Linux.
12080 : Remove SIGSTKSZ used by Posix.
12081 : Remove SIGTYP void lines used by OS2.
12082 xxx=`echo '#include <signal.h>' |
12083 $cppstdin $cppminus $cppflags 2>/dev/null |
12084 $grep '^[ ]*#.*include' |
12085 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12086 : Check this list of files to be sure we have parsed the cpp output ok.
12087 : This will also avoid potentially non-existent files, such
12090 for xx in $xxx /dev/null ; do
12091 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12093 : If we have found no files, at least try signal.h
12094 case "$xxxfiles" in
12095 '') xxxfiles=`./findhdr signal.h` ;;
12098 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12099 print substr($2, 4, 20)
12101 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12102 print substr($3, 4, 20)
12104 : Append some common names just in case the awk scan failed.
12105 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12106 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12107 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12108 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12109 : generate a few handy files for later
12110 $cat > signal.c <<'EOCP'
12111 #include <sys/types.h>
12112 #include <signal.h>
12116 /* Strange style to avoid deeply-nested #if/#else/#endif */
12119 # define NSIG (_NSIG)
12125 # define NSIG (SIGMAX+1)
12131 # define NSIG (SIG_MAX+1)
12137 # define NSIG (MAXSIG+1)
12143 # define NSIG (MAX_SIG+1)
12148 # ifdef SIGARRAYSIZE
12149 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12155 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12159 /* Default to some arbitrary number that's big enough to get most
12160 of the common signals.
12166 printf("NSIG %d\n", NSIG);
12172 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12174 printf "#ifdef SIG"; printf $1; printf "\n"
12175 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12176 printf $1; printf ");\n"
12180 printf "#endif /* JUST_NSIG */\n";
12184 $cat >signal.awk <<'EOP'
12185 BEGIN { ndups = 0 }
12186 $1 ~ /^NSIG$/ { nsig = $2 }
12187 ($1 !~ /^NSIG$/) && (NF == 2) {
12188 if ($2 > maxsig) { maxsig = $2 }
12189 if (sig_name[$2]) {
12190 dup_name[ndups] = $1
12191 dup_num[ndups] = $2
12203 printf("NSIG %d\n", nsig);
12204 for (n = 1; n < nsig; n++) {
12206 printf("%s %d\n", sig_name[n], sig_num[n])
12209 printf("NUM%d %d\n", n, n)
12212 for (n = 0; n < ndups; n++) {
12213 printf("%s %d\n", dup_name[n], dup_num[n])
12217 $cat >signal_cmd <<EOS
12219 if $test -s signal.lst; then
12220 echo "Using your existing signal.lst file"
12225 $cat >>signal_cmd <<'EOS'
12228 if eval $compile_ok; then
12229 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12231 echo "(I can't seem be able to compile the whole test program)" >&4
12232 echo "(I'll try it in little pieces.)" >&4
12233 set signal -DJUST_NSIG
12234 if eval $compile_ok; then
12235 ./signal$_exe > signal.nsg
12238 echo "I can't seem to figure out how many signals you have." >&4
12239 echo "Guessing 50." >&4
12240 echo 'NSIG 50' > signal.nsg
12242 : Now look at all the signal names, one at a time.
12243 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12244 $cat > signal.c <<EOCP
12245 #include <sys/types.h>
12246 #include <signal.h>
12249 printf("$xx %d\n", SIG${xx});
12254 if eval $compile; then
12255 echo "SIG${xx} found."
12256 ./signal$_exe >> signal.ls1
12258 echo "SIG${xx} NOT found."
12261 if $test -s signal.ls1; then
12262 $cat signal.nsg signal.ls1 |
12263 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12267 if $test -s signal.lst; then
12270 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12271 echo 'kill -l' >signal
12272 set X `csh -f <signal`
12276 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12278 echo $@ | $tr ' ' $trnl | \
12279 $awk '{ printf "%s %d\n", $1, ++s; }
12280 END { printf "NSIG %d\n", ++s }' >signal.lst
12282 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12284 chmod a+x signal_cmd
12285 $eunicefix signal_cmd
12287 : generate list of signal names
12289 case "$sig_name_init" in
12291 *) case "$sig_num_init" in
12292 ''|*,*) doinit=yes ;;
12297 echo "Generating a list of signal names and numbers..." >&4
12299 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12300 sig_name=`$awk 'BEGIN { printf "ZERO " }
12301 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12302 sig_num=`$awk 'BEGIN { printf "0 " }
12303 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12304 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12305 !/^NSIG/ { printf "\"%s\", ", $1 }
12306 END { printf "0\n" }' signal.lst`
12307 sig_num_init=`$awk 'BEGIN { printf "0, " }
12308 !/^NSIG/ { printf "%d, ", $2}
12309 END { printf "0\n"}' signal.lst`
12312 echo "The following $sig_count signals are available:"
12314 echo $sig_name | $awk \
12315 'BEGIN { linelen = 0 }
12317 for (i = 1; i <= NF; i++) {
12318 name = "SIG" $i " "
12319 linelen = linelen + length(name)
12320 if (linelen > 70) {
12322 linelen = length(name)
12328 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12330 : see what type is used for signed size_t
12331 set ssize_t ssizetype int stdio.h sys/types.h
12334 $cat > ssize.c <<EOM
12336 #include <sys/types.h>
12337 #define Size_t $sizetype
12338 #define SSize_t $dflt
12341 if (sizeof(Size_t) == sizeof(SSize_t))
12343 else if (sizeof(Size_t) == sizeof(int))
12352 if eval $compile_ok && ./ssize > /dev/null; then
12353 ssizetype=`./ssize`
12354 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12357 Help! I can't compile and run the ssize_t test program: please enlighten me!
12358 (This is probably a misconfiguration in your system or libraries, and
12359 you really ought to fix it. Still, I'll try anyway.)
12361 I need a type that is the same size as $sizetype, but is guaranteed to
12362 be signed. Common values are ssize_t, int and long.
12365 rp="What signed type is the same size as $sizetype?"
12369 $rm -f ssize ssize.*
12371 : see what type of char stdio uses.
12373 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12374 echo "Your stdio uses unsigned chars." >&4
12375 stdchar="unsigned char"
12377 echo "Your stdio uses signed chars." >&4
12381 : see if time exists
12383 if test "X$d_time" = X -o X"$timetype" = X; then
12384 if set time val -f d_time; eval $csym; $val; then
12385 echo 'time() found.' >&4
12387 rp="What is the type returned by time() on this system?"
12388 set time_t timetype long stdio.h sys/types.h
12391 echo 'time() not found, hope that will do.' >&4
12399 : see what type uids are declared as in the kernel
12401 echo "Looking for the type for user ids returned by getuid()."
12402 set uid_t uidtype xxx stdio.h sys/types.h
12406 xxx=`./findhdr sys/user.h`
12407 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12409 unsigned) dflt="$1 $2" ;;
12413 *) dflt="$uidtype";;
12416 uid_t) echo "uid_t found." ;;
12417 *) rp="What is the type for user ids returned by getuid()?"
12423 : see if dbm.h is available
12424 : see if dbmclose exists
12425 set dbmclose d_dbmclose
12428 case "$d_dbmclose" in
12438 *) set rpcsvc/dbm.h i_rpcsvcdbm
12443 *) echo "We won't be including <dbm.h>"
12453 : see if this is a sys/file.h system
12458 : do we need to include sys/file.h ?
12462 if $h_sysfile; then
12464 echo "We'll be including <sys/file.h>." >&4
12467 echo "We won't be including <sys/file.h>." >&4
12477 : see if fcntl.h is there
12482 : see if we can include fcntl.h
12488 echo "We'll be including <fcntl.h>." >&4
12491 if $h_sysfile; then
12492 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12494 echo "We won't be including <fcntl.h>." >&4
12506 : see if locale.h is available
12507 set locale.h i_locale
12510 : see if mach cthreads are available
12511 if test "X$usethreads" = "X$define"; then
12512 set mach/cthreads.h i_machcthr
12515 i_machcthr="$undef"
12520 : see if this is a math.h system
12524 : see if this is a mntent.h system
12525 set mntent.h i_mntent
12528 : see if ndbm.h is available
12533 : see if dbm_open exists
12534 set dbm_open d_dbm_open
12536 case "$d_dbm_open" in
12539 echo "We won't be including <ndbm.h>"
12548 : see if net/errno.h is available
12550 set net/errno.h val
12553 : Unfortunately, it causes problems on some systems. Arrgh.
12556 cat > try.c <<'EOM'
12559 #include <net/errno.h>
12565 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12566 echo "We'll be including <net/errno.h>." >&4
12568 echo "We won't be including <net/errno.h>." >&4
12577 : see if netinet/tcp.h is available
12578 set netinet/tcp.h i_netinettcp
12581 : see if this is a poll.h system
12585 : get C preprocessor symbols handy
12587 $echo $n "Hmm... $c"
12588 echo $al | $tr ' ' $trnl >Cppsym.know
12589 $cat <<EOSS >Cppsym
12597 case "\$list\$#" in
12600 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12602 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12605 unknown="\$unknown \$sym"
12615 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12617 exit 0; _ _ _ _\1\\ \1\\
12620 echo "exit 1; _ _ _" >>Cppsym\$\$
12621 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12623 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12629 $rm -f Cppsym\$\$ Cppsym2\$\$
12634 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12636 : now check the C compiler for additional symbols
12637 postprocess_cc_v=''
12639 aix) postprocess_cc_v="|$tr , ' '" ;;
12646 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12649 -D*) echo "\$i" | $sed 's/^-D//';;
12650 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12655 postprocess_cc_v=''
12658 ./ccsym > ccsym1.raw
12659 if $test -s ccsym1.raw; then
12660 $sort ccsym1.raw | $uniq >ccsym.raw
12662 mv ccsym1.raw ccsym.raw
12665 $awk '/\=/ { print $0; next }
12666 { print $0"=1" }' ccsym.raw >ccsym.list
12667 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12668 $comm -13 ccsym.true ccsym.list >ccsym.own
12669 $comm -12 ccsym.true ccsym.list >ccsym.com
12670 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12672 if $test -z ccsym.raw; then
12673 echo "Your C compiler doesn't seem to define any symbols!" >&4
12675 echo "However, your C preprocessor defines the following symbols:"
12678 cppsymbols=`$cat Cppsym.true`
12679 cppsymbols=`echo $cppsymbols`
12680 cppccsymbols="$cppsymbols"
12682 if $test -s ccsym.com; then
12683 echo "Your C compiler and pre-processor define these symbols:"
12684 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12687 cppccsymbols=`$cat ccsym.com`
12688 cppccsymbols=`echo $cppccsymbols`
12689 $test "$silent" || sleep 1
12691 if $test -s ccsym.cpp; then
12692 $test "$also" && echo " "
12693 echo "Your C pre-processor ${also}defines the following symbols:"
12694 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12696 cppsymbols=`$cat ccsym.cpp`
12697 cppsymbols=`echo $cppsymbols`
12698 $test "$silent" || sleep 1
12700 if $test -s ccsym.own; then
12701 $test "$also" && echo " "
12702 echo "Your C compiler ${also}defines the following cpp symbols:"
12703 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12704 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12705 ccsymbols=`$cat ccsym.own`
12706 ccsymbols=`echo $ccsymbols`
12707 $test "$silent" || sleep 1
12712 : see if this is a termio system
12716 if $test `./findhdr termios.h`; then
12717 set tcsetattr i_termios
12723 "$define") echo "You have POSIX termios.h... good!" >&4;;
12724 *) if ./Cppsym pyr; then
12725 case "`/bin/universe`" in
12726 ucb) if $test `./findhdr sgtty.h`; then
12728 echo "<sgtty.h> found." >&4
12730 echo "System is pyramid with BSD universe."
12731 echo "<sgtty.h> not found--you could have problems." >&4
12733 *) if $test `./findhdr termio.h`; then
12735 echo "<termio.h> found." >&4
12737 echo "System is pyramid with USG universe."
12738 echo "<termio.h> not found--you could have problems." >&4
12742 if $test `./findhdr termio.h`; then
12743 echo "<termio.h> found." >&4
12745 elif $test `./findhdr sgtty.h`; then
12746 echo "<sgtty.h> found." >&4
12749 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12752 if $test `./findhdr sgtty.h`; then
12753 echo "<sgtty.h> found." >&4
12755 elif $test `./findhdr termio.h`; then
12756 echo "<termio.h> found." >&4
12759 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12763 set i_termio; eval $setvar
12764 val=$val2; set i_sgtty; eval $setvar
12765 val=$val3; set i_termios; eval $setvar
12767 : see if this is a shadow.h system
12768 set shadow.h i_shadow
12771 : see if this is a socks.h system
12772 set socks.h i_socks
12775 : see if stdarg is available
12777 if $test `./findhdr stdarg.h`; then
12778 echo "<stdarg.h> found." >&4
12781 echo "<stdarg.h> NOT found." >&4
12785 : see if varags is available
12787 if $test `./findhdr varargs.h`; then
12788 echo "<varargs.h> found." >&4
12790 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12793 : set up the varargs testing programs
12794 $cat > varargs.c <<EOP
12796 #include <stdarg.h>
12799 #include <varargs.h>
12803 int f(char *p, ...)
12817 p = va_arg(ap, char *);
12822 $cat > varargs <<EOP
12824 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12833 : now check which varargs header should be included
12838 if `./varargs I_STDARG`; then
12840 elif `./varargs I_VARARGS`; then
12845 if `./varargs I_VARARGS`; then
12852 echo "I could not find the definition for va_dcl... You have problems..." >&4
12853 val="$undef"; set i_stdarg; eval $setvar
12854 val="$undef"; set i_varargs; eval $setvar
12859 case "$i_varhdr" in
12861 val="$define"; set i_stdarg; eval $setvar
12862 val="$undef"; set i_varargs; eval $setvar
12865 val="$undef"; set i_stdarg; eval $setvar
12866 val="$define"; set i_varargs; eval $setvar
12869 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12873 : see if stddef is available
12874 set stddef.h i_stddef
12877 : see if sys/access.h is available
12878 set sys/access.h i_sysaccess
12881 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12882 set sys/filio.h i_sysfilio
12885 if $test `./findhdr sys/ioctl.h`; then
12887 echo '<sys/ioctl.h> found.' >&4
12890 if $test $i_sysfilio = "$define"; then
12891 echo '<sys/ioctl.h> NOT found.' >&4
12893 $test $i_sgtty = "$define" && xxx="sgtty.h"
12894 $test $i_termio = "$define" && xxx="termio.h"
12895 $test $i_termios = "$define" && xxx="termios.h"
12896 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12902 : see if sys/resource.h has to be included
12903 set sys/resource.h i_sysresrc
12906 : see if sys/security.h is available
12907 set sys/security.h i_syssecrt
12910 : see if this is a sys/statvfs.h system
12911 set sys/statvfs.h i_sysstatvfs
12914 : see if this is a sys/un.h system
12915 set sys/un.h i_sysun
12918 : see if this is a syswait system
12919 set sys/wait.h i_syswait
12922 : see if this is an utime system
12923 set utime.h i_utime
12926 : see if this is a values.h system
12927 set values.h i_values
12930 : see if this is a vfork system
12933 set vfork.h i_vfork
12941 : see if gdbm.h is available
12946 : see if gdbm_open exists
12947 set gdbm_open d_gdbm_open
12949 case "$d_gdbm_open" in
12952 echo "We won't be including <gdbm.h>"
12962 echo "Looking for extensions..." >&4
12963 : If we are using the old config.sh, known_extensions may contain
12964 : old or inaccurate or duplicate values.
12965 known_extensions=''
12966 nonxs_extensions=''
12967 : We do not use find because it might not be available.
12968 : We do not just use MANIFEST because the user may have dropped
12969 : some additional extensions into the source tree and expect them
12972 : Function to recursively find available extensions, ignoring DynaLoader
12973 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
12977 DynaLoader|dynaload) ;;
12979 if $test -f $xxx/$xxx.xs; then
12980 known_extensions="$known_extensions $1$xxx";
12981 elif $test -f $xxx/Makefile.PL; then
12982 nonxs_extensions="$nonxs_extensions $1$xxx";
12984 if $test -d $xxx -a $# -lt 10; then
12987 eval $find_extensions;
12999 eval $find_extensions
13000 set X $nonxs_extensions
13002 nonxs_extensions="$*"
13003 set X $known_extensions
13005 known_extensions="$*"
13008 : Now see which are supported on this system.
13010 for xxx in $known_extensions ; do
13014 $define) avail_ext="$avail_ext $xxx" ;;
13017 GDBM_File|gdbm_fil)
13019 $define) avail_ext="$avail_ext $xxx" ;;
13022 NDBM_File|ndbm_fil)
13024 $define) avail_ext="$avail_ext $xxx" ;;
13027 ODBM_File|odbm_fil)
13028 case "${i_dbm}${i_rpcsvcdbm}" in
13029 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13033 case "$useposix" in
13034 true|define|y) avail_ext="$avail_ext $xxx" ;;
13038 case "$useopcode" in
13039 true|define|y) avail_ext="$avail_ext $xxx" ;;
13043 case "$d_socket" in
13044 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13048 case "$usethreads" in
13049 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13053 : XXX Do we need a useipcsysv variable here
13054 case "${d_msg}${d_sem}${d_shm}" in
13055 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13058 *) avail_ext="$avail_ext $xxx"
13067 : Now see which nonxs extensions are supported on this system.
13068 : For now assume all are.
13070 for xxx in $nonxs_extensions ; do
13072 *) nonxs_ext="$nonxs_ext $xxx"
13084 A number of extensions are supplied with $package. You may choose to
13085 compile these extensions for dynamic loading (the default), compile
13086 them into the $package executable (static loading), or not include
13087 them at all. Answer "none" to include no extensions.
13088 Note that DynaLoader is always built and need not be mentioned here.
13091 case "$dynamic_ext" in
13092 '') dflt="$avail_ext" ;;
13093 *) dflt="$dynamic_ext"
13094 # Perhaps we are reusing an old out-of-date config.sh.
13097 if test X"$dynamic_ext" != X"$avail_ext"; then
13099 NOTICE: Your previous config.sh list may be incorrect.
13100 The extensions now available to you are
13102 but the default list from your previous config.sh is
13114 rp="What extensions do you wish to load dynamically?"
13117 none) dynamic_ext=' ' ;;
13118 *) dynamic_ext="$ans" ;;
13121 case "$static_ext" in
13123 : Exclude those already listed in dynamic linking
13125 for xxx in $avail_ext; do
13126 case " $dynamic_ext " in
13128 *) dflt="$dflt $xxx" ;;
13135 *) dflt="$static_ext"
13142 rp="What extensions do you wish to load statically?"
13145 none) static_ext=' ' ;;
13146 *) static_ext="$ans" ;;
13151 A number of extensions are supplied with $package. Answer "none"
13152 to include no extensions.
13153 Note that DynaLoader is always built and need not be mentioned here.
13156 case "$static_ext" in
13157 '') dflt="$avail_ext" ;;
13158 *) dflt="$static_ext"
13159 # Perhaps we are reusing an old out-of-date config.sh.
13162 if test X"$static_ext" != X"$avail_ext"; then
13164 NOTICE: Your previous config.sh list may be incorrect.
13165 The extensions now available to you are
13167 but the default list from your previous config.sh is
13176 : Exclude those that are not xs extensions
13180 rp="What extensions do you wish to include?"
13183 none) static_ext=' ' ;;
13184 *) static_ext="$ans" ;;
13189 set X $dynamic_ext $static_ext $nonxs_ext
13193 : Remove build directory name from cppstdin so it can be used from
13194 : either the present location or the final installed location.
13196 : Get out of the UU directory to get correct path name.
13198 case "$cppstdin" in
13200 echo "Stripping down cppstdin path name"
13206 : end of configuration questions
13208 echo "End of configuration questions."
13211 : back to where it started
13212 if test -d ../UU; then
13216 : configuration may be patched via a 'config.over' file
13217 if $test -f config.over; then
13220 rp='I see a config.over file. Do you wish to load it?'
13223 n*) echo "OK, I'll ignore it.";;
13225 echo "Configuration override changes have been loaded."
13230 : in case they want portability, strip down executable paths
13231 case "$d_portable" in
13234 echo "Stripping down executable paths..." >&4
13235 for file in $loclist $trylist; do
13237 eval $file=`basename $temp`
13242 : create config.sh file
13244 echo "Creating config.sh..." >&4
13245 $spitshell <<EOT >config.sh
13248 # This file was produced by running the Configure script. It holds all the
13249 # definitions figured out by Configure. Should you modify one of these values,
13250 # do not forget to propagate your changes by running "Configure -der". You may
13251 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13254 # Package name : $package
13255 # Source directory : $src
13256 # Configuration time: $cf_time
13257 # Configured by : $cf_by
13258 # Target system : $myuname
13268 Revision='$Revision'
13275 alignbytes='$alignbytes'
13276 ansi2knr='$ansi2knr'
13277 aphostname='$aphostname'
13278 apiversion='$apiversion'
13281 archlibexp='$archlibexp'
13282 archname64='$archname64'
13283 archname='$archname'
13284 archobjs='$archobjs'
13289 bincompat5005='$bincompat5005'
13293 byteorder='$byteorder'
13295 castflags='$castflags'
13298 cccdlflags='$cccdlflags'
13299 ccdlflags='$ccdlflags'
13301 ccsymbols='$ccsymbols'
13303 cf_email='$cf_email'
13308 clocktype='$clocktype'
13310 compress='$compress'
13311 contains='$contains'
13315 cpp_stuff='$cpp_stuff'
13316 cppccsymbols='$cppccsymbols'
13317 cppflags='$cppflags'
13319 cppminus='$cppminus'
13321 cppstdin='$cppstdin'
13322 cppsymbols='$cppsymbols'
13323 crosscompile='$crosscompile'
13324 cryptlib='$cryptlib'
13326 d_Gconvert='$d_Gconvert'
13327 d_PRIEldbl='$d_PRIEldbl'
13328 d_PRIFldbl='$d_PRIFldbl'
13329 d_PRIGldbl='$d_PRIGldbl'
13330 d_PRIX64='$d_PRIX64'
13331 d_PRId64='$d_PRId64'
13332 d_PRIeldbl='$d_PRIeldbl'
13333 d_PRIfldbl='$d_PRIfldbl'
13334 d_PRIgldbl='$d_PRIgldbl'
13335 d_PRIi64='$d_PRIi64'
13336 d_PRIo64='$d_PRIo64'
13337 d_PRIu64='$d_PRIu64'
13338 d_PRIx64='$d_PRIx64'
13339 d_access='$d_access'
13340 d_accessx='$d_accessx'
13342 d_archlib='$d_archlib'
13345 d_attribut='$d_attribut'
13348 d_bincompat5005='$d_bincompat5005'
13350 d_bsdgetpgrp='$d_bsdgetpgrp'
13351 d_bsdsetpgrp='$d_bsdsetpgrp'
13353 d_casti32='$d_casti32'
13354 d_castneg='$d_castneg'
13355 d_charvspr='$d_charvspr'
13357 d_chroot='$d_chroot'
13358 d_chsize='$d_chsize'
13359 d_closedir='$d_closedir'
13360 d_cmsghdr_s='$d_cmsghdr_s'
13364 d_cuserid='$d_cuserid'
13365 d_dbl_dig='$d_dbl_dig'
13366 d_difftime='$d_difftime'
13367 d_dirnamlen='$d_dirnamlen'
13368 d_dlerror='$d_dlerror'
13369 d_dlopen='$d_dlopen'
13370 d_dlsymun='$d_dlsymun'
13371 d_dosuid='$d_dosuid'
13372 d_drand48proto='$d_drand48proto'
13374 d_eaccess='$d_eaccess'
13375 d_endgrent='$d_endgrent'
13376 d_endhent='$d_endhent'
13377 d_endnent='$d_endnent'
13378 d_endpent='$d_endpent'
13379 d_endpwent='$d_endpwent'
13380 d_endsent='$d_endsent'
13381 d_endspent='$d_endspent'
13382 d_eofnblk='$d_eofnblk'
13383 d_eunice='$d_eunice'
13384 d_fchmod='$d_fchmod'
13385 d_fchown='$d_fchown'
13387 d_fd_macros='$d_fd_macros'
13388 d_fd_set='$d_fd_set'
13389 d_fds_bits='$d_fds_bits'
13390 d_fgetpos64='$d_fgetpos64'
13391 d_fgetpos='$d_fgetpos'
13392 d_flexfnam='$d_flexfnam'
13394 d_fopen64='$d_fopen64'
13396 d_fpathconf='$d_fpathconf'
13397 d_fpos64_t='$d_fpos64_t'
13398 d_freopen64='$d_freopen64'
13399 d_fseek64='$d_fseek64'
13400 d_fseeko64='$d_fseeko64'
13401 d_fseeko='$d_fseeko'
13402 d_fsetpos64='$d_fsetpos64'
13403 d_fsetpos='$d_fsetpos'
13404 d_fstatfs='$d_fstatfs'
13405 d_fstatvfs='$d_fstatvfs'
13406 d_ftell64='$d_ftell64'
13407 d_ftello64='$d_ftello64'
13408 d_ftello='$d_ftello'
13410 d_getgrent='$d_getgrent'
13411 d_getgrps='$d_getgrps'
13412 d_gethbyaddr='$d_gethbyaddr'
13413 d_gethbyname='$d_gethbyname'
13414 d_gethent='$d_gethent'
13415 d_gethname='$d_gethname'
13416 d_gethostprotos='$d_gethostprotos'
13417 d_getlogin='$d_getlogin'
13418 d_getmntent='$d_getmntent'
13419 d_getnbyaddr='$d_getnbyaddr'
13420 d_getnbyname='$d_getnbyname'
13421 d_getnent='$d_getnent'
13422 d_getnetprotos='$d_getnetprotos'
13423 d_getpbyname='$d_getpbyname'
13424 d_getpbynumber='$d_getpbynumber'
13425 d_getpent='$d_getpent'
13426 d_getpgid='$d_getpgid'
13427 d_getpgrp2='$d_getpgrp2'
13428 d_getpgrp='$d_getpgrp'
13429 d_getppid='$d_getppid'
13430 d_getprior='$d_getprior'
13431 d_getprotoprotos='$d_getprotoprotos'
13432 d_getpwent='$d_getpwent'
13433 d_getsbyname='$d_getsbyname'
13434 d_getsbyport='$d_getsbyport'
13435 d_getsent='$d_getsent'
13436 d_getservprotos='$d_getservprotos'
13437 d_getspent='$d_getspent'
13438 d_getspnam='$d_getspnam'
13439 d_gettimeod='$d_gettimeod'
13440 d_gnulibc='$d_gnulibc'
13441 d_grpasswd='$d_grpasswd'
13442 d_hasmntopt='$d_hasmntopt'
13445 d_inetaton='$d_inetaton'
13446 d_int64t='$d_int64t'
13447 d_iovec_s='$d_iovec_s'
13448 d_isascii='$d_isascii'
13449 d_killpg='$d_killpg'
13450 d_lchown='$d_lchown'
13452 d_llseek='$d_llseek'
13453 d_locconv='$d_locconv'
13455 d_longdbl='$d_longdbl'
13456 d_longlong='$d_longlong'
13458 d_madvise='$d_madvise'
13460 d_mbstowcs='$d_mbstowcs'
13461 d_mbtowc='$d_mbtowc'
13462 d_memchr='$d_memchr'
13463 d_memcmp='$d_memcmp'
13464 d_memcpy='$d_memcpy'
13465 d_memmove='$d_memmove'
13466 d_memset='$d_memset'
13468 d_mkfifo='$d_mkfifo'
13469 d_mktime='$d_mktime'
13471 d_mprotect='$d_mprotect'
13473 d_msg_ctrunc='$d_msg_ctrunc'
13474 d_msg_dontroute='$d_msg_dontroute'
13475 d_msg_oob='$d_msg_oob'
13476 d_msg_peek='$d_msg_peek'
13477 d_msg_proxy='$d_msg_proxy'
13478 d_msgctl='$d_msgctl'
13479 d_msgget='$d_msgget'
13480 d_msghdr_s='$d_msghdr_s'
13481 d_msgrcv='$d_msgrcv'
13482 d_msgsnd='$d_msgsnd'
13484 d_munmap='$d_munmap'
13485 d_mymalloc='$d_mymalloc'
13487 d_off64_t='$d_off64_t'
13488 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13489 d_oldpthreads='$d_oldpthreads'
13490 d_oldsock='$d_oldsock'
13492 d_pathconf='$d_pathconf'
13494 d_phostname='$d_phostname'
13497 d_portable='$d_portable'
13498 d_pthread_yield='$d_pthread_yield'
13500 d_pwchange='$d_pwchange'
13501 d_pwclass='$d_pwclass'
13502 d_pwcomment='$d_pwcomment'
13503 d_pwexpire='$d_pwexpire'
13504 d_pwgecos='$d_pwgecos'
13505 d_pwpasswd='$d_pwpasswd'
13506 d_pwquota='$d_pwquota'
13507 d_readdir='$d_readdir'
13508 d_readlink='$d_readlink'
13510 d_recvmsg='$d_recvmsg'
13511 d_rename='$d_rename'
13512 d_rewinddir='$d_rewinddir'
13514 d_safebcpy='$d_safebcpy'
13515 d_safemcpy='$d_safemcpy'
13516 d_sanemcmp='$d_sanemcmp'
13517 d_sched_yield='$d_sched_yield'
13518 d_scm_rights='$d_scm_rights'
13519 d_seekdir='$d_seekdir'
13520 d_select='$d_select'
13522 d_semctl='$d_semctl'
13523 d_semctl_semid_ds='$d_semctl_semid_ds'
13524 d_semctl_semun='$d_semctl_semun'
13525 d_semget='$d_semget'
13527 d_sendmsg='$d_sendmsg'
13528 d_setegid='$d_setegid'
13529 d_seteuid='$d_seteuid'
13530 d_setgrent='$d_setgrent'
13531 d_setgrps='$d_setgrps'
13532 d_sethent='$d_sethent'
13533 d_setlinebuf='$d_setlinebuf'
13534 d_setlocale='$d_setlocale'
13535 d_setnent='$d_setnent'
13536 d_setpent='$d_setpent'
13537 d_setpgid='$d_setpgid'
13538 d_setpgrp2='$d_setpgrp2'
13539 d_setpgrp='$d_setpgrp'
13540 d_setprior='$d_setprior'
13541 d_setpwent='$d_setpwent'
13542 d_setregid='$d_setregid'
13543 d_setresgid='$d_setresgid'
13544 d_setresuid='$d_setresuid'
13545 d_setreuid='$d_setreuid'
13546 d_setrgid='$d_setrgid'
13547 d_setruid='$d_setruid'
13548 d_setsent='$d_setsent'
13549 d_setsid='$d_setsid'
13550 d_setspent='$d_setspent'
13551 d_setvbuf='$d_setvbuf'
13555 d_shmatprototype='$d_shmatprototype'
13556 d_shmctl='$d_shmctl'
13558 d_shmget='$d_shmget'
13559 d_sigaction='$d_sigaction'
13560 d_sigsetjmp='$d_sigsetjmp'
13561 d_socket='$d_socket'
13562 d_sockpair='$d_sockpair'
13563 d_statblks='$d_statblks'
13564 d_statfs='$d_statfs'
13565 d_statfsflags='$d_statfsflags'
13566 d_statvfs='$d_statvfs'
13567 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13568 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13569 d_stdio_stream_array='$d_stdio_stream_array'
13570 d_stdiobase='$d_stdiobase'
13571 d_stdstdio='$d_stdstdio'
13572 d_strchr='$d_strchr'
13573 d_strcoll='$d_strcoll'
13574 d_strctcpy='$d_strctcpy'
13575 d_strerrm='$d_strerrm'
13576 d_strerror='$d_strerror'
13577 d_strtod='$d_strtod'
13578 d_strtol='$d_strtol'
13579 d_strtoul='$d_strtoul'
13580 d_strtoull='$d_strtoull'
13581 d_strxfrm='$d_strxfrm'
13582 d_suidsafe='$d_suidsafe'
13583 d_symlink='$d_symlink'
13584 d_syscall='$d_syscall'
13585 d_sysconf='$d_sysconf'
13586 d_sysernlst='$d_sysernlst'
13587 d_syserrlst='$d_syserrlst'
13588 d_system='$d_system'
13589 d_tcgetpgrp='$d_tcgetpgrp'
13590 d_tcsetpgrp='$d_tcsetpgrp'
13591 d_telldir='$d_telldir'
13592 d_telldirproto='$d_telldirproto'
13595 d_tmpfile64='$d_tmpfile64'
13596 d_truncate='$d_truncate'
13597 d_tzname='$d_tzname'
13600 d_union_semun='$d_union_semun'
13601 d_vendorlib='$d_vendorlib'
13603 d_void_closedir='$d_void_closedir'
13604 d_voidsig='$d_voidsig'
13605 d_voidtty='$d_voidtty'
13606 d_volatile='$d_volatile'
13607 d_vprintf='$d_vprintf'
13609 d_waitpid='$d_waitpid'
13610 d_wcstombs='$d_wcstombs'
13611 d_wctomb='$d_wctomb'
13612 d_writev='$d_writev'
13615 db_hashtype='$db_hashtype'
13616 db_prefixtype='$db_prefixtype'
13617 defvoidused='$defvoidused'
13618 direntrytype='$direntrytype'
13621 doublesize='$doublesize'
13623 dynamic_ext='$dynamic_ext'
13629 eunicefix='$eunicefix'
13632 extensions='$extensions'
13633 fflushNULL='$fflushNULL'
13634 fflushall='$fflushall'
13636 firstmakefile='$firstmakefile'
13638 fpostype='$fpostype'
13639 freetype='$freetype'
13641 full_csh='$full_csh'
13642 full_sed='$full_sed'
13643 gccversion='$gccversion'
13647 groupcat='$groupcat'
13648 groupstype='$groupstype'
13651 h_sysfile='$h_sysfile'
13655 i_arpainet='$i_arpainet'
13656 i_bsdioctl='$i_bsdioctl'
13659 i_dirent='$i_dirent'
13666 i_inttypes='$i_inttypes'
13667 i_limits='$i_limits'
13668 i_locale='$i_locale'
13669 i_machcthr='$i_machcthr'
13670 i_malloc='$i_malloc'
13672 i_memory='$i_memory'
13673 i_mntent='$i_mntent'
13676 i_neterrno='$i_neterrno'
13677 i_netinettcp='$i_netinettcp'
13680 i_pthread='$i_pthread'
13682 i_rpcsvcdbm='$i_rpcsvcdbm'
13685 i_shadow='$i_shadow'
13687 i_stdarg='$i_stdarg'
13688 i_stddef='$i_stddef'
13689 i_stdlib='$i_stdlib'
13690 i_string='$i_string'
13691 i_sysaccess='$i_sysaccess'
13692 i_sysdir='$i_sysdir'
13693 i_sysfile='$i_sysfile'
13694 i_sysfilio='$i_sysfilio'
13696 i_sysioctl='$i_sysioctl'
13697 i_sysmman='$i_sysmman'
13698 i_sysmount='$i_sysmount'
13699 i_sysndir='$i_sysndir'
13700 i_sysparam='$i_sysparam'
13701 i_sysresrc='$i_sysresrc'
13702 i_syssecrt='$i_syssecrt'
13703 i_sysselct='$i_sysselct'
13704 i_syssockio='$i_syssockio'
13705 i_sysstat='$i_sysstat'
13706 i_sysstatvfs='$i_sysstatvfs'
13707 i_systime='$i_systime'
13708 i_systimek='$i_systimek'
13709 i_systimes='$i_systimes'
13710 i_systypes='$i_systypes'
13711 i_sysuio='$i_sysuio'
13713 i_syswait='$i_syswait'
13714 i_termio='$i_termio'
13715 i_termios='$i_termios'
13717 i_unistd='$i_unistd'
13719 i_values='$i_values'
13720 i_varargs='$i_varargs'
13721 i_varhdr='$i_varhdr'
13723 ignore_versioned_solibs='$ignore_versioned_solibs'
13726 installarchlib='$installarchlib'
13727 installbin='$installbin'
13728 installman1dir='$installman1dir'
13729 installman3dir='$installman3dir'
13730 installprefix='$installprefix'
13731 installprefixexp='$installprefixexp'
13732 installprivlib='$installprivlib'
13733 installscript='$installscript'
13734 installsitearch='$installsitearch'
13735 installsitelib='$installsitelib'
13736 installstyle='$installstyle'
13737 installusrbinperl='$installusrbinperl'
13738 installvendorlib='$installvendorlib'
13740 known_extensions='$known_extensions'
13744 lddlflags='$lddlflags'
13746 ldlibpthname='$ldlibpthname'
13753 libswanted='$libswanted'
13759 locincpth='$locincpth'
13760 loclibpth='$loclibpth'
13761 longdblsize='$longdblsize'
13762 longlongsize='$longlongsize'
13763 longsize='$longsize'
13767 lseeksize='$lseeksize'
13768 lseektype='$lseektype'
13772 make_set_make='$make_set_make'
13773 mallocobj='$mallocobj'
13774 mallocsrc='$mallocsrc'
13775 malloctype='$malloctype'
13777 man1direxp='$man1direxp'
13780 man3direxp='$man3direxp'
13784 mips_type='$mips_type'
13786 mmaptype='$mmaptype'
13788 modetype='$modetype'
13790 multiarch='$multiarch'
13792 myarchname='$myarchname'
13793 mydomain='$mydomain'
13794 myhostname='$myhostname'
13797 netdb_hlen_type='$netdb_hlen_type'
13798 netdb_host_type='$netdb_host_type'
13799 netdb_name_type='$netdb_name_type'
13800 netdb_net_type='$netdb_net_type'
13803 nm_so_opt='$nm_so_opt'
13804 nonxs_ext='$nonxs_ext'
13806 o_nonblock='$o_nonblock'
13808 old_pthread_create_joinable='$old_pthread_create_joinable'
13809 optimize='$optimize'
13810 orderlib='$orderlib'
13816 patchlevel='$patchlevel'
13817 path_sep='$path_sep'
13819 perladmin='$perladmin'
13820 perlpath='$perlpath'
13822 phostname='$phostname'
13828 prefixexp='$prefixexp'
13830 privlibexp='$privlibexp'
13831 prototype='$prototype'
13833 randbits='$randbits'
13834 randfunc='$randfunc'
13835 randseedtype='$randseedtype'
13837 rd_nodata='$rd_nodata'
13841 sPRIEldbl='$sPRIEldbl'
13842 sPRIFldbl='$sPRIFldbl'
13843 sPRIGldbl='$sPRIGldbl'
13846 sPRIeldbl='$sPRIeldbl'
13847 sPRIfldbl='$sPRIfldbl'
13848 sPRIgldbl='$sPRIgldbl'
13853 sched_yield='$sched_yield'
13854 scriptdir='$scriptdir'
13855 scriptdirexp='$scriptdirexp'
13857 seedfunc='$seedfunc'
13858 selectminbits='$selectminbits'
13859 selecttype='$selecttype'
13860 sendmail='$sendmail'
13863 sharpbang='$sharpbang'
13864 shmattype='$shmattype'
13865 shortsize='$shortsize'
13868 sig_count='$sig_count'
13869 sig_name='$sig_name'
13870 sig_name_init='$sig_name_init'
13872 sig_num_init='$sig_num_init'
13873 signal_t='$signal_t'
13874 sitearch='$sitearch'
13875 sitearchexp='$sitearchexp'
13877 sitelibexp='$sitelibexp'
13878 siteprefix='$siteprefix'
13879 siteprefixexp='$siteprefixexp'
13880 sizetype='$sizetype'
13885 sockethdr='$sockethdr'
13886 socketlib='$socketlib'
13888 spackage='$spackage'
13889 spitshell='$spitshell'
13892 ssizetype='$ssizetype'
13893 startperl='$startperl'
13895 static_ext='$static_ext'
13897 stdio_base='$stdio_base'
13898 stdio_bufsiz='$stdio_bufsiz'
13899 stdio_cnt='$stdio_cnt'
13900 stdio_filbuf='$stdio_filbuf'
13901 stdio_ptr='$stdio_ptr'
13902 stdio_stream_array='$stdio_stream_array'
13905 subversion='$subversion'
13912 timeincl='$timeincl'
13913 timetype='$timetype'
13921 use64bits='$use64bits'
13923 uselongdouble='$uselongdouble'
13924 usemultiplicity='$usemultiplicity'
13925 usemymalloc='$usemymalloc'
13927 useopcode='$useopcode'
13928 useperlio='$useperlio'
13929 useposix='$useposix'
13931 useshrplib='$useshrplib'
13932 usesocks='$usesocks'
13933 usethreads='$usethreads'
13934 usevendorprefix='$usevendorprefix'
13935 usevfork='$usevfork'
13938 vendorlib='$vendorlib'
13939 vendorlibexp='$vendorlibexp'
13940 vendorprefix='$vendorprefix'
13941 vendorprefixexp='$vendorprefixexp'
13944 voidflags='$voidflags'
13950 : Add in command line options if available
13951 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13953 : add special variables
13954 $test -f $src/patchlevel.h && \
13955 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13956 echo "CONFIGDOTSH=true" >>config.sh
13958 : propagate old symbols
13959 if $test -f UU/config.sh; then
13960 <UU/config.sh sort | uniq >UU/oldconfig.sh
13961 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13962 sort | uniq -u >UU/oldsyms
13963 set X `cat UU/oldsyms`
13969 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13971 echo "# Variables propagated from previous config.sh file." >>config.sh
13972 for sym in `cat UU/oldsyms`; do
13973 echo " Propagating $hint variable "'$'"$sym..."
13974 eval 'tmp="$'"${sym}"'"'
13976 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13982 : Finish up by extracting the .SH files
13996 If you'd like to make any changes to the config.sh file before I begin
13997 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14000 rp="Press return or use a shell escape to edit config.sh:"
14005 *) : in case they cannot read
14006 sh 1>&4 -c "$ans";;
14011 : if this fails, just run all the .SH files by hand
14018 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14025 Now you need to generate make dependencies by running "$make depend".
14026 You might prefer to run it in background: "$make depend > makedepend.out &"
14027 It can take a while, so you might not want to run it right now.
14032 rp="Run $make depend now?"
14036 $make depend && echo "Now you must run a $make."
14039 echo "You must run '$make depend' then '$make'."
14042 elif test -f [Mm]akefile; then
14044 echo "Now you must run a $make."
14049 if $test -f Policy.sh; then
14052 If you compile $package on a different machine or from a different object
14053 directory, copy the Policy.sh file from this object directory to the
14054 new one before you run Configure -- this will help you with most of
14055 the policy defaults.
14059 if $test -f config.msg; then
14060 echo "Hmm. I also noted the following information while running:"
14062 $cat config.msg >&4
14065 $rm -f kit*isdone ark*isdone