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 Mon Aug 30 22:33:03 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
441 d_old_pthread_create_joinable=''
442 old_pthread_create_joinable=''
691 ignore_versioned_solibs=''
812 d_stdio_stream_array=''
813 stdio_stream_array=''
847 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
850 : We must find out about Eunice early
852 if test -f /etc/unixtovms; then
853 eunicefix=/etc/unixtovms
855 if test -f /etc/unixtovms.exe; then
856 eunicefix=/etc/unixtovms.exe
860 : Possible local include directories to search.
861 : Set locincpth to "" in a hint file to defeat local include searches.
862 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
863 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
865 : no include file wanted by default
868 : list of known cpp symbols, sorted alphabetically
869 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
870 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
871 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
872 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
873 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
874 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
875 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
876 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
877 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
878 al="$al VMS Xenix286"
879 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
880 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
881 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
882 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
883 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
884 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
885 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
886 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
887 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
888 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
889 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
890 al="$al __SVR4_2__ __UMAXV__"
891 al="$al ____386BSD____ __alpha __alpha__ __amiga"
892 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
893 al="$al __host_mips__"
894 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
895 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
896 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
897 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
898 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
899 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
900 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
901 al="$al __mc88100 __mc88100__ __mips __mips__"
902 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
903 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
904 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
905 al="$al _host_mips _mips _unix"
906 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
907 al="$al apollo ardent att386 att3b"
908 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
909 al="$al cadmus clipper concurrent convex cray ctix"
910 al="$al dmert encore gcos gcx gimpel gould"
911 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
912 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
913 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
914 al="$al i186 i286 i386 i486 i8086"
915 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
916 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
917 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
918 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
919 al="$al mc88000 mc88100 merlin mert mips mvs n16"
920 al="$al ncl_el ncl_mr"
921 al="$al news1500 news1700 news1800 news1900 news3700"
922 al="$al news700 news800 news900 ns16000 ns32000"
923 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
924 al="$al parisc pc532 pdp11 plexus posix pyr"
925 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
926 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
927 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
928 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
929 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
930 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
933 : Trailing extension. Override this in a hint file, if needed.
935 : Extra object files, if any, needed on this platform.
938 : change the next line if compiling for Xenix/286 on Xenix/386
939 xlibpth='/usr/lib/386 /lib/386'
941 : Possible local library directories to search.
942 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
943 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
945 : general looking path for locating libraries
946 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
947 glibpth="$glibpth /lib /usr/lib $xlibpth"
948 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
949 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
951 : Private path used by Configure to find libraries. Its value
952 : is prepended to libpth. This variable takes care of special
953 : machines, like the mips. Usually, it should be empty.
956 : default library list
958 : some systems want to use only the non-versioned libso:s
959 ignore_versioned_solibs=''
960 : full support for void wanted by default
963 : set useposix=false in your hint file to disable the POSIX extension.
965 : set useopcode=false in your hint file to disable the Opcode extension.
967 : set usemultiplicity on the Configure command line to enable multiplicity.
968 : set usesocks on the Configure command line to enable socks.
969 : set usethreads on the Configure command line to enable threads.
970 : List of libraries we want.
971 : If anyone needs -lnet, put it in a hint file.
972 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
973 libswanted="$libswanted dld ld sun m c cposix posix"
974 libswanted="$libswanted ndir dir crypt sec"
975 libswanted="$libswanted ucb bsd BSD PW x"
976 : We probably want to search /usr/shlib before most other libraries.
977 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
978 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
979 glibpth="/usr/shlib $glibpth"
980 : Do not use vfork unless overridden by a hint file.
983 : Find the basic shell for Bourne shell scripts
987 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
990 if test -f "$xxx"; then
993 : Build up a list and do a single loop so we can 'break' out.
994 pth=`echo $PATH | sed -e "s/$p_/ /g"`
995 for xxx in sh bash ksh pdksh ash; do
997 try="$try ${p}/${xxx}"
1001 if test -f "$xxx"; then
1004 elif test -f "$xxx.exe"; then
1015 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1017 Usually it's in /bin/sh. How did you even get this far?
1018 Please contact me (Perl Maintainers) at perlbug@perl.com and
1019 we'll try to straighten this all out.
1025 : see if sh knows # comments
1026 if `$sh -c '#' >/dev/null 2>&1`; then
1030 test -f $xcat || xcat=/usr/bin/cat
1035 if test -s today; then
1038 echo "#! $xcat" > try
1042 if test -s today; then
1050 echo "Your $sh doesn't grok # comments--I will strip them later on."
1053 echo "exec grep -v '^[ ]*#'" >spitshell
1055 $eunicefix spitshell
1056 spitshell=`pwd`/spitshell
1058 echo "I presume that if # doesn't work, #! won't work either!"
1063 : figure out how to guarantee sh startup
1065 '') startsh=${sharpbang}${sh} ;;
1077 : echo "Yup, it does."
1079 echo "Hmm... '$startsh' does not guarantee sh startup..."
1080 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1085 : Save command line options in file UU/cmdline.opt for later use in
1086 : generating config.sh.
1087 cat > cmdline.opt <<EOSH
1088 # Configure command line arguments.
1095 cat >>cmdline.opt <<EOSH
1096 config_arg$argn='$arg'
1098 argn=`expr $argn + 1`
1101 : produce awk script to parse command line options
1102 cat >options.awk <<'EOF'
1104 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1106 len = length(optstr);
1107 for (i = 1; i <= len; i++) {
1108 c = substr(optstr, i, 1);
1109 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1120 if (substr(str, 1, 1) != "-") {
1121 printf("'%s'\n", str);
1125 for (i = 2; i <= len; i++) {
1126 c = substr(str, i, 1);
1128 printf("-%s\n", substr(str, i));
1134 printf("'%s'\n", substr(str, i + 1));
1147 : process the command line options
1148 set X `for arg in "$@"; do echo "X$arg"; done |
1149 sed -e s/X// | awk -f options.awk`
1154 : set up default values
1165 cat >optdef.sh <<EOS
1171 while test $# -gt 0; do
1173 -d) shift; fastread=yes;;
1174 -e) shift; alldone=cont;;
1178 if test -r "$1"; then
1181 echo "$me: cannot read config file $1." >&2
1186 -h) shift; error=true;;
1187 -r) shift; reuseval=true;;
1188 -s) shift; silent=true; realsilent=true;;
1189 -E) shift; alldone=exit;;
1190 -K) shift; knowitall=true;;
1191 -O) shift; override=true;;
1192 -S) shift; silent=true; extractsh=true;;
1197 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1198 echo "$me: ignoring -D $1" >&2
1201 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1202 *) echo "$1='define'" >> optdef.sh;;
1209 *=) echo "$1" >> optdef.sh;;
1211 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1212 echo "$me: ignoring -U $1" >&2
1214 *) echo "$1='undef'" >> optdef.sh;;
1218 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1221 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1229 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1230 [-U symbol] [-U symbol=]
1231 -d : use defaults for all answers.
1232 -e : go on without questioning past the production of config.sh.
1233 -f : specify an alternate default configuration file.
1234 -h : print this help message and exit (with an error status).
1235 -r : reuse C symbols value if possible (skips costly nm extraction).
1236 -s : silent mode, only echoes questions and essential information.
1237 -D : define symbol to have some value:
1238 -D symbol symbol gets the value 'define'
1239 -D symbol=value symbol gets the value 'value'
1240 -E : stop at the end of questions, after having produced config.sh.
1241 -K : do not use unless you know what you are doing.
1242 -O : let -D and -U override definitions from loaded configuration file.
1243 -S : perform variable substitutions on all .SH files (can mix with -f)
1244 -U : undefine symbol:
1245 -U symbol symbol gets the value 'undef'
1246 -U symbol= symbol gets completely empty
1247 -V : print version number and exit (with a zero status).
1254 case "$fastread$alldone" in
1257 if test ! -t 0; then
1258 echo "Say 'sh Configure', not 'sh <Configure'"
1266 true) exec 1>/dev/null;;
1269 : run the defines and the undefines, if any, but leave the file out there...
1275 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1276 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1277 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1278 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1279 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1282 : Some greps do not return status, grrr.
1283 echo "grimblepritz" >grimble
1284 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1286 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1292 : the following should work in any shell
1296 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1297 cat >contains <<'EOSS'
1298 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1303 : Find the path to the source tree
1306 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1309 *) src=`cd ../$src && pwd` ;;
1322 if test -f $rsrc/Configure && \
1323 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1325 : found it, so we are ok.
1328 for src in . .. ../.. ../../.. ../../../..; do
1329 if test -f ../$src/Configure && \
1330 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1341 Sorry, I can't seem to locate the source dir for $package. Please start
1342 Configure with an explicit path -- i.e. /some/path/Configure.
1350 echo "Sources for $package found in \"$src\"." >&4
1354 : script used to extract .SH files with variable substitutions
1355 cat >extract <<'EOS'
1357 echo "Doing variable substitutions on .SH files..."
1358 if test -f $src/MANIFEST; then
1359 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1361 echo "(Looking for .SH files under the source directory.)"
1362 set x `(cd $src; find . -name "*.SH" -print)`
1366 0) set x `(cd $src; echo *.SH)`; shift;;
1368 if test ! -f $src/$1; then
1374 while test $name; do
1375 if test ! -d "$name"; then
1376 create="$name $create";
1377 name=`echo $name | sed -e "s|^[^/]*$||"`;
1378 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1383 for file in $create; do
1392 dir=`expr X$file : 'X\(.*\)/'`
1393 file=`expr X$file : 'X.*/\(.*\)'`
1394 (cd $dir && . ./$file)
1404 dir=`expr X$file : 'X\(.*\)/'`
1405 file=`expr X$file : 'X.*/\(.*\)'`
1406 (set x $dir; shift; eval $mkdir_p)
1416 if test -f $src/config_h.SH; then
1417 if test ! -f config.h; then
1418 : oops, they left it out of MANIFEST, probably, so do it anyway.
1424 : extract files and exit if asked to do so
1425 case "$extractsh" in
1427 case "$realsilent" in
1431 case "$config_sh" in
1432 '') config_sh='config.sh';;
1435 echo "Fetching answers from $config_sh..."
1438 test "$override" && . ./optdef.sh
1447 : Eunice requires " " instead of "", can you believe it
1450 echo "Beginning of configuration questions for $package."
1452 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1454 : first determine how to suppress newline on echo command
1456 echo "Checking echo to see how to suppress newlines..."
1457 (echo "hi there\c" ; echo " ") >.echotmp
1458 if $contains c .echotmp >/dev/null 2>&1 ; then
1469 echo $n "The star should be here-->$c"
1473 : Now test for existence of everything in MANIFEST
1475 if test -f $rsrc/MANIFEST; then
1476 echo "First let's make sure your kit is complete. Checking..." >&4
1477 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1480 for filelist in x??; do
1481 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1483 if test -s missing; then
1487 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1489 You have the option of continuing the configuration process, despite the
1490 distinct possibility that your kit is damaged, by typing 'y'es. If you
1491 do, don't blame me if something goes wrong. I advise you to type 'n'o
1492 and contact the author (perlbug@perl.com).
1495 echo $n "Continue? [n] $c" >&4
1499 echo "Continuing..." >&4
1503 echo "ABORTING..." >&4
1508 echo "Looks good..."
1511 echo "There is no MANIFEST file. I hope your kit is complete !"
1516 : Find the appropriate value for a newline for tr
1517 if test -n "$DJGPP"; then
1520 if test X"$trnl" = X; then
1521 case "`echo foo|tr '\n' x 2>/dev/null`" in
1525 if test X"$trnl" = X; then
1526 case "`echo foo|tr '\012' x 2>/dev/null`" in
1527 foox) trnl='\012' ;;
1530 if test X"$trnl" = X; then
1533 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1539 : compute the number of columns on the terminal for proper question formatting
1544 : set up the echo used in my read
1545 myecho="case \"\$xxxm\" in
1546 '') echo $n \"\$rp $c\" >&4;;
1548 '') echo $n \"[\$xxxm] $c\";;
1550 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1552 echo $n \"[\$xxxm] $c\" >&4
1554 echo $n \"\$rp [\$xxxm] $c\" >&4
1560 : now set up to do reads with possible shell escape and default assignment
1566 case "\$fastread" in
1567 yes) case "\$dflt" in
1570 case "\$silent-\$rp" in
1575 *) case "\$silent" in
1576 true) case "\$rp" in
1581 while expr "X\$ans" : "X!" >/dev/null; do
1585 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1593 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1602 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1607 echo "(OK, I'll run with -d after this question.)" >&4
1610 echo "*** Sorry, \$1 not supported yet." >&4
1620 echo "*** Substitution done -- please confirm."
1622 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1627 echo "*** Error -- try again."
1634 case "\$ans\$xxxm\$nostick" in
1646 : create .config dir to save info across Configure sessions
1647 test -d ../.config || mkdir ../.config
1648 cat >../.config/README <<EOF
1649 This directory created by Configure to save information that should
1650 persist across sessions for $package.
1652 You may safely delete it if you wish.
1655 : general instructions
1658 user=`(logname) 2>/dev/null`
1660 '') user=`whoami 2>&1`;;
1662 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1665 rp='Would you like to see the instructions?'
1676 This installation shell script will examine your system and ask you questions
1677 to determine how the perl5 package should be installed. If you get
1678 stuck on a question, you may use a ! shell escape to start a subshell or
1679 execute a command. Many of the questions will have default answers in square
1680 brackets; typing carriage return will give you the default.
1682 On some of the questions which ask for file or directory names you are allowed
1683 to use the ~name construct to specify the login directory belonging to "name",
1684 even if you don't have a shell which knows about that. Questions where this is
1685 allowed will be marked "(~name ok)".
1689 dflt='Type carriage return to continue'
1693 The prompter used in this script allows you to use shell variables and
1694 backticks in your answers. You may use $1, $2, etc... to refer to the words
1695 in the default answer, as if the default line was a set of arguments given to a
1696 script shell. This means you may also use $* to repeat the whole default line,
1697 so you do not have to re-type everything to add something to the default.
1699 Everytime there is a substitution, you will have to confirm. If there is an
1700 error (e.g. an unmatched backtick), the default answer will remain unchanged
1701 and you will be prompted again.
1703 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1704 the questions and use the computed defaults (or the previous answers if there
1705 was already a config.sh file). Type 'Configure -h' for a list of options.
1706 You may also start interactively and then answer '& -d' at any prompt to turn
1707 on the non-interactive behaviour for the remainder of the execution.
1713 Much effort has been expended to ensure that this shell script will run on any
1714 Unix system. If despite that it blows up on yours, your best bet is to edit
1715 Configure and run it again. If you can't run Configure for some reason,
1716 you'll have to generate a config.sh file by hand. Whatever problems you
1717 have, let me (perlbug@perl.com) know how I blew it.
1719 This installation script affects things in two ways:
1721 1) it may do direct variable substitutions on some of the files included
1723 2) it builds a config.h file for inclusion in C programs. You may edit
1724 any of these files as the need arises after running this script.
1726 If you make a mistake on a question, there is no easy way to back up to it
1727 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1728 files. Configure will offer to let you do this before it runs the SH files.
1731 dflt='Type carriage return to continue'
1733 case "$firsttime" in
1734 true) echo $user >>../.config/instruct;;
1738 : find out where common programs are
1740 echo "Locating common programs..." >&4
1753 if test -d \$dir/\$thing; then
1759 for thisthing in \$dir/\$thing; do
1760 : just loop through to pick last item
1762 if test -f \$thisthing; then
1765 elif test -f \$dir/\$thing.exe; then
1766 if test -n "$DJGPP"; then
1767 echo \$dir/\$thing.exe
1769 : on Eunice apparently
1819 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1820 pth="$pth /lib /usr/lib"
1821 for file in $loclist; do
1825 if test -f "$xxx"; then
1828 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1829 xxx=`./loc $file $file $pth`
1832 '') xxx=`./loc $file $file $pth`;;
1833 *) xxx=`./loc $xxx $xxx $pth`;;
1839 echo $file is in $xxx.
1842 echo $file is in $xxx.
1845 echo "I don't know where '$file' is, and my life depends on it." >&4
1846 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1852 echo "Don't worry if any of the following aren't found..."
1854 for file in $trylist; do
1858 if test -f "$xxx"; then
1861 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1862 xxx=`./loc $file $file $pth`
1865 '') xxx=`./loc $file $file $pth`;;
1866 *) xxx=`./loc $xxx $xxx $pth`;;
1872 echo $file is in $xxx.
1875 echo $file is in $xxx.
1878 echo "I don't see $file out there, $say."
1885 echo "Substituting grep for egrep."
1891 echo "Substituting cp for ln."
1897 echo "Hopefully test is built into your sh."
1900 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1901 echo "Using the test built into your sh."
1909 echo "Hopefully echo is built into your sh."
1914 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1915 $echo $n "hi there$c" >foo1
1916 echo $n "hi there$c" >foo2
1917 if cmp foo1 foo2 >/dev/null 2>&1; then
1918 echo "They are compatible. In fact, they may be identical."
1925 They are not compatible! You are probably running ksh on a non-USG system.
1926 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1927 have echo built in and we may have to run some Bourne shell scripts. That
1928 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1931 $echo $n "The star should be here-->$c"
1938 : determine whether symbolic links are supported
1941 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1942 echo "Symbolic links are supported." >&4
1945 echo "Symbolic links are NOT supported." >&4
1950 : see whether [:lower:] and [:upper:] are supported character classes
1952 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1954 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1958 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1959 # (0xc9 and 0xd1), therefore that is a nice testing point.
1960 if test "X$up" = X -o "X$low" = X; then
1961 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1967 if test "X$up" = X -o "X$low" = X; then
1968 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1974 if test "X$up" = X -o "X$low" = X; then
1975 case "`echo IJ | od -x 2>/dev/null`" in
1977 echo "Hey, this might be EBCDIC." >&4
1978 if test "X$up" = X -o "X$low" = X; then
1979 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1980 ij) up='[A-IJ-RS-Z]'
1985 if test "X$up" = X -o "X$low" = X; then
1986 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1996 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1998 echo "Using $up and $low to convert case." >&4
2001 echo "I don't know how to translate letters from upper to lower case." >&4
2002 echo "Your tr is not acting any way I know of." >&4
2006 : set up the translation script tr, must be called with ./tr of course
2010 '[A-Z][a-z]') exec $tr '$up' '$low';;
2011 '[a-z][A-Z]') exec $tr '$low' '$up';;
2018 : Try to determine whether config.sh was made on this system
2019 case "$config_sh" in
2021 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2022 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2023 # because the A-Z/a-z are not consecutive.
2024 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2025 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2026 newmyuname="$myuname"
2028 case "$knowitall" in
2030 if test -f ../config.sh; then
2031 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2032 eval "`grep myuname= ../config.sh`"
2034 if test "X$myuname" = "X$newmyuname"; then
2042 : Get old answers from old config file if Configure was run on the
2043 : same system, otherwise use the hints.
2046 if test -f config.sh; then
2048 rp="I see a config.sh file. Shall I use it to set the defaults?"
2051 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2052 *) echo "Fetching default answers from your old config.sh file..." >&4
2060 : Older versions did not always set $sh. Catch re-use of such
2069 if test ! -f config.sh; then
2072 First time through, eh? I have some defaults handy for some systems
2073 that need some extra help getting the Configure answers right:
2076 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2078 : Half the following guesses are probably wrong... If you have better
2079 : tests or hints, please send them to perlbug@perl.com
2080 : The metaconfig authors would also appreciate a copy...
2081 $test -f /irix && osname=irix
2082 $test -f /xenix && osname=sco_xenix
2083 $test -f /dynix && osname=dynix
2084 $test -f /dnix && osname=dnix
2085 $test -f /lynx.os && osname=lynxos
2086 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2087 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2088 $test -f /bin/mips && /bin/mips && osname=mips
2089 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2090 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2091 $test -d /usr/apollo/bin && osname=apollo
2092 $test -f /etc/saf/_sactab && osname=svr4
2093 $test -d /usr/include/minix && osname=minix
2094 if $test -d /MachTen -o -d /MachTen_Folder; then
2096 if $test -x /sbin/version; then
2097 osvers=`/sbin/version | $awk '{print $2}' |
2098 $sed -e 's/[A-Za-z]$//'`
2099 elif $test -x /usr/etc/version; then
2100 osvers=`/usr/etc/version | $awk '{print $2}' |
2101 $sed -e 's/[A-Za-z]$//'`
2106 $test -f /sys/posix.dll &&
2107 $test -f /usr/bin/what &&
2108 set X `/usr/bin/what /sys/posix.dll` &&
2109 $test "$3" = UWIN &&
2112 if $test -f $uname; then
2120 umips) osname=umips ;;
2123 [23]100) osname=mips ;;
2124 next*) osname=next ;;
2126 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2127 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2130 elif $test -f /etc/kconfig; then
2132 if test "$lns" = "$ln -s"; then
2134 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2136 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2143 if test -n "$DJGPP"; then
2152 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2154 'not found') osvers="$4"."$3" ;;
2155 '<3240'|'<>3240') osvers=3.2.0 ;;
2156 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2157 '=3250'|'>3250') osvers=3.2.5 ;;
2161 *dc.osx) osname=dcosx
2167 domainos) osname=apollo
2173 dynixptx*) osname=dynixptx
2174 osvers=`echo "$4"|sed 's/^v//'`
2176 freebsd) osname=freebsd
2178 genix) osname=genix ;;
2180 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2196 netbsd*) osname=netbsd
2199 news-os) osvers="$3"
2201 4*) osname=newsos4 ;;
2205 bsd386) osname=bsd386
2208 POSIX-BC | posix-bc ) osname=posix-bc
2211 powerux | power_ux | powermax_os | powermaxos | \
2212 powerunix | power_unix) osname=powerux
2215 next*) osname=next ;;
2216 solaris) osname=solaris
2218 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2225 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2229 titanos) osname=titanos
2238 ultrix) osname=ultrix
2241 osf1|mls+) case "$5" in
2244 osvers=`echo "$3" | sed 's/^[xvt]//'`
2246 hp*) osname=hp_osf1 ;;
2247 mips) osname=mips_osf1 ;;
2256 $2) case "$osname" in
2260 : svr4.x or possibly later
2270 if test -f /stand/boot ; then
2271 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2272 if test -n "$INITPROG" -a -f "$INITPROG"; then
2273 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2274 if test -n "$isesix"; then
2282 *) if test -f /etc/systemid; then
2284 set `echo $3 | $sed 's/\./ /g'` $4
2285 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2287 elif $test -f $src/hints/sco_$1_$2.sh; then
2289 elif $test -f $src/hints/sco_$1.sh; then
2294 '') : Still unknown. Probably a generic Sys V.
2303 *) case "$osname" in
2304 '') : Still unknown. Probably a generic BSD.
2312 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2313 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2314 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2317 $rm -f UU/kernel.what
2318 elif test -d c:/.; then
2325 : Now look for a hint file osname_osvers, unless one has been
2326 : specified already.
2329 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2330 : Also try without trailing minor version numbers.
2331 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2332 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2333 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2334 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2337 *) case "$osvers" in
2340 *) if $test -f $src/hints/$file.sh ; then
2342 elif $test -f $src/hints/$xfile.sh ; then
2344 elif $test -f $src/hints/$xxfile.sh ; then
2346 elif $test -f $src/hints/$xxxfile.sh ; then
2348 elif $test -f $src/hints/$xxxxfile.sh ; then
2350 elif $test -f "$src/hints/${osname}.sh" ; then
2359 if $test -f Policy.sh ; then
2362 none) dflt="Policy" ;;
2363 *) dflt="Policy $dflt" ;;
2368 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2372 if $test -f Policy.sh ; then
2375 There's also a Policy hint file available, which should make the
2376 site-specific (policy) questions easier to answer.
2383 You may give one or more space-separated answers, or "none" if appropriate.
2384 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2385 is a good thing. DO NOT give a wrong version or a wrong OS.
2389 rp="Which of these apply, if any?"
2392 for file in $tans; do
2393 if $test X$file = XPolicy -a -f Policy.sh; then
2395 $cat Policy.sh >> UU/config.sh
2396 elif $test -f $src/hints/$file.sh; then
2397 . $src/hints/$file.sh
2398 $cat $src/hints/$file.sh >> UU/config.sh
2399 elif $test X$tans = X -o X$tans = Xnone ; then
2402 : Give one chance to correct a possible typo.
2403 echo "$file.sh does not exist"
2405 rp="hint to use instead?"
2407 for file in $ans; do
2408 if $test -f "$src/hints/$file.sh"; then
2409 . $src/hints/$file.sh
2410 $cat $src/hints/$file.sh >> UU/config.sh
2411 elif $test X$ans = X -o X$ans = Xnone ; then
2414 echo "$file.sh does not exist -- ignored."
2421 : Remember our hint file for later.
2422 if $test -f "$src/hints/$file.sh" ; then
2432 echo "Fetching default answers from $config_sh..." >&4
2436 cp $config_sh config.sh 2>/dev/null
2446 test "$override" && . ./optdef.sh
2447 myuname="$newmyuname"
2449 : Restore computed paths
2450 for file in $loclist $trylist; do
2451 eval $file="\$_$file"
2456 Configure uses the operating system name and version to set some defaults.
2457 The default value is probably right if the name rings a bell. Otherwise,
2458 since spelling matters for me, either accept the default or answer "none"
2465 ''|' '|none) dflt=none ;;
2466 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2469 *) dflt="$osname" ;;
2471 rp="Operating system name?"
2475 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2481 ''|' '|none) dflt=none ;;
2482 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2483 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2485 ''|' ') dflt=none ;;
2490 *) dflt="$osvers" ;;
2492 rp="Operating system version?"
2499 : who configured the system
2500 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2501 cf_by=`(logname) 2>/dev/null`
2504 cf_by=`(whoami) 2>/dev/null`
2506 "") cf_by=unknown ;;
2510 : set up the script used to warn in case of inconsistency
2517 echo "*** WHOA THERE!!! ***" >&4
2518 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2519 rp=" Keep the $hint value?"
2522 y) td=$was; tu=$was;;
2526 : function used to set $1 to $val
2527 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2529 $define$undef) . ./whoa; eval "$var=\$td";;
2530 $undef$define) . ./whoa; eval "$var=\$tu";;
2531 *) eval "$var=$val";;
2536 Perl can be built to take advantage of threads, on some systems.
2537 To do so, Configure must be run with -Dusethreads.
2539 Note that threading is a highly experimental feature, and
2540 some known race conditions still remain. If you choose to try
2541 it, be very sure to not actually deploy it for production
2542 purposes. README.threads has more details, and is required
2543 reading if you enable threads.
2545 case "$usethreads" in
2546 $define|true|[yY]*) dflt='y';;
2549 rp='Build a threading Perl?'
2552 y|Y) val="$define" ;;
2558 case "$d_oldpthreads" in
2559 '') : Configure tests would be welcome here. For now, assume undef.
2561 *) val="$d_oldpthreads" ;;
2567 case "$usethreads" in
2568 "$define"|true|[yY]*)
2569 : Look for a hint-file generated 'call-back-unit'. If the
2570 : user has specified that a threading perl is to be built,
2571 : we may need to set or change some other defaults.
2572 if $test -f usethreads.cbu; then
2573 echo "Your platform has some specific hints for threaded builds, using them..."
2577 (Your platform doesn't have any specific hints for threaded builds.
2578 Assuming POSIX threads, then.)
2586 Perl can be built so that multiple Perl interpreters can coexist
2587 within the same Perl executable. To do so, Configure must be run with
2590 Normally you do not need this and you should answer no.
2593 case "$usemultiplicity" in
2594 $define|true|[yY]*) dflt='y';;
2597 rp='Build Perl for multiplicity?'
2600 y|Y) val="$define" ;;
2606 : determine where manual pages are on this system
2610 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2611 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2612 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2613 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2614 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2615 sysman=`./loc . /usr/man/man1 $syspath`
2618 if $test -d "$sysman"; then
2619 echo "System manual is in $sysman." >&4
2621 echo "Could not find manual pages in source form." >&4
2624 : see what memory models we can support
2627 $cat >pdp11.c <<'EOP'
2636 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2637 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2638 dflt='unsplit split'
2640 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2643 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2648 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2651 if $test -d /lib/large || $test -d /usr/lib/large; then
2654 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2663 Some systems have different model sizes. On most systems they are called
2664 small, medium, large, and huge. On the PDP11 they are called unsplit and
2665 split. If your system doesn't support different memory models, say "none".
2666 If you wish to force everything to one memory model, say "none" here and
2667 put the appropriate flags later when it asks you for other cc and ld flags.
2668 Venix systems may wish to put "none" and let the compiler figure things out.
2669 (In the following question multiple model names should be space separated.)
2671 The default for most systems is "none".
2674 rp="Which memory models are supported?"
2689 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2690 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2697 rp="What flag indicates separate I and D space?"
2705 *large*|*small*|*medium*|*huge*)
2712 rp="What flag indicates large model?"
2722 *huge*) case "$huge" in
2726 rp="What flag indicates huge model?"
2736 *medium*) case "$medium" in
2740 rp="What flag indicates medium model?"
2747 *) medium="$large";;
2750 *small*) case "$small" in
2754 rp="What flag indicates small model?"
2765 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2768 $rm -f pdp11.* pdp11
2770 : make some quick guesses about what we are up against
2772 $echo $n "Hmm... $c"
2782 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2783 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2785 echo "Looks kind of like an OSF/1 system, but we'll see..."
2787 elif test `echo abc | tr a-z A-Z` = Abc ; then
2788 xxx=`./loc addbib blurfl $pth`
2789 if $test -f $xxx; then
2790 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2794 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2795 echo "Looks kind of like an extended USG system, but we'll see..."
2797 echo "Looks kind of like a USG system, but we'll see..."
2801 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2802 echo "Looks kind of like a BSD system, but we'll see..."
2806 echo "Looks kind of like a Version 7 system, but we'll see..."
2809 case "$eunicefix" in
2812 There is, however, a strange, musty smell in the air that reminds me of
2813 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2817 : it so happens the Eunice I know will not run shell scripts in Unix format
2821 echo "Congratulations. You aren't running Eunice."
2825 : Detect OS2. The p_ variable is set above in the Head.U unit.
2830 I have the feeling something is not exactly right, however...don't tell me...
2831 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2836 if test -f /xenix; then
2837 echo "Actually, this looks more like a XENIX system..."
2842 echo "It's not Xenix..."
2847 if test -f /venix; then
2848 echo "Actually, this looks more like a VENIX system..."
2855 echo "Nor is it Venix..."
2858 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2859 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2862 : see if we need a special compiler
2870 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2871 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2885 On some older systems the default C compiler will not resolve multiple global
2886 references that happen to have the same name. On some such systems the "Mcc"
2887 command may be used to force these to be resolved. On other systems a "cc -M"
2888 command is required. (Note that the -M flag on other systems indicates a
2889 memory model to use!) If you have the Gnu C compiler, you might wish to use
2895 rp="Use which C compiler?"
2903 rp="Use which C compiler?"
2907 : Look for a hint-file generated 'call-back-unit'. Now that the
2908 : user has specified the compiler, we may need to set or change some
2910 if $test -f cc.cbu; then
2914 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2915 $cat >gccvers.c <<EOM
2920 printf("%s\n", __VERSION__);
2922 printf("%s\n", "1");
2928 if $cc -o gccvers gccvers.c; then
2929 gccversion=`./gccvers`
2930 case "$gccversion" in
2931 '') echo "You are not using GNU cc." ;;
2932 *) echo "You are using GNU cc $gccversion." ;;
2936 echo "*** WHOA THERE!!! ***" >&4
2937 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2938 case "$knowitall" in
2940 echo " You'd better start hunting for one and let me know about it." >&4
2946 case "$gccversion" in
2947 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2952 Perl can be built to take advantage of explicit 64-bit interfaces,
2953 on some systems. To do so, Configure must be run with -Duse64bits.
2955 If this doesn't make any sense to you, just accept the default 'n'.
2957 case "$use64bits" in
2958 $define|true|[yY]*) dflt='y';;
2961 rp='Try to use explicit 64-bit interfaces, if available?'
2974 case "$archname64" in
2975 '') archname64='' ;; # not a typo
2978 case "$use64bits" in
2979 "$define"|true|[yY]*)
2980 : Look for a hint-file generated 'call-back-unit'. If the
2981 : user has specified that a 64 bit perl is to be built,
2982 : we may need to set or change some other defaults.
2983 if $test -f use64bits.cbu; then
2984 echo "Your platform has some specific hints for 64-bit builds, using them..."
2988 (Your platform doesn't have any specific hints for 64-bit builds.
2989 This is probably okay, especially if your system is a true 64-bit system.)
2991 case "$gccversion" in
2994 But since you seem to be using gcc,
2995 I will now add -DUSE_LONG_LONG to the compilation flags.
2997 ccflags="$ccflags -DUSE_LONG_LONG"
3004 : determine the architecture name
3006 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3007 tarch=`arch`"-$osname"
3008 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3009 if uname -m > tmparch 2>&1 ; then
3010 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3011 -e 's/$/'"-$osname/" tmparch`
3019 case "$myarchname" in
3022 echo "(Your architecture name used to be $myarchname.)"
3029 *) dflt="$archname";;
3031 rp='What is your architecture name'
3034 case "$usethreads" in
3036 echo "Threads selected." >&4
3038 *-thread*) echo "...and architecture name already has -thread." >&4
3040 *) archname="$archname-thread"
3041 echo "...setting architecture name to $archname." >&4
3046 case "$usemultiplicity" in
3048 echo "Multiplicity selected." >&4
3050 *-multi*) echo "...and architecture name already has -multi." >&4
3052 *) archname="$archname-multi"
3053 echo "...setting architecture name to $archname." >&4
3058 case "$use64bits" in
3060 echo "Explicit 64-bitness selected." >&4
3061 case "$archname64" in
3066 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3068 *) archname="$archname-$archname64"
3069 echo "...setting architecture name to $archname." >&4
3076 : decide how portable to be. Allow command line overrides.
3077 case "$d_portable" in
3079 *) d_portable="$define" ;;
3082 : set up shell script to do ~ expansion
3088 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3091 if $test -f /bin/csh; then
3092 /bin/csh -f -c "glob \$1"
3097 name=\`$expr x\$1 : '..\([^/]*\)'\`
3098 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3099 if $test ! -d "\$dir"; then
3101 echo "\$me: can't locate home directory for: \$name" >&2
3106 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3122 : now set up to get a file name
3126 cat <<'EOSC' >>getfile
3142 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3143 fn=`echo $fn | sed 's/(.*)//'`
3149 loc_file=`expr $fn : '.*:\(.*\)'`
3150 fn=`expr $fn : '\(.*\):.*'`
3158 */*) fullpath=true;;
3167 *e*) exp_file=true;;
3170 *p*) nopath_ok=true;;
3175 *d*) type='Directory';;
3176 *l*) type='Locate';;
3181 Locate) what='File';;
3186 case "$d_portable" in
3194 while test "$type"; do
3199 true) rp="$rp (~name ok)";;
3202 if test -f UU/getfile.ok && \
3203 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3222 value=`UU/filexp $ans`
3225 if test "$ans" != "$value"; then
3226 echo "(That expands to $value on this system.)"
3240 /*) value="$ansexp" ;;
3245 echo "I shall only accept a full path name, as in /bin/ls." >&4
3246 echo "Use a ! shell escape if you wish to check pathnames." >&4
3249 echo "Please give a full path name, starting with slash." >&4
3252 echo "Note that using ~name is ok provided it expands well." >&4
3265 for fp in $gfpth; do
3266 if test "X$fp" = X.; then
3271 if test -f "$pf"; then
3273 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3275 echo "($value is not a plain file, but that's ok.)"
3278 if test X"$type" = X; then
3285 for fp in $gfpth; do
3286 if test "X$fp" = X.; then
3291 if test -d "$pf"; then
3299 if test -d "$ansexp"; then
3300 echo "(Looking for $loc_file in directory $value.)"
3301 value="$value/$loc_file"
3302 ansexp="$ansexp/$loc_file"
3304 if test -f "$ansexp"; then
3307 case "$nopath_ok" in
3308 true) case "$value" in
3310 *) echo "Assuming $value will be in people's path."
3326 if test "$fastread" = yes; then
3331 rp="$what $value doesn't exist. Use that name anyway?"
3350 test "X$gfpthkeep" != Xy && gfpth=""
3353 : determine root of directory hierarchy where package will be installed.
3356 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3364 By default, $package will be installed in $dflt/bin, manual pages
3365 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3366 installation directories. Typically this is something like /usr/local.
3367 If you wish to have binaries under /usr/bin but other parts of the
3368 installation under /usr/local, that's ok: you will be prompted
3369 separately for each of the installation directories, the prefix being
3370 only used to set the defaults.
3374 rp='Installation prefix to use?'
3382 *) oldprefix="$prefix";;
3392 $define|true) afs=true ;;
3393 $undef|false) afs=false ;;
3394 *) if test -d /afs; then
3402 echo "AFS may be running... I'll be extra cautious then..." >&4
3404 echo "AFS does not seem to be running..." >&4
3407 : determine installation prefix for where package is to be installed.
3411 Since you are running AFS, I need to distinguish the directory in which
3412 files will reside from the directory in which they are installed (and from
3413 which they are presumably copied to the former directory by occult means).
3416 case "$installprefix" in
3417 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3418 *) dflt="$installprefix";;
3423 In some special cases, particularly when building $package for distribution,
3424 it is convenient to distinguish between the directory in which files should
3425 be installed from the directory ($prefix) in which they
3426 will eventually reside. For most users, these two directories are the same.
3429 case "$installprefix" in
3431 *) dflt=$installprefix;;
3435 rp='What installation prefix should I use for installing files?'
3437 installprefix="$ans"
3438 installprefixexp="$ansexp"
3440 : set the prefixit variable, to compute a suitable default value
3441 prefixit='case "$3" in
3443 case "$oldprefix" in
3444 "") eval "$1=\"\$$2\"";;
3451 ""|" ") eval "$1=\"\$$2\"";;
3457 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3459 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3460 /*-$oldprefix/*|\~*-$oldprefix/*)
3461 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3462 *) eval "$1=\"\$$2\"";;
3466 : set the base revision
3469 : get the patchlevel
3471 echo "Getting the current patchlevel..." >&4
3472 if $test -r $rsrc/patchlevel.h;then
3473 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3474 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3479 $echo $n "(You have $package" $c
3482 *) $echo $n " $baserev" $c ;;
3484 $echo $n " patchlevel $patchlevel" $c
3485 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3488 if test 0 -eq "$subversion"; then
3489 version=`LC_ALL=C; export LC_ALL; \
3490 echo $baserev $patchlevel | \
3491 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3493 version=`LC_ALL=C; export LC_ALL; \
3494 echo $baserev $patchlevel $subversion | \
3495 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3497 : Figure out perl API version. Perhaps this should be in patchlevel.h
3498 if test "$subversion" -lt 50; then
3499 apiversion=`LC_ALL=C; export LC_ALL; \
3500 LANGUAGE=C; export LANGUAGE; \
3501 echo $baserev $patchlevel | \
3502 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3504 apiversion="$version"
3507 : determine installation style
3508 : For now, try to deduce it from prefix unless it is already set.
3509 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3510 case "$installstyle" in
3511 '') case "$prefix" in
3512 *perl*) dflt='lib';;
3513 *) dflt='lib/perl5' ;;
3516 *) dflt='lib/perl5' ;;
3518 : Probably not worth prompting for this since we prompt for all
3519 : the directories individually, and the prompt would be too long and
3523 : determine where private library files go
3524 : Usual default is /usr/local/lib/perl5/$version.
3525 : Also allow things like /opt/perl/lib/$version, since
3526 : /opt/perl/lib/perl5... would be redundant.
3527 : The default "style" setting is made in installstyle.U
3528 case "$installstyle" in
3529 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3530 *) set dflt privlib lib/$version ;;
3535 There are some auxiliary files for $package that need to be put into a
3536 private library directory that is accessible by everyone.
3540 rp='Pathname where the private library files will reside?'
3543 privlibexp="$ansexp"
3544 : Change installation prefix, if necessary.
3545 if $test X"$prefix" != X"$installprefix"; then
3546 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3548 installprivlib="$privlibexp"
3551 : set the prefixup variable, to restore leading tilda escape
3552 prefixup='case "$prefixexp" in
3554 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3557 : determine where public architecture dependent libraries go
3560 : privlib default is /usr/local/lib/$package/$version
3561 : archlib default is /usr/local/lib/$package/$version/$archname
3562 : privlib may have an optional trailing /share.
3563 tdflt=`echo $privlib | $sed 's,/share$,,'`
3564 tdflt=$tdflt/$archname
3573 $spackage contains architecture-dependent library files. If you are
3574 sharing libraries in a heterogeneous environment, you might store
3575 these files in a separate location. Otherwise, you can just include
3576 them with the rest of the public library files.
3580 rp='Where do you want to put the public architecture-dependent libraries?'
3583 archlibexp="$ansexp"
3584 if $test X"$archlib" = X"$privlib"; then
3589 : Change installation prefix, if necessary.
3590 if $test X"$prefix" != X"$installprefix"; then
3591 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3593 installarchlib="$archlibexp"
3597 : Binary compatibility with 5.005 is not possible for builds
3598 : with advanced features
3599 case "$usethreads$usemultiplicity" in
3601 bincompat5005="$undef"
3602 d_bincompat5005="$undef"
3606 Perl 5.006 can be compiled for binary compatibility with 5.005.
3607 If you decide to do so, you will be able to continue using most
3608 of the extensions that were compiled for Perl 5.005.
3611 case "$bincompat5005$d_bincompat5005" in
3612 *"$undef"*) dflt=n ;;
3615 rp='Binary compatibility with Perl 5.005?'
3618 y*) val="$define" ;;
3623 case "$d_bincompat5005" in
3625 bincompat5005="$define"
3627 *) bincompat5005="$undef"
3628 d_bincompat5005="$undef"
3635 : see if setuid scripts can be secure
3638 Some kernels have a bug that prevents setuid #! scripts from being
3639 secure. Some sites have disabled setuid #! scripts because of this.
3641 First let's decide if your kernel supports secure setuid #! scripts.
3642 (If setuid #! scripts would be secure but have been disabled anyway,
3643 don't say that they are secure if asked.)
3648 if $test -d /dev/fd; then
3649 echo "#!$ls" >reflect
3650 chmod +x,u+s reflect
3651 ./reflect >flect 2>&1
3652 if $contains "/dev/fd" flect >/dev/null; then
3653 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3657 If you are not sure if they are secure, I can check but I'll need a
3658 username and password different from the one you are using right now.
3659 If you don't have such a username or don't want me to test, simply
3663 rp='Other username to test security of setuid scripts with?'
3668 case "$d_suidsafe" in
3669 '') echo "I'll assume setuid scripts are *not* secure." >&4
3672 echo "Well, the $hint value is *not* secure." >&4
3674 *) echo "Well, the $hint value *is* secure." >&4
3679 $rm -f reflect flect
3680 echo "#!$ls" >reflect
3681 chmod +x,u+s reflect
3684 echo '"su" will (probably) prompt you for '"$ans's password."
3685 su $ans -c './reflect >flect'
3686 if $contains "/dev/fd" flect >/dev/null; then
3687 echo "Okay, it looks like setuid scripts are secure." >&4
3690 echo "I don't think setuid scripts are secure." >&4
3695 rp='Does your kernel have *secure* setuid scripts?'
3698 [yY]*) val="$define";;
3703 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3704 echo "(That's for file descriptors, not floppy disks.)"
3710 $rm -f reflect flect
3712 : now see if they want to do setuid emulation
3715 case "$d_suidsafe" in
3718 echo "No need to emulate SUID scripts since they are secure here." >& 4
3722 Some systems have disabled setuid scripts, especially systems where
3723 setuid scripts cannot be secure. On systems where setuid scripts have
3724 been disabled, the setuid/setgid bits on scripts are currently
3725 useless. It is possible for $package to detect those bits and emulate
3726 setuid/setgid in a secure fashion. This emulation will only work if
3727 setuid scripts have been disabled in your kernel.
3731 "$define") dflt=y ;;
3734 rp="Do you want to do setuid/setgid emulation?"
3737 [yY]*) val="$define";;
3745 : What should the include directory be ?
3747 $echo $n "Hmm... $c"
3751 if $test -f /bin/mips && /bin/mips; then
3752 echo "Looks like a MIPS system..."
3753 $cat >usr.c <<'EOCP'
3754 #ifdef SYSTYPE_BSD43
3758 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3759 dflt='/bsd43/usr/include'
3763 mips_type='System V'
3765 $rm -f usr.c usr.out
3766 echo "and you're compiling with the $mips_type compiler and libraries."
3770 echo "Doesn't look like a MIPS system."
3780 case "$xxx_prompt" in
3783 rp='Where are the include files you want to use?'
3791 : see how we invoke the C preprocessor
3793 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3794 cat <<'EOT' >testcpp.c
3800 if test ! -f cppstdin; then
3801 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3802 # AIX cc -E doesn't show the absolute headerfile
3803 # locations but we'll cheat by using the -M flag.
3804 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
3806 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3809 echo "Keeping your $hint cppstdin wrapper."
3812 wrapper=`pwd`/cppstdin
3816 if $test "X$cppstdin" != "X" && \
3817 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3818 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3820 echo "You used to use $cppstdin $cppminus so we'll use that again."
3822 '') echo "But let's see if we can live without a wrapper..." ;;
3824 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3825 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3827 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3830 echo "(However, $cpprun $cpplast does not work, let's see...)"
3838 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3845 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3846 $cc -E <testcpp.c >testcpp.out 2>&1; \
3847 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3848 echo "Yup, it does."
3851 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3852 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3854 echo "Yup, it does."
3857 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3858 $cc -P <testcpp.c >testcpp.out 2>&1; \
3859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3860 echo "Yipee, that works!"
3863 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3864 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3866 echo "At long last!"
3869 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3870 $cpp <testcpp.c >testcpp.out 2>&1; \
3871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3875 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3876 $cpp - <testcpp.c >testcpp.out 2>&1; \
3877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3878 echo "Hooray, it works! I was beginning to wonder."
3881 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3882 $wrapper <testcpp.c >testcpp.out 2>&1; \
3883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3889 rp="No dice. I can't find a C preprocessor. Name one:"
3893 $x_cpp <testcpp.c >testcpp.out 2>&1
3894 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3895 echo "OK, that will do." >&4
3897 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3912 echo "Perhaps can we force $cc -E using a wrapper..."
3913 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3920 echo "Nope, we'll have to live without it..."
3934 "$wrapper"|'cppstdin') ;;
3935 *) $rm -f $wrapper;;
3937 $rm -f testcpp.c testcpp.out
3939 : Set private lib path
3942 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3947 '') dlist="$loclibpth $plibpth $glibpth";;
3948 *) dlist="$libpth";;
3951 : Now check and see which directories actually exist, avoiding duplicates
3955 if $test -d $xxx; then
3958 *) libpth="$libpth $xxx";;
3964 Some systems have incompatible or broken versions of libraries. Among
3965 the directories listed in the question below, please remove any you
3966 know not to be holding relevant libraries, and add any that are needed.
3967 Say "none" for none.
3978 rp="Directories to use for library searches?"
3985 : compute shared library extension
3988 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3998 On some systems, shared libraries may be available. Answer 'none' if
3999 you want to suppress searching of shared libraries for the remaining
4000 of this configuration.
4003 rp='What is the file extension used for shared libraries?'
4007 : Define several unixisms.
4008 : Hints files or command line option can be used to override them.
4009 : The convoluted testing is in case hints files set either the old
4012 '') case "$exe_ext" in
4014 *) _exe="$exe_ext" ;;
4019 '') case "$lib_ext" in
4026 '') case "$obj_ext" in
4033 '') case "$path_sep" in
4044 : Which makefile gets called first. This is used by make depend.
4045 case "$firstmakefile" in
4046 '') firstmakefile='makefile';;
4051 Perl can be built to use the SOCKS proxy protocol library. To do so,
4052 Configure must be run with -Dusesocks.
4054 Normally you do not need this and you should answer no.
4058 $define|true|[yY]*) dflt='y';;
4061 rp='Build Perl for SOCKS?'
4064 y|Y) val="$define" ;;
4070 : Looking for optional libraries
4072 echo "Checking for optional libraries..." >&4
4077 case "$libswanted" in
4078 '') libswanted='c_s';;
4082 libswanted="$libswanted socks5 socks5_sh"
4085 for thislib in $libswanted; do
4087 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4088 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4089 echo "Found -l$thislib (shared)."
4092 *) dflt="$dflt -l$thislib";;
4094 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4095 echo "Found -l$thislib (shared)."
4098 *) dflt="$dflt -l$thislib";;
4100 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4101 echo "Found -l$thislib."
4104 *) dflt="$dflt -l$thislib";;
4106 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4107 echo "Found -l$thislib."
4110 *) dflt="$dflt -l$thislib";;
4112 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4113 echo "Found -l${thislib}_s."
4116 *) dflt="$dflt -l${thislib}_s";;
4118 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4119 echo "Found -l$thislib."
4122 *) dflt="$dflt -l$thislib";;
4125 echo "No -l$thislib."
4136 ' '|'') dflt='none';;
4141 In order to compile $package on your machine, a number of libraries
4142 are usually needed. Include any other special libraries here as well.
4143 Say "none" for none. The default list is almost always right.
4147 rp="What libraries to use?"
4154 : determine optimization, if desired, or use for debug flag also
4156 ' '|$undef) dflt='none';;
4158 *) dflt="$optimize";;
4162 By default, $package compiles with the -O flag to use the optimizer.
4163 Alternately, you might want to use the symbolic debugger, which uses
4164 the -g flag (on traditional Unix systems). Either flag can be
4165 specified here. To use neither flag, specify the word "none".
4168 rp="What optimizer/debugger flag should be used?"
4172 'none') optimize=" ";;
4176 : We will not override a previous value, but we might want to
4177 : augment a hint file
4179 default|recommended)
4180 case "$gccversion" in
4181 1*) dflt='-fpcc-struct-return' ;;
4184 *-g*) dflt="$dflt -DDEBUGGING";;
4186 case "$gccversion" in
4187 2*) if test -d /etc/conf/kconfig.d &&
4188 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4194 case "$gccversion" in
4198 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4199 echo 'int main(void) { return 0; }' > gcctest.c
4200 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4201 echo "Yes, it does." 2>&1
4204 echo "Leaving current flags $ccflags alone." 2>&1
4206 *) dflt="$dflt -fno-strict-aliasing" ;;
4209 echo "Nope, it doesn't, but that's ok." 2>&1
4216 case "$mips_type" in
4217 *BSD*|'') inclwanted="$locincpth $usrinc";;
4218 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4220 for thisincl in $inclwanted; do
4221 if $test -d $thisincl; then
4222 if $test x$thisincl != x$usrinc; then
4225 *) dflt="$dflt -I$thisincl";;
4231 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4233 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4241 *) dflt="$dflt -D$2";;
4245 set signal.h LANGUAGE_C; eval $inctest
4249 ccflags="$ccflags -DSOCKS"
4254 default|recommended) dflt="$ccflags $dflt" ;;
4255 *) dflt="$ccflags";;
4263 Your C compiler may want other flags. For this question you should include
4264 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4265 but you should NOT include libraries or ld flags like -lwhatever. If you
4266 want $package to honor its debug switch, you should include -DDEBUGGING here.
4267 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4269 To use no flags, specify the word "none".
4275 rp="Any additional cc flags?"
4282 : the following weeds options from ccflags that are of no interest to cpp
4284 case "$gccversion" in
4285 1*) cppflags="$cppflags -D__GNUC__"
4287 case "$mips_type" in
4289 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4295 echo "Let me guess what the preprocessor flags are..." >&4
4309 *) ftry="$previous $flag";;
4311 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4312 >cpp1.out 2>/dev/null && \
4313 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4314 >cpp2.out 2>/dev/null && \
4315 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4316 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4318 cppflags="$cppflags $ftry"
4328 *-*) echo "They appear to be: $cppflags";;
4330 $rm -f cpp.c cpp?.out
4334 : flags used in final linking phase
4336 '') if ./venix; then
4342 *-posix*) dflt="$dflt -posix" ;;
4345 *) dflt="$ldflags";;
4348 : Try to guess additional flags to pick up local libraries.
4349 for thislibdir in $libpth; do
4350 case " $loclibpth " in
4353 *"-L$thislibdir "*) ;;
4354 *) dflt="$dflt -L$thislibdir" ;;
4366 Your C linker may need flags. For this question you should
4367 include -L/whatever and any other flags used by the C linker, but you
4368 should NOT include libraries like -lwhatever.
4370 Make sure you include the appropriate -L/path flags if your C linker
4371 does not normally search all of the directories you specified above,
4374 To use no flags, specify the word "none".
4378 rp="Any additional ld flags (NOT including libraries)?"
4384 rmlist="$rmlist pdp11"
4388 echo "Checking your choice of C compiler and flags for coherency..." >&4
4389 $cat > try.c <<'EOF'
4391 int main() { printf("Ok\n"); exit(0); }
4393 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4395 $cat >try.msg <<'EOM'
4396 I've tried to compile and run the following simple program:
4399 $cat try.c >> try.msg
4401 $cat >> try.msg <<EOM
4408 and I got the following output:
4412 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4413 if sh -c './try' >>try.msg 2>&1; then
4417 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4420 cat >> try.msg <<'EOQS'
4421 If $libs contains -lsfio, and sfio is mis-configured, then it
4422 sometimes (apparently) runs and exits with a 0 status, but with no
4423 output! It may have to do with sfio's use of _exit vs. exit.
4426 rp="You have a big problem. Shall I abort Configure"
4433 echo "The program compiled OK, but exited with status $?." >>try.msg
4434 rp="You have a problem. Shall I abort Configure"
4438 echo "I can't compile the test program." >>try.msg
4439 rp="You have a BIG problem. Shall I abort Configure"
4445 case "$knowitall" in
4447 echo "(The supplied flags or libraries might be incorrect.)"
4455 *) echo "Ok. Stopping Configure." >&4
4460 n) echo "OK, that should do.";;
4462 $rm -f try try.* core
4464 : determine filename position in cpp output
4466 echo "Computing filename position in cpp output for #include directives..." >&4
4467 echo '#include <stdio.h>' > foo.c
4470 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4471 $grep '^[ ]*#.*stdio\.h' | \
4472 while read cline; do
4475 while $test \$# -gt 0; do
4476 if $test -r \`echo \$1 | $tr -d '"'\`; then
4481 pos=\`expr \$pos + 1\`
4493 *) pos="${fieldn}th";;
4495 echo "Your cpp writes the filename in the $pos field of the line."
4497 : locate header file
4502 for usrincdir in $usrinc
4504 if test -f \$usrincdir/\$wanted; then
4505 echo "\$usrincdir/\$wanted"
4509 awkprg='{ print \$$fieldn }'
4510 echo "#include <\$wanted>" > foo\$\$.c
4511 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4512 $grep "^[ ]*#.*\$wanted" | \
4513 while read cline; do
4514 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4516 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4517 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4522 # status = 0: grep returned 0 lines, case statement not executed
4523 # status = 1: headerfile found
4524 # status = 2: while loop executed, no headerfile found
4528 if test \$status -eq 1; then
4535 : define an alternate in-header-list? function
4536 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4537 cont=true; xxf="echo \"<\$1> found.\" >&4";
4538 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4539 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4541 case $# in 4) instead=instead;; *) instead="at last";; esac;
4542 while $test "$cont"; do
4544 var=$2; eval "was=\$$2";
4545 if $test "$xxx" && $test -r "$xxx";
4547 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4550 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4551 set $yyy; shift; shift; yyy=$@;
4552 case $# in 0) cont="";;
4553 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4554 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4555 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4556 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4560 do set $yyy; var=$2; eval "was=\$$2";
4561 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4562 set $yyy; shift; shift; yyy=$@;
4565 : see if this is a malloc.h system
4566 set malloc.h i_malloc
4569 : see if stdlib is available
4570 set stdlib.h i_stdlib
4573 : determine which malloc to compile in
4575 case "$usemymalloc" in
4576 ''|[yY]*|true|$define) dflt='y' ;;
4579 rp="Do you wish to attempt to use the malloc that comes with $package?"
4585 mallocsrc='malloc.c'
4586 mallocobj="malloc$_o"
4587 d_mymalloc="$define"
4590 : Remove malloc from list of libraries to use
4591 echo "Removing unneeded -lmalloc from library list" >&4
4592 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4595 echo "libs = $libs" >&4
4607 : compute the return types of malloc and free
4609 $cat >malloc.c <<END
4613 #include <sys/types.h>
4627 case "$malloctype" in
4629 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4636 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4640 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4647 echo "Your system uses $freetype free(), it would seem." >&4
4651 The installation process will also create a directory for
4652 vendor-supplied add-ons. Vendors who supply perl with their system
4653 may find it convenient to place all vendor-supplied files in this
4654 directory rather than in the main distribution directory. This will
4655 ease upgrades between binary-compatible maintenance versions of perl.
4657 Of course you may also use these directories in whatever way you see
4658 fit. For example, you might use them to access modules shared over a
4659 company-wide network.
4661 The default answer should be fine for most people.
4662 This causes further questions about vendor add-ons to be skipped
4663 and no vendor-specific directories will be configured for perl.
4666 rp='Do you want to configure vendor-specific add-on directories?'
4667 case "$usevendorprefix" in
4668 define|true|[yY]*) dflt=y ;;
4674 rp='Installation prefix to use for vendor-supplied add-ons?'
4675 case "$vendorprefix" in
4677 *) dflt=$vendorprefix ;;
4681 case "$vendorprefix" in
4685 *) oldvendorprefix="$prefix";;
4689 usevendorprefix="$define"
4691 vendorprefixexp="$ansexp"
4693 *) usevendorprefix="$undef"
4699 case "$vendorprefix" in
4700 '') d_vendorlib="$undef"
4704 *) d_vendorlib="$define"
4705 : determine where vendor-supplied modules go.
4706 : Usual default is /usr/local/lib/perl5/vendor_perl
4707 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4708 case "$installstyle" in
4709 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4710 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4713 rp='Pathname for the vendor-supplied library files?'
4716 vendorlibexp="$ansexp"
4717 : Change installation prefix, if necessary.
4718 if $test X"$prefix" != X"$installprefix"; then
4719 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4721 installvendorlib="$vendorlibexp"
4726 : Cruising for prototypes
4728 echo "Checking out function prototypes..." >&4
4729 $cat >prototype.c <<'EOCP'
4730 int main(int argc, char *argv[]) {
4733 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4734 echo "Your C compiler appears to support function prototypes."
4737 echo "Your C compiler doesn't seem to understand function prototypes."
4744 case "$prototype" in
4746 *) ansi2knr='ansi2knr'
4751 This version of $package can only be compiled by a compiler that
4752 understands function prototypes. Unfortunately, your C compiler
4754 doesn't seem to understand them. Sorry about that.
4756 If GNU cc is available for your system, perhaps you could try that instead.
4758 Eventually, we hope to support building Perl with pre-ANSI compilers.
4759 If you would like to help in that effort, please contact <perlbug@perl.org>.
4761 Aborting Configure now.
4767 : determine where public executables go
4772 rp='Pathname where the public executables will reside?'
4774 if $test "X$ansexp" != "X$binexp"; then
4779 : Change installation prefix, if necessary.
4780 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4781 if $test X"$prefix" != X"$installprefix"; then
4782 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4784 installbin="$binexp"
4787 : determine whether to install perl also as /usr/bin/perl
4790 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4792 Many scripts expect to perl to be installed as /usr/bin/perl.
4793 I can install the perl you are about to compile also as /usr/bin/perl
4794 (in addition to $installbin/perl).
4796 case "$installusrbinperl" in
4797 "$undef"|[nN]*) dflt='n';;
4800 rp="Do you want to install perl as /usr/bin/perl?"
4803 [yY]*) val="$define";;
4809 set installusrbinperl
4812 : define a shorthand compile call
4816 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4817 : define a shorthand compile call for compilations that should be ok.
4821 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4824 echo "Checking for GNU C Library..." >&4
4825 cat >gnulibc.c <<EOM
4837 if eval $compile_ok && ./gnulibc; then
4839 echo "You are using the GNU C Library"
4842 echo "You are not using the GNU C Library"
4848 : see if nm is to be used to determine whether a symbol is defined or not
4852 case "$d_gnulibc" in
4855 echo "nm probably won't work on the GNU C Library." >&4
4861 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4863 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4864 echo "'nm' won't be sufficient on this sytem." >&4
4870 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4871 if $test $dflt -gt 20; then
4881 true|$define) dflt=y;;
4888 I can use $nm to extract the symbols from your C libraries. This
4889 is a time consuming task which may generate huge output on the disk (up
4890 to 3 megabytes) but that should make the symbols extraction faster. The
4891 alternative is to skip the 'nm' extraction part and to compile a small
4892 test program instead to determine whether each symbol is present. If
4893 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4894 this may be the best solution.
4896 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4899 rp="Shall I use $nm to extract C symbols from the libraries?"
4902 [Nn]*) usenm=false;;
4911 : nm options which may be necessary
4913 '') if $test -f /mach_boot; then
4915 elif $test -d /usr/ccs/lib; then
4916 nm_opt='-p' # Solaris (and SunOS?)
4917 elif $test -f /dgux; then
4919 elif $test -f /lib64/rld; then
4920 nm_opt='-p' # 64-bit Irix
4926 : nm options which may be necessary for shared libraries but illegal
4927 : for archive libraries. Thank you, Linux.
4928 case "$nm_so_opt" in
4929 '') case "$myuname" in
4931 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4932 nm_so_opt='--dynamic'
4941 : get list of predefined functions in a handy place
4946 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4953 *) for thislib in $libs; do
4956 : Handle C library specially below.
4959 thislib=`echo $thislib | $sed -e 's/^-l//'`
4960 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4962 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4964 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4966 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4968 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4970 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4972 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4977 libnames="$libnames $try"
4979 *) libnames="$libnames $thislib" ;;
4988 for xxx in $libpth; do
4989 $test -r $1 || set $xxx/libc.$so
4990 : The messy sed command sorts on library version numbers.
4992 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4993 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4995 s/[0-9][0-9]*/0000&/g
4996 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4999 sort | $sed -e 's/^.* //'`
5002 $test -r $1 || set /usr/ccs/lib/libc.$so
5003 $test -r $1 || set /lib/libsys_s$_a
5009 if $test -r "$1"; then
5010 echo "Your (shared) C library seems to be in $1."
5012 elif $test -r /lib/libc && $test -r /lib/clib; then
5013 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5015 libc='/lib/clib /lib/libc'
5016 if $test -r /lib/syslib; then
5017 echo "(Your math library is in /lib/syslib.)"
5018 libc="$libc /lib/syslib"
5020 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5021 echo "Your C library seems to be in $libc, as you said before."
5022 elif $test -r $incpath/usr/lib/libc$_a; then
5023 libc=$incpath/usr/lib/libc$_a;
5024 echo "Your C library seems to be in $libc. That's fine."
5025 elif $test -r /lib/libc$_a; then
5027 echo "Your C library seems to be in $libc. You're normal."
5029 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5031 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5032 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5033 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5035 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5037 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5040 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5042 if $test -r "$tans"; then
5043 echo "Your C library seems to be in $tans, of all places."
5049 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5053 If the guess above is wrong (which it might be if you're using a strange
5054 compiler, or your machine supports multiple models), you can override it here.
5059 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5061 I can't seem to find your C library. I've looked in the following places:
5064 $sed 's/^/ /' libpath
5067 None of these seems to contain your C library. I need to get its name...
5072 rp='Where is your C library?'
5077 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5078 set X `cat libnames`
5081 case $# in 1) xxx=file; esac
5082 echo "Extracting names from the following $xxx for later perusal:" >&4
5084 $sed 's/^/ /' libnames >&4
5086 $echo $n "This may take a while...$c" >&4
5090 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5091 *) $nm $nm_opt $file 2>/dev/null;;
5096 $grep fprintf libc.tmp > libc.ptf
5097 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5098 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5100 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5102 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5104 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5106 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5108 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5110 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5112 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5114 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5116 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5118 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5120 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5122 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5124 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5125 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5127 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5129 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5131 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5133 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5135 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5137 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5139 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5141 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5143 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5145 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5147 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5149 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5151 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5153 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5155 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5158 $nm -p $* 2>/dev/null >libc.tmp
5159 $grep fprintf libc.tmp > libc.ptf
5160 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5161 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5167 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5169 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5170 for thisname in $libnames $libc; do
5171 $ar t $thisname >>libc.tmp
5173 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5175 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5176 # Repeat libc to extract forwarders to DLL entries too
5177 for thisname in $libnames $libc; do
5178 $ar tv $thisname >>libc.tmp
5179 # Revision 50 of EMX has bug in $ar.
5180 # it will not extract forwarders to DLL entries
5181 # Use emximp which will extract exactly them.
5182 emximp -o tmp.imp $thisname \
5184 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5185 < tmp.imp >>libc.tmp
5188 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5191 echo "$ar didn't seem to work right." >&4
5192 echo "Maybe this is a Cray...trying bld instead..." >&4
5193 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5195 for thisname in $libnames; do
5197 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5198 $ar t $thisname >>libc.tmp
5202 echo "That didn't work either. Giving up." >&4
5209 if $test -f /lib/syscalls.exp; then
5211 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5212 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5216 $rm -f libnames libpath
5218 : see if dld is available
5222 : is a C symbol defined?
5225 -v) tf=libc.tmp; tc=""; tdc="";;
5226 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5227 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5230 case "$reuseval-$4" in
5232 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5238 if $contains $tlook $tf >/dev/null 2>&1;
5243 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5244 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5252 $define) tval=true;;
5258 : define an is-in-libc? function
5259 inlibc='echo " "; td=$define; tu=$undef;
5260 sym=$1; var=$2; eval "was=\$$2";
5262 case "$reuseval$was" in
5272 echo "$sym() found." >&4;
5273 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5275 echo "$sym() NOT found." >&4;
5276 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5280 $define) echo "$sym() found." >&4;;
5281 *) echo "$sym() NOT found." >&4;;
5285 : see if dlopen exists
5292 : determine which dynamic loading, if any, to compile in
5294 dldir="ext/DynaLoader"
5307 $define) dflt='y' ;;
5310 $define) dflt='y' ;;
5312 : Does a dl_xxx.xs file exist for this operating system
5313 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5316 rp="Do you wish to use dynamic loading?"
5323 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5324 dflt="$dldir/dl_${osname}.xs"
5325 elif $test "$d_dlopen" = "$define" ; then
5326 dflt="$dldir/dl_dlopen.xs"
5327 elif $test "$i_dld" = "$define" ; then
5328 dflt="$dldir/dl_dld.xs"
5333 *) dflt="$dldir/$dlsrc"
5336 echo "The following dynamic loading files are available:"
5337 : Can not go over to $dldir because getfile has path hard-coded in.
5338 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5339 rp="Source file to use for dynamic loading"
5345 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5349 Some systems may require passing special flags to $cc -c to
5350 compile modules that will be used to create a shared library.
5351 To use no flags, say "none".
5354 case "$cccdlflags" in
5355 '') case "$gccversion" in
5356 '') case "$osname" in
5358 next) dflt='none' ;;
5359 irix*) dflt='-KPIC' ;;
5360 svr4*|esix*|solaris) dflt='-KPIC' ;;
5361 sunos) dflt='-pic' ;;
5365 *) case "$osname" in
5366 svr4*|esix*|solaris) dflt='-fPIC' ;;
5371 *) dflt="$cccdlflags" ;;
5373 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5376 none) cccdlflags=' ' ;;
5377 *) cccdlflags="$ans" ;;
5382 Some systems use ld to create libraries that can be dynamically loaded,
5383 while other systems (such as those using ELF) use $cc.
5387 '') $cat >try.c <<'EOM'
5388 /* Test for whether ELF binaries are produced */
5393 int i = open("a.out",O_RDONLY);
5396 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5397 exit(0); /* succeed (yes, it's ELF) */
5402 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5404 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5408 echo "I'll use ld to build dynamic libraries."
5417 rp="What command should be used to create dynamic libraries?"
5423 Some systems may require passing special flags to $ld to create a
5424 library that can be dynamically loaded. If your ld flags include
5425 -L/other/path options to locate libraries outside your loader's normal
5426 search path, you may need to specify those -L options here as well. To
5427 use no flags, say "none".
5430 case "$lddlflags" in
5431 '') case "$osname" in
5432 beos) dflt='-nostart' ;;
5434 linux|irix*) dflt='-shared' ;;
5435 next) dflt='none' ;;
5436 solaris) dflt='-G' ;;
5437 sunos) dflt='-assert nodefinitions' ;;
5438 svr4*|esix*) dflt="-G $ldflags" ;;
5442 *) dflt="$lddlflags" ;;
5445 : Try to guess additional flags to pick up local libraries.
5446 : Be careful not to append to a plain 'none'
5450 for thisflag in $ldflags; do
5455 *) dflt="$dflt $thisflag" ;;
5462 ''|' ') dflt='none' ;;
5465 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5468 none) lddlflags=' ' ;;
5469 *) lddlflags="$ans" ;;
5474 Some systems may require passing special flags to $cc to indicate that
5475 the resulting executable will use dynamic linking. To use no flags,
5479 case "$ccdlflags" in
5480 '') case "$osname" in
5481 hpux) dflt='-Wl,-E' ;;
5482 linux) dflt='-rdynamic' ;;
5483 next) dflt='none' ;;
5484 sunos) dflt='none' ;;
5488 *) dflt="$ccdlflags" ;;
5490 rp="Any special flags to pass to $cc to use dynamic loading?"
5493 none) ccdlflags=' ' ;;
5494 *) ccdlflags="$ans" ;;
5508 # No dynamic loading being used, so don't bother even to prompt.
5511 *) case "$useshrplib" in
5512 '') case "$osname" in
5513 svr4*|dgux|dynixptx|esix|powerux|beos)
5515 also='Building a shared libperl is required for dynamic loading to work on your system.'
5520 also='Building a shared libperl is needed for MAB support.'
5538 The perl executable is normally obtained by linking perlmain.c with
5539 libperl${_a}, any static extensions (usually just DynaLoader), and
5540 any other libraries needed on this system (such as -lm, etc.). Since
5541 your system supports dynamic loading, it is probably possible to build
5542 a shared libperl.$so. If you will have more than one executable linked
5543 to libperl.$so, this will significantly reduce the size of each
5544 executable, but it may have a noticeable affect on performance. The
5545 default is probably sensible for your system.
5549 rp="Build a shared libperl.$so (y/n)"
5553 useshrplib='true' ;;
5554 *) useshrplib='false' ;;
5559 case "$useshrplib" in
5563 # Figure out a good name for libperl.so. Since it gets stored in
5564 # a version-specific architecture-dependent library, the version
5565 # number isn't really that important, except for making cc/ld happy.
5567 # A name such as libperl.so.3.1
5568 majmin="libperl.$so.$patchlevel.$subversion"
5569 # A name such as libperl.so.301
5570 majonly=`echo $patchlevel $subversion |
5571 $awk '{printf "%d%02d", $1, $2}'`
5572 majonly=libperl.$so.$majonly
5573 # I'd prefer to keep the os-specific stuff here to a minimum, and
5574 # rely on figuring it out from the naming of libc.
5575 case "${osname}${osvers}" in
5578 # XXX How handle the --version stuff for MAB?
5580 linux*) # ld won't link with a bare -lperl otherwise.
5583 *) # Try to guess based on whether libc has major.minor.
5585 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5586 *libc.$so.[0-9]*) dflt=$majonly ;;
5587 *) dflt=libperl.$so ;;
5597 I need to select a good name for the shared libperl. If your system uses
5598 library names with major and minor numbers, then you might want something
5599 like $majmin. Alternatively, if your system uses a single version
5600 number for shared libraries, then you might want to use $majonly.
5601 Or, your system might be quite happy with a simple libperl.$so.
5603 Since the shared libperl will get installed into a version-specific
5604 architecture-dependent directory, the version number of the shared perl
5605 library probably isn't important, so the default should be o.k.
5608 rp='What name do you want to give to the shared libperl?'
5611 echo "Ok, I'll use $libperl"
5614 libperl="libperl${_a}"
5618 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5622 WARNING: Use of the shrpdir variable for the installation location of
5623 the shared $libperl is not supported. It was never documented and
5624 will not work in this version. Let me (perlbug@perl.com)
5625 know of any problems this may cause.
5631 But your current setting of $shrpdir is
5632 the default anyway, so it's harmless.
5637 Further, your current attempted setting of $shrpdir
5638 conflicts with the value of $archlibexp/CORE
5639 that installperl will use.
5646 # How will the perl executable find the installed shared $libperl?
5647 # Add $xxx to ccdlflags.
5648 # If we can't figure out a command-line option, use $shrpenv to
5649 # set env LD_RUN_PATH. The main perl makefile uses this.
5650 shrpdir=$archlibexp/CORE
5653 if "$useshrplib"; then
5656 # We'll set it in Makefile.SH...
5662 xxx="-Wl,-R$shrpdir"
5664 linux|irix*|dec_osf)
5665 xxx="-Wl,-rpath,$shrpdir"
5668 # next doesn't like the default...
5671 # beos doesn't like the default, either.
5674 # hpux doesn't like the default, either.
5675 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5678 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5684 # Only add $xxx if it isn't already in ccdlflags.
5685 case " $ccdlflags " in
5687 *) ccdlflags="$ccdlflags $xxx"
5690 Adding $xxx to the flags
5691 passed to $ld so that the perl executable will find the
5692 installed shared $libperl.
5700 # Fix ccdlflags in AIX for building external extensions.
5701 # (For building Perl itself bare -bE:perl.exp is needed,
5702 # Makefile.SH takes care of this.)
5704 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5706 # Respect a hint or command-line value.
5708 '') shrpenv="$tmp_shrpenv" ;;
5710 case "$ldlibpthname" in
5711 '') ldlibpthname=LD_LIBRARY_PATH ;;
5712 none) ldlibpthname='' ;;
5715 : determine where manual pages go
5716 set man1dir man1dir none
5720 $spackage has manual pages available in source form.
5724 echo "However, you don't have nroff, so they're probably useless to you."
5726 '') man1dir="none";;
5729 echo "If you don't want the manual sources installed, answer 'none'."
5734 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5735 lookpath="$lookpath $prefixexp/man/p_man/man1"
5736 lookpath="$lookpath $prefixexp/man/u_man/man1"
5737 lookpath="$lookpath $prefixexp/man/man.1"
5739 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5740 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5750 rp="Where do the main $spackage manual pages (source) go?"
5752 if $test "X$man1direxp" != "X$ansexp"; then
5756 man1direxp="$ansexp"
5762 : Change installation prefix, if necessary.
5763 if $test X"$prefix" != X"$installprefix"; then
5764 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5766 installman1dir="$man1direxp"
5769 : What suffix to use on installed man pages
5776 rp="What suffix should be used for the main $spackage man pages?"
5778 '') case "$man1dir" in
5792 *) dflt="$man1ext";;
5799 : see if we can have long filenames
5801 rmlist="$rmlist /tmp/cf$$"
5802 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5803 first=123456789abcdef
5804 second=/tmp/cf$$/$first
5805 $rm -f $first $second
5806 if (echo hi >$first) 2>/dev/null; then
5807 if $test -f 123456789abcde; then
5808 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5811 if (echo hi >$second) 2>/dev/null; then
5812 if $test -f /tmp/cf$$/123456789abcde; then
5814 That's peculiar... You can have filenames longer than 14 characters, but only
5815 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5816 I shall consider your system cannot support long filenames at all.
5820 echo 'You can have filenames longer than 14 characters.' >&4
5825 How confusing! Some of your filesystems are sane enough to allow filenames
5826 longer than 14 characters but some others like /tmp can't even think about them.
5827 So, for now on, I shall assume your kernel does not allow them at all.
5834 You can't have filenames longer than 14 chars. You can't even think about them!
5840 $rm -rf /tmp/cf$$ 123456789abcde*
5842 : determine where library module manual pages go
5843 set man3dir man3dir none
5847 $spackage has manual pages for many of the library modules.
5853 However, you don't have nroff, so they're probably useless to you.
5856 '') man3dir="none";;
5860 case "$d_flexfnam" in
5863 However, your system can't handle the long file names like File::Basename.3.
5866 '') man3dir="none";;
5870 echo "If you don't want the manual sources installed, answer 'none'."
5871 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5873 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5874 if $test -d "$privlib/man/man3"; then
5877 WARNING: Previous versions of perl installed man3 pages into
5878 $privlib/man/man3. This version will suggest a
5879 new default of $dflt.
5883 rp='Do you wish to preserve the old behavior?(y/n)'
5886 y*) dflt="$privlib/man/man3" ;;
5892 *) dflt="$man3dir" ;;
5896 rp="Where do the $package library man pages (source) go?"
5899 man3direxp="$ansexp"
5905 : Change installation prefix, if necessary.
5906 if $test X"$prefix" != X"$installprefix"; then
5907 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
5909 installman3dir="$man3direxp"
5912 : What suffix to use on installed man pages
5918 rp="What suffix should be used for the $package library man pages?"
5920 '') case "$man3dir" in
5934 *) dflt="$man3ext";;
5941 : see if we have to deal with yellow pages, now NIS.
5942 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5943 if $test -f /usr/etc/nibindd; then
5945 echo "I'm fairly confident you're on a NeXT."
5947 rp='Do you get the hosts file via NetInfo?'
5956 y*) hostcat='nidump hosts .';;
5957 *) case "$hostcat" in
5958 nidump*) hostcat='';;
5968 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5976 rp='Are you getting the hosts file via yellow pages?'
5979 y*) hostcat='ypcat hosts';;
5980 *) hostcat='cat /etc/hosts';;
5986 '') hostcat='cat /etc/hosts';;
5989 '') groupcat='cat /etc/group';;
5992 '') passcat='cat /etc/passwd';;
5995 : now get the host name
5997 echo "Figuring out host name..." >&4
5998 case "$myhostname" in
6000 echo 'Maybe "hostname" will work...'
6001 if tans=`sh -c hostname 2>&1` ; then
6009 if $test "$cont"; then
6011 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6012 if tans=`cat /etc/systemid 2>&1` ; then
6014 phostname='cat /etc/systemid'
6015 echo "Whadyaknow. Xenix always was a bit strange..."
6018 elif $test -r /etc/systemid; then
6019 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6022 if $test "$cont"; then
6023 echo 'No, maybe "uuname -l" will work...'
6024 if tans=`sh -c 'uuname -l' 2>&1` ; then
6026 phostname='uuname -l'
6028 echo 'Strange. Maybe "uname -n" will work...'
6029 if tans=`sh -c 'uname -n' 2>&1` ; then
6031 phostname='uname -n'
6033 echo 'Oh well, maybe I can mine it out of whoami.h...'
6034 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6035 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6036 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6038 case "$myhostname" in
6039 '') echo "Does this machine have an identity crisis or something?"
6042 echo "Well, you said $myhostname before..."
6043 phostname='echo $myhostname';;
6049 : you do not want to know about this
6054 if $test "$myhostname" ; then
6056 rp='Your host name appears to be "'$myhostname'".'" Right?"
6064 : bad guess or no guess
6065 while $test "X$myhostname" = X ; do
6067 rp="Please type the (one word) name of your host:"
6072 : translate upper to lower if necessary
6073 case "$myhostname" in
6075 echo "(Normalizing case in your host name)"
6076 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6080 case "$myhostname" in
6082 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6083 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6084 echo "(Trimming domain name from host name--host name is now $myhostname)"
6086 *) case "$mydomain" in
6089 test "X$hostcat" = "Xypcat hosts" &&
6090 ypmatch "$myhostname" hosts 2>/dev/null |\
6091 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6094 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6095 /[ ]$myhostname[ . ]/p" > hosts
6098 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6099 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6100 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6101 hosts | $sort | $uniq | \
6102 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6103 case `$echo X$dflt` in
6104 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6107 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6112 tans=`./loc resolv.conf X /etc /usr/etc`
6113 if $test -f "$tans"; then
6114 echo "(Attempting domain name extraction from $tans)"
6115 dflt=.`$sed -n -e 's/ / /g' \
6116 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6117 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6119 .) dflt=.`$sed -n -e 's/ / /g' \
6120 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6121 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6128 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6129 dflt=.`sh -c domainname 2>/dev/null`
6132 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6137 .) echo "(Lost all hope -- silly guess then)"
6143 *) dflt="$mydomain";;
6147 rp="What is your domain name?"
6157 : translate upper to lower if necessary
6160 echo "(Normalizing case in your domain name)"
6161 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6165 : a little sanity check here
6166 case "$phostname" in
6169 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6170 $myhostname$mydomain|$myhostname) ;;
6172 case "$phostname" in
6174 echo "(That doesn't agree with your whoami.h file, by the way.)"
6177 echo "(That doesn't agree with your $phostname command, by the way.)"
6187 I need to get your e-mail address in Internet format if possible, i.e.
6188 something like user@host.domain. Please answer accurately since I have
6189 no easy means to double check it. The default value provided below
6190 is most probably close to the reality but may not be valid from outside
6191 your organization...
6195 while test "$cont"; do
6197 '') dflt="$cf_by@$myhostname$mydomain";;
6198 *) dflt="$cf_email";;
6200 rp='What is your e-mail address?'
6206 rp='Address does not look like an Internet one. Use it anyway?'
6222 If you or somebody else will be maintaining perl at your site, please
6223 fill in the correct e-mail address here so that they may be contacted
6224 if necessary. Currently, the "perlbug" program included with perl
6225 will send mail to this address in addition to perlbug@perl.com. You may
6226 enter "none" for no administrator.
6229 case "$perladmin" in
6230 '') dflt="$cf_email";;
6231 *) dflt="$perladmin";;
6233 rp='Perl administrator e-mail address'
6237 : figure out how to guarantee perl startup
6238 case "$startperl" in
6240 case "$sharpbang" in
6244 I can use the #! construct to start perl on your system. This will
6245 make startup of perl scripts faster, but may cause problems if you
6246 want to share those scripts and perl is not in a standard place
6247 ($binexp/perl) on all your platforms. The alternative is to force
6248 a shell by starting the script with a single ':' character.
6252 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6255 none) startperl=": # use perl";;
6256 *) startperl="#!$ans"
6257 if $test 30 -lt `echo "$ans" | wc -c`; then
6260 WARNING: Some systems limit the #! command to 32 characters.
6261 If you experience difficulty running Perl scripts with #!, try
6262 installing Perl in a directory with a shorter pathname.
6268 *) startperl=": # use perl"
6273 echo "I'll use $startperl to start perl scripts."
6275 : figure best path for perl in scripts
6278 perlpath="$binexp/perl"
6279 case "$startperl" in
6284 I will use the "eval 'exec'" idiom to start Perl on your system.
6285 I can use the full path of your Perl binary for this purpose, but
6286 doing so may cause problems if you want to share those scripts and
6287 Perl is not always in a standard place ($binexp/perl).
6291 rp="What path shall I use in \"eval 'exec'\"?"
6298 case "$startperl" in
6300 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6303 : determine where public executable scripts go
6304 set scriptdir scriptdir
6306 case "$scriptdir" in
6309 : guess some guesses
6310 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6311 $test -d /usr/share/bin && dflt=/usr/share/bin
6312 $test -d /usr/local/script && dflt=/usr/local/script
6313 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6314 $test -d $prefixexp/script && dflt=$prefixexp/script
6318 *) dflt="$scriptdir"
6323 Some installations have a separate directory just for executable scripts so
6324 that they can mount it across multiple architectures but keep the scripts in
6325 one spot. You might, for example, have a subdirectory of /usr/share for this.
6326 Or you might just lump your scripts in with all your other executables.
6330 rp='Where do you keep publicly executable scripts?'
6332 if $test "X$ansexp" != "X$scriptdirexp"; then
6336 scriptdirexp="$ansexp"
6337 : Change installation prefix, if necessary.
6338 if $test X"$prefix" != X"$installprefix"; then
6339 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6341 installscript="$scriptdirexp"
6346 After $package is installed, you may wish to install various
6347 add-on modules and utilities. Typically, these add-ons will
6348 be installed under $prefix with the rest
6349 of this package. However, you may wish to install such add-ons
6350 elsewhere under a different prefix.
6352 If you do not wish to put everything under a single prefix, that's
6353 ok. You will be prompted for the individual locations; this siteprefix
6354 is only used to suggest the defaults.
6356 The default should be fine for most people.
6360 rp='Installation prefix to use for add-on modules and utilities?'
6361 : XXX Here might be another good place for an installstyle setting.
6362 case "$siteprefix" in
6364 *) dflt=$siteprefix ;;
6368 case "$siteprefix" in
6373 *) oldsiteprefix="$prefix";;
6378 siteprefixexp="$ansexp"
6380 : determine where site specific libraries go.
6381 : Usual default is /usr/local/lib/perl5/site_perl
6382 : The default "style" setting is made in installstyle.U
6383 : XXX No longer works with Prefixit stuff.
6384 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6385 case "$installstyle" in
6386 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6387 *) dflt=$siteprefix/lib/site_$prog ;;
6391 The installation process will create a directory for
6392 site-specific extensions and modules. Most users find it convenient
6393 to place all site-specific files in this directory rather than in the
6394 main distribution directory.
6398 rp='Pathname for the site-specific library files?'
6401 sitelibexp="$ansexp"
6402 : Change installation prefix, if necessary.
6403 if $test X"$prefix" != X"$installprefix"; then
6404 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6406 installsitelib="$sitelibexp"
6409 : determine where site specific architecture-dependent libraries go.
6410 : sitelib default is /usr/local/lib/perl5/site_perl/
6411 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6412 : sitelib may have an optional trailing /share.
6413 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6414 tdflt="$tdflt/$apiversion/$archname"
6415 set sitearch sitearch none
6418 '') dflt="$tdflt" ;;
6419 *) dflt="$sitearch" ;;
6423 The installation process will also create a directory for
6424 architecture-dependent site-specific extensions and modules.
6428 rp='Pathname for the site-specific architecture-dependent library files?'
6431 sitearchexp="$ansexp"
6432 : Change installation prefix, if necessary.
6433 if $test X"$prefix" != X"$installprefix"; then
6434 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6436 installsitearch="$sitearchexp"
6441 Perl can be built to take advantage of long doubles which
6442 (if available) may give more accuracy and range for floating point
6443 numbers. To do so, Configure must be run with -Duselongdouble.
6445 If this doesn't make any sense to you, just accept the default 'n'.
6447 case "$uselongdouble" in
6448 $define|true|[yY]*) dflt='y';;
6451 rp='Try to use long doubles if available?'
6454 y|Y) val="$define" ;;
6460 case "$uselongdouble" in
6461 "$define"|true|[yY]*)
6462 : Look for a hint-file generated 'call-back-unit'. If the
6463 : user has specified that long doubles should be used,
6464 : we may need to set or change some other defaults.
6465 if $test -f uselongdouble.cbu; then
6466 echo "Your platform has some specific hints for long doubles, using them..."
6467 . ./uselongdouble.cbu
6470 (Your platform doesn't have any specific hints for long doubles.)
6478 Previous version of $package used the standard IO mechanisms as defined
6479 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6480 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6481 the default. This abstraction layer can use AT&T's sfio (if you already
6482 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6483 problems with some extension modules. Using PerlIO with stdio is safe,
6484 but it is slower than plain stdio and therefore is not the default.
6486 If this doesn't make any sense to you, just accept the default 'n'.
6488 case "$useperlio" in
6489 $define|true|[yY]*) dflt='y';;
6492 rp='Use the experimental PerlIO abstraction layer?'
6499 echo "Ok, doing things the stdio way"
6506 : Check how to convert floats to strings.
6507 if test "X$d_Gconvert" = X; then
6509 echo "Checking for an efficient way to convert floats to strings."
6512 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6513 char *myname = "gconvert";
6516 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6517 char *myname = "gcvt";
6520 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6521 char *myname = "sprintf";
6527 checkit(expect, got)
6531 if (strcmp(expect, got)) {
6532 printf("%s oddity: Expected %s, got %s\n",
6533 myname, expect, got);
6543 /* This must be 1st test on (which?) platform */
6544 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6545 Gconvert(0.1, 8, 0, buf);
6546 checkit("0.1", buf);
6548 Gconvert(1.0, 8, 0, buf);
6551 Gconvert(0.0, 8, 0, buf);
6554 Gconvert(-1.0, 8, 0, buf);
6557 /* Some Linux gcvt's give 1.e+5 here. */
6558 Gconvert(100000.0, 8, 0, buf);
6559 checkit("100000", buf);
6561 /* Some Linux gcvt's give -1.e+5 here. */
6562 Gconvert(-100000.0, 8, 0, buf);
6563 checkit("-100000", buf);
6568 case "$d_Gconvert" in
6569 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6570 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6571 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6572 *) xxx_list='gconvert gcvt sprintf' ;;
6575 for xxx_convert in $xxx_list; do
6576 echo "Trying $xxx_convert"
6578 set try -DTRY_$xxx_convert
6579 if eval $compile; then
6580 echo "$xxx_convert" found. >&4
6582 echo "I'll use $xxx_convert to convert floats into a string." >&4
6585 echo "...But $xxx_convert didn't work as I expected."
6588 echo "$xxx_convert NOT found." >&4
6592 case "$xxx_convert" in
6593 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6594 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6595 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6599 : see if inttypes.h is available
6600 : we want a real compile instead of Inhdr because some systems
6601 : have an inttypes.h which includes non-existent headers
6604 #include <inttypes.h>
6606 static int32_t foo32 = 0x12345678;
6610 if eval $compile; then
6611 echo "<inttypes.h> found." >&4
6614 echo "<inttypes.h> NOT found." >&4
6622 case "$use64bits" in
6625 echo $n "Checking to see if your system supports int64_t...$c" >&4
6627 #include <sys/types.h>
6628 #$i_inttypes I_INTTYPES
6630 #include <inttypes.h>
6632 int64_t foo() { int64_t x; x = 7; return x; }
6634 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6636 echo " Yup, it does." >&4
6639 echo " Nope, it doesn't." >&4
6650 : check for lengths of integral types
6654 echo "Checking to see how big your integers are..." >&4
6655 $cat >intsize.c <<'EOCP'
6659 printf("intsize=%d;\n", sizeof(int));
6660 printf("longsize=%d;\n", sizeof(long));
6661 printf("shortsize=%d;\n", sizeof(short));
6666 if eval $compile_ok && ./intsize > /dev/null; then
6668 echo "Your integers are $intsize bytes long."
6669 echo "Your long integers are $longsize bytes long."
6670 echo "Your short integers are $shortsize bytes long."
6674 Help! I can't compile and run the intsize test program: please enlighten me!
6675 (This is probably a misconfiguration in your system or libraries, and
6676 you really ought to fix it. Still, I'll try anyway.)
6680 rp="What is the size of an integer (in bytes)?"
6684 rp="What is the size of a long integer (in bytes)?"
6688 rp="What is the size of a short integer (in bytes)?"
6694 $rm -f intsize intsize.*
6696 : check for long long
6698 echo $n "Checking to see if your system supports long long...$c" >&4
6699 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6700 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6702 echo " Yup, it does." >&4
6705 echo " Nope, it doesn't." >&4
6711 : check for length of long long
6712 case "${d_longlong}${longlongsize}" in
6715 $echo $n "Checking to see how big your long longs are...$c" >&4
6716 $cat >try.c <<'EOCP'
6720 printf("%d\n", sizeof(long long));
6724 if eval $compile_ok; then
6725 longlongsize=`./try`
6726 $echo " $longlongsize bytes." >&4
6730 echo "(I can't seem to compile the test program. Guessing...)"
6731 rp="What is the size of a long long (in bytes)?"
6735 if $test "X$longsize" = "X$longlongsize"; then
6736 echo "(That isn't any different from an ordinary long.)"
6744 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6746 echo "Checking how to print 64-bit integers..." >&4
6748 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6750 $cat >try.c <<'EOCP'
6751 #include <sys/types.h>
6754 int q = 12345678901;
6759 if eval $compile; then
6763 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6764 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6765 echo "We will use %d."
6771 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6773 $cat >try.c <<'EOCP'
6774 #include <sys/types.h>
6777 long q = 12345678901;
6782 if eval $compile; then
6786 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6787 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6788 echo "We will use %ld."
6794 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6796 $cat >try.c <<'EOCP'
6797 #include <sys/types.h>
6798 #include <inttypes.h>
6801 int64_t q = 12345678901;
6802 printf("%" PRId64 "\n", q);
6806 if eval $compile; then
6810 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6811 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6812 echo "We will use the C9X style."
6818 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6820 $cat >try.c <<'EOCP'
6821 #include <sys/types.h>
6824 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6825 printf("%lld\n", q);
6829 if eval $compile; then
6833 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6834 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6835 echo "We will use the %lld style."
6841 if $test X"$sPRId64" = X -a X"$quad" != X; then
6843 #include <sys/types.h>
6846 $quad q = 12345678901;
6851 if eval $compile; then
6855 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6856 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6857 echo "We will use %lld."
6863 if $test X"$sPRId64" = X -a X"$quad" != X; then
6865 #include <sys/types.h>
6868 $quad q = 12345678901;
6873 if eval $compile; then
6877 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6878 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6879 echo "We will use %qd."
6885 if $test X"$sPRId64" = X; then
6886 echo "Cannot figure out how to print 64-bit integers." >&4
6891 fi # intsize -o longsize -o d_int64t -o d_longlong
6894 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6895 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6897 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6898 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6902 : check for length of double
6904 case "$doublesize" in
6906 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6907 $cat >try.c <<'EOCP'
6911 printf("%d\n", sizeof(double));
6915 if eval $compile_ok; then
6917 $echo " $doublesize bytes." >&4
6920 echo "(I can't seem to compile the test program. Guessing...)"
6921 rp="What is the size of a double precision number (in bytes)?"
6929 : check for long doubles
6931 echo $n "Checking to see if your system supports long double...$c" >&4
6932 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6933 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6935 echo " Yup, it does." >&4
6938 echo " Nope, it doesn't." >&4
6944 : check for length of long double
6945 case "${d_longdbl}${longdblsize}" in
6948 $echo $n "Checking to see how big your long doubles are...$c" >&4
6949 $cat >try.c <<'EOCP'
6953 printf("%d\n", sizeof(long double));
6957 if eval $compile; then
6959 $echo " $longdblsize bytes." >&4
6963 echo "(I can't seem to compile the test program. Guessing...)" >&4
6964 rp="What is the size of a long double (in bytes)?"
6968 if $test "X$doublesize" = "X$longdblsize"; then
6969 echo "(That isn't any different from an ordinary double.)"
6977 if $test X"$d_longdbl" = X"$define"; then
6979 echo "Checking how to print long doubles..." >&4
6981 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6982 $cat >try.c <<'EOCP'
6983 #include <sys/types.h>
6987 printf("%.3f\n", d);
6991 if eval $compile; then
6995 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6996 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6997 echo "We will use %f."
7003 if $test X"$sPRIfldbl" = X; then
7004 $cat >try.c <<'EOCP'
7005 #include <sys/types.h>
7008 long double d = 123.456;
7009 printf("%.3llf\n", d);
7013 if eval $compile; then
7017 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7018 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7019 echo "We will use %llf."
7025 if $test X"$sPRIfldbl" = X; then
7026 $cat >try.c <<'EOCP'
7027 #include <sys/types.h>
7030 long double d = 123.456;
7031 printf("%.3Lf\n", d);
7035 if eval $compile; then
7039 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7040 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7041 echo "We will use %Lf."
7047 if $test X"$sPRIfldbl" = X; then
7048 $cat >try.c <<'EOCP'
7049 #include <sys/types.h>
7052 long double d = 123.456;
7053 printf("%.3lf\n", d);
7057 if eval $compile; then
7061 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7062 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7063 echo "We will use %lf."
7069 if $test X"$sPRIfldbl" = X; then
7070 echo "Cannot figure out how to print long doubles." >&4
7077 case "$sPRIfldbl" in
7078 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7079 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7081 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7082 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7086 : Initialize h_fcntl
7089 : Initialize h_sysfile
7092 : access call always available on UNIX
7096 : locate the flags for 'access()'
7100 $cat >access.c <<'EOCP'
7101 #include <sys/types.h>
7106 #include <sys/file.h>
7115 : check sys/file.h first, no particular reason here
7116 if $test `./findhdr sys/file.h` && \
7117 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7119 echo "<sys/file.h> defines the *_OK access constants." >&4
7120 elif $test `./findhdr fcntl.h` && \
7121 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7123 echo "<fcntl.h> defines the *_OK access constants." >&4
7124 elif $test `./findhdr unistd.h` && \
7125 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7126 echo "<unistd.h> defines the *_OK access constants." >&4
7128 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7134 : see if accessx exists
7135 set accessx d_accessx
7138 : see if alarm exists
7142 : see if atolf exists
7146 : see if atoll exists
7150 : Look for GNU-cc style attribute checking
7152 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7153 $cat >attrib.c <<'EOCP'
7155 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7157 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7158 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7159 echo "Your C compiler doesn't fully support __attribute__."
7162 echo "Your C compiler supports __attribute__."
7166 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7173 : see if bcmp exists
7177 : see if bcopy exists
7181 : see if this is a unistd.h system
7182 set unistd.h i_unistd
7185 : see if getpgrp exists
7186 set getpgrp d_getpgrp
7189 case "$d_getpgrp" in
7192 echo "Checking to see which flavor of getpgrp is in use..."
7195 #include <sys/types.h>
7197 # include <unistd.h>
7201 if (getuid() == 0) {
7202 printf("(I see you are running Configure as super-user...)\n");
7206 if (getpgrp(1) == 0)
7215 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7216 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7218 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7219 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7222 echo "I can't seem to compile and run the test program."
7224 xxx="a USG one, i.e. you use getpgrp()."
7226 # SVR4 systems can appear rather BSD-ish.
7229 xxx="a BSD one, i.e. you use getpgrp(pid)."
7233 xxx="probably a USG one, i.e. you use getpgrp()."
7238 echo "Assuming your getpgrp is $xxx" >&4
7247 : see if setpgrp exists
7248 set setpgrp d_setpgrp
7251 case "$d_setpgrp" in
7254 echo "Checking to see which flavor of setpgrp is in use..."
7257 #include <sys/types.h>
7259 # include <unistd.h>
7263 if (getuid() == 0) {
7264 printf("(I see you are running Configure as super-user...)\n");
7268 if (-1 == setpgrp(1, 1))
7271 if (setpgrp() != -1)
7277 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7278 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7280 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7281 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7284 echo "(I can't seem to compile and run the test program.)"
7286 xxx="a USG one, i.e. you use setpgrp()."
7288 # SVR4 systems can appear rather BSD-ish.
7291 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7295 xxx="probably a USG one, i.e. you use setpgrp()."
7300 echo "Assuming your setpgrp is $xxx" >&4
7308 : see if bzero exists
7312 : see if signal is declared as pointer to function returning int or void
7314 xxx=`./findhdr signal.h`
7315 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7316 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7317 echo "You have int (*signal())() instead of void." >&4
7319 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7320 echo "You have void (*signal())()." >&4
7322 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7323 echo "You have int (*signal())() instead of void." >&4
7325 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7326 echo "You have void (*signal())()." >&4
7329 case "$d_voidsig" in
7331 echo "I can't determine whether signal handler returns void or int..." >&4
7333 rp="What type does your signal handler return?"
7340 echo "As you already told me, signal handler returns void." >&4
7343 *) echo "As you already told me, signal handler returns int." >&4
7350 case "$d_voidsig" in
7351 "$define") signal_t="void";;
7356 : check for ability to cast large floats to 32-bit ints.
7358 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7359 if $test "$intsize" -ge 4; then
7366 #include <sys/types.h>
7368 $signal_t blech(s) int s; { exit(3); }
7375 signal(SIGFPE, blech);
7377 /* Don't let compiler optimize the test away. Store the number
7378 in a writable string for gcc to pass to sscanf under HP/UX.
7380 sprintf(str, "2147483647");
7381 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7385 /* x86 processors will probably give 0x8000 0000, which is a
7386 sign change. We don't want that. We want to mimic SPARC
7387 behavior here, which is to preserve the sign and give
7390 if (i32 != ($xxx) f)
7396 if eval $compile_ok; then
7400 echo "(I can't seem to compile the test program--assuming it can't)"
7408 echo "Nope, it can't."
7415 : check for ability to cast negative floats to unsigned
7417 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7420 #include <sys/types.h>
7422 $signal_t blech(s) int s; { exit(7); }
7423 $signal_t blech_in_list(s) int s; { exit(4); }
7424 unsigned long dummy_long(p) unsigned long p; { return p; }
7425 unsigned int dummy_int(p) unsigned int p; { return p; }
7426 unsigned short dummy_short(p) unsigned short p; { return p; }
7430 unsigned long along;
7432 unsigned short ashort;
7436 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7437 a direct f = -123. assignment. gcc-2.8.0 reportedly
7438 optimized the whole file away
7440 /* Store the number in a writable string for gcc to pass to
7443 sprintf(str, "-123");
7444 sscanf(str, "%lf", &f); /* f = -123.; */
7446 signal(SIGFPE, blech);
7447 along = (unsigned long)f;
7448 aint = (unsigned int)f;
7449 ashort = (unsigned short)f;
7450 if (along != (unsigned long)-123)
7452 if (aint != (unsigned int)-123)
7454 if (ashort != (unsigned short)-123)
7456 sprintf(str, "1073741824.");
7457 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7460 along = (unsigned long)f;
7461 if (along != 0x80000000)
7465 along = (unsigned long)f;
7466 if (along != 0x7fffffff)
7470 along = (unsigned long)f;
7471 if (along != 0x80000001)
7475 signal(SIGFPE, blech_in_list);
7476 sprintf(str, "123.");
7477 sscanf(str, "%lf", &f); /* f = 123.; */
7478 along = dummy_long((unsigned long)f);
7479 aint = dummy_int((unsigned int)f);
7480 ashort = dummy_short((unsigned short)f);
7481 if (along != (unsigned long)123)
7483 if (aint != (unsigned int)123)
7485 if (ashort != (unsigned short)123)
7492 if eval $compile_ok; then
7496 echo "(I can't seem to compile the test program--assuming it can't)"
7499 case "$castflags" in
7504 echo "Nope, it can't."
7511 : see if vprintf exists
7513 if set vprintf val -f d_vprintf; eval $csym; $val; then
7514 echo 'vprintf() found.' >&4
7516 $cat >vprintf.c <<'EOF'
7517 #include <varargs.h>
7519 int main() { xxx("foo"); }
7528 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7532 if eval $compile && ./vprintf; then
7533 echo "Your vsprintf() returns (int)." >&4
7536 echo "Your vsprintf() returns (char*)." >&4
7540 echo 'vprintf() NOT found.' >&4
7550 : see if chown exists
7554 : see if chroot exists
7558 : see if chsize exists
7562 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7563 while $test $# -ge 2; do
7565 $define) echo "#include <$2>";;
7569 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7570 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7579 : see if this is a sys/uio.h system
7580 set sys/uio.h i_sysuio
7583 echo "Checking to see if your system supports struct iovec..." >&4
7584 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7586 case "$d_iovec_s" in
7587 "$define") echo "Yup, it does." >&4
7589 *) echo "Nope, it doesn't." >&4
7595 : see whether socket exists
7597 $echo $n "Hmm... $c" >&4
7598 if set socket val -f d_socket; eval $csym; $val; then
7599 echo "Looks like you have Berkeley networking support." >&4
7601 if set setsockopt val -f; eval $csym; $val; then
7604 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7608 if $contains socklib libc.list >/dev/null 2>&1; then
7609 echo "Looks like you have Berkeley networking support." >&4
7611 : we will have to assume that it supports the 4.2 BSD interface
7614 echo "You don't have Berkeley networking in libc$_a..." >&4
7615 if test "X$d_socket" = "X$define"; then
7616 echo "...but you seem to believe that you have sockets." >&4
7618 for net in net socket
7620 if test -f /usr/lib/lib$net$_a; then
7621 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7622 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7623 if $contains socket libc.list >/dev/null 2>&1; then
7628 echo "...but the Wollongong group seems to have hacked it in." >&4
7629 sockethdr="-I/usr/netinclude"
7632 echo "Found Berkeley sockets interface in lib$net." >& 4
7633 if $contains setsockopt libc.list >/dev/null 2>&1; then
7636 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7643 if test "X$d_socket" != "X$define"; then
7644 echo "or anywhere else I see." >&4
7652 : see if socketpair exists
7653 set socketpair d_sockpair
7658 echo "Checking the availability of certain socket constants..." >& 4
7659 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7660 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7662 #include <sys/types.h>
7663 #include <sys/socket.h>
7669 set try; if eval $compile; then
7672 set d_${enum}; eval $setvar
7676 set sendmsg d_sendmsg
7679 set recvmsg d_recvmsg
7683 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7684 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7686 case "$d_msghdr_s" in
7687 "$define") echo "Yup, it does." >&4
7689 *) echo "Nope, it doesn't." >&4
7693 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7694 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7696 case "$d_cmsghdr_s" in
7697 "$define") echo "Yup, it does." >&4
7699 *) echo "Nope, it doesn't." >&4
7703 : check for const keyword
7705 echo 'Checking to see if your C compiler knows about "const"...' >&4
7706 $cat >const.c <<'EOCP'
7707 typedef struct spug { int drokk; } spug;
7714 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7716 echo "Yup, it does."
7719 echo "Nope, it doesn't."
7724 : see if crypt exists
7726 if set crypt val -f d_crypt; eval $csym; $val; then
7727 echo 'crypt() found.' >&4
7731 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7732 if $test -z "$cryptlib"; then
7733 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7737 if $test -z "$cryptlib"; then
7738 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7742 if $test -z "$cryptlib"; then
7743 cryptlib=`./loc libcrypt$_a "" $libpth`
7747 if $test -z "$cryptlib"; then
7748 echo 'crypt() NOT found.' >&4
7757 : get csh whereabouts
7759 'csh') val="$undef" ;;
7764 : Respect a hint or command line value for full_csh.
7766 '') full_csh=$csh ;;
7769 : see if cuserid exists
7770 set cuserid d_cuserid
7773 : see if this is a limits.h system
7774 set limits.h i_limits
7777 : see if this is a float.h system
7781 : See if number of significant digits in a double precision number is known
7783 $cat >dbl_dig.c <<EOM
7793 printf("Contains DBL_DIG");
7796 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7797 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7798 echo "DBL_DIG found." >&4
7801 echo "DBL_DIG NOT found." >&4
7808 : see if difftime exists
7809 set difftime d_difftime
7812 : see if this is a dirent system
7814 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7816 echo "<dirent.h> found." >&4
7819 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7820 echo "<sys/dir.h> found." >&4
7823 xinc=`./findhdr sys/ndir.h`
7825 echo "<dirent.h> NOT found." >&4
7830 : Look for type of directory structure.
7832 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7834 case "$direntrytype" in
7837 $define) guess1='struct dirent' ;;
7838 *) guess1='struct direct' ;;
7841 *) guess1="$direntrytype"
7846 'struct dirent') guess2='struct direct' ;;
7847 *) guess2='struct dirent' ;;
7850 if $contains "$guess1" try.c >/dev/null 2>&1; then
7851 direntrytype="$guess1"
7852 echo "Your directory entries are $direntrytype." >&4
7853 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7854 direntrytype="$guess2"
7855 echo "Your directory entries seem to be $direntrytype." >&4
7857 echo "I don't recognize your system's directory entries." >&4
7858 rp="What type is used for directory entries on this system?"
7866 : see if the directory entry stores field length
7868 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7869 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7870 echo "Good, your directory entry keeps length information in d_namlen." >&4
7873 echo "Your directory entry does not know about the d_namlen field." >&4
7880 : see if dlerror exists
7883 set dlerror d_dlerror
7887 : see if dlfcn is available
7895 On a few systems, the dynamically loaded modules that perl generates and uses
7896 will need a different extension than shared libs. The default will probably
7904 rp='What is the extension of dynamically loaded modules'
7913 : Check if dlsym need a leading underscore
7919 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7920 $cat >dyna.c <<'EOM'
7929 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7931 #include <sys/types.h>
7945 int mode = RTLD_LAZY ;
7947 handle = dlopen("./dyna.$dlext", mode) ;
7948 if (handle == NULL) {
7953 symbol = dlsym(handle, "fred") ;
7954 if (symbol == NULL) {
7955 /* try putting a leading underscore */
7956 symbol = dlsym(handle, "_fred") ;
7957 if (symbol == NULL) {
7970 : Call the object file tmp-dyna.o in case dlext=o.
7971 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7972 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7973 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7974 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7977 1) echo "Test program failed using dlopen." >&4
7978 echo "Perhaps you should not use dynamic loading." >&4;;
7979 2) echo "Test program failed using dlsym." >&4
7980 echo "Perhaps you should not use dynamic loading." >&4;;
7981 3) echo "dlsym needs a leading underscore" >&4
7983 4) echo "dlsym doesn't need a leading underscore." >&4;;
7986 echo "I can't compile and run the test program." >&4
7987 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7992 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7997 hasproto='varname=$1; func=$2; shift; shift;
7998 while $test $# -ge 2; do
8000 $define) echo "#include <$2>";;
8004 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8005 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8006 echo "$func() prototype found.";
8009 echo "$func() prototype NOT found.";
8014 $rm -f try.c tryout.c'
8016 : see if prototype for drand48 is available
8018 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8021 : see if dup2 exists
8025 : see if eaccess exists
8026 set eaccess d_eaccess
8029 : see if endgrent exists
8030 set endgrent d_endgrent
8033 : see if endhostent exists
8034 set endhostent d_endhent
8037 : see if endnetent exists
8038 set endnetent d_endnent
8041 : see if endprotoent exists
8042 set endprotoent d_endpent
8045 : see if endpwent exists
8046 set endpwent d_endpwent
8049 : see if endservent exists
8050 set endservent d_endsent
8053 : see if endspent exists
8054 set endspent d_endspent
8057 : Locate the flags for 'open()'
8059 $cat >open3.c <<'EOCP'
8060 #include <sys/types.h>
8065 #include <sys/file.h>
8076 : check sys/file.h first to get FREAD on Sun
8077 if $test `./findhdr sys/file.h` && \
8078 set open3 -DI_SYS_FILE && eval $compile; then
8080 echo "<sys/file.h> defines the O_* constants..." >&4
8082 echo "and you have the 3 argument form of open()." >&4
8085 echo "but not the 3 argument form of open(). Oh, well." >&4
8088 elif $test `./findhdr fcntl.h` && \
8089 set open3 -DI_FCNTL && eval $compile; then
8091 echo "<fcntl.h> defines the O_* constants..." >&4
8093 echo "and you have the 3 argument form of open()." >&4
8096 echo "but not the 3 argument form of open(). Oh, well." >&4
8101 echo "I can't find the O_* constant definitions! You got problems." >&4
8107 : check for non-blocking I/O stuff
8108 case "$h_sysfile" in
8109 true) echo "#include <sys/file.h>" > head.c;;
8112 true) echo "#include <fcntl.h>" > head.c;;
8113 *) echo "#include <sys/fcntl.h>" > head.c;;
8118 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8119 case "$o_nonblock" in
8122 $cat >>try.c <<'EOCP'
8125 printf("O_NONBLOCK\n");
8129 printf("O_NDELAY\n");
8133 printf("FNDELAY\n");
8140 if eval $compile_ok; then
8142 case "$o_nonblock" in
8143 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8144 *) echo "Seems like we can use $o_nonblock.";;
8147 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8150 *) echo "Using $hint value $o_nonblock.";;
8152 $rm -f try try.* .out core
8155 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8161 #include <sys/types.h>
8163 #define MY_O_NONBLOCK $o_nonblock
8164 #ifndef errno /* XXX need better Configure test */
8167 $signal_t blech(x) int x; { exit(3); }
8169 $cat >> try.c <<'EOCP'
8177 pipe(pd); /* Down: child -> parent */
8178 pipe(pu); /* Up: parent -> child */
8181 close(pd[1]); /* Parent reads from pd[0] */
8182 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8183 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8185 signal(SIGALRM, blech);
8187 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8189 sprintf(string, "%d\n", ret);
8190 write(2, string, strlen(string));
8193 if (errno == EAGAIN) {
8199 if (errno == EWOULDBLOCK)
8200 printf("EWOULDBLOCK\n");
8203 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8204 sleep(2); /* Give it time to close our pipe */
8206 ret = read(pd[0], buf, 1); /* Should read EOF */
8208 sprintf(string, "%d\n", ret);
8209 write(3, string, strlen(string));
8213 close(pd[0]); /* We write to pd[1] */
8214 close(pu[1]); /* We read from pu[0] */
8215 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8216 close(pd[1]); /* Pipe pd is now fully closed! */
8217 exit(0); /* Bye bye, thank you for playing! */
8221 if eval $compile_ok; then
8222 echo "$startsh" >mtry
8223 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8225 ./mtry >/dev/null 2>&1
8227 0) eagain=`$cat try.out`;;
8228 1) echo "Could not perform non-blocking setting!";;
8229 2) echo "I did a successful read() for something that was not there!";;
8230 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8231 *) echo "Something terribly wrong happened during testing.";;
8233 rd_nodata=`$cat try.ret`
8234 echo "A read() system call with no data present returns $rd_nodata."
8235 case "$rd_nodata" in
8238 echo "(That's peculiar, fixing that to be -1.)"
8244 echo "Forcing errno EAGAIN on read() with no data available."
8248 echo "Your read() sets errno to $eagain when no data is available."
8251 status=`$cat try.err`
8253 0) echo "And it correctly returns 0 to signal EOF.";;
8254 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8255 *) echo "However, your read() returns '$status' on EOF??";;
8258 if test "$status" = "$rd_nodata"; then
8259 echo "WARNING: you can't distinguish between EOF and no data!"
8263 echo "I can't compile the test program--assuming errno EAGAIN will do."
8270 echo "Using $hint value $eagain."
8271 echo "Your read() returns $rd_nodata when no data is present."
8272 case "$d_eofnblk" in
8273 "$define") echo "And you can see EOF because read() returns 0.";;
8274 "$undef") echo "But you can't see EOF status from read() returned value.";;
8276 echo "(Assuming you can't see EOF status from read anyway.)"
8282 $rm -f try try.* .out core head.c mtry
8284 : see if fchmod exists
8288 : see if fchown exists
8292 : see if this is an fcntl system
8296 : see if sys/select.h has to be included
8297 set sys/select.h i_sysselct
8300 : see if we should include time.h, sys/time.h, or both
8302 if test "X$timeincl" = X; then
8303 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8304 $echo $n "I'm now running the test program...$c"
8305 $cat >try.c <<'EOCP'
8306 #include <sys/types.h>
8311 #ifdef SYSTIMEKERNEL
8314 #include <sys/time.h>
8317 #include <sys/select.h>
8326 struct timezone tzp;
8328 if (foo.tm_sec == foo.tm_sec)
8331 if (bar.tv_sec == bar.tv_sec)
8338 for s_timezone in '-DS_TIMEZONE' ''; do
8340 for s_timeval in '-DS_TIMEVAL' ''; do
8341 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8342 for i_time in '' '-DI_TIME'; do
8343 for i_systime in '-DI_SYSTIME' ''; do
8346 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8347 if eval $compile; then
8348 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8352 $echo $n "Succeeded with $flags$c"
8364 *SYSTIMEKERNEL*) i_systimek="$define"
8365 timeincl=`./findhdr sys/time.h`
8366 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8367 *) i_systimek="$undef";;
8370 *I_TIME*) i_time="$define"
8371 timeincl=`./findhdr time.h`" $timeincl"
8372 echo "We'll include <time.h>." >&4;;
8373 *) i_time="$undef";;
8376 *I_SYSTIME*) i_systime="$define"
8377 timeincl=`./findhdr sys/time.h`" $timeincl"
8378 echo "We'll include <sys/time.h>." >&4;;
8379 *) i_systime="$undef";;
8384 : check for fd_set items
8387 Checking to see how well your C compiler handles fd_set and friends ...
8389 $cat >fd_set.c <<EOCP
8390 #$i_systime I_SYS_TIME
8391 #$i_sysselct I_SYS_SELECT
8392 #$d_socket HAS_SOCKET
8393 #include <sys/types.h>
8395 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8398 #include <sys/time.h>
8401 #include <sys/select.h>
8410 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8417 set fd_set -DTRYBITS
8418 if eval $compile; then
8419 d_fds_bits="$define"
8421 echo "Well, your system knows about the normal fd_set typedef..." >&4
8423 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8424 d_fd_macros="$define"
8427 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8429 d_fd_macros="$undef"
8433 Hmm, your compiler has some difficulty with fd_set. Checking further...
8436 if eval $compile; then
8439 echo "Well, your system has some sort of fd_set available..." >&4
8441 echo "and you have the normal fd_set macros." >&4
8442 d_fd_macros="$define"
8445 but not the normal fd_set macros! Gross! More work for me...
8447 d_fd_macros="$undef"
8450 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8453 d_fd_macros="$undef"
8458 : see if fgetpos exists
8459 set fgetpos d_fgetpos
8462 : see if flock exists
8466 : see if fork exists
8470 : see if pathconf exists
8471 set pathconf d_pathconf
8474 : see if fpathconf exists
8475 set fpathconf d_fpathconf
8479 : see if llseek exists
8485 echo $n "Checking to see if your system supports off64_t...$c" >&4
8487 #include <sys/types.h>
8489 off64_t foo() { off64_t x; x = 7; return x; }'
8491 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8493 echo " Yup, it does." >&4
8496 echo " Nope, it doesn't." >&4
8502 : check for fpos64_t
8504 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8506 #include <sys/stdio.h>
8507 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8509 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8511 echo " Yup, it does." >&4
8514 echo " Nope, it doesn't." >&4
8520 : see if fseeko exists
8524 : see if fsetpos exists
8525 set fsetpos d_fsetpos
8528 : see if this is a sys/param system
8529 set sys/param.h i_sysparam
8532 : see if this is a sys/mount.h system
8533 set sys/mount.h i_sysmount
8537 : see if statfs exists
8541 : see if fstatfs exists
8542 set fstatfs d_fstatfs
8545 : see if statfs knows about mount flags
8546 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8550 : see if statvfs exists
8551 set statvfs d_statvfs
8554 : see if fstatvfs exists
8555 set fstatvfs d_fstatvfs
8559 : see if ftello exists
8563 : see if getgrent exists
8564 set getgrent d_getgrent
8567 : see if gethostbyaddr exists
8568 set gethostbyaddr d_gethbyaddr
8571 : see if gethostbyname exists
8572 set gethostbyname d_gethbyname
8575 : see if gethostent exists
8576 set gethostent d_gethent
8579 : see how we will look up host name
8582 if set gethostname val -f d_gethname; eval $csym; $val; then
8583 echo 'gethostname() found.' >&4
8584 d_gethname="$define"
8587 if set uname val -f d_uname; eval $csym; $val; then
8590 uname() was found, but you're running xenix, and older versions of xenix
8591 have a broken uname(). If you don't really know whether your xenix is old
8592 enough to have a broken system call, use the default answer.
8599 rp='Is your uname() broken?'
8602 n*) d_uname="$define"; call=uname;;
8605 echo 'uname() found.' >&4
8612 case "$d_gethname" in
8613 '') d_gethname="$undef";;
8616 '') d_uname="$undef";;
8618 case "$d_uname$d_gethname" in
8623 Every now and then someone has a $call() that lies about the hostname
8624 but can't be fixed for political or economic reasons. If you wish, I can
8625 pretend $call() isn't there and maybe compute hostname at run-time
8626 thanks to the '$phostname' command.
8629 rp="Shall I ignore $call() from now on?"
8632 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8635 case "$phostname" in
8637 *) case "$aphostname" in
8643 file=`./loc $file $file $pth`
8644 aphostname=`echo $file $*`
8649 case "$d_uname$d_gethname" in
8652 case "$phostname" in
8654 echo "There will be no way for $package to get your hostname." >&4;;
8656 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8660 case "$d_phostname" in
8661 '') d_phostname="$undef";;
8664 : see if this is a netdb.h system
8668 : see if prototypes for various gethostxxx netdb.h functions are available
8670 set d_gethostprotos gethostent $i_netdb netdb.h
8673 : see if getlogin exists
8674 set getlogin d_getlogin
8677 : see if getmntent exists
8678 set getmntent d_getmntent
8681 : see if getnetbyaddr exists
8682 set getnetbyaddr d_getnbyaddr
8685 : see if getnetbyname exists
8686 set getnetbyname d_getnbyname
8689 : see if getnetent exists
8690 set getnetent d_getnent
8693 : see if prototypes for various getnetxxx netdb.h functions are available
8695 set d_getnetprotos getnetent $i_netdb netdb.h
8699 : see if getprotobyname exists
8700 set getprotobyname d_getpbyname
8703 : see if getprotobynumber exists
8704 set getprotobynumber d_getpbynumber
8707 : see if getprotoent exists
8708 set getprotoent d_getpent
8711 : see if getpgid exists
8712 set getpgid d_getpgid
8715 : see if getpgrp2 exists
8716 set getpgrp2 d_getpgrp2
8719 : see if getppid exists
8720 set getppid d_getppid
8723 : see if getpriority exists
8724 set getpriority d_getprior
8727 : see if prototypes for various getprotoxxx netdb.h functions are available
8729 set d_getprotoprotos getprotoent $i_netdb netdb.h
8732 : see if getpwent exists
8733 set getpwent d_getpwent
8737 : see if getservbyname exists
8738 set getservbyname d_getsbyname
8741 : see if getservbyport exists
8742 set getservbyport d_getsbyport
8745 : see if getservent exists
8746 set getservent d_getsent
8749 : see if prototypes for various getservxxx netdb.h functions are available
8751 set d_getservprotos getservent $i_netdb netdb.h
8754 : see if getspent exists
8755 set getspent d_getspent
8758 : see if getspnam exists
8759 set getspnam d_getspnam
8762 : see if gettimeofday or ftime exists
8763 set gettimeofday d_gettimeod
8765 case "$d_gettimeod" in
8771 val="$undef"; set d_ftime; eval $setvar
8774 case "$d_gettimeod$d_ftime" in
8777 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8781 : see if this is an grp system
8787 xxx=`./findhdr grp.h`
8788 $cppstdin $cppflags $cppminus < $xxx >$$.h
8790 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8802 set d_grpasswd; eval $setvar
8806 : see if hasmntopt exists
8807 set hasmntopt d_hasmntopt
8810 : see if this is a netinet/in.h or sys/in.h system
8811 set netinet/in.h i_niin sys/in.h i_sysin
8814 : see if arpa/inet.h has to be included
8815 set arpa/inet.h i_arpainet
8818 : see if htonl --and friends-- exists
8823 : Maybe they are macros.
8828 #include <sys/types.h>
8829 #$i_niin I_NETINET_IN
8831 #$i_arpainet I_ARPA_INET
8833 #include <netinet/in.h>
8839 #include <arpa/inet.h>
8842 printf("Defined as a macro.");
8845 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8846 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8848 echo "But it seems to be defined as a macro." >&4
8856 : see which of string.h or strings.h is needed
8858 strings=`./findhdr string.h`
8859 if $test "$strings" && $test -r "$strings"; then
8860 echo "Using <string.h> instead of <strings.h>." >&4
8864 strings=`./findhdr strings.h`
8865 if $test "$strings" && $test -r "$strings"; then
8866 echo "Using <strings.h> instead of <string.h>." >&4
8868 echo "No string header found -- You'll surely have problems." >&4
8874 "$undef") strings=`./findhdr strings.h`;;
8875 *) strings=`./findhdr string.h`;;
8880 if set index val -f; eval $csym; $val; then
8881 if set strchr val -f d_strchr; eval $csym; $val; then
8882 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8885 echo "strchr() found." >&4
8889 echo "index() found." >&4
8894 echo "index() found." >&4
8897 if set strchr val -f d_strchr; eval $csym; $val; then
8900 echo "strchr() found." >&4
8902 echo "No index() or strchr() found!" >&4
8907 set d_strchr; eval $setvar
8909 set d_index; eval $setvar
8911 : check whether inet_aton exists
8912 set inet_aton d_inetaton
8917 $cat >isascii.c <<'EOCP'
8929 if eval $compile; then
8930 echo "isascii() found." >&4
8933 echo "isascii() NOT found." >&4
8940 : see if killpg exists
8944 : see if lchown exists
8946 $cat > try.c <<'EOCP'
8947 /* System header to define __stub macros and hopefully few prototypes,
8948 which can conflict with char lchown(); below. */
8950 /* Override any gcc2 internal prototype to avoid an error. */
8951 /* We use char because int might match the return type of a gcc2
8952 builtin and then its argument prototype would still apply. */
8955 /* The GNU C library defines this for functions which it implements
8956 to always fail with ENOSYS. Some functions are actually named
8957 something starting with __ and the normal name is an alias. */
8958 #if defined (__stub_lchown) || defined (__stub___lchown)
8966 if eval $compile; then
8967 $echo "lchown() found." >&4
8970 $echo "lchown() NOT found." >&4
8976 : See if number of significant digits in a double precision number is known
8978 $cat >ldbl_dig.c <<EOM
8988 printf("Contains LDBL_DIG");
8991 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
8992 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
8993 echo "LDBL_DIG found." >&4
8996 echo "LDBL_DIG NOT found." >&4
9003 : see if link exists
9007 : see if localeconv exists
9008 set localeconv d_locconv
9011 : see if lockf exists
9015 : see if lstat exists
9019 : see if madvise exists
9020 set madvise d_madvise
9023 : see if mblen exists
9027 : see if mbstowcs exists
9028 set mbstowcs d_mbstowcs
9031 : see if mbtowc exists
9035 : see if memchr exists
9039 : see if memcmp exists
9043 : see if memcpy exists
9047 : see if memmove exists
9048 set memmove d_memmove
9051 : see if memset exists
9055 : see if mkdir exists
9059 : see if mkfifo exists
9063 : see if mktime exists
9067 : see if this is a sys/mman.h system
9068 set sys/mman.h i_sysmman
9071 : see if mmap exists
9074 : see what shmat returns
9075 : default to something harmless
9077 case "$i_sysmman$d_mmap" in
9079 $cat >mmap.c <<'END'
9080 #include <sys/mman.h>
9083 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9088 echo "and it returns ($mmaptype)." >&4
9094 : see if mprotect exists
9095 set mprotect d_mprotect
9098 : see if msgctl exists
9102 : see if msgget exists
9106 : see if msgsnd exists
9110 : see if msgrcv exists
9114 : see how much of the 'msg*(2)' library is present.
9117 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9118 *"$undef"*) h_msg=false;;
9122 case "`ipcs 2>&1`" in
9123 "SVID messages"*"not configured"*)
9124 echo "Your $osname does not have the msg*(2) configured." >&4
9139 : we could also check for sys/ipc.h ...
9140 if $h_msg && $test `./findhdr sys/msg.h`; then
9141 echo "You have the full msg*(2) library." >&4
9144 echo "You don't have the full msg*(2) library." >&4
9150 : see if msync exists
9154 : see if munmap exists
9158 : see if nice exists
9162 : see if POSIX threads are available
9163 if test "X$usethreads" = "X$define"; then
9164 set pthread.h i_pthread
9172 : how to create joinable pthreads
9173 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9175 echo "Checking what constant to use for creating joinable pthreads..." >&4
9176 $cat >try.c <<'EOCP'
9177 #include <pthread.h>
9179 int detachstate = JOINABLE;
9182 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9183 if eval $compile; then
9184 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9185 val="$undef" # Yes, undef.
9186 set d_old_pthread_create_joinable
9189 set old_pthread_create_joinable
9192 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9193 if eval $compile; then
9194 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9196 set d_old_pthread_create_joinable
9198 val=PTHREAD_CREATE_UNDETACHED
9199 set old_pthread_create_joinable
9202 set try -DJOINABLE=__UNDETACHED
9203 if eval $compile; then
9204 echo "You seem to use __UNDETACHED." >&4
9206 set d_old_pthread_create_joinable
9209 set old_pthread_create_joinable
9212 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9214 set d_old_pthread_create_joinable
9217 set old_pthread_create_joinable
9224 d_old_pthread_create_joinable="$undef"
9225 old_pthread_create_joinable=""
9228 : see if pause exists
9232 : see if pipe exists
9236 : see if poll exists
9241 : see whether the various POSIXish _yields exist
9243 #include <pthread.h>
9249 #ifdef PTHREAD_YIELD
9252 #ifdef PTHREAD_YIELD_NULL
9253 pthread_yield(NULL);
9259 : see if sched_yield exists
9260 set try -DSCHED_YIELD
9261 if eval $compile; then
9263 sched_yield='sched_yield()'
9267 case "$usethreads" in
9270 $define) echo 'sched_yield() found.' >&4 ;;
9271 *) echo 'sched_yield() NOT found.' >&4 ;;
9277 : see if pthread_yield exists
9278 set try -DPTHREAD_YIELD
9279 if eval $compile; then
9281 case "$sched_yield" in
9282 '') sched_yield='pthread_yield()' ;;
9285 set try -DPTHREAD_YIELD_NULL
9286 if eval $compile; then
9288 case "$sched_yield" in
9289 '') sched_yield='pthread_yield(NULL)' ;;
9295 case "$usethreads" in
9298 $define) echo 'pthread_yield() found.' >&4 ;;
9299 *) echo 'pthread_yield() NOT found.' >&4 ;;
9306 case "$sched_yield" in
9307 '') sched_yield=undef ;;
9312 : see if this is a pwd.h system
9318 xxx=`./findhdr pwd.h`
9319 $cppstdin $cppflags $cppminus < $xxx >$$.h
9321 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9329 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9337 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9345 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9353 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9361 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9369 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9377 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9389 set d_pwquota; eval $setvar
9390 set d_pwage; eval $setvar
9391 set d_pwchange; eval $setvar
9392 set d_pwclass; eval $setvar
9393 set d_pwexpire; eval $setvar
9394 set d_pwcomment; eval $setvar
9395 set d_pwgecos; eval $setvar
9396 set d_pwpasswd; eval $setvar
9400 : see if readdir and friends exist
9401 set readdir d_readdir
9403 set seekdir d_seekdir
9405 set telldir d_telldir
9407 set rewinddir d_rewinddir
9410 : see if readlink exists
9411 set readlink d_readlink
9414 : see if readv exists
9418 : see if rename exists
9422 : see if rmdir exists
9426 : see if memory.h is available.
9431 : See if it conflicts with string.h
9437 $cppstdin $cppflags $cppminus < $strings > mem.h
9438 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9440 echo "We won't be including <memory.h>."
9450 : can bcopy handle overlapping blocks?
9455 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9462 $cat >>try.c <<'EOCP'
9465 # include <memory.h>
9468 # include <stdlib.h>
9471 # include <string.h>
9473 # include <strings.h>
9476 # include <unistd.h> /* Needed for NetBSD */
9480 char buf[128], abc[128];
9486 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9488 for (align = 7; align >= 0; align--) {
9489 for (len = 36; len; len--) {
9492 for (off = 1; off <= len; off++) {
9493 bcopy(b, b+off, len);
9494 bcopy(b+off, b, len);
9495 if (bcmp(b, abc, len))
9504 if eval $compile_ok; then
9505 if ./try 2>/dev/null; then
9509 echo "It can't, sorry."
9510 case "$d_memmove" in
9511 "$define") echo "But that's Ok since you have memmove()." ;;
9515 echo "(I can't compile the test program, so we'll assume not...)"
9516 case "$d_memmove" in
9517 "$define") echo "But that's Ok since you have memmove()." ;;
9522 $rm -f try.* try core
9526 : can memcpy handle overlapping blocks?
9531 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9538 $cat >>try.c <<'EOCP'
9541 # include <memory.h>
9544 # include <stdlib.h>
9547 # include <string.h>
9549 # include <strings.h>
9552 # include <unistd.h> /* Needed for NetBSD */
9556 char buf[128], abc[128];
9562 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9563 try to store the string in read-only memory. */
9564 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9566 for (align = 7; align >= 0; align--) {
9567 for (len = 36; len; len--) {
9569 memcpy(b, abc, len);
9570 for (off = 1; off <= len; off++) {
9571 memcpy(b+off, b, len);
9572 memcpy(b, b+off, len);
9573 if (memcmp(b, abc, len))
9582 if eval $compile_ok; then
9583 if ./try 2>/dev/null; then
9587 echo "It can't, sorry."
9588 case "$d_memmove" in
9589 "$define") echo "But that's Ok since you have memmove()." ;;
9593 echo "(I can't compile the test program, so we'll assume not...)"
9594 case "$d_memmove" in
9595 "$define") echo "But that's Ok since you have memmove()." ;;
9600 $rm -f try.* try core
9604 : can memcmp be trusted to compare relative magnitude?
9609 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9616 $cat >>try.c <<'EOCP'
9619 # include <memory.h>
9622 # include <stdlib.h>
9625 # include <string.h>
9627 # include <strings.h>
9630 # include <unistd.h> /* Needed for NetBSD */
9636 if ((a < b) && memcmp(&a, &b, 1) < 0)
9642 if eval $compile_ok; then
9643 if ./try 2>/dev/null; then
9647 echo "No, it can't (it uses signed chars)."
9650 echo "(I can't compile the test program, so we'll assume not...)"
9654 $rm -f try.* try core
9658 : see if select exists
9662 : see if semctl exists
9666 : see if semget exists
9670 : see if semop exists
9674 : see how much of the 'sem*(2)' library is present.
9677 case "$d_semctl$d_semget$d_semop" in
9678 *"$undef"*) h_sem=false;;
9682 case "`ipcs 2>&1`" in
9683 "SVID messages"*"not configured"*)
9684 echo "Your $osname does not have the sem*(2) configured." >&4
9697 : we could also check for sys/ipc.h ...
9698 if $h_sem && $test `./findhdr sys/sem.h`; then
9699 echo "You have the full sem*(2) library." >&4
9702 echo "You don't have the full sem*(2) library." >&4
9708 : see whether sys/sem.h defines union semun
9710 $cat > try.c <<'END'
9711 #include <sys/types.h>
9712 #include <sys/ipc.h>
9713 #include <sys/sem.h>
9714 int main () { union semun semun; semun.buf = 0; }
9717 if eval $compile; then
9718 echo "You have union semun in <sys/sem.h>." >&4
9721 echo "You do not have union semun in <sys/sem.h>." >&4
9724 $rm -f try try.c try.h
9728 : see how to do semctl IPC_STAT
9731 : see whether semctl IPC_STAT can use union semun
9736 # define S_IRUSR S_IREAD
9737 # define S_IWUSR S_IWRITE
9738 # define S_IXUSR S_IEXEC
9740 # define S_IRUSR 0400
9741 # define S_IWUSR 0200
9742 # define S_IXUSR 0100
9744 # define S_IRGRP (S_IRUSR>>3)
9745 # define S_IWGRP (S_IWUSR>>3)
9746 # define S_IXGRP (S_IXUSR>>3)
9747 # define S_IROTH (S_IRUSR>>6)
9748 # define S_IWOTH (S_IWUSR>>6)
9749 # define S_IXOTH (S_IXUSR>>6)
9752 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9753 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9754 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9759 #include <sys/types.h>
9760 #include <sys/ipc.h>
9761 #include <sys/sem.h>
9762 #include <sys/stat.h>
9769 #$d_union_semun HAS_UNION_SEMUN
9772 #ifndef HAS_UNION_SEMUN
9775 struct semid_ds *buf;
9776 unsigned short *array;
9782 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9783 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9785 struct semid_ds argbuf;
9788 st = semctl(sem, 0, IPC_STAT, arg);
9792 # endif /* IPC_STAT */
9793 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9795 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9796 # endif /* IPC_RMID */
9797 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9799 #endif /* IPC_PRIVATE && ... */
9800 printf("semget failed: errno = %d\n", errno);
9806 if eval $compile; then
9809 semun) val="$define" ;;
9815 case "$d_semctl_semun" in
9817 echo "You can use union semun for semctl IPC_STAT." >&4
9820 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9825 : see whether semctl IPC_STAT can use struct semid_ds pointer
9826 $cat > try.c <<'END'
9827 #include <sys/types.h>
9828 #include <sys/ipc.h>
9829 #include <sys/sem.h>
9830 #include <sys/stat.h>
9838 struct semid_ds arg;
9841 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9842 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9845 st = semctl(sem, 0, IPC_STAT, &arg);
9847 printf("semid_ds\n");
9849 # endif /* IPC_STAT */
9850 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9852 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9853 # endif /* IPC_RMID */
9854 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9856 #endif /* IPC_PRIVATE && ... */
9857 printf("semget failed: errno = %d\n", errno);
9864 if eval $compile; then
9867 semid_ds) val="$define" ;;
9871 set d_semctl_semid_ds
9873 case "$d_semctl_semid_ds" in
9875 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9877 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9884 # We do not have the full sem*(2) library, so assume we can not
9890 set d_semctl_semid_ds
9895 : see if setegid exists
9896 set setegid d_setegid
9899 : see if seteuid exists
9900 set seteuid d_seteuid
9903 : see if setgrent exists
9904 set setgrent d_setgrent
9907 : see if sethostent exists
9908 set sethostent d_sethent
9911 : see if setlinebuf exists
9912 set setlinebuf d_setlinebuf
9915 : see if setlocale exists
9916 set setlocale d_setlocale
9919 : see if setnetent exists
9920 set setnetent d_setnent
9923 : see if setprotoent exists
9924 set setprotoent d_setpent
9927 : see if setpgid exists
9928 set setpgid d_setpgid
9931 : see if setpgrp2 exists
9932 set setpgrp2 d_setpgrp2
9935 : see if setpriority exists
9936 set setpriority d_setprior
9939 : see if setpwent exists
9940 set setpwent d_setpwent
9943 : see if setregid exists
9944 set setregid d_setregid
9946 set setresgid d_setresgid
9949 : see if setreuid exists
9950 set setreuid d_setreuid
9952 set setresuid d_setresuid
9955 : see if setrgid exists
9956 set setrgid d_setrgid
9959 : see if setruid exists
9960 set setruid d_setruid
9963 : see if setservent exists
9964 set setservent d_setsent
9967 : see if setsid exists
9971 : see if setspent exists
9972 set setspent d_setspent
9975 : see if setvbuf exists
9976 set setvbuf d_setvbuf
9979 : see if sfio.h is available
9984 : see if sfio library is available
9995 : Ok, but do we want to use it.
9999 true|$define|[yY]*) dflt='y';;
10002 echo "$package can use the sfio library, but it is experimental."
10003 rp="You seem to have sfio available, do you want to try using it?"
10007 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10009 : Remove sfio from list of libraries to use
10010 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10013 echo "libs = $libs" >&4
10017 *) case "$usesfio" in
10018 true|$define|[yY]*)
10019 echo "Sorry, cannot find sfio on this machine" >&4
10020 echo "Ignoring your setting of usesfio=$usesfio" >&4
10028 $define) usesfio='true';;
10029 *) usesfio='false';;
10032 : see if shmctl exists
10033 set shmctl d_shmctl
10036 : see if shmget exists
10037 set shmget d_shmget
10040 : see if shmat exists
10043 : see what shmat returns
10046 $cat >shmat.c <<'END'
10047 #include <sys/shm.h>
10050 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10055 echo "and it returns ($shmattype)." >&4
10056 : see if a prototype for shmat is available
10057 xxx=`./findhdr sys/shm.h`
10058 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10059 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10070 set d_shmatprototype
10073 : see if shmdt exists
10077 : see how much of the 'shm*(2)' library is present.
10080 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10081 *"$undef"*) h_shm=false;;
10085 case "`ipcs 2>&1`" in
10086 "SVID shared memory"*"not configured"*)
10087 echo "Your $osname does not have the shm*(2) configured." >&4
10090 set shmctl d_shmctl
10092 set shmget d_shmget
10102 : we could also check for sys/ipc.h ...
10103 if $h_shm && $test `./findhdr sys/shm.h`; then
10104 echo "You have the full shm*(2) library." >&4
10107 echo "You don't have the full shm*(2) library." >&4
10114 : see if we have sigaction
10115 if set sigaction val -f d_sigaction; eval $csym; $val; then
10116 echo 'sigaction() found.' >&4
10117 $cat > try.c <<'EOP'
10119 #include <sys/types.h>
10120 #include <signal.h>
10123 struct sigaction act, oact;
10127 if eval $compile_ok; then
10130 echo "But you don't seem to have a useable struct sigaction." >&4
10134 echo 'sigaction NOT found.' >&4
10137 set d_sigaction; eval $setvar
10138 $rm -f try try$_o try.c
10140 : see if sigsetjmp exists
10142 case "$d_sigsetjmp" in
10144 $cat >try.c <<'EOP'
10145 #include <setjmp.h>
10150 if (sigsetjmp(env,1))
10153 siglongjmp(env, 1);
10158 if eval $compile; then
10159 if ./try >/dev/null 2>&1; then
10160 echo "POSIX sigsetjmp found." >&4
10164 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10170 echo "sigsetjmp not found." >&4
10174 *) val="$d_sigsetjmp"
10175 case "$d_sigsetjmp" in
10176 $define) echo "POSIX sigsetjmp found." >&4;;
10177 $undef) echo "sigsetjmp not found." >&4;;
10185 : see if sys/stat.h is available
10186 set sys/stat.h i_sysstat
10189 : see if stat knows about block sizes
10191 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10194 : see if _ptr and _cnt from stdio act std
10196 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10197 echo "(Looks like you have stdio.h from Linux.)"
10198 case "$stdio_ptr" in
10199 '') stdio_ptr='((fp)->_IO_read_ptr)'
10202 *) ptr_lval=$d_stdio_ptr_lval;;
10204 case "$stdio_cnt" in
10205 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10208 *) cnt_lval=$d_stdio_cnt_lval;;
10210 case "$stdio_base" in
10211 '') stdio_base='((fp)->_IO_read_base)';;
10213 case "$stdio_bufsiz" in
10214 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10217 case "$stdio_ptr" in
10218 '') stdio_ptr='((fp)->_ptr)'
10221 *) ptr_lval=$d_stdio_ptr_lval;;
10223 case "$stdio_cnt" in
10224 '') stdio_cnt='((fp)->_cnt)'
10227 *) cnt_lval=$d_stdio_cnt_lval;;
10229 case "$stdio_base" in
10230 '') stdio_base='((fp)->_base)';;
10232 case "$stdio_bufsiz" in
10233 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10236 : test whether _ptr and _cnt really work
10237 echo "Checking how std your stdio is..." >&4
10240 #define FILE_ptr(fp) $stdio_ptr
10241 #define FILE_cnt(fp) $stdio_cnt
10243 FILE *fp = fopen("try.c", "r");
10246 18 <= FILE_cnt(fp) &&
10247 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10255 if eval $compile; then
10257 echo "Your stdio acts pretty std."
10260 echo "Your stdio isn't very std."
10263 echo "Your stdio doesn't appear very std."
10269 : Can _ptr be used as an lvalue?
10270 case "$d_stdstdio$ptr_lval" in
10271 $define$define) val=$define ;;
10274 set d_stdio_ptr_lval
10277 : Can _cnt be used as an lvalue?
10278 case "$d_stdstdio$cnt_lval" in
10279 $define$define) val=$define ;;
10282 set d_stdio_cnt_lval
10285 : see if _base is also standard
10287 case "$d_stdstdio" in
10291 #define FILE_base(fp) $stdio_base
10292 #define FILE_bufsiz(fp) $stdio_bufsiz
10294 FILE *fp = fopen("try.c", "r");
10297 19 <= FILE_bufsiz(fp) &&
10298 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10305 if eval $compile; then
10307 echo "And its _base field acts std."
10310 echo "But its _base field isn't std."
10313 echo "However, it seems to be lacking the _base field."
10322 Checking how to access stdio streams by file descriptor number...
10324 case "$stdio_stream_array" in
10325 '') $cat >try.c <<EOCP
10328 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10332 for s in _iob __iob __sF
10334 set try -DSTDIO_STREAM_ARRAY=$s
10335 if eval $compile; then
10336 case "`./try$exe_ext`" in
10337 yes) stdio_stream_array=$s; break ;;
10341 $rm -f try.* try$exe_ext
10343 case "$stdio_stream_array" in
10345 I can't figure out how to access stdio streams by file descriptor number.
10347 d_stdio_stream_array="$undef"
10350 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10352 d_stdio_stream_array="$define"
10356 : see if strcoll exists
10357 set strcoll d_strcoll
10360 : check for structure copying
10362 echo "Checking to see if your C compiler can copy structs..." >&4
10363 $cat >try.c <<'EOCP'
10373 if $cc -c try.c >/dev/null 2>&1 ; then
10375 echo "Yup, it can."
10378 echo "Nope, it can't."
10384 : see if strerror and/or sys_errlist[] exist
10386 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10387 if set strerror val -f d_strerror; eval $csym; $val; then
10388 echo 'strerror() found.' >&4
10389 d_strerror="$define"
10390 d_strerrm='strerror(e)'
10391 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10392 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10393 d_syserrlst="$define"
10395 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10396 d_syserrlst="$undef"
10398 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10399 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10400 echo 'strerror() found in string header.' >&4
10401 d_strerror="$define"
10402 d_strerrm='strerror(e)'
10403 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10404 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10405 d_syserrlst="$define"
10407 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10408 d_syserrlst="$undef"
10410 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10411 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10412 d_strerror="$undef"
10413 d_syserrlst="$define"
10414 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10416 echo 'strerror() and sys_errlist[] NOT found.' >&4
10417 d_strerror="$undef"
10418 d_syserrlst="$undef"
10419 d_strerrm='"unknown"'
10423 : see if strtod exists
10424 set strtod d_strtod
10427 : see if strtol exists
10428 set strtol d_strtol
10431 : see if strtoul exists
10432 set strtoul d_strtoul
10435 : see if strtoull exists
10436 set strtoull d_strtoull
10439 : see if strxfrm exists
10440 set strxfrm d_strxfrm
10443 : see if symlink exists
10444 set symlink d_symlink
10447 : see if syscall exists
10448 set syscall d_syscall
10451 : see if sysconf exists
10452 set sysconf d_sysconf
10455 : see if system exists
10456 set system d_system
10459 : see if tcgetpgrp exists
10460 set tcgetpgrp d_tcgetpgrp
10463 : see if tcsetpgrp exists
10464 set tcsetpgrp d_tcsetpgrp
10467 : see if sys/types.h has to be included
10468 set sys/types.h i_systypes
10471 : see if prototype for telldir is available
10473 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10476 : define an is-a-typedef? function
10477 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10479 "") inclist="sys/types.h";;
10481 eval "varval=\$$var";
10485 for inc in $inclist; do
10486 echo "#include <$inc>" >>temp.c;
10488 echo "#ifdef $type" >> temp.c;
10489 echo "printf(\"We have $type\");" >> temp.c;
10490 echo "#endif" >> temp.c;
10491 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10492 if $contains $type temp.E >/dev/null 2>&1; then
10493 eval "$var=\$type";
10498 *) eval "$var=\$varval";;
10501 : define an is-a-typedef? function that prompts if the type is not available.
10502 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10504 "") inclist="sys/types.h";;
10506 eval "varval=\$$var";
10510 for inc in $inclist; do
10511 echo "#include <$inc>" >>temp.c;
10513 echo "#ifdef $type" >> temp.c;
10514 echo "printf(\"We have $type\");" >> temp.c;
10515 echo "#endif" >> temp.c;
10516 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10518 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10519 if $contains $type temp.E >/dev/null 2>&1; then
10520 echo "$type found." >&4;
10521 eval "$var=\$type";
10523 echo "$type NOT found." >&4;
10529 *) eval "$var=\$varval";;
10532 : see if this is a sys/times.h system
10533 set sys/times.h i_systimes
10536 : see if times exists
10538 if set times val -f d_times; eval $csym; $val; then
10539 echo 'times() found.' >&4
10542 case "$i_systimes" in
10543 "$define") inc='sys/times.h';;
10545 rp="What is the type returned by times() on this system?"
10546 set clock_t clocktype long stdio.h sys/types.h $inc
10549 echo 'times() NOT found, hope that will do.' >&4
10554 : see if truncate exists
10555 set truncate d_truncate
10558 : see if tzname[] exists
10560 if set tzname val -a d_tzname; eval $csym; $val; then
10562 echo 'tzname[] found.' >&4
10565 echo 'tzname[] NOT found.' >&4
10570 : see if umask exists
10574 : backward compatibility for d_hvfork
10575 if test X$d_hvfork != X; then
10576 d_vfork="$d_hvfork"
10579 : see if there is a vfork
10584 : Ok, but do we want to use it. vfork is reportedly unreliable in
10585 : perl on Solaris 2.x, and probably elsewhere.
10589 case "$usevfork" in
10595 Perl can only use a vfork() that doesn't suffer from strict
10596 restrictions on calling functions or modifying global data in
10597 the child. For example, glibc-2.1 contains such a vfork()
10598 that is unsuitable. If your system provides a proper fork()
10599 call, chances are that you do NOT want perl to use vfork().
10602 rp="Do you still want to use vfork()?"
10607 echo "Ok, we won't use vfork()."
10616 $define) usevfork='true';;
10617 *) usevfork='false';;
10620 : see if this is an sysdir system
10621 set sys/dir.h i_sysdir
10624 : see if this is an sysndir system
10625 set sys/ndir.h i_sysndir
10628 : see if closedir exists
10629 set closedir d_closedir
10632 case "$d_closedir" in
10635 echo "Checking whether closedir() returns a status..." >&4
10636 cat > closedir.c <<EOM
10637 #$i_dirent I_DIRENT /**/
10638 #$i_sysdir I_SYS_DIR /**/
10639 #$i_sysndir I_SYS_NDIR /**/
10640 #$i_systypes I_SYS_TYPES /**/
10642 #if defined(I_SYS_TYPES)
10643 #include <sys/types.h>
10645 #if defined(I_DIRENT)
10646 #include <dirent.h>
10647 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10648 #include <sys/dir.h>
10652 #include <sys/ndir.h>
10656 #include <ndir.h> /* may be wrong in the future */
10658 #include <sys/dir.h>
10663 int main() { return closedir(opendir(".")); }
10666 if eval $compile_ok; then
10667 if ./closedir > /dev/null 2>&1 ; then
10668 echo "Yes, it does."
10671 echo "No, it doesn't."
10675 echo "(I can't seem to compile the test program--assuming it doesn't)"
10683 set d_void_closedir
10686 : check for volatile keyword
10688 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10689 $cat >try.c <<'EOCP'
10692 typedef struct _goo_struct goo_struct;
10693 goo_struct * volatile goo = ((goo_struct *)0);
10694 struct _goo_struct {
10699 typedef unsigned short foo_t;
10700 char *volatile foo;
10702 volatile foo_t blech;
10706 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10708 echo "Yup, it does."
10711 echo "Nope, it doesn't."
10717 : see if there is a wait4
10721 : see if waitpid exists
10722 set waitpid d_waitpid
10725 : see if wcstombs exists
10726 set wcstombs d_wcstombs
10729 : see if wctomb exists
10730 set wctomb d_wctomb
10733 : see if writev exists
10734 set writev d_writev
10737 : preserve RCS keywords in files with variable substitution, grrr
10742 Revision='$Revision'
10744 case "$crosscompile" in
10745 ''|[nN]*) crosscompile="$undef" ;;
10749 next|rhapsody) multiarch="$define" ;;
10751 case "$multiarch" in
10752 ''|[nN]*) multiarch="$undef" ;;
10755 : check for alignment requirements
10757 case "$crosscompile$multiarch" in
10760 You seem to be either cross-compiling or doing a multiarchitecture build,
10761 skipping the memory alignment check.
10764 case "$alignbytes" in
10765 '') alignbytes=8 ;;
10769 case "$alignbytes" in
10770 '') echo "Checking alignment constraints..." >&4
10771 $cat >try.c <<'EOCP'
10778 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10782 if eval $compile_ok; then
10786 echo "(I can't seem to compile the test program...)"
10789 *) dflt="$alignbytes"
10792 rp="Doubles must be aligned on a how-many-byte boundary?"
10800 : check for ordering of bytes in a long
10802 case "$crosscompile$multiarch" in
10805 You seem to be either cross-compiling or doing a multiarchitecture build,
10806 skipping the byteorder check.
10812 case "$byteorder" in
10815 In the following, larger digits indicate more significance. A big-endian
10816 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10817 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10818 machines may have weird orders like 3412. A Cray will report 87654321,
10819 an Alpha will report 12345678. If the test program works the default is
10821 I'm now running the test program...
10823 $cat >try.c <<'EOCP'
10830 char c[sizeof(long)];
10833 if (sizeof(long) > 4)
10834 u.l = (0x08070605L << 32) | 0x04030201L;
10837 for (i = 0; i < sizeof(long); i++)
10838 printf("%c", u.c[i]+'0');
10845 if eval $compile && ./try > /dev/null; then
10848 [1-4][1-4][1-4][1-4]|12345678|87654321)
10849 echo "(The test program ran ok.)"
10850 echo "byteorder=$dflt"
10853 ????|????????) echo "(The test program ran ok.)" ;;
10854 *) echo "(The test program didn't run right for some reason.)" ;;
10859 (I can't seem to compile the test program. Guessing big-endian...)
10862 case "$xxx_prompt" in
10864 rp="What is the order of bytes in a long?"
10878 : how do we catenate cpp tokens here?
10880 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10881 $cat >cpp_stuff.c <<'EOCP'
10882 #define RCAT(a,b)a/**/b
10883 #define ACAT(a,b)a ## b
10887 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10888 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10889 echo "Oh! Smells like ANSI's been here." >&4
10890 echo "We can catify or stringify, separately or together!"
10892 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10893 echo "Ah, yes! The good old days!" >&4
10894 echo "However, in the good old days we don't know how to stringify and"
10895 echo "catify at the same time."
10899 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10900 to have to edit the values of CAT[2-5] in config.h...
10902 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10906 : see if this is a db.h system
10912 : Check db version.
10914 echo "Checking Berkeley DB version ..." >&4
10920 #include <sys/types.h>
10925 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10926 int Major, Minor, Patch ;
10927 unsigned long Version ;
10928 (void)db_version(&Major, &Minor, &Patch) ;
10929 printf("You have Berkeley DB Version 2 or greater\n");
10931 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10932 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10933 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10934 Major, Minor, Patch) ;
10936 /* check that db.h & libdb are compatible */
10937 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10938 printf("db.h and libdb are incompatible\n") ;
10942 printf("db.h and libdb are compatible\n") ;
10944 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10945 + DB_VERSION_PATCH ;
10947 /* needs to be >= 2.3.4 */
10948 if (Version < 2003004) {
10949 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10950 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10956 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10957 printf("You have Berkeley DB Version 1\n");
10958 exit(0); /* DB version < 2: the coast is clear. */
10960 exit(1); /* <db.h> not Berkeley DB? */
10966 if eval $compile && ./try; then
10967 echo 'Looks OK.' >&4
10969 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10973 : Remove db from list of libraries to use
10974 echo "Removing unusable -ldb from library list" >&4
10975 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10978 echo "libs = $libs" >&4
10988 : Check the return type needed for hash
10990 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10996 #include <sys/types.h>
10999 #ifndef DB_VERSION_MAJOR
11000 u_int32_t hash_cb (ptr, size)
11008 info.hash = hash_cb;
11012 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11013 if $contains warning try.out >>/dev/null 2>&1 ; then
11016 db_hashtype='u_int32_t'
11019 : XXX Maybe we should just give up here.
11020 db_hashtype=u_int32_t
11022 echo "Help: I can't seem to compile the db test program." >&4
11023 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11026 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11028 *) db_hashtype=u_int32_t
11033 : Check the return type needed for prefix
11035 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11041 #include <sys/types.h>
11044 #ifndef DB_VERSION_MAJOR
11045 size_t prefix_cb (key1, key2)
11053 info.prefix = prefix_cb;
11057 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11058 if $contains warning try.out >>/dev/null 2>&1 ; then
11059 db_prefixtype='int'
11061 db_prefixtype='size_t'
11064 db_prefixtype='size_t'
11065 : XXX Maybe we should just give up here.
11067 echo "Help: I can't seem to compile the db test program." >&4
11068 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11071 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11073 *) db_prefixtype='size_t'
11077 : check for void type
11079 echo "Checking to see how well your C compiler groks the void type..." >&4
11080 case "$voidflags" in
11082 $cat >try.c <<'EOCP'
11088 extern void moo(); /* function returning void */
11089 void (*goo)(); /* ptr to func returning void */
11091 void *hue; /* generic ptr */
11104 int main() { sub(); }
11106 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11107 voidflags=$defvoidused
11108 echo "Good. It appears to support void to the level $package wants.">&4
11109 if $contains warning .out >/dev/null 2>&1; then
11110 echo "However, you might get some warnings that look like this:"
11114 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11115 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11116 echo "It supports 1..."
11117 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11118 echo "It also supports 2..."
11119 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11121 echo "And it supports 4 but not 8 definitely."
11123 echo "It doesn't support 4..."
11124 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11126 echo "But it supports 8."
11129 echo "Neither does it support 8."
11133 echo "It does not support 2..."
11134 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11136 echo "But it supports 4 and 8."
11138 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11140 echo "And it supports 4 but has not heard about 8."
11142 echo "However it supports 8 but not 4."
11147 echo "There is no support at all for void."
11152 case "$voidflags" in
11154 *) $cat >&4 <<'EOM'
11155 Support flag bits are:
11156 1: basic void declarations.
11157 2: arrays of pointers to functions returning void.
11158 4: operations between pointers to and addresses of void functions.
11159 8: generic void pointers.
11162 rp="Your void support flags add up to what?"
11170 : How can we generate normalized random numbers ?
11172 echo "Looking for a random number function..." >&4
11173 case "$randfunc" in
11175 if set drand48 val -f; eval $csym; $val; then
11177 echo "Good, found drand48()." >&4
11178 elif set random val -f; eval $csym; $val; then
11180 echo "OK, found random()." >&4
11183 echo "Yick, looks like I have to use rand()." >&4
11194 *-Dmy_rand=*|*-Dmy_srand=*)
11195 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11196 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11197 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11198 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11202 while $test "$cont"; do
11203 rp="Use which function to generate random numbers?"
11205 if $test "$ans" = "$dflt"; then
11211 if set $ans val -f; eval $csym; $val; then
11215 rp="I cannot find function $ans. Use that name anyway?"
11224 case "$randfunc" in
11226 drand01="drand48()"
11232 case "$randbits" in
11234 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11236 #$i_unistd I_UNISTD
11237 #$i_stdlib I_STDLIB
11240 # include <unistd.h>
11243 # include <stdlib.h>
11248 register unsigned long tmp;
11249 register unsigned long max = 0L;
11251 for (i = 1000; i; i--) {
11252 tmp = (unsigned long) $randfunc();
11253 if (tmp > max) max = tmp;
11255 for (i = 0; max; i++)
11261 if eval $compile_ok; then
11265 echo "(I can't seem to compile the test program...)"
11272 rp="How many bits does your $randfunc() function produce?"
11276 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11277 seedfunc="s$randfunc"
11278 randseedtype=unsigned
11282 rp="How many bits does your $randfunc() function produce?"
11285 seedfunc="s$randfunc"
11286 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11287 if set $seedfunc val -f; eval $csym; $val; then
11288 echo "(Using $seedfunc() to seed random generator)"
11290 echo "(Warning: no $seedfunc() to seed random generator)"
11293 randseedtype=unsigned
11301 echo "Determining whether or not we are on an EBCDIC system..." >&4
11302 $cat >tebcdic.c <<'EOM'
11305 if ('M'==0xd4) return 0;
11312 if eval $compile_ok; then
11314 echo "You have EBCDIC." >&4
11317 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11320 echo "I'm unable to compile the test program." >&4
11321 echo "I'll assume ASCII or some ISO Latin." >&4
11323 $rm -f tebcdic.c tebcdic
11329 Checking how to flush all pending stdio output...
11331 # I only know how to find the first 32 possibly open files on SunOS.
11332 # See also hints/sunos_4_1.sh and util.c --AD
11334 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11336 $cat >>try.c <<EOCP
11338 #$i_unistd I_UNISTD
11340 # include <unistd.h>
11342 #$d_sysconf HAS_SYSCONF
11343 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11344 #ifdef HAS_STDIO_STREAM_ARRAY
11345 # define STDIO_STREAM_ARRAY $stdio_stream_array
11348 FILE* p = fopen("try.out", "w");
11352 # ifdef TRY_FPRINTF
11356 #ifdef TRY_FFLUSH_NULL
11359 #ifdef TRY_FFLUSH_ALL
11361 long open_max = -1;
11362 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11363 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11365 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11366 open_max = sysconf(_SC_OPEN_MAX);
11369 open_max = FOPEN_MAX;
11372 open_max = OPEN_MAX;
11381 # ifdef HAS_STDIO_STREAM_ARRAY
11382 if (open_max > 0) {
11384 for (i = 0; i < open_max; i++)
11385 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11386 STDIO_STREAM_ARRAY[i]._file < open_max &&
11387 STDIO_STREAM_ARRAY[i]._flag)
11388 fflush(&STDIO_STREAM_ARRAY[i]);
11396 : first we have to find out how _not_ to flush
11397 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11399 set try -DTRY_FPUTC
11400 if eval $compile; then
11402 ./try$exe_ext 2>/dev/null
11403 if $test ! -s try.out -a "X$?" = X42; then
11409 set try -DTRY_FPRINTF
11411 if eval $compile; then
11413 ./try$exe_ext 2>/dev/null
11414 if $test ! -s try.out -a "X$?" = X42; then
11415 output=-DTRY_FPRINTF
11421 : check for fflush NULL behaviour
11422 case "$fflushNULL" in
11423 '') set try -DTRY_FFLUSH_NULL $output
11424 if eval $compile; then
11426 ./try$exe_ext 2>/dev/null
11428 if $test -s try.out -a "X$code" = X42; then
11429 fflushNULL="`$cat try.out`"
11431 if $test "X$code" != X42; then
11433 (If this test failed, don't worry, we'll try another method shortly.)
11438 $rm -f core try.core core.try.*
11439 case "$fflushNULL" in
11441 Your fflush(NULL) works okay.
11443 fflushNULL="$define"
11446 Your fflush(NULL) isn't working (contrary to ANSI C).
11448 fflushNULL="$undef"
11451 Cannot figure out whether your fflush(NULL) works or not.
11452 I'm assuming it doesn't (contrary to ANSI C).
11454 fflushNULL="$undef"
11458 $define|true|[yY]*)
11459 fflushNULL="$define"
11462 fflushNULL="$undef"
11465 : check explicit looping only if NULL did not work
11466 case "$fflushNULL" in
11468 : check for fflush all behaviour
11469 case "$fflushall" in
11470 '') set try -DTRY_FFLUSH_ALL $output
11471 if eval $compile; then
11473 (Now testing the other method--but note that also this may fail.)
11476 ./try$exe_ext 2>/dev/null
11477 if $test -s try.out -a "X$?" = X42; then
11478 fflushall="`$cat try.out`"
11481 $rm -f core try.core core.try.*
11482 case "$fflushall" in
11484 Whew. Flushing explicitly all the stdio streams works.
11486 fflushall="$define"
11489 Sigh. Flushing explicitly all the stdio streams doesn't work.
11494 Cannot figure out whether flushing stdio streams explicitly works or not.
11495 I'm assuming it doesn't.
11501 "$define"|true|[yY]*)
11502 fflushall="$define"
11509 *) fflushall="$undef"
11512 case "$fflushNULL$fflushall" in
11515 I cannot figure out how to flush pending stdio output.
11519 $rm -f try.* try$exe_ext
11521 : see what type file positions are declared as in the library
11522 rp="What is the type for file position used by fsetpos()?"
11523 set fpos_t fpostype long stdio.h sys/types.h
11526 : Store the full pathname to the ar program for use in the C program
11527 : Respect a hint or command line value for full_ar.
11532 : Store the full pathname to the sed program for use in the C program
11535 : see what type gids are declared as in the kernel
11537 echo "Looking for the type for group ids returned by getgid()."
11538 set gid_t gidtype xxx stdio.h sys/types.h
11542 xxx=`./findhdr sys/user.h`
11543 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11545 unsigned) dflt="$1 $2" ;;
11549 *) dflt="$gidtype";;
11552 gid_t) echo "gid_t found." ;;
11553 *) rp="What is the type for group ids returned by getgid()?"
11559 : see if getgroups exists
11560 set getgroups d_getgrps
11563 : see if setgroups exists
11564 set setgroups d_setgrps
11568 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11570 case "$d_getgrps$d_setgrps" in
11572 case "$groupstype" in
11573 '') dflt="$gidtype" ;;
11574 *) dflt="$groupstype" ;;
11577 What type of pointer is the second argument to getgroups() and setgroups()?
11578 Usually this is the same as group ids, $gidtype, but not always.
11581 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11585 *) groupstype="$gidtype";;
11588 : see what type lseek is declared as in the kernel
11589 rp="What is the type used for lseek's offset on this system?"
11590 set off_t lseektype long stdio.h sys/types.h
11594 $echo $n "Checking to see how big your file offsets are...$c" >&4
11596 #include <sys/types.h>
11600 printf("%d\n", sizeof($lseektype));
11604 if eval $compile_ok; then
11606 $echo " $lseeksize bytes." >&4
11610 echo "(I can't seem to compile the test program. Guessing...)"
11611 rp="What is the size of your file offsets (in bytes)?"
11618 echo "Checking if your $make program sets \$(MAKE)..." >&4
11619 case "$make_set_make" in
11621 $sed 's/^X //' > testmake.mak << 'EOF'
11623 X @echo 'maketemp="$(MAKE)"'
11625 case "`$make -f testmake.mak 2>/dev/null`" in
11626 *maketemp=*) make_set_make='#' ;;
11627 *) make_set_make="MAKE=$make" ;;
11629 $rm -f testmake.mak
11632 case "$make_set_make" in
11633 '#') echo "Yup, it does.";;
11634 *) echo "Nope, it doesn't.";;
11637 : see what type is used for mode_t
11638 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11639 set mode_t modetype int stdio.h sys/types.h
11642 : define a fucntion to check prototypes
11643 $cat > protochk <<EOSH
11646 optimize="$optimize"
11648 prototype="$prototype"
11653 $cat >> protochk <<'EOSH'
11658 while test $# -ge 2; do
11660 $define) echo "#include <$2>" >> try.c ;;
11661 literal) echo "$2" >> try.c ;;
11665 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11666 cat >> try.c <<'EOCP'
11667 #ifdef CAN_PROTOTYPE
11668 #define _(args) args
11673 echo "$foo" >> try.c
11674 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11675 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11681 $eunicefix protochk
11683 : see what type is used for size_t
11684 rp="What is the type used for the length parameter for string functions?"
11685 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11688 : check for type of arguments to gethostbyaddr.
11689 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11690 case "$d_gethbyaddr" in
11694 Checking to see what type of arguments are accepted by gethostbyaddr().
11696 hdrs="$define sys/types.h
11697 $d_socket sys/socket.h
11698 $i_niin netinet/in.h
11700 $i_unistd unistd.h"
11701 : The first arg can 'char *' or 'void *'
11702 : The second arg is some of integral type
11703 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11704 for yyy in size_t long int; do
11705 case "$netdb_host_type" in
11706 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11707 if ./protochk "$try" $hdrs; then
11708 echo "Your system accepts $xxx for the first arg."
11709 echo "...and $yyy for the second arg."
11710 netdb_host_type="$xxx"
11711 netdb_hlen_type="$yyy"
11717 : In case none of those worked, prompt the user.
11718 case "$netdb_host_type" in
11719 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11722 netdb_host_type=$ans
11723 rp='What is the type for the 2nd argument to gethostbyaddr?'
11726 netdb_hlen_type=$ans
11730 *) : no gethostbyaddr, so pick harmless defaults
11731 netdb_host_type='char *'
11732 netdb_hlen_type="$sizetype"
11735 # Remove the "const" if needed. -- but then we'll have a
11737 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11740 : check for type of argument to gethostbyname.
11741 if test "X$netdb_name_type" = X ; then
11742 case "$d_gethbyname" in
11746 Checking to see what type of argument is accepted by gethostbyname().
11748 hdrs="$define sys/types.h
11749 $d_socket sys/socket.h
11750 $i_niin netinet/in.h
11752 $i_unistd unistd.h"
11753 for xxx in "const char *" "char *"; do
11754 case "$netdb_name_type" in
11755 '') try="extern struct hostent *gethostbyname($xxx);"
11756 if ./protochk "$try" $hdrs; then
11757 echo "Your system accepts $xxx."
11758 netdb_name_type="$xxx"
11763 : In case none of those worked, prompt the user.
11764 case "$netdb_name_type" in
11765 '') rp='What is the type for the 1st argument to gethostbyname?'
11768 netdb_name_type=$ans
11772 *) : no gethostbyname, so pick harmless default
11773 netdb_name_type='char *'
11778 : check for type of 1st argument to getnetbyaddr.
11779 if test "X$netdb_net_type" = X ; then
11780 case "$d_getnbyaddr" in
11784 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11786 hdrs="$define sys/types.h
11787 $d_socket sys/socket.h
11788 $i_niin netinet/in.h
11790 $i_unistd unistd.h"
11791 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11792 case "$netdb_net_type" in
11793 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11794 if ./protochk "$try" $hdrs; then
11795 echo "Your system accepts $xxx."
11796 netdb_net_type="$xxx"
11801 : In case none of those worked, prompt the user.
11802 case "$netdb_net_type" in
11803 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11806 netdb_net_type=$ans
11810 *) : no getnetbyaddr, so pick harmless default
11811 netdb_net_type='long'
11815 : locate the preferred pager for this system
11829 '') dflt=/usr/ucb/more;;
11836 rp='What pager is used on your system?'
11840 : see what type pids are declared as in the kernel
11841 rp="What is the type of process ids on this system?"
11842 set pid_t pidtype int stdio.h sys/types.h
11845 : check for length of pointer
11849 $echo $n "Checking to see how big your pointers are...$c" >&4
11850 if test "$voidflags" -gt 7; then
11851 echo '#define VOID_PTR char *' > try.c
11853 echo '#define VOID_PTR void *' > try.c
11855 $cat >>try.c <<'EOCP'
11859 printf("%d\n", sizeof(VOID_PTR));
11864 if eval $compile_ok; then
11866 $echo " $ptrsize bytes." >&4
11869 echo "(I can't seem to compile the test program. Guessing...)" >&4
11870 rp="What is the size of a pointer (in bytes)?"
11878 : see if ar generates random libraries by itself
11880 echo "Checking how to generate random libraries on your machine..." >&4
11881 echo 'int bar1() { return bar2(); }' > bar1.c
11882 echo 'int bar2() { return 2; }' > bar2.c
11883 $cat > foo.c <<'EOP'
11884 int main() { printf("%d\n", bar1()); exit(0); }
11886 $cc $ccflags -c bar1.c >/dev/null 2>&1
11887 $cc $ccflags -c bar2.c >/dev/null 2>&1
11888 $cc $ccflags -c foo.c >/dev/null 2>&1
11889 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11890 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11891 ./foobar >/dev/null 2>&1; then
11892 echo "$ar appears to generate random libraries itself."
11895 elif $ar ts bar$_a >/dev/null 2>&1 &&
11896 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11897 ./foobar >/dev/null 2>&1; then
11898 echo "a table of contents needs to be added with '$ar ts'."
11905 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11906 $test -f $ranlib || ranlib=''
11909 if $test -n "$ranlib"; then
11910 echo "your system has '$ranlib'; we'll use that."
11913 echo "your system doesn't seem to support random libraries"
11914 echo "so we'll use lorder and tsort to order the libraries."
11921 : check for type of arguments to select.
11922 case "$selecttype" in
11923 '') case "$d_select" in
11926 Checking to see what type of arguments are accepted by select().
11928 hdrs="$define sys/types.h
11929 $i_systime sys/time.h
11930 $i_sysselct sys/select.h
11931 $d_socket sys/socket.h"
11932 : The first arg can be int, unsigned, or size_t
11933 : The last arg may or may not be 'const'
11935 : void pointer has been seen but using that
11936 : breaks the selectminbits test
11937 for xxx in 'fd_set *' 'int *'; do
11938 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11939 for tmo in 'struct timeval *' 'const struct timeval *'; do
11941 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11942 if ./protochk "$try" $hdrs; then
11943 echo "Your system accepts $xxx."
11952 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11953 case "$d_fd_set" in
11954 $define) dflt="fd_set *" ;;
11963 *) : no select, so pick a harmless default
11970 : check for the select 'width'
11971 case "$selectminbits" in
11972 '') case "$d_select" in
11976 Checking to see on how many bits at a time your select() operates...
11979 #include <sys/types.h>
11981 #$i_systime I_SYS_TIME
11982 #$i_systimek I_SYS_TIME_KERNEL
11987 # ifdef I_SYS_TIME_KERNEL
11990 # include <sys/time.h>
11991 # ifdef I_SYS_TIME_KERNEL
11995 #$i_sysselct I_SYS_SELECT
11996 #ifdef I_SYS_SELECT
11997 #include <sys/select.h>
11999 #$d_socket HAS_SOCKET
12001 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12005 #define S sizeof(*(b))
12007 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12008 #define NBITS (NBYTES * 8)
12017 fp = fopen("try.c", "r");
12023 b = ($selecttype)s;
12024 for (i = 0; i < NBITS; i++)
12028 select(fd + 1, b, 0, 0, &t);
12029 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12030 printf("%d\n", i + 1);
12035 if eval $compile_ok; then
12036 selectminbits=`./try`
12037 case "$selectminbits" in
12039 Cannot figure out on how many bits at a time your select() operates.
12040 I'll play safe and guess it is 32 bits.
12046 *) bits="$selectminbits bits" ;;
12048 echo "Your select() operates on $bits at a time." >&4
12050 rp='What is the minimum number of bits your select() operates on?'
12051 case "$byteorder" in
12052 1234|12345678) dflt=32 ;;
12057 selectminbits="$val"
12061 *) : no select, so pick a harmless default
12068 : Trace out the files included by signal.h, then look for SIGxxx names.
12069 : Remove SIGARRAYSIZE used by HPUX.
12070 : Remove SIGSTKSIZE used by Linux.
12071 : Remove SIGSTKSZ used by Posix.
12072 : Remove SIGTYP void lines used by OS2.
12073 xxx=`echo '#include <signal.h>' |
12074 $cppstdin $cppminus $cppflags 2>/dev/null |
12075 $grep '^[ ]*#.*include' |
12076 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12077 : Check this list of files to be sure we have parsed the cpp output ok.
12078 : This will also avoid potentially non-existent files, such
12081 for xx in $xxx /dev/null ; do
12082 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12084 : If we have found no files, at least try signal.h
12085 case "$xxxfiles" in
12086 '') xxxfiles=`./findhdr signal.h` ;;
12089 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12090 print substr($2, 4, 20)
12092 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12093 print substr($3, 4, 20)
12095 : Append some common names just in case the awk scan failed.
12096 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12097 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12098 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12099 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12100 : generate a few handy files for later
12101 $cat > signal.c <<'EOCP'
12102 #include <sys/types.h>
12103 #include <signal.h>
12107 /* Strange style to avoid deeply-nested #if/#else/#endif */
12110 # define NSIG (_NSIG)
12116 # define NSIG (SIGMAX+1)
12122 # define NSIG (SIG_MAX+1)
12128 # define NSIG (MAXSIG+1)
12134 # define NSIG (MAX_SIG+1)
12139 # ifdef SIGARRAYSIZE
12140 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12146 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12150 /* Default to some arbitrary number that's big enough to get most
12151 of the common signals.
12157 printf("NSIG %d\n", NSIG);
12163 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12165 printf "#ifdef SIG"; printf $1; printf "\n"
12166 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12167 printf $1; printf ");\n"
12171 printf "#endif /* JUST_NSIG */\n";
12175 $cat >signal.awk <<'EOP'
12176 BEGIN { ndups = 0 }
12177 $1 ~ /^NSIG$/ { nsig = $2 }
12178 ($1 !~ /^NSIG$/) && (NF == 2) {
12179 if ($2 > maxsig) { maxsig = $2 }
12180 if (sig_name[$2]) {
12181 dup_name[ndups] = $1
12182 dup_num[ndups] = $2
12194 printf("NSIG %d\n", nsig);
12195 for (n = 1; n < nsig; n++) {
12197 printf("%s %d\n", sig_name[n], sig_num[n])
12200 printf("NUM%d %d\n", n, n)
12203 for (n = 0; n < ndups; n++) {
12204 printf("%s %d\n", dup_name[n], dup_num[n])
12208 $cat >signal_cmd <<EOS
12210 if $test -s signal.lst; then
12211 echo "Using your existing signal.lst file"
12216 $cat >>signal_cmd <<'EOS'
12219 if eval $compile_ok; then
12220 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12222 echo "(I can't seem be able to compile the whole test program)" >&4
12223 echo "(I'll try it in little pieces.)" >&4
12224 set signal -DJUST_NSIG
12225 if eval $compile_ok; then
12226 ./signal$_exe > signal.nsg
12229 echo "I can't seem to figure out how many signals you have." >&4
12230 echo "Guessing 50." >&4
12231 echo 'NSIG 50' > signal.nsg
12233 : Now look at all the signal names, one at a time.
12234 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12235 $cat > signal.c <<EOCP
12236 #include <sys/types.h>
12237 #include <signal.h>
12240 printf("$xx %d\n", SIG${xx});
12245 if eval $compile; then
12246 echo "SIG${xx} found."
12247 ./signal$_exe >> signal.ls1
12249 echo "SIG${xx} NOT found."
12252 if $test -s signal.ls1; then
12253 $cat signal.nsg signal.ls1 |
12254 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12258 if $test -s signal.lst; then
12261 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12262 echo 'kill -l' >signal
12263 set X `csh -f <signal`
12267 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12269 echo $@ | $tr ' ' $trnl | \
12270 $awk '{ printf "%s %d\n", $1, ++s; }
12271 END { printf "NSIG %d\n", ++s }' >signal.lst
12273 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12275 chmod a+x signal_cmd
12276 $eunicefix signal_cmd
12278 : generate list of signal names
12280 case "$sig_name_init" in
12282 *) case "$sig_num_init" in
12283 ''|*,*) doinit=yes ;;
12288 echo "Generating a list of signal names and numbers..." >&4
12290 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12291 sig_name=`$awk 'BEGIN { printf "ZERO " }
12292 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12293 sig_num=`$awk 'BEGIN { printf "0 " }
12294 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12295 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12296 !/^NSIG/ { printf "\"%s\", ", $1 }
12297 END { printf "0\n" }' signal.lst`
12298 sig_num_init=`$awk 'BEGIN { printf "0, " }
12299 !/^NSIG/ { printf "%d, ", $2}
12300 END { printf "0\n"}' signal.lst`
12303 echo "The following $sig_count signals are available:"
12305 echo $sig_name | $awk \
12306 'BEGIN { linelen = 0 }
12308 for (i = 1; i <= NF; i++) {
12309 name = "SIG" $i " "
12310 linelen = linelen + length(name)
12311 if (linelen > 70) {
12313 linelen = length(name)
12319 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12321 : see what type is used for signed size_t
12322 set ssize_t ssizetype int stdio.h sys/types.h
12325 $cat > ssize.c <<EOM
12327 #include <sys/types.h>
12328 #define Size_t $sizetype
12329 #define SSize_t $dflt
12332 if (sizeof(Size_t) == sizeof(SSize_t))
12334 else if (sizeof(Size_t) == sizeof(int))
12343 if eval $compile_ok && ./ssize > /dev/null; then
12344 ssizetype=`./ssize`
12345 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12348 Help! I can't compile and run the ssize_t test program: please enlighten me!
12349 (This is probably a misconfiguration in your system or libraries, and
12350 you really ought to fix it. Still, I'll try anyway.)
12352 I need a type that is the same size as $sizetype, but is guaranteed to
12353 be signed. Common values are ssize_t, int and long.
12356 rp="What signed type is the same size as $sizetype?"
12360 $rm -f ssize ssize.*
12362 : see what type of char stdio uses.
12364 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12365 echo "Your stdio uses unsigned chars." >&4
12366 stdchar="unsigned char"
12368 echo "Your stdio uses signed chars." >&4
12372 : see if time exists
12374 if test "X$d_time" = X -o X"$timetype" = X; then
12375 if set time val -f d_time; eval $csym; $val; then
12376 echo 'time() found.' >&4
12378 rp="What is the type returned by time() on this system?"
12379 set time_t timetype long stdio.h sys/types.h
12382 echo 'time() not found, hope that will do.' >&4
12390 : see what type uids are declared as in the kernel
12392 echo "Looking for the type for user ids returned by getuid()."
12393 set uid_t uidtype xxx stdio.h sys/types.h
12397 xxx=`./findhdr sys/user.h`
12398 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12400 unsigned) dflt="$1 $2" ;;
12404 *) dflt="$uidtype";;
12407 uid_t) echo "uid_t found." ;;
12408 *) rp="What is the type for user ids returned by getuid()?"
12414 : see if dbm.h is available
12415 : see if dbmclose exists
12416 set dbmclose d_dbmclose
12419 case "$d_dbmclose" in
12429 *) set rpcsvc/dbm.h i_rpcsvcdbm
12434 *) echo "We won't be including <dbm.h>"
12444 : see if this is a sys/file.h system
12449 : do we need to include sys/file.h ?
12453 if $h_sysfile; then
12455 echo "We'll be including <sys/file.h>." >&4
12458 echo "We won't be including <sys/file.h>." >&4
12468 : see if fcntl.h is there
12473 : see if we can include fcntl.h
12479 echo "We'll be including <fcntl.h>." >&4
12482 if $h_sysfile; then
12483 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12485 echo "We won't be including <fcntl.h>." >&4
12497 : see if locale.h is available
12498 set locale.h i_locale
12501 : see if mach cthreads are available
12502 if test "X$usethreads" = "X$define"; then
12503 set mach/cthreads.h i_machcthr
12506 i_machcthr="$undef"
12511 : see if this is a math.h system
12515 : see if this is a mntent.h system
12516 set mntent.h i_mntent
12519 : see if ndbm.h is available
12524 : see if dbm_open exists
12525 set dbm_open d_dbm_open
12527 case "$d_dbm_open" in
12530 echo "We won't be including <ndbm.h>"
12539 : see if net/errno.h is available
12541 set net/errno.h val
12544 : Unfortunately, it causes problems on some systems. Arrgh.
12547 cat > try.c <<'EOM'
12550 #include <net/errno.h>
12556 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12557 echo "We'll be including <net/errno.h>." >&4
12559 echo "We won't be including <net/errno.h>." >&4
12568 : see if netinet/tcp.h is available
12569 set netinet/tcp.h i_netinettcp
12572 : see if this is a poll.h system
12576 : get C preprocessor symbols handy
12578 $echo $n "Hmm... $c"
12579 echo $al | $tr ' ' $trnl >Cppsym.know
12580 $cat <<EOSS >Cppsym
12588 case "\$list\$#" in
12591 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12593 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12596 unknown="\$unknown \$sym"
12606 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12608 exit 0; _ _ _ _\1\\ \1\\
12611 echo "exit 1; _ _ _" >>Cppsym\$\$
12612 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12614 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12620 $rm -f Cppsym\$\$ Cppsym2\$\$
12625 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12627 : now check the C compiler for additional symbols
12628 postprocess_cc_v=''
12630 aix) postprocess_cc_v="|$tr , ' '" ;;
12637 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12640 -D*) echo "\$i" | $sed 's/^-D//';;
12641 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12646 postprocess_cc_v=''
12649 ./ccsym > ccsym1.raw
12650 if $test -s ccsym1.raw; then
12651 $sort ccsym1.raw | $uniq >ccsym.raw
12653 mv ccsym1.raw ccsym.raw
12656 $awk '/\=/ { print $0; next }
12657 { print $0"=1" }' ccsym.raw >ccsym.list
12658 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12659 $comm -13 ccsym.true ccsym.list >ccsym.own
12660 $comm -12 ccsym.true ccsym.list >ccsym.com
12661 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12663 if $test -z ccsym.raw; then
12664 echo "Your C compiler doesn't seem to define any symbols!" >&4
12666 echo "However, your C preprocessor defines the following symbols:"
12669 cppsymbols=`$cat Cppsym.true`
12670 cppsymbols=`echo $cppsymbols`
12671 cppccsymbols="$cppsymbols"
12673 if $test -s ccsym.com; then
12674 echo "Your C compiler and pre-processor define these symbols:"
12675 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12678 cppccsymbols=`$cat ccsym.com`
12679 cppccsymbols=`echo $cppccsymbols`
12680 $test "$silent" || sleep 1
12682 if $test -s ccsym.cpp; then
12683 $test "$also" && echo " "
12684 echo "Your C pre-processor ${also}defines the following symbols:"
12685 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12687 cppsymbols=`$cat ccsym.cpp`
12688 cppsymbols=`echo $cppsymbols`
12689 $test "$silent" || sleep 1
12691 if $test -s ccsym.own; then
12692 $test "$also" && echo " "
12693 echo "Your C compiler ${also}defines the following cpp symbols:"
12694 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12695 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12696 ccsymbols=`$cat ccsym.own`
12697 ccsymbols=`echo $ccsymbols`
12698 $test "$silent" || sleep 1
12703 : see if this is a termio system
12707 if $test `./findhdr termios.h`; then
12708 set tcsetattr i_termios
12714 "$define") echo "You have POSIX termios.h... good!" >&4;;
12715 *) if ./Cppsym pyr; then
12716 case "`/bin/universe`" in
12717 ucb) if $test `./findhdr sgtty.h`; then
12719 echo "<sgtty.h> found." >&4
12721 echo "System is pyramid with BSD universe."
12722 echo "<sgtty.h> not found--you could have problems." >&4
12724 *) if $test `./findhdr termio.h`; then
12726 echo "<termio.h> found." >&4
12728 echo "System is pyramid with USG universe."
12729 echo "<termio.h> not found--you could have problems." >&4
12733 if $test `./findhdr termio.h`; then
12734 echo "<termio.h> found." >&4
12736 elif $test `./findhdr sgtty.h`; then
12737 echo "<sgtty.h> found." >&4
12740 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12743 if $test `./findhdr sgtty.h`; then
12744 echo "<sgtty.h> found." >&4
12746 elif $test `./findhdr termio.h`; then
12747 echo "<termio.h> found." >&4
12750 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12754 set i_termio; eval $setvar
12755 val=$val2; set i_sgtty; eval $setvar
12756 val=$val3; set i_termios; eval $setvar
12758 : see if this is a shadow.h system
12759 set shadow.h i_shadow
12762 : see if this is a socks.h system
12763 set socks.h i_socks
12766 : see if stdarg is available
12768 if $test `./findhdr stdarg.h`; then
12769 echo "<stdarg.h> found." >&4
12772 echo "<stdarg.h> NOT found." >&4
12776 : see if varags is available
12778 if $test `./findhdr varargs.h`; then
12779 echo "<varargs.h> found." >&4
12781 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12784 : set up the varargs testing programs
12785 $cat > varargs.c <<EOP
12787 #include <stdarg.h>
12790 #include <varargs.h>
12794 int f(char *p, ...)
12808 p = va_arg(ap, char *);
12813 $cat > varargs <<EOP
12815 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12824 : now check which varargs header should be included
12829 if `./varargs I_STDARG`; then
12831 elif `./varargs I_VARARGS`; then
12836 if `./varargs I_VARARGS`; then
12843 echo "I could not find the definition for va_dcl... You have problems..." >&4
12844 val="$undef"; set i_stdarg; eval $setvar
12845 val="$undef"; set i_varargs; eval $setvar
12850 case "$i_varhdr" in
12852 val="$define"; set i_stdarg; eval $setvar
12853 val="$undef"; set i_varargs; eval $setvar
12856 val="$undef"; set i_stdarg; eval $setvar
12857 val="$define"; set i_varargs; eval $setvar
12860 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12864 : see if stddef is available
12865 set stddef.h i_stddef
12868 : see if sys/access.h is available
12869 set sys/access.h i_sysaccess
12872 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12873 set sys/filio.h i_sysfilio
12876 if $test `./findhdr sys/ioctl.h`; then
12878 echo '<sys/ioctl.h> found.' >&4
12881 if $test $i_sysfilio = "$define"; then
12882 echo '<sys/ioctl.h> NOT found.' >&4
12884 $test $i_sgtty = "$define" && xxx="sgtty.h"
12885 $test $i_termio = "$define" && xxx="termio.h"
12886 $test $i_termios = "$define" && xxx="termios.h"
12887 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12893 : see if sys/resource.h has to be included
12894 set sys/resource.h i_sysresrc
12897 : see if sys/security.h is available
12898 set sys/security.h i_syssecrt
12901 : see if this is a sys/statvfs.h system
12902 set sys/statvfs.h i_sysstatvfs
12905 : see if this is a sys/un.h system
12906 set sys/un.h i_sysun
12909 : see if this is a syswait system
12910 set sys/wait.h i_syswait
12913 : see if this is an utime system
12914 set utime.h i_utime
12917 : see if this is a values.h system
12918 set values.h i_values
12921 : see if this is a vfork system
12924 set vfork.h i_vfork
12932 : see if gdbm.h is available
12937 : see if gdbm_open exists
12938 set gdbm_open d_gdbm_open
12940 case "$d_gdbm_open" in
12943 echo "We won't be including <gdbm.h>"
12953 echo "Looking for extensions..." >&4
12954 : If we are using the old config.sh, known_extensions may contain
12955 : old or inaccurate or duplicate values.
12956 known_extensions=''
12957 nonxs_extensions=''
12958 : We do not use find because it might not be available.
12959 : We do not just use MANIFEST because the user may have dropped
12960 : some additional extensions into the source tree and expect them
12963 : Function to recursively find available extensions, ignoring DynaLoader
12964 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
12968 DynaLoader|dynaload) ;;
12970 if $test -f $xxx/$xxx.xs; then
12971 known_extensions="$known_extensions $1$xxx";
12972 elif $test -f $xxx/Makefile.PL; then
12973 nonxs_extensions="$nonxs_extensions $1$xxx";
12975 if $test -d $xxx -a $# -lt 10; then
12978 eval $find_extensions;
12990 eval $find_extensions
12991 set X $nonxs_extensions
12993 nonxs_extensions="$*"
12994 set X $known_extensions
12996 known_extensions="$*"
12999 : Now see which are supported on this system.
13001 for xxx in $known_extensions ; do
13005 $define) avail_ext="$avail_ext $xxx" ;;
13008 GDBM_File|gdbm_fil)
13010 $define) avail_ext="$avail_ext $xxx" ;;
13013 NDBM_File|ndbm_fil)
13015 $define) avail_ext="$avail_ext $xxx" ;;
13018 ODBM_File|odbm_fil)
13019 case "${i_dbm}${i_rpcsvcdbm}" in
13020 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13024 case "$useposix" in
13025 true|define|y) avail_ext="$avail_ext $xxx" ;;
13029 case "$useopcode" in
13030 true|define|y) avail_ext="$avail_ext $xxx" ;;
13034 case "$d_socket" in
13035 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13039 case "$usethreads" in
13040 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13044 : XXX Do we need a useipcsysv variable here
13045 case "${d_msg}${d_sem}${d_shm}" in
13046 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13049 *) avail_ext="$avail_ext $xxx"
13058 : Now see which nonxs extensions are supported on this system.
13059 : For now assume all are.
13061 for xxx in $nonxs_extensions ; do
13063 *) nonxs_ext="$nonxs_ext $xxx"
13075 A number of extensions are supplied with $package. You may choose to
13076 compile these extensions for dynamic loading (the default), compile
13077 them into the $package executable (static loading), or not include
13078 them at all. Answer "none" to include no extensions.
13079 Note that DynaLoader is always built and need not be mentioned here.
13082 case "$dynamic_ext" in
13083 '') dflt="$avail_ext" ;;
13084 *) dflt="$dynamic_ext"
13085 # Perhaps we are reusing an old out-of-date config.sh.
13088 if test X"$dynamic_ext" != X"$avail_ext"; then
13090 NOTICE: Your previous config.sh list may be incorrect.
13091 The extensions now available to you are
13093 but the default list from your previous config.sh is
13105 rp="What extensions do you wish to load dynamically?"
13108 none) dynamic_ext=' ' ;;
13109 *) dynamic_ext="$ans" ;;
13112 case "$static_ext" in
13114 : Exclude those already listed in dynamic linking
13116 for xxx in $avail_ext; do
13117 case " $dynamic_ext " in
13119 *) dflt="$dflt $xxx" ;;
13126 *) dflt="$static_ext"
13133 rp="What extensions do you wish to load statically?"
13136 none) static_ext=' ' ;;
13137 *) static_ext="$ans" ;;
13142 A number of extensions are supplied with $package. Answer "none"
13143 to include no extensions.
13144 Note that DynaLoader is always built and need not be mentioned here.
13147 case "$static_ext" in
13148 '') dflt="$avail_ext" ;;
13149 *) dflt="$static_ext"
13150 # Perhaps we are reusing an old out-of-date config.sh.
13153 if test X"$static_ext" != X"$avail_ext"; then
13155 NOTICE: Your previous config.sh list may be incorrect.
13156 The extensions now available to you are
13158 but the default list from your previous config.sh is
13167 : Exclude those that are not xs extensions
13171 rp="What extensions do you wish to include?"
13174 none) static_ext=' ' ;;
13175 *) static_ext="$ans" ;;
13180 set X $dynamic_ext $static_ext $nonxs_ext
13184 : Remove build directory name from cppstdin so it can be used from
13185 : either the present location or the final installed location.
13187 : Get out of the UU directory to get correct path name.
13189 case "$cppstdin" in
13191 echo "Stripping down cppstdin path name"
13197 : end of configuration questions
13199 echo "End of configuration questions."
13202 : back to where it started
13203 if test -d ../UU; then
13207 : configuration may be patched via a 'config.over' file
13208 if $test -f config.over; then
13211 rp='I see a config.over file. Do you wish to load it?'
13214 n*) echo "OK, I'll ignore it.";;
13216 echo "Configuration override changes have been loaded."
13221 : in case they want portability, strip down executable paths
13222 case "$d_portable" in
13225 echo "Stripping down executable paths..." >&4
13226 for file in $loclist $trylist; do
13228 eval $file=`basename $temp`
13233 : create config.sh file
13235 echo "Creating config.sh..." >&4
13236 $spitshell <<EOT >config.sh
13239 # This file was produced by running the Configure script. It holds all the
13240 # definitions figured out by Configure. Should you modify one of these values,
13241 # do not forget to propagate your changes by running "Configure -der". You may
13242 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13245 # Package name : $package
13246 # Source directory : $src
13247 # Configuration time: $cf_time
13248 # Configured by : $cf_by
13249 # Target system : $myuname
13259 Revision='$Revision'
13266 alignbytes='$alignbytes'
13267 ansi2knr='$ansi2knr'
13268 aphostname='$aphostname'
13269 apiversion='$apiversion'
13272 archlibexp='$archlibexp'
13273 archname64='$archname64'
13274 archname='$archname'
13275 archobjs='$archobjs'
13280 bincompat5005='$bincompat5005'
13284 byteorder='$byteorder'
13286 castflags='$castflags'
13289 cccdlflags='$cccdlflags'
13290 ccdlflags='$ccdlflags'
13292 ccsymbols='$ccsymbols'
13294 cf_email='$cf_email'
13299 clocktype='$clocktype'
13301 compress='$compress'
13302 contains='$contains'
13306 cpp_stuff='$cpp_stuff'
13307 cppccsymbols='$cppccsymbols'
13308 cppflags='$cppflags'
13310 cppminus='$cppminus'
13312 cppstdin='$cppstdin'
13313 cppsymbols='$cppsymbols'
13314 crosscompile='$crosscompile'
13315 cryptlib='$cryptlib'
13317 d_Gconvert='$d_Gconvert'
13318 d_PRIEldbl='$d_PRIEldbl'
13319 d_PRIFldbl='$d_PRIFldbl'
13320 d_PRIGldbl='$d_PRIGldbl'
13321 d_PRIX64='$d_PRIX64'
13322 d_PRId64='$d_PRId64'
13323 d_PRIeldbl='$d_PRIeldbl'
13324 d_PRIfldbl='$d_PRIfldbl'
13325 d_PRIgldbl='$d_PRIgldbl'
13326 d_PRIi64='$d_PRIi64'
13327 d_PRIo64='$d_PRIo64'
13328 d_PRIu64='$d_PRIu64'
13329 d_PRIx64='$d_PRIx64'
13330 d_access='$d_access'
13331 d_accessx='$d_accessx'
13333 d_archlib='$d_archlib'
13336 d_attribut='$d_attribut'
13339 d_bincompat5005='$d_bincompat5005'
13341 d_bsdgetpgrp='$d_bsdgetpgrp'
13342 d_bsdsetpgrp='$d_bsdsetpgrp'
13344 d_casti32='$d_casti32'
13345 d_castneg='$d_castneg'
13346 d_charvspr='$d_charvspr'
13348 d_chroot='$d_chroot'
13349 d_chsize='$d_chsize'
13350 d_closedir='$d_closedir'
13351 d_cmsghdr_s='$d_cmsghdr_s'
13355 d_cuserid='$d_cuserid'
13356 d_dbl_dig='$d_dbl_dig'
13357 d_difftime='$d_difftime'
13358 d_dirnamlen='$d_dirnamlen'
13359 d_dlerror='$d_dlerror'
13360 d_dlopen='$d_dlopen'
13361 d_dlsymun='$d_dlsymun'
13362 d_dosuid='$d_dosuid'
13363 d_drand48proto='$d_drand48proto'
13365 d_eaccess='$d_eaccess'
13366 d_endgrent='$d_endgrent'
13367 d_endhent='$d_endhent'
13368 d_endnent='$d_endnent'
13369 d_endpent='$d_endpent'
13370 d_endpwent='$d_endpwent'
13371 d_endsent='$d_endsent'
13372 d_endspent='$d_endspent'
13373 d_eofnblk='$d_eofnblk'
13374 d_eunice='$d_eunice'
13375 d_fchmod='$d_fchmod'
13376 d_fchown='$d_fchown'
13378 d_fd_macros='$d_fd_macros'
13379 d_fd_set='$d_fd_set'
13380 d_fds_bits='$d_fds_bits'
13381 d_fgetpos='$d_fgetpos'
13382 d_flexfnam='$d_flexfnam'
13385 d_fpathconf='$d_fpathconf'
13386 d_fpos64_t='$d_fpos64_t'
13387 d_fseeko='$d_fseeko'
13388 d_fsetpos='$d_fsetpos'
13389 d_fstatfs='$d_fstatfs'
13390 d_fstatvfs='$d_fstatvfs'
13391 d_ftello='$d_ftello'
13393 d_getgrent='$d_getgrent'
13394 d_getgrps='$d_getgrps'
13395 d_gethbyaddr='$d_gethbyaddr'
13396 d_gethbyname='$d_gethbyname'
13397 d_gethent='$d_gethent'
13398 d_gethname='$d_gethname'
13399 d_gethostprotos='$d_gethostprotos'
13400 d_getlogin='$d_getlogin'
13401 d_getmntent='$d_getmntent'
13402 d_getnbyaddr='$d_getnbyaddr'
13403 d_getnbyname='$d_getnbyname'
13404 d_getnent='$d_getnent'
13405 d_getnetprotos='$d_getnetprotos'
13406 d_getpbyname='$d_getpbyname'
13407 d_getpbynumber='$d_getpbynumber'
13408 d_getpent='$d_getpent'
13409 d_getpgid='$d_getpgid'
13410 d_getpgrp2='$d_getpgrp2'
13411 d_getpgrp='$d_getpgrp'
13412 d_getppid='$d_getppid'
13413 d_getprior='$d_getprior'
13414 d_getprotoprotos='$d_getprotoprotos'
13415 d_getpwent='$d_getpwent'
13416 d_getsbyname='$d_getsbyname'
13417 d_getsbyport='$d_getsbyport'
13418 d_getsent='$d_getsent'
13419 d_getservprotos='$d_getservprotos'
13420 d_getspent='$d_getspent'
13421 d_getspnam='$d_getspnam'
13422 d_gettimeod='$d_gettimeod'
13423 d_gnulibc='$d_gnulibc'
13424 d_grpasswd='$d_grpasswd'
13425 d_hasmntopt='$d_hasmntopt'
13428 d_inetaton='$d_inetaton'
13429 d_int64t='$d_int64t'
13430 d_iovec_s='$d_iovec_s'
13431 d_isascii='$d_isascii'
13432 d_killpg='$d_killpg'
13433 d_lchown='$d_lchown'
13434 d_ldbl_dig='$d_ldbl_dig'
13436 d_llseek='$d_llseek'
13437 d_locconv='$d_locconv'
13439 d_longdbl='$d_longdbl'
13440 d_longlong='$d_longlong'
13442 d_madvise='$d_madvise'
13444 d_mbstowcs='$d_mbstowcs'
13445 d_mbtowc='$d_mbtowc'
13446 d_memchr='$d_memchr'
13447 d_memcmp='$d_memcmp'
13448 d_memcpy='$d_memcpy'
13449 d_memmove='$d_memmove'
13450 d_memset='$d_memset'
13452 d_mkfifo='$d_mkfifo'
13453 d_mktime='$d_mktime'
13455 d_mprotect='$d_mprotect'
13457 d_msg_ctrunc='$d_msg_ctrunc'
13458 d_msg_dontroute='$d_msg_dontroute'
13459 d_msg_oob='$d_msg_oob'
13460 d_msg_peek='$d_msg_peek'
13461 d_msg_proxy='$d_msg_proxy'
13462 d_msgctl='$d_msgctl'
13463 d_msgget='$d_msgget'
13464 d_msghdr_s='$d_msghdr_s'
13465 d_msgrcv='$d_msgrcv'
13466 d_msgsnd='$d_msgsnd'
13468 d_munmap='$d_munmap'
13469 d_mymalloc='$d_mymalloc'
13471 d_off64_t='$d_off64_t'
13472 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13473 d_oldpthreads='$d_oldpthreads'
13474 d_oldsock='$d_oldsock'
13476 d_pathconf='$d_pathconf'
13478 d_phostname='$d_phostname'
13481 d_portable='$d_portable'
13482 d_pthread_yield='$d_pthread_yield'
13484 d_pwchange='$d_pwchange'
13485 d_pwclass='$d_pwclass'
13486 d_pwcomment='$d_pwcomment'
13487 d_pwexpire='$d_pwexpire'
13488 d_pwgecos='$d_pwgecos'
13489 d_pwpasswd='$d_pwpasswd'
13490 d_pwquota='$d_pwquota'
13491 d_readdir='$d_readdir'
13492 d_readlink='$d_readlink'
13494 d_recvmsg='$d_recvmsg'
13495 d_rename='$d_rename'
13496 d_rewinddir='$d_rewinddir'
13498 d_safebcpy='$d_safebcpy'
13499 d_safemcpy='$d_safemcpy'
13500 d_sanemcmp='$d_sanemcmp'
13501 d_sched_yield='$d_sched_yield'
13502 d_scm_rights='$d_scm_rights'
13503 d_seekdir='$d_seekdir'
13504 d_select='$d_select'
13506 d_semctl='$d_semctl'
13507 d_semctl_semid_ds='$d_semctl_semid_ds'
13508 d_semctl_semun='$d_semctl_semun'
13509 d_semget='$d_semget'
13511 d_sendmsg='$d_sendmsg'
13512 d_setegid='$d_setegid'
13513 d_seteuid='$d_seteuid'
13514 d_setgrent='$d_setgrent'
13515 d_setgrps='$d_setgrps'
13516 d_sethent='$d_sethent'
13517 d_setlinebuf='$d_setlinebuf'
13518 d_setlocale='$d_setlocale'
13519 d_setnent='$d_setnent'
13520 d_setpent='$d_setpent'
13521 d_setpgid='$d_setpgid'
13522 d_setpgrp2='$d_setpgrp2'
13523 d_setpgrp='$d_setpgrp'
13524 d_setprior='$d_setprior'
13525 d_setpwent='$d_setpwent'
13526 d_setregid='$d_setregid'
13527 d_setresgid='$d_setresgid'
13528 d_setresuid='$d_setresuid'
13529 d_setreuid='$d_setreuid'
13530 d_setrgid='$d_setrgid'
13531 d_setruid='$d_setruid'
13532 d_setsent='$d_setsent'
13533 d_setsid='$d_setsid'
13534 d_setspent='$d_setspent'
13535 d_setvbuf='$d_setvbuf'
13539 d_shmatprototype='$d_shmatprototype'
13540 d_shmctl='$d_shmctl'
13542 d_shmget='$d_shmget'
13543 d_sigaction='$d_sigaction'
13544 d_sigsetjmp='$d_sigsetjmp'
13545 d_socket='$d_socket'
13546 d_sockpair='$d_sockpair'
13547 d_statblks='$d_statblks'
13548 d_statfs='$d_statfs'
13549 d_statfsflags='$d_statfsflags'
13550 d_statvfs='$d_statvfs'
13551 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13552 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13553 d_stdio_stream_array='$d_stdio_stream_array'
13554 d_stdiobase='$d_stdiobase'
13555 d_stdstdio='$d_stdstdio'
13556 d_strchr='$d_strchr'
13557 d_strcoll='$d_strcoll'
13558 d_strctcpy='$d_strctcpy'
13559 d_strerrm='$d_strerrm'
13560 d_strerror='$d_strerror'
13561 d_strtod='$d_strtod'
13562 d_strtol='$d_strtol'
13563 d_strtoul='$d_strtoul'
13564 d_strtoull='$d_strtoull'
13565 d_strxfrm='$d_strxfrm'
13566 d_suidsafe='$d_suidsafe'
13567 d_symlink='$d_symlink'
13568 d_syscall='$d_syscall'
13569 d_sysconf='$d_sysconf'
13570 d_sysernlst='$d_sysernlst'
13571 d_syserrlst='$d_syserrlst'
13572 d_system='$d_system'
13573 d_tcgetpgrp='$d_tcgetpgrp'
13574 d_tcsetpgrp='$d_tcsetpgrp'
13575 d_telldir='$d_telldir'
13576 d_telldirproto='$d_telldirproto'
13579 d_truncate='$d_truncate'
13580 d_tzname='$d_tzname'
13583 d_union_semun='$d_union_semun'
13584 d_vendorlib='$d_vendorlib'
13586 d_void_closedir='$d_void_closedir'
13587 d_voidsig='$d_voidsig'
13588 d_voidtty='$d_voidtty'
13589 d_volatile='$d_volatile'
13590 d_vprintf='$d_vprintf'
13592 d_waitpid='$d_waitpid'
13593 d_wcstombs='$d_wcstombs'
13594 d_wctomb='$d_wctomb'
13595 d_writev='$d_writev'
13598 db_hashtype='$db_hashtype'
13599 db_prefixtype='$db_prefixtype'
13600 defvoidused='$defvoidused'
13601 direntrytype='$direntrytype'
13604 doublesize='$doublesize'
13606 dynamic_ext='$dynamic_ext'
13612 eunicefix='$eunicefix'
13615 extensions='$extensions'
13616 fflushNULL='$fflushNULL'
13617 fflushall='$fflushall'
13619 firstmakefile='$firstmakefile'
13621 fpostype='$fpostype'
13622 freetype='$freetype'
13624 full_csh='$full_csh'
13625 full_sed='$full_sed'
13626 gccversion='$gccversion'
13630 groupcat='$groupcat'
13631 groupstype='$groupstype'
13634 h_sysfile='$h_sysfile'
13638 i_arpainet='$i_arpainet'
13639 i_bsdioctl='$i_bsdioctl'
13642 i_dirent='$i_dirent'
13649 i_inttypes='$i_inttypes'
13650 i_limits='$i_limits'
13651 i_locale='$i_locale'
13652 i_machcthr='$i_machcthr'
13653 i_malloc='$i_malloc'
13655 i_memory='$i_memory'
13656 i_mntent='$i_mntent'
13659 i_neterrno='$i_neterrno'
13660 i_netinettcp='$i_netinettcp'
13663 i_pthread='$i_pthread'
13665 i_rpcsvcdbm='$i_rpcsvcdbm'
13668 i_shadow='$i_shadow'
13670 i_stdarg='$i_stdarg'
13671 i_stddef='$i_stddef'
13672 i_stdlib='$i_stdlib'
13673 i_string='$i_string'
13674 i_sysaccess='$i_sysaccess'
13675 i_sysdir='$i_sysdir'
13676 i_sysfile='$i_sysfile'
13677 i_sysfilio='$i_sysfilio'
13679 i_sysioctl='$i_sysioctl'
13680 i_sysmman='$i_sysmman'
13681 i_sysmount='$i_sysmount'
13682 i_sysndir='$i_sysndir'
13683 i_sysparam='$i_sysparam'
13684 i_sysresrc='$i_sysresrc'
13685 i_syssecrt='$i_syssecrt'
13686 i_sysselct='$i_sysselct'
13687 i_syssockio='$i_syssockio'
13688 i_sysstat='$i_sysstat'
13689 i_sysstatvfs='$i_sysstatvfs'
13690 i_systime='$i_systime'
13691 i_systimek='$i_systimek'
13692 i_systimes='$i_systimes'
13693 i_systypes='$i_systypes'
13694 i_sysuio='$i_sysuio'
13696 i_syswait='$i_syswait'
13697 i_termio='$i_termio'
13698 i_termios='$i_termios'
13700 i_unistd='$i_unistd'
13702 i_values='$i_values'
13703 i_varargs='$i_varargs'
13704 i_varhdr='$i_varhdr'
13706 ignore_versioned_solibs='$ignore_versioned_solibs'
13709 installarchlib='$installarchlib'
13710 installbin='$installbin'
13711 installman1dir='$installman1dir'
13712 installman3dir='$installman3dir'
13713 installprefix='$installprefix'
13714 installprefixexp='$installprefixexp'
13715 installprivlib='$installprivlib'
13716 installscript='$installscript'
13717 installsitearch='$installsitearch'
13718 installsitelib='$installsitelib'
13719 installstyle='$installstyle'
13720 installusrbinperl='$installusrbinperl'
13721 installvendorlib='$installvendorlib'
13723 known_extensions='$known_extensions'
13727 lddlflags='$lddlflags'
13729 ldlibpthname='$ldlibpthname'
13736 libswanted='$libswanted'
13742 locincpth='$locincpth'
13743 loclibpth='$loclibpth'
13744 longdblsize='$longdblsize'
13745 longlongsize='$longlongsize'
13746 longsize='$longsize'
13750 lseeksize='$lseeksize'
13751 lseektype='$lseektype'
13755 make_set_make='$make_set_make'
13756 mallocobj='$mallocobj'
13757 mallocsrc='$mallocsrc'
13758 malloctype='$malloctype'
13760 man1direxp='$man1direxp'
13763 man3direxp='$man3direxp'
13767 mips_type='$mips_type'
13769 mmaptype='$mmaptype'
13771 modetype='$modetype'
13773 multiarch='$multiarch'
13775 myarchname='$myarchname'
13776 mydomain='$mydomain'
13777 myhostname='$myhostname'
13780 netdb_hlen_type='$netdb_hlen_type'
13781 netdb_host_type='$netdb_host_type'
13782 netdb_name_type='$netdb_name_type'
13783 netdb_net_type='$netdb_net_type'
13786 nm_so_opt='$nm_so_opt'
13787 nonxs_ext='$nonxs_ext'
13789 o_nonblock='$o_nonblock'
13791 old_pthread_create_joinable='$old_pthread_create_joinable'
13792 optimize='$optimize'
13793 orderlib='$orderlib'
13799 patchlevel='$patchlevel'
13800 path_sep='$path_sep'
13802 perladmin='$perladmin'
13803 perlpath='$perlpath'
13805 phostname='$phostname'
13811 prefixexp='$prefixexp'
13813 privlibexp='$privlibexp'
13814 prototype='$prototype'
13816 randbits='$randbits'
13817 randfunc='$randfunc'
13818 randseedtype='$randseedtype'
13820 rd_nodata='$rd_nodata'
13824 sPRIEldbl='$sPRIEldbl'
13825 sPRIFldbl='$sPRIFldbl'
13826 sPRIGldbl='$sPRIGldbl'
13829 sPRIeldbl='$sPRIeldbl'
13830 sPRIfldbl='$sPRIfldbl'
13831 sPRIgldbl='$sPRIgldbl'
13836 sched_yield='$sched_yield'
13837 scriptdir='$scriptdir'
13838 scriptdirexp='$scriptdirexp'
13840 seedfunc='$seedfunc'
13841 selectminbits='$selectminbits'
13842 selecttype='$selecttype'
13843 sendmail='$sendmail'
13846 sharpbang='$sharpbang'
13847 shmattype='$shmattype'
13848 shortsize='$shortsize'
13851 sig_count='$sig_count'
13852 sig_name='$sig_name'
13853 sig_name_init='$sig_name_init'
13855 sig_num_init='$sig_num_init'
13856 signal_t='$signal_t'
13857 sitearch='$sitearch'
13858 sitearchexp='$sitearchexp'
13860 sitelibexp='$sitelibexp'
13861 siteprefix='$siteprefix'
13862 siteprefixexp='$siteprefixexp'
13863 sizetype='$sizetype'
13868 sockethdr='$sockethdr'
13869 socketlib='$socketlib'
13871 spackage='$spackage'
13872 spitshell='$spitshell'
13875 ssizetype='$ssizetype'
13876 startperl='$startperl'
13878 static_ext='$static_ext'
13880 stdio_base='$stdio_base'
13881 stdio_bufsiz='$stdio_bufsiz'
13882 stdio_cnt='$stdio_cnt'
13883 stdio_filbuf='$stdio_filbuf'
13884 stdio_ptr='$stdio_ptr'
13885 stdio_stream_array='$stdio_stream_array'
13888 subversion='$subversion'
13895 timeincl='$timeincl'
13896 timetype='$timetype'
13904 use64bits='$use64bits'
13906 uselongdouble='$uselongdouble'
13907 usemultiplicity='$usemultiplicity'
13908 usemymalloc='$usemymalloc'
13910 useopcode='$useopcode'
13911 useperlio='$useperlio'
13912 useposix='$useposix'
13914 useshrplib='$useshrplib'
13915 usesocks='$usesocks'
13916 usethreads='$usethreads'
13917 usevendorprefix='$usevendorprefix'
13918 usevfork='$usevfork'
13921 vendorlib='$vendorlib'
13922 vendorlibexp='$vendorlibexp'
13923 vendorprefix='$vendorprefix'
13924 vendorprefixexp='$vendorprefixexp'
13927 voidflags='$voidflags'
13933 : Add in command line options if available
13934 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13936 : add special variables
13937 $test -f $src/patchlevel.h && \
13938 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13939 echo "CONFIGDOTSH=true" >>config.sh
13941 : propagate old symbols
13942 if $test -f UU/config.sh; then
13943 <UU/config.sh sort | uniq >UU/oldconfig.sh
13944 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13945 sort | uniq -u >UU/oldsyms
13946 set X `cat UU/oldsyms`
13952 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13954 echo "# Variables propagated from previous config.sh file." >>config.sh
13955 for sym in `cat UU/oldsyms`; do
13956 echo " Propagating $hint variable "'$'"$sym..."
13957 eval 'tmp="$'"${sym}"'"'
13959 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13965 : Finish up by extracting the .SH files
13979 If you'd like to make any changes to the config.sh file before I begin
13980 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13983 rp="Press return or use a shell escape to edit config.sh:"
13988 *) : in case they cannot read
13989 sh 1>&4 -c "$ans";;
13994 : if this fails, just run all the .SH files by hand
14001 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14008 Now you need to generate make dependencies by running "$make depend".
14009 You might prefer to run it in background: "$make depend > makedepend.out &"
14010 It can take a while, so you might not want to run it right now.
14015 rp="Run $make depend now?"
14019 $make depend && echo "Now you must run a $make."
14022 echo "You must run '$make depend' then '$make'."
14025 elif test -f [Mm]akefile; then
14027 echo "Now you must run a $make."
14032 if $test -f Policy.sh; then
14035 If you compile $package on a different machine or from a different object
14036 directory, copy the Policy.sh file from this object directory to the
14037 new one before you run Configure -- this will help you with most of
14038 the policy defaults.
14042 if $test -f config.msg; then
14043 echo "Hmm. I also noted the following information while running:"
14045 $cat config.msg >&4
14048 $rm -f kit*isdone ark*isdone