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 16 22:35:18 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 optimize, if desired, or use for debug flag also
4156 ' '|$undef) dflt='none';;
4158 *) dflt="$optimize";;
4162 Some C compilers have problems with their optimizers. By default, $package
4163 compiles with the -O flag to use the optimizer. Alternately, you might want
4164 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4165 systems). Either flag can be specified here. To use neither flag, specify
4169 rp="What optimizer/debugger flag should be used?"
4173 'none') optimize=" ";;
4177 : We will not override a previous value, but we might want to
4178 : augment a hint file
4181 case "$gccversion" in
4182 1*) dflt='-fpcc-struct-return' ;;
4185 *-g*) dflt="$dflt -DDEBUGGING";;
4187 case "$gccversion" in
4188 2*) if test -d /etc/conf/kconfig.d &&
4189 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4198 case "$mips_type" in
4199 *BSD*|'') inclwanted="$locincpth $usrinc";;
4200 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4202 for thisincl in $inclwanted; do
4203 if $test -d $thisincl; then
4204 if $test x$thisincl != x$usrinc; then
4207 *) dflt="$dflt -I$thisincl";;
4213 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4215 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4223 *) dflt="$dflt -D$2";;
4227 set signal.h LANGUAGE_C; eval $inctest
4231 ccflags="$ccflags -DSOCKS"
4236 none|recommended) dflt="$ccflags $dflt" ;;
4237 *) dflt="$ccflags";;
4245 Your C compiler may want other flags. For this question you should include
4246 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4247 but you should NOT include libraries or ld flags like -lwhatever. If you
4248 want $package to honor its debug switch, you should include -DDEBUGGING here.
4249 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4251 To use no flags, specify the word "none".
4257 rp="Any additional cc flags?"
4264 : the following weeds options from ccflags that are of no interest to cpp
4266 case "$gccversion" in
4267 1*) cppflags="$cppflags -D__GNUC__"
4269 case "$mips_type" in
4271 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4277 echo "Let me guess what the preprocessor flags are..." >&4
4291 *) ftry="$previous $flag";;
4293 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4294 >cpp1.out 2>/dev/null && \
4295 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4296 >cpp2.out 2>/dev/null && \
4297 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4298 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4300 cppflags="$cppflags $ftry"
4310 *-*) echo "They appear to be: $cppflags";;
4312 $rm -f cpp.c cpp?.out
4316 : flags used in final linking phase
4318 '') if ./venix; then
4324 *-posix*) dflt="$dflt -posix" ;;
4327 *) dflt="$ldflags";;
4330 : Try to guess additional flags to pick up local libraries.
4331 for thislibdir in $libpth; do
4332 case " $loclibpth " in
4335 *"-L$thislibdir "*) ;;
4336 *) dflt="$dflt -L$thislibdir" ;;
4348 Your C linker may need flags. For this question you should
4349 include -L/whatever and any other flags used by the C linker, but you
4350 should NOT include libraries like -lwhatever.
4352 Make sure you include the appropriate -L/path flags if your C linker
4353 does not normally search all of the directories you specified above,
4356 To use no flags, specify the word "none".
4360 rp="Any additional ld flags (NOT including libraries)?"
4366 rmlist="$rmlist pdp11"
4370 echo "Checking your choice of C compiler and flags for coherency..." >&4
4371 $cat > try.c <<'EOF'
4373 int main() { printf("Ok\n"); exit(0); }
4375 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4377 $cat >try.msg <<'EOM'
4378 I've tried to compile and run the following simple program:
4381 $cat try.c >> try.msg
4383 $cat >> try.msg <<EOM
4390 and I got the following output:
4394 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4395 if sh -c './try' >>try.msg 2>&1; then
4399 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4402 cat >> try.msg <<'EOQS'
4403 If $libs contains -lsfio, and sfio is mis-configured, then it
4404 sometimes (apparently) runs and exits with a 0 status, but with no
4405 output! It may have to do with sfio's use of _exit vs. exit.
4408 rp="You have a big problem. Shall I abort Configure"
4415 echo "The program compiled OK, but exited with status $?." >>try.msg
4416 rp="You have a problem. Shall I abort Configure"
4420 echo "I can't compile the test program." >>try.msg
4421 rp="You have a BIG problem. Shall I abort Configure"
4427 case "$knowitall" in
4429 echo "(The supplied flags or libraries might be incorrect.)"
4437 *) echo "Ok. Stopping Configure." >&4
4442 n) echo "OK, that should do.";;
4444 $rm -f try try.* core
4446 : determine filename position in cpp output
4448 echo "Computing filename position in cpp output for #include directives..." >&4
4449 echo '#include <stdio.h>' > foo.c
4452 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4453 $grep '^[ ]*#.*stdio\.h' | \
4454 while read cline; do
4457 while $test \$# -gt 0; do
4458 if $test -r \`echo \$1 | $tr -d '"'\`; then
4463 pos=\`expr \$pos + 1\`
4475 *) pos="${fieldn}th";;
4477 echo "Your cpp writes the filename in the $pos field of the line."
4479 : locate header file
4484 for usrincdir in $usrinc
4486 if test -f \$usrincdir/\$wanted; then
4487 echo "\$usrincdir/\$wanted"
4491 awkprg='{ print \$$fieldn }'
4492 echo "#include <\$wanted>" > foo\$\$.c
4493 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4494 $grep "^[ ]*#.*\$wanted" | \
4495 while read cline; do
4496 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4498 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4499 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4504 # status = 0: grep returned 0 lines, case statement not executed
4505 # status = 1: headerfile found
4506 # status = 2: while loop executed, no headerfile found
4510 if test \$status -eq 1; then
4517 : define an alternate in-header-list? function
4518 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4519 cont=true; xxf="echo \"<\$1> found.\" >&4";
4520 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4521 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4523 case $# in 4) instead=instead;; *) instead="at last";; esac;
4524 while $test "$cont"; do
4526 var=$2; eval "was=\$$2";
4527 if $test "$xxx" && $test -r "$xxx";
4529 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4532 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4533 set $yyy; shift; shift; yyy=$@;
4534 case $# in 0) cont="";;
4535 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4536 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4537 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4538 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4542 do set $yyy; var=$2; eval "was=\$$2";
4543 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4544 set $yyy; shift; shift; yyy=$@;
4547 : see if this is a malloc.h system
4548 set malloc.h i_malloc
4551 : see if stdlib is available
4552 set stdlib.h i_stdlib
4555 : determine which malloc to compile in
4557 case "$usemymalloc" in
4558 ''|[yY]*|true|$define) dflt='y' ;;
4561 rp="Do you wish to attempt to use the malloc that comes with $package?"
4567 mallocsrc='malloc.c'
4568 mallocobj="malloc$_o"
4569 d_mymalloc="$define"
4572 : Remove malloc from list of libraries to use
4573 echo "Removing unneeded -lmalloc from library list" >&4
4574 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4577 echo "libs = $libs" >&4
4589 : compute the return types of malloc and free
4591 $cat >malloc.c <<END
4595 #include <sys/types.h>
4609 case "$malloctype" in
4611 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4618 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4622 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4629 echo "Your system uses $freetype free(), it would seem." >&4
4633 The installation process will also create a directory for
4634 vendor-supplied add-ons. Vendors who supply perl with their system
4635 may find it convenient to place all vendor-supplied files in this
4636 directory rather than in the main distribution directory. This will
4637 ease upgrades between binary-compatible maintenance versions of perl.
4639 Of course you may also use these directories in whatever way you see
4640 fit. For example, you might use them to access modules shared over a
4641 company-wide network.
4643 The default answer should be fine for most people.
4644 This causes further questions about vendor add-ons to be skipped
4645 and no vendor-specific directories will be configured for perl.
4648 rp='Do you want to configure vendor-specific add-on directories?'
4649 case "$usevendorprefix" in
4650 define|true|[yY]*) dflt=y ;;
4656 rp='Installation prefix to use for vendor-supplied add-ons?'
4657 case "$vendorprefix" in
4659 *) dflt=$vendorprefix ;;
4663 case "$vendorprefix" in
4667 *) oldvendorprefix="$prefix";;
4671 usevendorprefix="$define"
4673 vendorprefixexp="$ansexp"
4675 *) usevendorprefix="$undef"
4681 case "$vendorprefix" in
4682 '') d_vendorlib="$undef"
4686 *) d_vendorlib="$define"
4687 : determine where vendor-supplied modules go.
4688 : Usual default is /usr/local/lib/perl5/vendor_perl
4689 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4690 case "$installstyle" in
4691 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4692 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4695 rp='Pathname for the vendor-supplied library files?'
4698 vendorlibexp="$ansexp"
4699 : Change installation prefix, if necessary.
4700 if $test X"$prefix" != X"$installprefix"; then
4701 installvendorlib=`echo $vendorlibexp | $sed 's#^$prefix#$installprefix#'`
4703 installvendorlib="$vendorlibexp"
4708 : Cruising for prototypes
4710 echo "Checking out function prototypes..." >&4
4711 $cat >prototype.c <<'EOCP'
4712 int main(int argc, char *argv[]) {
4715 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4716 echo "Your C compiler appears to support function prototypes."
4719 echo "Your C compiler doesn't seem to understand function prototypes."
4726 case "$prototype" in
4728 *) ansi2knr='ansi2knr'
4733 This version of $package can only be compiled by a compiler that
4734 understands function prototypes. Unfortunately, your C compiler
4736 doesn't seem to understand them. Sorry about that.
4738 If GNU cc is available for your system, perhaps you could try that instead.
4740 Eventually, we hope to support building Perl with pre-ANSI compilers.
4741 If you would like to help in that effort, please contact <perlbug@perl.org>.
4743 Aborting Configure now.
4749 : determine where public executables go
4754 rp='Pathname where the public executables will reside?'
4756 if $test "X$ansexp" != "X$binexp"; then
4761 : Change installation prefix, if necessary.
4762 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4763 if $test X"$prefix" != X"$installprefix"; then
4764 installbin=`echo $binexp | sed 's#^$prefix#$installprefix#'`
4766 installbin="$binexp"
4769 : determine whether to install perl also as /usr/bin/perl
4772 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4774 Many scripts expect to perl to be installed as /usr/bin/perl.
4775 I can install the perl you are about to compile also as /usr/bin/perl
4776 (in addition to $installbin/perl).
4778 case "$installusrbinperl" in
4779 "$undef"|[nN]*) dflt='n';;
4782 rp="Do you want to install perl as /usr/bin/perl?"
4785 [yY]*) val="$define";;
4791 set installusrbinperl
4794 : define a shorthand compile call
4798 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4799 : define a shorthand compile call for compilations that should be ok.
4803 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4806 echo "Checking for GNU C Library..." >&4
4807 cat >gnulibc.c <<EOM
4819 if eval $compile_ok && ./gnulibc; then
4821 echo "You are using the GNU C Library"
4824 echo "You are not using the GNU C Library"
4830 : see if nm is to be used to determine whether a symbol is defined or not
4834 case "$d_gnulibc" in
4837 echo "nm probably won't work on the GNU C Library." >&4
4843 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4845 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4846 echo "'nm' won't be sufficient on this sytem." >&4
4852 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4853 if $test $dflt -gt 20; then
4863 true|$define) dflt=y;;
4870 I can use $nm to extract the symbols from your C libraries. This
4871 is a time consuming task which may generate huge output on the disk (up
4872 to 3 megabytes) but that should make the symbols extraction faster. The
4873 alternative is to skip the 'nm' extraction part and to compile a small
4874 test program instead to determine whether each symbol is present. If
4875 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4876 this may be the best solution.
4878 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4881 rp="Shall I use $nm to extract C symbols from the libraries?"
4884 [Nn]*) usenm=false;;
4893 : nm options which may be necessary
4895 '') if $test -f /mach_boot; then
4897 elif $test -d /usr/ccs/lib; then
4898 nm_opt='-p' # Solaris (and SunOS?)
4899 elif $test -f /dgux; then
4901 elif $test -f /lib64/rld; then
4902 nm_opt='-p' # 64-bit Irix
4908 : nm options which may be necessary for shared libraries but illegal
4909 : for archive libraries. Thank you, Linux.
4910 case "$nm_so_opt" in
4911 '') case "$myuname" in
4913 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4914 nm_so_opt='--dynamic'
4923 : get list of predefined functions in a handy place
4928 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4935 *) for thislib in $libs; do
4938 : Handle C library specially below.
4941 thislib=`echo $thislib | $sed -e 's/^-l//'`
4942 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4944 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4946 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4948 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4950 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4952 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4954 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4959 libnames="$libnames $try"
4961 *) libnames="$libnames $thislib" ;;
4970 for xxx in $libpth; do
4971 $test -r $1 || set $xxx/libc.$so
4972 : The messy sed command sorts on library version numbers.
4974 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4975 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4977 s/[0-9][0-9]*/0000&/g
4978 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4981 sort | $sed -e 's/^.* //'`
4984 $test -r $1 || set /usr/ccs/lib/libc.$so
4985 $test -r $1 || set /lib/libsys_s$_a
4991 if $test -r "$1"; then
4992 echo "Your (shared) C library seems to be in $1."
4994 elif $test -r /lib/libc && $test -r /lib/clib; then
4995 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4997 libc='/lib/clib /lib/libc'
4998 if $test -r /lib/syslib; then
4999 echo "(Your math library is in /lib/syslib.)"
5000 libc="$libc /lib/syslib"
5002 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5003 echo "Your C library seems to be in $libc, as you said before."
5004 elif $test -r $incpath/usr/lib/libc$_a; then
5005 libc=$incpath/usr/lib/libc$_a;
5006 echo "Your C library seems to be in $libc. That's fine."
5007 elif $test -r /lib/libc$_a; then
5009 echo "Your C library seems to be in $libc. You're normal."
5011 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5013 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5014 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5015 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5017 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5019 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5022 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5024 if $test -r "$tans"; then
5025 echo "Your C library seems to be in $tans, of all places."
5031 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5035 If the guess above is wrong (which it might be if you're using a strange
5036 compiler, or your machine supports multiple models), you can override it here.
5041 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5043 I can't seem to find your C library. I've looked in the following places:
5046 $sed 's/^/ /' libpath
5049 None of these seems to contain your C library. I need to get its name...
5054 rp='Where is your C library?'
5059 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5060 set X `cat libnames`
5063 case $# in 1) xxx=file; esac
5064 echo "Extracting names from the following $xxx for later perusal:" >&4
5066 $sed 's/^/ /' libnames >&4
5068 $echo $n "This may take a while...$c" >&4
5072 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5073 *) $nm $nm_opt $file 2>/dev/null;;
5078 $grep fprintf libc.tmp > libc.ptf
5079 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5080 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5082 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5084 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5086 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5088 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5090 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5092 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5094 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5096 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5098 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5100 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5102 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5104 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5106 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5107 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5109 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5111 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5113 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5115 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5117 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5119 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5121 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5123 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5125 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5127 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5129 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5131 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5133 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5135 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5137 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5140 $nm -p $* 2>/dev/null >libc.tmp
5141 $grep fprintf libc.tmp > libc.ptf
5142 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5143 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5149 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5151 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5152 for thisname in $libnames $libc; do
5153 $ar t $thisname >>libc.tmp
5155 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5157 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5158 # Repeat libc to extract forwarders to DLL entries too
5159 for thisname in $libnames $libc; do
5160 $ar tv $thisname >>libc.tmp
5161 # Revision 50 of EMX has bug in $ar.
5162 # it will not extract forwarders to DLL entries
5163 # Use emximp which will extract exactly them.
5164 emximp -o tmp.imp $thisname \
5166 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5167 < tmp.imp >>libc.tmp
5170 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5173 echo "$ar didn't seem to work right." >&4
5174 echo "Maybe this is a Cray...trying bld instead..." >&4
5175 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5177 for thisname in $libnames; do
5179 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5180 $ar t $thisname >>libc.tmp
5184 echo "That didn't work either. Giving up." >&4
5191 if $test -f /lib/syscalls.exp; then
5193 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5194 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5198 $rm -f libnames libpath
5200 : see if dld is available
5204 : is a C symbol defined?
5207 -v) tf=libc.tmp; tc=""; tdc="";;
5208 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5209 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5212 case "$reuseval-$4" in
5214 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5220 if $contains $tlook $tf >/dev/null 2>&1;
5225 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5226 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5234 $define) tval=true;;
5240 : define an is-in-libc? function
5241 inlibc='echo " "; td=$define; tu=$undef;
5242 sym=$1; var=$2; eval "was=\$$2";
5244 case "$reuseval$was" in
5254 echo "$sym() found." >&4;
5255 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5257 echo "$sym() NOT found." >&4;
5258 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5262 $define) echo "$sym() found." >&4;;
5263 *) echo "$sym() NOT found." >&4;;
5267 : see if dlopen exists
5274 : determine which dynamic loading, if any, to compile in
5276 dldir="ext/DynaLoader"
5289 $define) dflt='y' ;;
5292 $define) dflt='y' ;;
5294 : Does a dl_xxx.xs file exist for this operating system
5295 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5298 rp="Do you wish to use dynamic loading?"
5305 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5306 dflt="$dldir/dl_${osname}.xs"
5307 elif $test "$d_dlopen" = "$define" ; then
5308 dflt="$dldir/dl_dlopen.xs"
5309 elif $test "$i_dld" = "$define" ; then
5310 dflt="$dldir/dl_dld.xs"
5315 *) dflt="$dldir/$dlsrc"
5318 echo "The following dynamic loading files are available:"
5319 : Can not go over to $dldir because getfile has path hard-coded in.
5320 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5321 rp="Source file to use for dynamic loading"
5327 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5331 Some systems may require passing special flags to $cc -c to
5332 compile modules that will be used to create a shared library.
5333 To use no flags, say "none".
5336 case "$cccdlflags" in
5337 '') case "$gccversion" in
5338 '') case "$osname" in
5340 next) dflt='none' ;;
5341 irix*) dflt='-KPIC' ;;
5342 svr4*|esix*|solaris) dflt='-KPIC' ;;
5343 sunos) dflt='-pic' ;;
5347 *) case "$osname" in
5348 svr4*|esix*|solaris) dflt='-fPIC' ;;
5353 *) dflt="$cccdlflags" ;;
5355 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5358 none) cccdlflags=' ' ;;
5359 *) cccdlflags="$ans" ;;
5364 Some systems use ld to create libraries that can be dynamically loaded,
5365 while other systems (such as those using ELF) use $cc.
5369 '') $cat >try.c <<'EOM'
5370 /* Test for whether ELF binaries are produced */
5375 int i = open("a.out",O_RDONLY);
5378 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5379 exit(0); /* succeed (yes, it's ELF) */
5384 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5386 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5390 echo "I'll use ld to build dynamic libraries."
5399 rp="What command should be used to create dynamic libraries?"
5405 Some systems may require passing special flags to $ld to create a
5406 library that can be dynamically loaded. If your ld flags include
5407 -L/other/path options to locate libraries outside your loader's normal
5408 search path, you may need to specify those -L options here as well. To
5409 use no flags, say "none".
5412 case "$lddlflags" in
5413 '') case "$osname" in
5414 beos) dflt='-nostart' ;;
5416 linux|irix*) dflt='-shared' ;;
5417 next) dflt='none' ;;
5418 solaris) dflt='-G' ;;
5419 sunos) dflt='-assert nodefinitions' ;;
5420 svr4*|esix*) dflt="-G $ldflags" ;;
5424 *) dflt="$lddlflags" ;;
5427 : Try to guess additional flags to pick up local libraries.
5428 : Be careful not to append to a plain 'none'
5432 for thisflag in $ldflags; do
5437 *) dflt="$dflt $thisflag" ;;
5444 ''|' ') dflt='none' ;;
5447 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5450 none) lddlflags=' ' ;;
5451 *) lddlflags="$ans" ;;
5456 Some systems may require passing special flags to $cc to indicate that
5457 the resulting executable will use dynamic linking. To use no flags,
5461 case "$ccdlflags" in
5462 '') case "$osname" in
5463 hpux) dflt='-Wl,-E' ;;
5464 linux) dflt='-rdynamic' ;;
5465 next) dflt='none' ;;
5466 sunos) dflt='none' ;;
5470 *) dflt="$ccdlflags" ;;
5472 rp="Any special flags to pass to $cc to use dynamic loading?"
5475 none) ccdlflags=' ' ;;
5476 *) ccdlflags="$ans" ;;
5490 # No dynamic loading being used, so don't bother even to prompt.
5493 *) case "$useshrplib" in
5494 '') case "$osname" in
5495 svr4*|dgux|dynixptx|esix|powerux|beos)
5497 also='Building a shared libperl is required for dynamic loading to work on your system.'
5502 also='Building a shared libperl is needed for MAB support.'
5520 The perl executable is normally obtained by linking perlmain.c with
5521 libperl${_a}, any static extensions (usually just DynaLoader), and
5522 any other libraries needed on this system (such as -lm, etc.). Since
5523 your system supports dynamic loading, it is probably possible to build
5524 a shared libperl.$so. If you will have more than one executable linked
5525 to libperl.$so, this will significantly reduce the size of each
5526 executable, but it may have a noticeable affect on performance. The
5527 default is probably sensible for your system.
5531 rp="Build a shared libperl.$so (y/n)"
5535 useshrplib='true' ;;
5536 *) useshrplib='false' ;;
5541 case "$useshrplib" in
5545 # Figure out a good name for libperl.so. Since it gets stored in
5546 # a version-specific architecture-dependent library, the version
5547 # number isn't really that important, except for making cc/ld happy.
5549 # A name such as libperl.so.3.1
5550 majmin="libperl.$so.$patchlevel.$subversion"
5551 # A name such as libperl.so.301
5552 majonly=`echo $patchlevel $subversion |
5553 $awk '{printf "%d%02d", $1, $2}'`
5554 majonly=libperl.$so.$majonly
5555 # I'd prefer to keep the os-specific stuff here to a minimum, and
5556 # rely on figuring it out from the naming of libc.
5557 case "${osname}${osvers}" in
5560 # XXX How handle the --version stuff for MAB?
5562 linux*) # ld won't link with a bare -lperl otherwise.
5565 *) # Try to guess based on whether libc has major.minor.
5567 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5568 *libc.$so.[0-9]*) dflt=$majonly ;;
5569 *) dflt=libperl.$so ;;
5579 I need to select a good name for the shared libperl. If your system uses
5580 library names with major and minor numbers, then you might want something
5581 like $majmin. Alternatively, if your system uses a single version
5582 number for shared libraries, then you might want to use $majonly.
5583 Or, your system might be quite happy with a simple libperl.$so.
5585 Since the shared libperl will get installed into a version-specific
5586 architecture-dependent directory, the version number of the shared perl
5587 library probably isn't important, so the default should be o.k.
5590 rp='What name do you want to give to the shared libperl?'
5593 echo "Ok, I'll use $libperl"
5596 libperl="libperl${_a}"
5600 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5604 WARNING: Use of the shrpdir variable for the installation location of
5605 the shared $libperl is not supported. It was never documented and
5606 will not work in this version. Let me (perlbug@perl.com)
5607 know of any problems this may cause.
5613 But your current setting of $shrpdir is
5614 the default anyway, so it's harmless.
5619 Further, your current attempted setting of $shrpdir
5620 conflicts with the value of $archlibexp/CORE
5621 that installperl will use.
5628 # How will the perl executable find the installed shared $libperl?
5629 # Add $xxx to ccdlflags.
5630 # If we can't figure out a command-line option, use $shrpenv to
5631 # set env LD_RUN_PATH. The main perl makefile uses this.
5632 shrpdir=$archlibexp/CORE
5635 if "$useshrplib"; then
5638 # We'll set it in Makefile.SH...
5644 xxx="-Wl,-R$shrpdir"
5646 linux|irix*|dec_osf)
5647 xxx="-Wl,-rpath,$shrpdir"
5650 # next doesn't like the default...
5653 # beos doesn't like the default, either.
5656 # hpux doesn't like the default, either.
5657 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5660 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5666 # Only add $xxx if it isn't already in ccdlflags.
5667 case " $ccdlflags " in
5669 *) ccdlflags="$ccdlflags $xxx"
5672 Adding $xxx to the flags
5673 passed to $ld so that the perl executable will find the
5674 installed shared $libperl.
5682 # Fix ccdlflags in AIX for building external extensions.
5683 # (For building Perl itself bare -bE:perl.exp is needed,
5684 # Makefile.SH takes care of this.)
5686 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5688 # Respect a hint or command-line value.
5690 '') shrpenv="$tmp_shrpenv" ;;
5692 case "$ldlibpthname" in
5693 '') ldlibpthname=LD_LIBRARY_PATH ;;
5694 none) ldlibpthname='' ;;
5697 : determine where manual pages go
5698 set man1dir man1dir none
5702 $spackage has manual pages available in source form.
5706 echo "However, you don't have nroff, so they're probably useless to you."
5708 '') man1dir="none";;
5711 echo "If you don't want the manual sources installed, answer 'none'."
5716 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5717 lookpath="$lookpath $prefixexp/man/p_man/man1"
5718 lookpath="$lookpath $prefixexp/man/u_man/man1"
5719 lookpath="$lookpath $prefixexp/man/man.1"
5721 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5722 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5732 rp="Where do the main $spackage manual pages (source) go?"
5734 if $test "X$man1direxp" != "X$ansexp"; then
5738 man1direxp="$ansexp"
5744 : Change installation prefix, if necessary.
5745 if $test X"$prefix" != X"$installprefix"; then
5746 installman1dir=`echo $man1direxp | $sed 's#^$prefix#$installprefix#'`
5748 installman1dir="$man1direxp"
5751 : What suffix to use on installed man pages
5758 rp="What suffix should be used for the main $spackage man pages?"
5760 '') case "$man1dir" in
5774 *) dflt="$man1ext";;
5781 : see if we can have long filenames
5783 rmlist="$rmlist /tmp/cf$$"
5784 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5785 first=123456789abcdef
5786 second=/tmp/cf$$/$first
5787 $rm -f $first $second
5788 if (echo hi >$first) 2>/dev/null; then
5789 if $test -f 123456789abcde; then
5790 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5793 if (echo hi >$second) 2>/dev/null; then
5794 if $test -f /tmp/cf$$/123456789abcde; then
5796 That's peculiar... You can have filenames longer than 14 characters, but only
5797 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5798 I shall consider your system cannot support long filenames at all.
5802 echo 'You can have filenames longer than 14 characters.' >&4
5807 How confusing! Some of your filesystems are sane enough to allow filenames
5808 longer than 14 characters but some others like /tmp can't even think about them.
5809 So, for now on, I shall assume your kernel does not allow them at all.
5816 You can't have filenames longer than 14 chars. You can't even think about them!
5822 $rm -rf /tmp/cf$$ 123456789abcde*
5824 : determine where library module manual pages go
5825 set man3dir man3dir none
5829 $spackage has manual pages for many of the library modules.
5835 However, you don't have nroff, so they're probably useless to you.
5838 '') man3dir="none";;
5842 case "$d_flexfnam" in
5845 However, your system can't handle the long file names like File::Basename.3.
5848 '') man3dir="none";;
5852 echo "If you don't want the manual sources installed, answer 'none'."
5853 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5855 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5856 if $test -d "$privlib/man/man3"; then
5859 WARNING: Previous versions of perl installed man3 pages into
5860 $privlib/man/man3. This version will suggest a
5861 new default of $dflt.
5865 rp='Do you wish to preserve the old behavior?(y/n)'
5868 y*) dflt="$privlib/man/man3" ;;
5874 *) dflt="$man3dir" ;;
5878 rp="Where do the $package library man pages (source) go?"
5881 man3direxp="$ansexp"
5887 : Change installation prefix, if necessary.
5888 if $test X"$prefix" != X"$installprefix"; then
5889 installman3dir=`echo $man3direxp | $sed 's#^$prefix#$installprefix#'`
5891 installman3dir="$man3direxp"
5894 : What suffix to use on installed man pages
5900 rp="What suffix should be used for the $package library man pages?"
5902 '') case "$man3dir" in
5916 *) dflt="$man3ext";;
5923 : see if we have to deal with yellow pages, now NIS.
5924 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5925 if $test -f /usr/etc/nibindd; then
5927 echo "I'm fairly confident you're on a NeXT."
5929 rp='Do you get the hosts file via NetInfo?'
5938 y*) hostcat='nidump hosts .';;
5939 *) case "$hostcat" in
5940 nidump*) hostcat='';;
5950 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5958 rp='Are you getting the hosts file via yellow pages?'
5961 y*) hostcat='ypcat hosts';;
5962 *) hostcat='cat /etc/hosts';;
5968 '') hostcat='cat /etc/hosts';;
5971 '') groupcat='cat /etc/group';;
5974 '') passcat='cat /etc/passwd';;
5977 : now get the host name
5979 echo "Figuring out host name..." >&4
5980 case "$myhostname" in
5982 echo 'Maybe "hostname" will work...'
5983 if tans=`sh -c hostname 2>&1` ; then
5991 if $test "$cont"; then
5993 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5994 if tans=`cat /etc/systemid 2>&1` ; then
5996 phostname='cat /etc/systemid'
5997 echo "Whadyaknow. Xenix always was a bit strange..."
6000 elif $test -r /etc/systemid; then
6001 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6004 if $test "$cont"; then
6005 echo 'No, maybe "uuname -l" will work...'
6006 if tans=`sh -c 'uuname -l' 2>&1` ; then
6008 phostname='uuname -l'
6010 echo 'Strange. Maybe "uname -n" will work...'
6011 if tans=`sh -c 'uname -n' 2>&1` ; then
6013 phostname='uname -n'
6015 echo 'Oh well, maybe I can mine it out of whoami.h...'
6016 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6017 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6018 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6020 case "$myhostname" in
6021 '') echo "Does this machine have an identity crisis or something?"
6024 echo "Well, you said $myhostname before..."
6025 phostname='echo $myhostname';;
6031 : you do not want to know about this
6036 if $test "$myhostname" ; then
6038 rp='Your host name appears to be "'$myhostname'".'" Right?"
6046 : bad guess or no guess
6047 while $test "X$myhostname" = X ; do
6049 rp="Please type the (one word) name of your host:"
6054 : translate upper to lower if necessary
6055 case "$myhostname" in
6057 echo "(Normalizing case in your host name)"
6058 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6062 case "$myhostname" in
6064 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6065 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6066 echo "(Trimming domain name from host name--host name is now $myhostname)"
6068 *) case "$mydomain" in
6071 test "X$hostcat" = "Xypcat hosts" &&
6072 ypmatch "$myhostname" hosts 2>/dev/null |\
6073 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6076 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6077 /[ ]$myhostname[ . ]/p" > hosts
6080 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6081 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6082 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6083 hosts | $sort | $uniq | \
6084 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6085 case `$echo X$dflt` in
6086 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6089 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6094 tans=`./loc resolv.conf X /etc /usr/etc`
6095 if $test -f "$tans"; then
6096 echo "(Attempting domain name extraction from $tans)"
6097 dflt=.`$sed -n -e 's/ / /g' \
6098 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6099 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6101 .) dflt=.`$sed -n -e 's/ / /g' \
6102 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6103 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6110 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6111 dflt=.`sh -c domainname 2>/dev/null`
6114 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6119 .) echo "(Lost all hope -- silly guess then)"
6125 *) dflt="$mydomain";;
6129 rp="What is your domain name?"
6139 : translate upper to lower if necessary
6142 echo "(Normalizing case in your domain name)"
6143 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6147 : a little sanity check here
6148 case "$phostname" in
6151 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6152 $myhostname$mydomain|$myhostname) ;;
6154 case "$phostname" in
6156 echo "(That doesn't agree with your whoami.h file, by the way.)"
6159 echo "(That doesn't agree with your $phostname command, by the way.)"
6169 I need to get your e-mail address in Internet format if possible, i.e.
6170 something like user@host.domain. Please answer accurately since I have
6171 no easy means to double check it. The default value provided below
6172 is most probably close to the reality but may not be valid from outside
6173 your organization...
6177 while test "$cont"; do
6179 '') dflt="$cf_by@$myhostname$mydomain";;
6180 *) dflt="$cf_email";;
6182 rp='What is your e-mail address?'
6188 rp='Address does not look like an Internet one. Use it anyway?'
6204 If you or somebody else will be maintaining perl at your site, please
6205 fill in the correct e-mail address here so that they may be contacted
6206 if necessary. Currently, the "perlbug" program included with perl
6207 will send mail to this address in addition to perlbug@perl.com. You may
6208 enter "none" for no administrator.
6211 case "$perladmin" in
6212 '') dflt="$cf_email";;
6213 *) dflt="$perladmin";;
6215 rp='Perl administrator e-mail address'
6219 : figure out how to guarantee perl startup
6220 case "$startperl" in
6222 case "$sharpbang" in
6226 I can use the #! construct to start perl on your system. This will
6227 make startup of perl scripts faster, but may cause problems if you
6228 want to share those scripts and perl is not in a standard place
6229 ($binexp/perl) on all your platforms. The alternative is to force
6230 a shell by starting the script with a single ':' character.
6234 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6237 none) startperl=": # use perl";;
6238 *) startperl="#!$ans"
6239 if $test 30 -lt `echo "$ans" | wc -c`; then
6242 WARNING: Some systems limit the #! command to 32 characters.
6243 If you experience difficulty running Perl scripts with #!, try
6244 installing Perl in a directory with a shorter pathname.
6250 *) startperl=": # use perl"
6255 echo "I'll use $startperl to start perl scripts."
6257 : figure best path for perl in scripts
6260 perlpath="$binexp/perl"
6261 case "$startperl" in
6266 I will use the "eval 'exec'" idiom to start Perl on your system.
6267 I can use the full path of your Perl binary for this purpose, but
6268 doing so may cause problems if you want to share those scripts and
6269 Perl is not always in a standard place ($binexp/perl).
6273 rp="What path shall I use in \"eval 'exec'\"?"
6280 case "$startperl" in
6282 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6285 : determine where public executable scripts go
6286 set scriptdir scriptdir
6288 case "$scriptdir" in
6291 : guess some guesses
6292 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6293 $test -d /usr/share/bin && dflt=/usr/share/bin
6294 $test -d /usr/local/script && dflt=/usr/local/script
6295 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6296 $test -d $prefixexp/script && dflt=$prefixexp/script
6300 *) dflt="$scriptdir"
6305 Some installations have a separate directory just for executable scripts so
6306 that they can mount it across multiple architectures but keep the scripts in
6307 one spot. You might, for example, have a subdirectory of /usr/share for this.
6308 Or you might just lump your scripts in with all your other executables.
6312 rp='Where do you keep publicly executable scripts?'
6314 if $test "X$ansexp" != "X$scriptdirexp"; then
6318 scriptdirexp="$ansexp"
6319 : Change installation prefix, if necessary.
6320 if $test X"$prefix" != X"$installprefix"; then
6321 installscript=`echo $scriptdirexp | sed 's#^$prefix#$installprefix#'`
6323 installscript="$scriptdirexp"
6328 After $package is installed, you may wish to install various
6329 add-on modules and utilities. Typically, these add-ons will
6330 be installed under $prefix with the rest
6331 of this package. However, you may wish to install such add-ons
6332 elsewhere under a different prefix.
6334 If you do not wish to put everything under a single prefix, that's
6335 ok. You will be prompted for the individual locations; this siteprefix
6336 is only used to suggest the defaults.
6338 The default should be fine for most people.
6342 rp='Installation prefix to use for add-on modules and utilities?'
6343 : XXX Here might be another good place for an installstyle setting.
6344 case "$siteprefix" in
6346 *) dflt=$siteprefix ;;
6350 case "$siteprefix" in
6355 *) oldsiteprefix="$prefix";;
6360 siteprefixexp="$ansexp"
6362 : determine where site specific libraries go.
6363 : Usual default is /usr/local/lib/perl5/site_perl
6364 : The default "style" setting is made in installstyle.U
6365 : XXX No longer works with Prefixit stuff.
6366 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6367 case "$installstyle" in
6368 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6369 *) dflt=$siteprefix/lib/site_$prog ;;
6373 The installation process will create a directory for
6374 site-specific extensions and modules. Most users find it convenient
6375 to place all site-specific files in this directory rather than in the
6376 main distribution directory.
6380 rp='Pathname for the site-specific library files?'
6383 sitelibexp="$ansexp"
6384 : Change installation prefix, if necessary.
6385 if $test X"$prefix" != X"$installprefix"; then
6386 installsitelib=`echo $sitelibexp | sed 's#^$prefix#$installprefix#'`
6388 installsitelib="$sitelibexp"
6391 : determine where site specific architecture-dependent libraries go.
6392 : sitelib default is /usr/local/lib/perl5/site_perl/
6393 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6394 : sitelib may have an optional trailing /share.
6395 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6396 tdflt="$tdflt/$apiversion/$archname"
6397 set sitearch sitearch none
6400 '') dflt="$tdflt" ;;
6401 *) dflt="$sitearch" ;;
6405 The installation process will also create a directory for
6406 architecture-dependent site-specific extensions and modules.
6410 rp='Pathname for the site-specific architecture-dependent library files?'
6413 sitearchexp="$ansexp"
6414 : Change installation prefix, if necessary.
6415 if $test X"$prefix" != X"$installprefix"; then
6416 installsitearch=`echo $sitearchexp | sed 's#^$prefix#$installprefix#'`
6418 installsitearch="$sitearchexp"
6423 Perl can be built to take advantage of long doubles which
6424 (if available) may give more accuracy and range for floating point
6425 numbers. To do so, Configure must be run with -Duselongdouble.
6427 If this doesn't make any sense to you, just accept the default 'n'.
6429 case "$uselongdouble" in
6430 $define|true|[yY]*) dflt='y';;
6433 rp='Try to use long doubles if available?'
6436 y|Y) val="$define" ;;
6442 case "$uselongdouble" in
6443 "$define"|true|[yY]*)
6444 : Look for a hint-file generated 'call-back-unit'. If the
6445 : user has specified that long doubles should be used,
6446 : we may need to set or change some other defaults.
6447 if $test -f uselongdouble.cbu; then
6448 echo "Your platform has some specific hints for long doubles, using them..."
6449 . ./uselongdouble.cbu
6452 (Your platform doesn't have any specific hints for long doubles.)
6460 Previous version of $package used the standard IO mechanisms as defined
6461 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6462 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6463 the default. This abstraction layer can use AT&T's sfio (if you already
6464 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6465 problems with some extension modules. Using PerlIO with stdio is safe,
6466 but it is slower than plain stdio and therefore is not the default.
6468 If this doesn't make any sense to you, just accept the default 'n'.
6470 case "$useperlio" in
6471 $define|true|[yY]*) dflt='y';;
6474 rp='Use the experimental PerlIO abstraction layer?'
6481 echo "Ok, doing things the stdio way"
6488 : Check how to convert floats to strings.
6489 if test "X$d_Gconvert" = X; then
6491 echo "Checking for an efficient way to convert floats to strings."
6494 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6495 char *myname = "gconvert";
6498 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6499 char *myname = "gcvt";
6502 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6503 char *myname = "sprintf";
6509 checkit(expect, got)
6513 if (strcmp(expect, got)) {
6514 printf("%s oddity: Expected %s, got %s\n",
6515 myname, expect, got);
6525 /* This must be 1st test on (which?) platform */
6526 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6527 Gconvert(0.1, 8, 0, buf);
6528 checkit("0.1", buf);
6530 Gconvert(1.0, 8, 0, buf);
6533 Gconvert(0.0, 8, 0, buf);
6536 Gconvert(-1.0, 8, 0, buf);
6539 /* Some Linux gcvt's give 1.e+5 here. */
6540 Gconvert(100000.0, 8, 0, buf);
6541 checkit("100000", buf);
6543 /* Some Linux gcvt's give -1.e+5 here. */
6544 Gconvert(-100000.0, 8, 0, buf);
6545 checkit("-100000", buf);
6550 case "$d_Gconvert" in
6551 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6552 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6553 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6554 *) xxx_list='gconvert gcvt sprintf' ;;
6557 for xxx_convert in $xxx_list; do
6558 echo "Trying $xxx_convert"
6560 set try -DTRY_$xxx_convert
6561 if eval $compile; then
6562 echo "$xxx_convert" found. >&4
6564 echo "I'll use $xxx_convert to convert floats into a string." >&4
6567 echo "...But $xxx_convert didn't work as I expected."
6570 echo "$xxx_convert NOT found." >&4
6574 case "$xxx_convert" in
6575 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6576 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6577 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6581 : see if inttypes.h is available
6582 : we want a real compile instead of Inhdr because some systems
6583 : have an inttypes.h which includes non-existent headers
6586 #include <inttypes.h>
6588 static int32_t foo32 = 0x12345678;
6592 if eval $compile; then
6593 echo "<inttypes.h> found." >&4
6596 echo "<inttypes.h> NOT found." >&4
6604 case "$use64bits" in
6607 echo $n "Checking to see if your system supports int64_t...$c" >&4
6609 #include <sys/types.h>
6610 #$i_inttypes I_INTTYPES
6612 #include <inttypes.h>
6614 int64_t foo() { int64_t x; x = 7; return x; }
6616 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6618 echo " Yup, it does." >&4
6621 echo " Nope, it doesn't." >&4
6632 : check for lengths of integral types
6636 echo "Checking to see how big your integers are..." >&4
6637 $cat >intsize.c <<'EOCP'
6641 printf("intsize=%d;\n", sizeof(int));
6642 printf("longsize=%d;\n", sizeof(long));
6643 printf("shortsize=%d;\n", sizeof(short));
6648 if eval $compile_ok && ./intsize > /dev/null; then
6650 echo "Your integers are $intsize bytes long."
6651 echo "Your long integers are $longsize bytes long."
6652 echo "Your short integers are $shortsize bytes long."
6656 Help! I can't compile and run the intsize test program: please enlighten me!
6657 (This is probably a misconfiguration in your system or libraries, and
6658 you really ought to fix it. Still, I'll try anyway.)
6662 rp="What is the size of an integer (in bytes)?"
6666 rp="What is the size of a long integer (in bytes)?"
6670 rp="What is the size of a short integer (in bytes)?"
6676 $rm -f intsize intsize.*
6678 : check for long long
6680 echo $n "Checking to see if your system supports long long...$c" >&4
6681 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6682 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6684 echo " Yup, it does." >&4
6687 echo " Nope, it doesn't." >&4
6693 : check for length of long long
6694 case "${d_longlong}${longlongsize}" in
6697 $echo $n "Checking to see how big your long longs are...$c" >&4
6698 $cat >try.c <<'EOCP'
6702 printf("%d\n", sizeof(long long));
6706 if eval $compile_ok; then
6707 longlongsize=`./try`
6708 $echo " $longlongsize bytes." >&4
6712 echo "(I can't seem to compile the test program. Guessing...)"
6713 rp="What is the size of a long long (in bytes)?"
6717 if $test "X$longsize" = "X$longlongsize"; then
6718 echo "(That isn't any different from an ordinary long.)"
6726 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6728 echo "Checking how to print 64-bit integers..." >&4
6730 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6732 $cat >try.c <<'EOCP'
6733 #include <sys/types.h>
6736 int q = 12345678901;
6741 if eval $compile; then
6745 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6746 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6747 echo "We will use %d."
6753 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6755 $cat >try.c <<'EOCP'
6756 #include <sys/types.h>
6759 long q = 12345678901;
6764 if eval $compile; then
6768 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6769 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6770 echo "We will use %ld."
6776 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6778 $cat >try.c <<'EOCP'
6779 #include <sys/types.h>
6780 #include <inttypes.h>
6783 int64_t q = 12345678901;
6784 printf("%" PRId64 "\n", q);
6788 if eval $compile; then
6792 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6793 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6794 echo "We will use the C9X style."
6800 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6802 $cat >try.c <<'EOCP'
6803 #include <sys/types.h>
6806 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6807 printf("%lld\n", q);
6811 if eval $compile; then
6815 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6816 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6817 echo "We will use the %lld style."
6823 if $test X"$sPRId64" = X -a X"$quad" != X; then
6825 #include <sys/types.h>
6828 $quad q = 12345678901;
6833 if eval $compile; then
6837 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6838 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6839 echo "We will use %lld."
6845 if $test X"$sPRId64" = X -a X"$quad" != X; then
6847 #include <sys/types.h>
6850 $quad q = 12345678901;
6855 if eval $compile; then
6859 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6860 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6861 echo "We will use %qd."
6867 if $test X"$sPRId64" = X; then
6868 echo "Cannot figure out how to print 64-bit integers." >&4
6873 fi # intsize -o longsize -o d_int64t -o d_longlong
6876 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6877 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6879 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6880 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6884 : check for length of double
6886 case "$doublesize" in
6888 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6889 $cat >try.c <<'EOCP'
6893 printf("%d\n", sizeof(double));
6897 if eval $compile_ok; then
6899 $echo " $doublesize bytes." >&4
6902 echo "(I can't seem to compile the test program. Guessing...)"
6903 rp="What is the size of a double precision number (in bytes)?"
6911 : check for long doubles
6913 echo $n "Checking to see if your system supports long double...$c" >&4
6914 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
6915 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6917 echo " Yup, it does." >&4
6920 echo " Nope, it doesn't." >&4
6926 : check for length of long double
6927 case "${d_longdbl}${longdblsize}" in
6930 $echo $n "Checking to see how big your long doubles are...$c" >&4
6931 $cat >try.c <<'EOCP'
6935 printf("%d\n", sizeof(long double));
6939 if eval $compile; then
6941 $echo " $longdblsize bytes." >&4
6945 echo "(I can't seem to compile the test program. Guessing...)" >&4
6946 rp="What is the size of a long double (in bytes)?"
6950 if $test "X$doublesize" = "X$longdblsize"; then
6951 echo "(That isn't any different from an ordinary double.)"
6959 if $test X"$d_longdbl" = X"$define"; then
6961 echo "Checking how to print long doubles..." >&4
6963 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6964 $cat >try.c <<'EOCP'
6965 #include <sys/types.h>
6969 printf("%.3f\n", d);
6973 if eval $compile; then
6977 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6978 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
6979 echo "We will use %f."
6985 if $test X"$sPRIfldbl" = X; then
6986 $cat >try.c <<'EOCP'
6987 #include <sys/types.h>
6990 long double d = 123.456;
6991 printf("%.3llf\n", d);
6995 if eval $compile; then
6999 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7000 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7001 echo "We will use %llf."
7007 if $test X"$sPRIfldbl" = X; then
7008 $cat >try.c <<'EOCP'
7009 #include <sys/types.h>
7012 long double d = 123.456;
7013 printf("%.3Lf\n", d);
7017 if eval $compile; then
7021 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7022 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7023 echo "We will use %Lf."
7029 if $test X"$sPRIfldbl" = X; then
7030 $cat >try.c <<'EOCP'
7031 #include <sys/types.h>
7034 long double d = 123.456;
7035 printf("%.3lf\n", d);
7039 if eval $compile; then
7043 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7044 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7045 echo "We will use %lf."
7051 if $test X"$sPRIfldbl" = X; then
7052 echo "Cannot figure out how to print long doubles." >&4
7059 case "$sPRIfldbl" in
7060 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7061 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7063 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7064 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7068 : Initialize h_fcntl
7071 : Initialize h_sysfile
7074 : access call always available on UNIX
7078 : locate the flags for 'access()'
7082 $cat >access.c <<'EOCP'
7083 #include <sys/types.h>
7088 #include <sys/file.h>
7097 : check sys/file.h first, no particular reason here
7098 if $test `./findhdr sys/file.h` && \
7099 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7101 echo "<sys/file.h> defines the *_OK access constants." >&4
7102 elif $test `./findhdr fcntl.h` && \
7103 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7105 echo "<fcntl.h> defines the *_OK access constants." >&4
7106 elif $test `./findhdr unistd.h` && \
7107 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7108 echo "<unistd.h> defines the *_OK access constants." >&4
7110 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7116 : see if accessx exists
7117 set accessx d_accessx
7120 : see if alarm exists
7124 : see if atolf exists
7128 : see if atoll exists
7132 : Look for GNU-cc style attribute checking
7134 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7135 $cat >attrib.c <<'EOCP'
7137 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7139 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7140 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7141 echo "Your C compiler doesn't fully support __attribute__."
7144 echo "Your C compiler supports __attribute__."
7148 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7155 : see if bcmp exists
7159 : see if bcopy exists
7163 : see if this is a unistd.h system
7164 set unistd.h i_unistd
7167 : see if getpgrp exists
7168 set getpgrp d_getpgrp
7171 case "$d_getpgrp" in
7174 echo "Checking to see which flavor of getpgrp is in use..."
7177 #include <sys/types.h>
7179 # include <unistd.h>
7183 if (getuid() == 0) {
7184 printf("(I see you are running Configure as super-user...)\n");
7188 if (getpgrp(1) == 0)
7197 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7198 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7200 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7201 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7204 echo "I can't seem to compile and run the test program."
7206 xxx="a USG one, i.e. you use getpgrp()."
7208 # SVR4 systems can appear rather BSD-ish.
7211 xxx="a BSD one, i.e. you use getpgrp(pid)."
7215 xxx="probably a USG one, i.e. you use getpgrp()."
7220 echo "Assuming your getpgrp is $xxx" >&4
7229 : see if setpgrp exists
7230 set setpgrp d_setpgrp
7233 case "$d_setpgrp" in
7236 echo "Checking to see which flavor of setpgrp is in use..."
7239 #include <sys/types.h>
7241 # include <unistd.h>
7245 if (getuid() == 0) {
7246 printf("(I see you are running Configure as super-user...)\n");
7250 if (-1 == setpgrp(1, 1))
7253 if (setpgrp() != -1)
7259 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7260 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7262 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7263 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7266 echo "(I can't seem to compile and run the test program.)"
7268 xxx="a USG one, i.e. you use setpgrp()."
7270 # SVR4 systems can appear rather BSD-ish.
7273 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7277 xxx="probably a USG one, i.e. you use setpgrp()."
7282 echo "Assuming your setpgrp is $xxx" >&4
7290 : see if bzero exists
7294 : see if signal is declared as pointer to function returning int or void
7296 xxx=`./findhdr signal.h`
7297 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7298 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7299 echo "You have int (*signal())() instead of void." >&4
7301 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7302 echo "You have void (*signal())()." >&4
7304 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7305 echo "You have int (*signal())() instead of void." >&4
7307 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7308 echo "You have void (*signal())()." >&4
7311 case "$d_voidsig" in
7313 echo "I can't determine whether signal handler returns void or int..." >&4
7315 rp="What type does your signal handler return?"
7322 echo "As you already told me, signal handler returns void." >&4
7325 *) echo "As you already told me, signal handler returns int." >&4
7332 case "$d_voidsig" in
7333 "$define") signal_t="void";;
7338 : check for ability to cast large floats to 32-bit ints.
7340 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7341 if $test "$intsize" -ge 4; then
7348 #include <sys/types.h>
7350 $signal_t blech(s) int s; { exit(3); }
7357 signal(SIGFPE, blech);
7359 /* Don't let compiler optimize the test away. Store the number
7360 in a writable string for gcc to pass to sscanf under HP/UX.
7362 sprintf(str, "2147483647");
7363 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7367 /* x86 processors will probably give 0x8000 0000, which is a
7368 sign change. We don't want that. We want to mimic SPARC
7369 behavior here, which is to preserve the sign and give
7372 if (i32 != ($xxx) f)
7378 if eval $compile_ok; then
7382 echo "(I can't seem to compile the test program--assuming it can't)"
7390 echo "Nope, it can't."
7397 : check for ability to cast negative floats to unsigned
7399 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7402 #include <sys/types.h>
7404 $signal_t blech(s) int s; { exit(7); }
7405 $signal_t blech_in_list(s) int s; { exit(4); }
7406 unsigned long dummy_long(p) unsigned long p; { return p; }
7407 unsigned int dummy_int(p) unsigned int p; { return p; }
7408 unsigned short dummy_short(p) unsigned short p; { return p; }
7412 unsigned long along;
7414 unsigned short ashort;
7418 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7419 a direct f = -123. assignment. gcc-2.8.0 reportedly
7420 optimized the whole file away
7422 /* Store the number in a writable string for gcc to pass to
7425 sprintf(str, "-123");
7426 sscanf(str, "%lf", &f); /* f = -123.; */
7428 signal(SIGFPE, blech);
7429 along = (unsigned long)f;
7430 aint = (unsigned int)f;
7431 ashort = (unsigned short)f;
7432 if (along != (unsigned long)-123)
7434 if (aint != (unsigned int)-123)
7436 if (ashort != (unsigned short)-123)
7438 sprintf(str, "1073741824.");
7439 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7442 along = (unsigned long)f;
7443 if (along != 0x80000000)
7447 along = (unsigned long)f;
7448 if (along != 0x7fffffff)
7452 along = (unsigned long)f;
7453 if (along != 0x80000001)
7457 signal(SIGFPE, blech_in_list);
7458 sprintf(str, "123.");
7459 sscanf(str, "%lf", &f); /* f = 123.; */
7460 along = dummy_long((unsigned long)f);
7461 aint = dummy_int((unsigned int)f);
7462 ashort = dummy_short((unsigned short)f);
7463 if (along != (unsigned long)123)
7465 if (aint != (unsigned int)123)
7467 if (ashort != (unsigned short)123)
7474 if eval $compile_ok; then
7478 echo "(I can't seem to compile the test program--assuming it can't)"
7481 case "$castflags" in
7486 echo "Nope, it can't."
7493 : see if vprintf exists
7495 if set vprintf val -f d_vprintf; eval $csym; $val; then
7496 echo 'vprintf() found.' >&4
7498 $cat >vprintf.c <<'EOF'
7499 #include <varargs.h>
7501 int main() { xxx("foo"); }
7510 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7514 if eval $compile && ./vprintf; then
7515 echo "Your vsprintf() returns (int)." >&4
7518 echo "Your vsprintf() returns (char*)." >&4
7522 echo 'vprintf() NOT found.' >&4
7532 : see if chown exists
7536 : see if chroot exists
7540 : see if chsize exists
7544 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7545 while $test $# -ge 2; do
7547 $define) echo "#include <$2>";;
7551 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7552 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7561 : see if this is a sys/uio.h system
7562 set sys/uio.h i_sysuio
7565 echo "Checking to see if your system supports struct iovec..." >&4
7566 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7568 case "$d_iovec_s" in
7569 "$define") echo "Yup, it does." >&4
7571 *) echo "Nope, it doesn't." >&4
7577 : see whether socket exists
7579 $echo $n "Hmm... $c" >&4
7580 if set socket val -f d_socket; eval $csym; $val; then
7581 echo "Looks like you have Berkeley networking support." >&4
7583 if set setsockopt val -f; eval $csym; $val; then
7586 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7590 if $contains socklib libc.list >/dev/null 2>&1; then
7591 echo "Looks like you have Berkeley networking support." >&4
7593 : we will have to assume that it supports the 4.2 BSD interface
7596 echo "You don't have Berkeley networking in libc$_a..." >&4
7597 if test "X$d_socket" = "X$define"; then
7598 echo "...but you seem to believe that you have sockets." >&4
7600 for net in net socket
7602 if test -f /usr/lib/lib$net$_a; then
7603 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7604 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7605 if $contains socket libc.list >/dev/null 2>&1; then
7610 echo "...but the Wollongong group seems to have hacked it in." >&4
7611 sockethdr="-I/usr/netinclude"
7614 echo "Found Berkeley sockets interface in lib$net." >& 4
7615 if $contains setsockopt libc.list >/dev/null 2>&1; then
7618 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7625 if test "X$d_socket" != "X$define"; then
7626 echo "or anywhere else I see." >&4
7634 : see if socketpair exists
7635 set socketpair d_sockpair
7640 echo "Checking the availability of certain socket constants..." >& 4
7641 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7642 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7644 #include <sys/types.h>
7645 #include <sys/socket.h>
7651 set try; if eval $compile; then
7654 set d_${enum}; eval $setvar
7658 set sendmsg d_sendmsg
7661 set recvmsg d_recvmsg
7665 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7666 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7668 case "$d_msghdr_s" in
7669 "$define") echo "Yup, it does." >&4
7671 *) echo "Nope, it doesn't." >&4
7675 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7676 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7678 case "$d_cmsghdr_s" in
7679 "$define") echo "Yup, it does." >&4
7681 *) echo "Nope, it doesn't." >&4
7685 : check for const keyword
7687 echo 'Checking to see if your C compiler knows about "const"...' >&4
7688 $cat >const.c <<'EOCP'
7689 typedef struct spug { int drokk; } spug;
7696 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7698 echo "Yup, it does."
7701 echo "Nope, it doesn't."
7706 : see if crypt exists
7708 if set crypt val -f d_crypt; eval $csym; $val; then
7709 echo 'crypt() found.' >&4
7713 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7714 if $test -z "$cryptlib"; then
7715 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7719 if $test -z "$cryptlib"; then
7720 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7724 if $test -z "$cryptlib"; then
7725 cryptlib=`./loc libcrypt$_a "" $libpth`
7729 if $test -z "$cryptlib"; then
7730 echo 'crypt() NOT found.' >&4
7739 : get csh whereabouts
7741 'csh') val="$undef" ;;
7746 : Respect a hint or command line value for full_csh.
7748 '') full_csh=$csh ;;
7751 : see if cuserid exists
7752 set cuserid d_cuserid
7755 : see if this is a limits.h system
7756 set limits.h i_limits
7759 : see if this is a float.h system
7763 : See if number of significant digits in a double precision number is known
7765 $cat >dbl_dig.c <<EOM
7775 printf("Contains DBL_DIG");
7778 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7779 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7780 echo "DBL_DIG found." >&4
7783 echo "DBL_DIG NOT found." >&4
7790 : see if difftime exists
7791 set difftime d_difftime
7794 : see if this is a dirent system
7796 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7798 echo "<dirent.h> found." >&4
7801 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7802 echo "<sys/dir.h> found." >&4
7805 xinc=`./findhdr sys/ndir.h`
7807 echo "<dirent.h> NOT found." >&4
7812 : Look for type of directory structure.
7814 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7816 case "$direntrytype" in
7819 $define) guess1='struct dirent' ;;
7820 *) guess1='struct direct' ;;
7823 *) guess1="$direntrytype"
7828 'struct dirent') guess2='struct direct' ;;
7829 *) guess2='struct dirent' ;;
7832 if $contains "$guess1" try.c >/dev/null 2>&1; then
7833 direntrytype="$guess1"
7834 echo "Your directory entries are $direntrytype." >&4
7835 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7836 direntrytype="$guess2"
7837 echo "Your directory entries seem to be $direntrytype." >&4
7839 echo "I don't recognize your system's directory entries." >&4
7840 rp="What type is used for directory entries on this system?"
7848 : see if the directory entry stores field length
7850 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7851 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7852 echo "Good, your directory entry keeps length information in d_namlen." >&4
7855 echo "Your directory entry does not know about the d_namlen field." >&4
7862 : see if dlerror exists
7865 set dlerror d_dlerror
7869 : see if dlfcn is available
7877 On a few systems, the dynamically loaded modules that perl generates and uses
7878 will need a different extension than shared libs. The default will probably
7886 rp='What is the extension of dynamically loaded modules'
7895 : Check if dlsym need a leading underscore
7901 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7902 $cat >dyna.c <<'EOM'
7911 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7913 #include <sys/types.h>
7927 int mode = RTLD_LAZY ;
7929 handle = dlopen("./dyna.$dlext", mode) ;
7930 if (handle == NULL) {
7935 symbol = dlsym(handle, "fred") ;
7936 if (symbol == NULL) {
7937 /* try putting a leading underscore */
7938 symbol = dlsym(handle, "_fred") ;
7939 if (symbol == NULL) {
7952 : Call the object file tmp-dyna.o in case dlext=o.
7953 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7954 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7955 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7956 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7959 1) echo "Test program failed using dlopen." >&4
7960 echo "Perhaps you should not use dynamic loading." >&4;;
7961 2) echo "Test program failed using dlsym." >&4
7962 echo "Perhaps you should not use dynamic loading." >&4;;
7963 3) echo "dlsym needs a leading underscore" >&4
7965 4) echo "dlsym doesn't need a leading underscore." >&4;;
7968 echo "I can't compile and run the test program." >&4
7969 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7974 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7979 hasproto='varname=$1; func=$2; shift; shift;
7980 while $test $# -ge 2; do
7982 $define) echo "#include <$2>";;
7986 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7987 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7988 echo "$func() prototype found.";
7991 echo "$func() prototype NOT found.";
7996 $rm -f try.c tryout.c'
7998 : see if prototype for drand48 is available
8000 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8003 : see if dup2 exists
8007 : see if eaccess exists
8008 set eaccess d_eaccess
8011 : see if endgrent exists
8012 set endgrent d_endgrent
8015 : see if endhostent exists
8016 set endhostent d_endhent
8019 : see if endnetent exists
8020 set endnetent d_endnent
8023 : see if endprotoent exists
8024 set endprotoent d_endpent
8027 : see if endpwent exists
8028 set endpwent d_endpwent
8031 : see if endservent exists
8032 set endservent d_endsent
8035 : see if endspent exists
8036 set endspent d_endspent
8039 : Locate the flags for 'open()'
8041 $cat >open3.c <<'EOCP'
8042 #include <sys/types.h>
8047 #include <sys/file.h>
8058 : check sys/file.h first to get FREAD on Sun
8059 if $test `./findhdr sys/file.h` && \
8060 set open3 -DI_SYS_FILE && eval $compile; then
8062 echo "<sys/file.h> defines the O_* constants..." >&4
8064 echo "and you have the 3 argument form of open()." >&4
8067 echo "but not the 3 argument form of open(). Oh, well." >&4
8070 elif $test `./findhdr fcntl.h` && \
8071 set open3 -DI_FCNTL && eval $compile; then
8073 echo "<fcntl.h> defines the O_* constants..." >&4
8075 echo "and you have the 3 argument form of open()." >&4
8078 echo "but not the 3 argument form of open(). Oh, well." >&4
8083 echo "I can't find the O_* constant definitions! You got problems." >&4
8089 : check for non-blocking I/O stuff
8090 case "$h_sysfile" in
8091 true) echo "#include <sys/file.h>" > head.c;;
8094 true) echo "#include <fcntl.h>" > head.c;;
8095 *) echo "#include <sys/fcntl.h>" > head.c;;
8100 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8101 case "$o_nonblock" in
8104 $cat >>try.c <<'EOCP'
8107 printf("O_NONBLOCK\n");
8111 printf("O_NDELAY\n");
8115 printf("FNDELAY\n");
8122 if eval $compile_ok; then
8124 case "$o_nonblock" in
8125 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8126 *) echo "Seems like we can use $o_nonblock.";;
8129 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8132 *) echo "Using $hint value $o_nonblock.";;
8134 $rm -f try try.* .out core
8137 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8143 #include <sys/types.h>
8145 #define MY_O_NONBLOCK $o_nonblock
8146 #ifndef errno /* XXX need better Configure test */
8149 $signal_t blech(x) int x; { exit(3); }
8151 $cat >> try.c <<'EOCP'
8159 pipe(pd); /* Down: child -> parent */
8160 pipe(pu); /* Up: parent -> child */
8163 close(pd[1]); /* Parent reads from pd[0] */
8164 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8165 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8167 signal(SIGALRM, blech);
8169 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8171 sprintf(string, "%d\n", ret);
8172 write(2, string, strlen(string));
8175 if (errno == EAGAIN) {
8181 if (errno == EWOULDBLOCK)
8182 printf("EWOULDBLOCK\n");
8185 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8186 sleep(2); /* Give it time to close our pipe */
8188 ret = read(pd[0], buf, 1); /* Should read EOF */
8190 sprintf(string, "%d\n", ret);
8191 write(3, string, strlen(string));
8195 close(pd[0]); /* We write to pd[1] */
8196 close(pu[1]); /* We read from pu[0] */
8197 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8198 close(pd[1]); /* Pipe pd is now fully closed! */
8199 exit(0); /* Bye bye, thank you for playing! */
8203 if eval $compile_ok; then
8204 echo "$startsh" >mtry
8205 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8207 ./mtry >/dev/null 2>&1
8209 0) eagain=`$cat try.out`;;
8210 1) echo "Could not perform non-blocking setting!";;
8211 2) echo "I did a successful read() for something that was not there!";;
8212 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8213 *) echo "Something terribly wrong happened during testing.";;
8215 rd_nodata=`$cat try.ret`
8216 echo "A read() system call with no data present returns $rd_nodata."
8217 case "$rd_nodata" in
8220 echo "(That's peculiar, fixing that to be -1.)"
8226 echo "Forcing errno EAGAIN on read() with no data available."
8230 echo "Your read() sets errno to $eagain when no data is available."
8233 status=`$cat try.err`
8235 0) echo "And it correctly returns 0 to signal EOF.";;
8236 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8237 *) echo "However, your read() returns '$status' on EOF??";;
8240 if test "$status" = "$rd_nodata"; then
8241 echo "WARNING: you can't distinguish between EOF and no data!"
8245 echo "I can't compile the test program--assuming errno EAGAIN will do."
8252 echo "Using $hint value $eagain."
8253 echo "Your read() returns $rd_nodata when no data is present."
8254 case "$d_eofnblk" in
8255 "$define") echo "And you can see EOF because read() returns 0.";;
8256 "$undef") echo "But you can't see EOF status from read() returned value.";;
8258 echo "(Assuming you can't see EOF status from read anyway.)"
8264 $rm -f try try.* .out core head.c mtry
8266 : see if fchmod exists
8270 : see if fchown exists
8274 : see if this is an fcntl system
8278 : see if sys/select.h has to be included
8279 set sys/select.h i_sysselct
8282 : see if we should include time.h, sys/time.h, or both
8284 if test "X$timeincl" = X; then
8285 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8286 $echo $n "I'm now running the test program...$c"
8287 $cat >try.c <<'EOCP'
8288 #include <sys/types.h>
8293 #ifdef SYSTIMEKERNEL
8296 #include <sys/time.h>
8299 #include <sys/select.h>
8308 struct timezone tzp;
8310 if (foo.tm_sec == foo.tm_sec)
8313 if (bar.tv_sec == bar.tv_sec)
8320 for s_timezone in '-DS_TIMEZONE' ''; do
8322 for s_timeval in '-DS_TIMEVAL' ''; do
8323 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8324 for i_time in '' '-DI_TIME'; do
8325 for i_systime in '-DI_SYSTIME' ''; do
8328 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8329 if eval $compile; then
8330 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8334 $echo $n "Succeeded with $flags$c"
8346 *SYSTIMEKERNEL*) i_systimek="$define"
8347 timeincl=`./findhdr sys/time.h`
8348 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8349 *) i_systimek="$undef";;
8352 *I_TIME*) i_time="$define"
8353 timeincl=`./findhdr time.h`" $timeincl"
8354 echo "We'll include <time.h>." >&4;;
8355 *) i_time="$undef";;
8358 *I_SYSTIME*) i_systime="$define"
8359 timeincl=`./findhdr sys/time.h`" $timeincl"
8360 echo "We'll include <sys/time.h>." >&4;;
8361 *) i_systime="$undef";;
8366 : check for fd_set items
8369 Checking to see how well your C compiler handles fd_set and friends ...
8371 $cat >fd_set.c <<EOCP
8372 #$i_systime I_SYS_TIME
8373 #$i_sysselct I_SYS_SELECT
8374 #$d_socket HAS_SOCKET
8375 #include <sys/types.h>
8377 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8380 #include <sys/time.h>
8383 #include <sys/select.h>
8392 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8399 set fd_set -DTRYBITS
8400 if eval $compile; then
8401 d_fds_bits="$define"
8403 echo "Well, your system knows about the normal fd_set typedef..." >&4
8405 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8406 d_fd_macros="$define"
8409 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8411 d_fd_macros="$undef"
8415 Hmm, your compiler has some difficulty with fd_set. Checking further...
8418 if eval $compile; then
8421 echo "Well, your system has some sort of fd_set available..." >&4
8423 echo "and you have the normal fd_set macros." >&4
8424 d_fd_macros="$define"
8427 but not the normal fd_set macros! Gross! More work for me...
8429 d_fd_macros="$undef"
8432 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8435 d_fd_macros="$undef"
8440 : see if fgetpos exists
8441 set fgetpos d_fgetpos
8444 : see if flock exists
8448 : see if fork exists
8452 : see if pathconf exists
8453 set pathconf d_pathconf
8456 : see if fpathconf exists
8457 set fpathconf d_fpathconf
8461 : see if llseek exists
8467 echo $n "Checking to see if your system supports off64_t...$c" >&4
8469 #include <sys/types.h>
8471 off64_t foo() { off64_t x; x = 7; return x; }'
8473 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8475 echo " Yup, it does." >&4
8478 echo " Nope, it doesn't." >&4
8484 : check for fpos64_t
8486 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8488 #include <sys/stdio.h>
8489 fpos64_t foo() { fpos64_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 : see if fseeko exists
8506 : see if fsetpos exists
8507 set fsetpos d_fsetpos
8510 : see if this is a sys/param system
8511 set sys/param.h i_sysparam
8514 : see if this is a sys/mount.h system
8515 set sys/mount.h i_sysmount
8519 : see if statfs exists
8523 : see if fstatfs exists
8524 set fstatfs d_fstatfs
8527 : see if statfs knows about mount flags
8528 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8532 : see if statvfs exists
8533 set statvfs d_statvfs
8536 : see if fstatvfs exists
8537 set fstatvfs d_fstatvfs
8541 : see if ftello exists
8545 : see if getgrent exists
8546 set getgrent d_getgrent
8549 : see if gethostbyaddr exists
8550 set gethostbyaddr d_gethbyaddr
8553 : see if gethostbyname exists
8554 set gethostbyname d_gethbyname
8557 : see if gethostent exists
8558 set gethostent d_gethent
8561 : see how we will look up host name
8564 if set gethostname val -f d_gethname; eval $csym; $val; then
8565 echo 'gethostname() found.' >&4
8566 d_gethname="$define"
8569 if set uname val -f d_uname; eval $csym; $val; then
8572 uname() was found, but you're running xenix, and older versions of xenix
8573 have a broken uname(). If you don't really know whether your xenix is old
8574 enough to have a broken system call, use the default answer.
8581 rp='Is your uname() broken?'
8584 n*) d_uname="$define"; call=uname;;
8587 echo 'uname() found.' >&4
8594 case "$d_gethname" in
8595 '') d_gethname="$undef";;
8598 '') d_uname="$undef";;
8600 case "$d_uname$d_gethname" in
8605 Every now and then someone has a $call() that lies about the hostname
8606 but can't be fixed for political or economic reasons. If you wish, I can
8607 pretend $call() isn't there and maybe compute hostname at run-time
8608 thanks to the '$phostname' command.
8611 rp="Shall I ignore $call() from now on?"
8614 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8617 case "$phostname" in
8619 *) case "$aphostname" in
8625 file=`./loc $file $file $pth`
8626 aphostname=`echo $file $*`
8631 case "$d_uname$d_gethname" in
8634 case "$phostname" in
8636 echo "There will be no way for $package to get your hostname." >&4;;
8638 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8642 case "$d_phostname" in
8643 '') d_phostname="$undef";;
8646 : see if this is a netdb.h system
8650 : see if prototypes for various gethostxxx netdb.h functions are available
8652 set d_gethostprotos gethostent $i_netdb netdb.h
8655 : see if getlogin exists
8656 set getlogin d_getlogin
8659 : see if getmntent exists
8660 set getmntent d_getmntent
8663 : see if getnetbyaddr exists
8664 set getnetbyaddr d_getnbyaddr
8667 : see if getnetbyname exists
8668 set getnetbyname d_getnbyname
8671 : see if getnetent exists
8672 set getnetent d_getnent
8675 : see if prototypes for various getnetxxx netdb.h functions are available
8677 set d_getnetprotos getnetent $i_netdb netdb.h
8681 : see if getprotobyname exists
8682 set getprotobyname d_getpbyname
8685 : see if getprotobynumber exists
8686 set getprotobynumber d_getpbynumber
8689 : see if getprotoent exists
8690 set getprotoent d_getpent
8693 : see if getpgid exists
8694 set getpgid d_getpgid
8697 : see if getpgrp2 exists
8698 set getpgrp2 d_getpgrp2
8701 : see if getppid exists
8702 set getppid d_getppid
8705 : see if getpriority exists
8706 set getpriority d_getprior
8709 : see if prototypes for various getprotoxxx netdb.h functions are available
8711 set d_getprotoprotos getprotoent $i_netdb netdb.h
8714 : see if getpwent exists
8715 set getpwent d_getpwent
8719 : see if getservbyname exists
8720 set getservbyname d_getsbyname
8723 : see if getservbyport exists
8724 set getservbyport d_getsbyport
8727 : see if getservent exists
8728 set getservent d_getsent
8731 : see if prototypes for various getservxxx netdb.h functions are available
8733 set d_getservprotos getservent $i_netdb netdb.h
8736 : see if getspent exists
8737 set getspent d_getspent
8740 : see if getspnam exists
8741 set getspnam d_getspnam
8744 : see if gettimeofday or ftime exists
8745 set gettimeofday d_gettimeod
8747 case "$d_gettimeod" in
8753 val="$undef"; set d_ftime; eval $setvar
8756 case "$d_gettimeod$d_ftime" in
8759 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8763 : see if this is an grp system
8769 xxx=`./findhdr grp.h`
8770 $cppstdin $cppflags $cppminus < $xxx >$$.h
8772 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8784 set d_grpasswd; eval $setvar
8788 : see if hasmntopt exists
8789 set hasmntopt d_hasmntopt
8792 : see if this is a netinet/in.h or sys/in.h system
8793 set netinet/in.h i_niin sys/in.h i_sysin
8796 : see if arpa/inet.h has to be included
8797 set arpa/inet.h i_arpainet
8800 : see if htonl --and friends-- exists
8805 : Maybe they are macros.
8810 #include <sys/types.h>
8811 #$i_niin I_NETINET_IN
8813 #$i_arpainet I_ARPA_INET
8815 #include <netinet/in.h>
8821 #include <arpa/inet.h>
8824 printf("Defined as a macro.");
8827 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8828 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8830 echo "But it seems to be defined as a macro." >&4
8838 : see which of string.h or strings.h is needed
8840 strings=`./findhdr string.h`
8841 if $test "$strings" && $test -r "$strings"; then
8842 echo "Using <string.h> instead of <strings.h>." >&4
8846 strings=`./findhdr strings.h`
8847 if $test "$strings" && $test -r "$strings"; then
8848 echo "Using <strings.h> instead of <string.h>." >&4
8850 echo "No string header found -- You'll surely have problems." >&4
8856 "$undef") strings=`./findhdr strings.h`;;
8857 *) strings=`./findhdr string.h`;;
8862 if set index val -f; eval $csym; $val; then
8863 if set strchr val -f d_strchr; eval $csym; $val; then
8864 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8867 echo "strchr() found." >&4
8871 echo "index() found." >&4
8876 echo "index() found." >&4
8879 if set strchr val -f d_strchr; eval $csym; $val; then
8882 echo "strchr() found." >&4
8884 echo "No index() or strchr() found!" >&4
8889 set d_strchr; eval $setvar
8891 set d_index; eval $setvar
8893 : check whether inet_aton exists
8894 set inet_aton d_inetaton
8899 $cat >isascii.c <<'EOCP'
8911 if eval $compile; then
8912 echo "isascii() found." >&4
8915 echo "isascii() NOT found." >&4
8922 : see if killpg exists
8926 : see if lchown exists
8928 $cat > try.c <<'EOCP'
8929 /* System header to define __stub macros and hopefully few prototypes,
8930 which can conflict with char lchown(); below. */
8932 /* Override any gcc2 internal prototype to avoid an error. */
8933 /* We use char because int might match the return type of a gcc2
8934 builtin and then its argument prototype would still apply. */
8937 /* The GNU C library defines this for functions which it implements
8938 to always fail with ENOSYS. Some functions are actually named
8939 something starting with __ and the normal name is an alias. */
8940 #if defined (__stub_lchown) || defined (__stub___lchown)
8948 if eval $compile; then
8949 $echo "lchown() found." >&4
8952 $echo "lchown() NOT found." >&4
8958 : See if number of significant digits in a double precision number is known
8960 $cat >ldbl_dig.c <<EOM
8970 printf("Contains LDBL_DIG");
8973 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
8974 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
8975 echo "LDBL_DIG found." >&4
8978 echo "LDBL_DIG NOT found." >&4
8985 : see if link exists
8989 : see if localeconv exists
8990 set localeconv d_locconv
8993 : see if lockf exists
8997 : see if lstat exists
9001 : see if madvise exists
9002 set madvise d_madvise
9005 : see if mblen exists
9009 : see if mbstowcs exists
9010 set mbstowcs d_mbstowcs
9013 : see if mbtowc exists
9017 : see if memchr exists
9021 : see if memcmp exists
9025 : see if memcpy exists
9029 : see if memmove exists
9030 set memmove d_memmove
9033 : see if memset exists
9037 : see if mkdir exists
9041 : see if mkfifo exists
9045 : see if mktime exists
9049 : see if this is a sys/mman.h system
9050 set sys/mman.h i_sysmman
9053 : see if mmap exists
9056 : see what shmat returns
9057 : default to something harmless
9059 case "$i_sysmman$d_mmap" in
9061 $cat >mmap.c <<'END'
9062 #include <sys/mman.h>
9065 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9070 echo "and it returns ($mmaptype)." >&4
9076 : see if mprotect exists
9077 set mprotect d_mprotect
9080 : see if msgctl exists
9084 : see if msgget exists
9088 : see if msgsnd exists
9092 : see if msgrcv exists
9096 : see how much of the 'msg*(2)' library is present.
9099 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9100 *"$undef"*) h_msg=false;;
9104 case "`ipcs 2>&1`" in
9105 "SVID messages"*"not configured"*)
9106 echo "Your $osname does not have the msg*(2) configured." >&4
9121 : we could also check for sys/ipc.h ...
9122 if $h_msg && $test `./findhdr sys/msg.h`; then
9123 echo "You have the full msg*(2) library." >&4
9126 echo "You don't have the full msg*(2) library." >&4
9132 : see if msync exists
9136 : see if munmap exists
9140 : see if nice exists
9144 : see if POSIX threads are available
9145 if test "X$usethreads" = "X$define"; then
9146 set pthread.h i_pthread
9154 : how to create joinable pthreads
9155 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9157 echo "Checking what constant to use for creating joinable pthreads..." >&4
9158 $cat >try.c <<'EOCP'
9159 #include <pthread.h>
9161 int detachstate = JOINABLE;
9164 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9165 if eval $compile; then
9166 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9167 val="$undef" # Yes, undef.
9168 set d_old_pthread_create_joinable
9171 set old_pthread_create_joinable
9174 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9175 if eval $compile; then
9176 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9178 set d_old_pthread_create_joinable
9180 val=PTHREAD_CREATE_UNDETACHED
9181 set old_pthread_create_joinable
9184 set try -DJOINABLE=__UNDETACHED
9185 if eval $compile; then
9186 echo "You seem to use __UNDETACHED." >&4
9188 set d_old_pthread_create_joinable
9191 set old_pthread_create_joinable
9194 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9196 set d_old_pthread_create_joinable
9199 set old_pthread_create_joinable
9206 d_old_pthread_create_joinable="$undef"
9207 old_pthread_create_joinable=""
9210 : see if pause exists
9214 : see if pipe exists
9218 : see if poll exists
9223 : see whether the various POSIXish _yields exist
9225 #include <pthread.h>
9231 #ifdef PTHREAD_YIELD
9234 #ifdef PTHREAD_YIELD_NULL
9235 pthread_yield(NULL);
9241 : see if sched_yield exists
9242 set try -DSCHED_YIELD
9243 if eval $compile; then
9245 sched_yield='sched_yield()'
9249 case "$usethreads" in
9252 $define) echo 'sched_yield() found.' >&4 ;;
9253 *) echo 'sched_yield() NOT found.' >&4 ;;
9259 : see if pthread_yield exists
9260 set try -DPTHREAD_YIELD
9261 if eval $compile; then
9263 case "$sched_yield" in
9264 '') sched_yield='pthread_yield()' ;;
9267 set try -DPTHREAD_YIELD_NULL
9268 if eval $compile; then
9270 case "$sched_yield" in
9271 '') sched_yield='pthread_yield(NULL)' ;;
9277 case "$usethreads" in
9280 $define) echo 'pthread_yield() found.' >&4 ;;
9281 *) echo 'pthread_yield() NOT found.' >&4 ;;
9288 case "$sched_yield" in
9289 '') sched_yield=undef ;;
9294 : see if this is a pwd.h system
9300 xxx=`./findhdr pwd.h`
9301 $cppstdin $cppflags $cppminus < $xxx >$$.h
9303 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9311 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9319 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9327 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9335 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9343 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9351 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9359 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9371 set d_pwquota; eval $setvar
9372 set d_pwage; eval $setvar
9373 set d_pwchange; eval $setvar
9374 set d_pwclass; eval $setvar
9375 set d_pwexpire; eval $setvar
9376 set d_pwcomment; eval $setvar
9377 set d_pwgecos; eval $setvar
9378 set d_pwpasswd; eval $setvar
9382 : see if readdir and friends exist
9383 set readdir d_readdir
9385 set seekdir d_seekdir
9387 set telldir d_telldir
9389 set rewinddir d_rewinddir
9392 : see if readlink exists
9393 set readlink d_readlink
9396 : see if readv exists
9400 : see if rename exists
9404 : see if rmdir exists
9408 : see if memory.h is available.
9413 : See if it conflicts with string.h
9419 $cppstdin $cppflags $cppminus < $strings > mem.h
9420 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9422 echo "We won't be including <memory.h>."
9432 : can bcopy handle overlapping blocks?
9437 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9444 $cat >>try.c <<'EOCP'
9447 # include <memory.h>
9450 # include <stdlib.h>
9453 # include <string.h>
9455 # include <strings.h>
9458 # include <unistd.h> /* Needed for NetBSD */
9462 char buf[128], abc[128];
9468 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9470 for (align = 7; align >= 0; align--) {
9471 for (len = 36; len; len--) {
9474 for (off = 1; off <= len; off++) {
9475 bcopy(b, b+off, len);
9476 bcopy(b+off, b, len);
9477 if (bcmp(b, abc, len))
9486 if eval $compile_ok; then
9487 if ./try 2>/dev/null; then
9491 echo "It can't, sorry."
9492 case "$d_memmove" in
9493 "$define") echo "But that's Ok since you have memmove()." ;;
9497 echo "(I can't compile the test program, so we'll assume not...)"
9498 case "$d_memmove" in
9499 "$define") echo "But that's Ok since you have memmove()." ;;
9504 $rm -f try.* try core
9508 : can memcpy handle overlapping blocks?
9513 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9520 $cat >>try.c <<'EOCP'
9523 # include <memory.h>
9526 # include <stdlib.h>
9529 # include <string.h>
9531 # include <strings.h>
9534 # include <unistd.h> /* Needed for NetBSD */
9538 char buf[128], abc[128];
9544 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9545 try to store the string in read-only memory. */
9546 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9548 for (align = 7; align >= 0; align--) {
9549 for (len = 36; len; len--) {
9551 memcpy(b, abc, len);
9552 for (off = 1; off <= len; off++) {
9553 memcpy(b+off, b, len);
9554 memcpy(b, b+off, len);
9555 if (memcmp(b, abc, len))
9564 if eval $compile_ok; then
9565 if ./try 2>/dev/null; then
9569 echo "It can't, sorry."
9570 case "$d_memmove" in
9571 "$define") echo "But that's Ok since you have memmove()." ;;
9575 echo "(I can't compile the test program, so we'll assume not...)"
9576 case "$d_memmove" in
9577 "$define") echo "But that's Ok since you have memmove()." ;;
9582 $rm -f try.* try core
9586 : can memcmp be trusted to compare relative magnitude?
9591 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9598 $cat >>try.c <<'EOCP'
9601 # include <memory.h>
9604 # include <stdlib.h>
9607 # include <string.h>
9609 # include <strings.h>
9612 # include <unistd.h> /* Needed for NetBSD */
9618 if ((a < b) && memcmp(&a, &b, 1) < 0)
9624 if eval $compile_ok; then
9625 if ./try 2>/dev/null; then
9629 echo "No, it can't (it uses signed chars)."
9632 echo "(I can't compile the test program, so we'll assume not...)"
9636 $rm -f try.* try core
9640 : see if select exists
9644 : see if semctl exists
9648 : see if semget exists
9652 : see if semop exists
9656 : see how much of the 'sem*(2)' library is present.
9659 case "$d_semctl$d_semget$d_semop" in
9660 *"$undef"*) h_sem=false;;
9664 case "`ipcs 2>&1`" in
9665 "SVID messages"*"not configured"*)
9666 echo "Your $osname does not have the sem*(2) configured." >&4
9679 : we could also check for sys/ipc.h ...
9680 if $h_sem && $test `./findhdr sys/sem.h`; then
9681 echo "You have the full sem*(2) library." >&4
9684 echo "You don't have the full sem*(2) library." >&4
9690 : see whether sys/sem.h defines union semun
9692 $cat > try.c <<'END'
9693 #include <sys/types.h>
9694 #include <sys/ipc.h>
9695 #include <sys/sem.h>
9696 int main () { union semun semun; semun.buf = 0; }
9699 if eval $compile; then
9700 echo "You have union semun in <sys/sem.h>." >&4
9703 echo "You do not have union semun in <sys/sem.h>." >&4
9706 $rm -f try try.c try.h
9710 : see how to do semctl IPC_STAT
9713 : see whether semctl IPC_STAT can use union semun
9718 # define S_IRUSR S_IREAD
9719 # define S_IWUSR S_IWRITE
9720 # define S_IXUSR S_IEXEC
9722 # define S_IRUSR 0400
9723 # define S_IWUSR 0200
9724 # define S_IXUSR 0100
9726 # define S_IRGRP (S_IRUSR>>3)
9727 # define S_IWGRP (S_IWUSR>>3)
9728 # define S_IXGRP (S_IXUSR>>3)
9729 # define S_IROTH (S_IRUSR>>6)
9730 # define S_IWOTH (S_IWUSR>>6)
9731 # define S_IXOTH (S_IXUSR>>6)
9734 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9735 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9736 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9741 #include <sys/types.h>
9742 #include <sys/ipc.h>
9743 #include <sys/sem.h>
9744 #include <sys/stat.h>
9751 #$d_union_semun HAS_UNION_SEMUN
9754 #ifndef HAS_UNION_SEMUN
9757 struct semid_ds *buf;
9758 unsigned short *array;
9764 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9765 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9767 struct semid_ds argbuf;
9770 st = semctl(sem, 0, IPC_STAT, arg);
9774 # endif /* IPC_STAT */
9775 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9777 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9778 # endif /* IPC_RMID */
9779 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9781 #endif /* IPC_PRIVATE && ... */
9782 printf("semget failed: errno = %d\n", errno);
9788 if eval $compile; then
9791 semun) val="$define" ;;
9797 case "$d_semctl_semun" in
9799 echo "You can use union semun for semctl IPC_STAT." >&4
9802 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9807 : see whether semctl IPC_STAT can use struct semid_ds pointer
9808 $cat > try.c <<'END'
9809 #include <sys/types.h>
9810 #include <sys/ipc.h>
9811 #include <sys/sem.h>
9812 #include <sys/stat.h>
9820 struct semid_ds arg;
9823 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9824 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9827 st = semctl(sem, 0, IPC_STAT, &arg);
9829 printf("semid_ds\n");
9831 # endif /* IPC_STAT */
9832 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9834 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9835 # endif /* IPC_RMID */
9836 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9838 #endif /* IPC_PRIVATE && ... */
9839 printf("semget failed: errno = %d\n", errno);
9846 if eval $compile; then
9849 semid_ds) val="$define" ;;
9853 set d_semctl_semid_ds
9855 case "$d_semctl_semid_ds" in
9857 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9859 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9866 # We do not have the full sem*(2) library, so assume we can not
9872 set d_semctl_semid_ds
9877 : see if setegid exists
9878 set setegid d_setegid
9881 : see if seteuid exists
9882 set seteuid d_seteuid
9885 : see if setgrent exists
9886 set setgrent d_setgrent
9889 : see if sethostent exists
9890 set sethostent d_sethent
9893 : see if setlinebuf exists
9894 set setlinebuf d_setlinebuf
9897 : see if setlocale exists
9898 set setlocale d_setlocale
9901 : see if setnetent exists
9902 set setnetent d_setnent
9905 : see if setprotoent exists
9906 set setprotoent d_setpent
9909 : see if setpgid exists
9910 set setpgid d_setpgid
9913 : see if setpgrp2 exists
9914 set setpgrp2 d_setpgrp2
9917 : see if setpriority exists
9918 set setpriority d_setprior
9921 : see if setpwent exists
9922 set setpwent d_setpwent
9925 : see if setregid exists
9926 set setregid d_setregid
9928 set setresgid d_setresgid
9931 : see if setreuid exists
9932 set setreuid d_setreuid
9934 set setresuid d_setresuid
9937 : see if setrgid exists
9938 set setrgid d_setrgid
9941 : see if setruid exists
9942 set setruid d_setruid
9945 : see if setservent exists
9946 set setservent d_setsent
9949 : see if setsid exists
9953 : see if setspent exists
9954 set setspent d_setspent
9957 : see if setvbuf exists
9958 set setvbuf d_setvbuf
9961 : see if sfio.h is available
9966 : see if sfio library is available
9977 : Ok, but do we want to use it.
9981 true|$define|[yY]*) dflt='y';;
9984 echo "$package can use the sfio library, but it is experimental."
9985 rp="You seem to have sfio available, do you want to try using it?"
9989 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9991 : Remove sfio from list of libraries to use
9992 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9995 echo "libs = $libs" >&4
9999 *) case "$usesfio" in
10000 true|$define|[yY]*)
10001 echo "Sorry, cannot find sfio on this machine" >&4
10002 echo "Ignoring your setting of usesfio=$usesfio" >&4
10010 $define) usesfio='true';;
10011 *) usesfio='false';;
10014 : see if shmctl exists
10015 set shmctl d_shmctl
10018 : see if shmget exists
10019 set shmget d_shmget
10022 : see if shmat exists
10025 : see what shmat returns
10028 $cat >shmat.c <<'END'
10029 #include <sys/shm.h>
10032 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10037 echo "and it returns ($shmattype)." >&4
10038 : see if a prototype for shmat is available
10039 xxx=`./findhdr sys/shm.h`
10040 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10041 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10052 set d_shmatprototype
10055 : see if shmdt exists
10059 : see how much of the 'shm*(2)' library is present.
10062 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10063 *"$undef"*) h_shm=false;;
10067 case "`ipcs 2>&1`" in
10068 "SVID shared memory"*"not configured"*)
10069 echo "Your $osname does not have the shm*(2) configured." >&4
10072 set shmctl d_shmctl
10074 set shmget d_shmget
10084 : we could also check for sys/ipc.h ...
10085 if $h_shm && $test `./findhdr sys/shm.h`; then
10086 echo "You have the full shm*(2) library." >&4
10089 echo "You don't have the full shm*(2) library." >&4
10096 : see if we have sigaction
10097 if set sigaction val -f d_sigaction; eval $csym; $val; then
10098 echo 'sigaction() found.' >&4
10099 $cat > try.c <<'EOP'
10101 #include <sys/types.h>
10102 #include <signal.h>
10105 struct sigaction act, oact;
10109 if eval $compile_ok; then
10112 echo "But you don't seem to have a useable struct sigaction." >&4
10116 echo 'sigaction NOT found.' >&4
10119 set d_sigaction; eval $setvar
10120 $rm -f try try$_o try.c
10122 : see if sigsetjmp exists
10124 case "$d_sigsetjmp" in
10126 $cat >try.c <<'EOP'
10127 #include <setjmp.h>
10132 if (sigsetjmp(env,1))
10135 siglongjmp(env, 1);
10140 if eval $compile; then
10141 if ./try >/dev/null 2>&1; then
10142 echo "POSIX sigsetjmp found." >&4
10146 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10152 echo "sigsetjmp not found." >&4
10156 *) val="$d_sigsetjmp"
10157 case "$d_sigsetjmp" in
10158 $define) echo "POSIX sigsetjmp found." >&4;;
10159 $undef) echo "sigsetjmp not found." >&4;;
10167 : see if sys/stat.h is available
10168 set sys/stat.h i_sysstat
10171 : see if stat knows about block sizes
10173 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10176 : see if _ptr and _cnt from stdio act std
10178 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10179 echo "(Looks like you have stdio.h from Linux.)"
10180 case "$stdio_ptr" in
10181 '') stdio_ptr='((fp)->_IO_read_ptr)'
10184 *) ptr_lval=$d_stdio_ptr_lval;;
10186 case "$stdio_cnt" in
10187 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10190 *) cnt_lval=$d_stdio_cnt_lval;;
10192 case "$stdio_base" in
10193 '') stdio_base='((fp)->_IO_read_base)';;
10195 case "$stdio_bufsiz" in
10196 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10199 case "$stdio_ptr" in
10200 '') stdio_ptr='((fp)->_ptr)'
10203 *) ptr_lval=$d_stdio_ptr_lval;;
10205 case "$stdio_cnt" in
10206 '') stdio_cnt='((fp)->_cnt)'
10209 *) cnt_lval=$d_stdio_cnt_lval;;
10211 case "$stdio_base" in
10212 '') stdio_base='((fp)->_base)';;
10214 case "$stdio_bufsiz" in
10215 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10218 : test whether _ptr and _cnt really work
10219 echo "Checking how std your stdio is..." >&4
10222 #define FILE_ptr(fp) $stdio_ptr
10223 #define FILE_cnt(fp) $stdio_cnt
10225 FILE *fp = fopen("try.c", "r");
10228 18 <= FILE_cnt(fp) &&
10229 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10237 if eval $compile; then
10239 echo "Your stdio acts pretty std."
10242 echo "Your stdio isn't very std."
10245 echo "Your stdio doesn't appear very std."
10251 : Can _ptr be used as an lvalue?
10252 case "$d_stdstdio$ptr_lval" in
10253 $define$define) val=$define ;;
10256 set d_stdio_ptr_lval
10259 : Can _cnt be used as an lvalue?
10260 case "$d_stdstdio$cnt_lval" in
10261 $define$define) val=$define ;;
10264 set d_stdio_cnt_lval
10267 : see if _base is also standard
10269 case "$d_stdstdio" in
10273 #define FILE_base(fp) $stdio_base
10274 #define FILE_bufsiz(fp) $stdio_bufsiz
10276 FILE *fp = fopen("try.c", "r");
10279 19 <= FILE_bufsiz(fp) &&
10280 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10287 if eval $compile; then
10289 echo "And its _base field acts std."
10292 echo "But its _base field isn't std."
10295 echo "However, it seems to be lacking the _base field."
10304 Checking how to access stdio streams by file descriptor number...
10306 case "$stdio_stream_array" in
10307 '') $cat >try.c <<EOCP
10310 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10314 for s in _iob __iob __sF
10316 set try -DSTDIO_STREAM_ARRAY=$s
10317 if eval $compile; then
10318 case "`./try$exe_ext`" in
10319 yes) stdio_stream_array=$s; break ;;
10323 $rm -f try.* try$exe_ext
10325 case "$stdio_stream_array" in
10327 I can't figure out how to access stdio streams by file descriptor number.
10329 d_stdio_stream_array="$undef"
10332 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10334 d_stdio_stream_array="$define"
10338 : see if strcoll exists
10339 set strcoll d_strcoll
10342 : check for structure copying
10344 echo "Checking to see if your C compiler can copy structs..." >&4
10345 $cat >try.c <<'EOCP'
10355 if $cc -c try.c >/dev/null 2>&1 ; then
10357 echo "Yup, it can."
10360 echo "Nope, it can't."
10366 : see if strerror and/or sys_errlist[] exist
10368 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10369 if set strerror val -f d_strerror; eval $csym; $val; then
10370 echo 'strerror() found.' >&4
10371 d_strerror="$define"
10372 d_strerrm='strerror(e)'
10373 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10374 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10375 d_syserrlst="$define"
10377 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10378 d_syserrlst="$undef"
10380 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10381 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10382 echo 'strerror() found in string header.' >&4
10383 d_strerror="$define"
10384 d_strerrm='strerror(e)'
10385 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10386 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10387 d_syserrlst="$define"
10389 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10390 d_syserrlst="$undef"
10392 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10393 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10394 d_strerror="$undef"
10395 d_syserrlst="$define"
10396 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10398 echo 'strerror() and sys_errlist[] NOT found.' >&4
10399 d_strerror="$undef"
10400 d_syserrlst="$undef"
10401 d_strerrm='"unknown"'
10405 : see if strtod exists
10406 set strtod d_strtod
10409 : see if strtol exists
10410 set strtol d_strtol
10413 : see if strtoul exists
10414 set strtoul d_strtoul
10417 : see if strtoull exists
10418 set strtoull d_strtoull
10421 : see if strxfrm exists
10422 set strxfrm d_strxfrm
10425 : see if symlink exists
10426 set symlink d_symlink
10429 : see if syscall exists
10430 set syscall d_syscall
10433 : see if sysconf exists
10434 set sysconf d_sysconf
10437 : see if system exists
10438 set system d_system
10441 : see if tcgetpgrp exists
10442 set tcgetpgrp d_tcgetpgrp
10445 : see if tcsetpgrp exists
10446 set tcsetpgrp d_tcsetpgrp
10449 : see if sys/types.h has to be included
10450 set sys/types.h i_systypes
10453 : see if prototype for telldir is available
10455 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10458 : define an is-a-typedef? function
10459 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10461 "") inclist="sys/types.h";;
10463 eval "varval=\$$var";
10467 for inc in $inclist; do
10468 echo "#include <$inc>" >>temp.c;
10470 echo "#ifdef $type" >> temp.c;
10471 echo "printf(\"We have $type\");" >> temp.c;
10472 echo "#endif" >> temp.c;
10473 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10474 if $contains $type temp.E >/dev/null 2>&1; then
10475 eval "$var=\$type";
10480 *) eval "$var=\$varval";;
10483 : define an is-a-typedef? function that prompts if the type is not available.
10484 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10486 "") inclist="sys/types.h";;
10488 eval "varval=\$$var";
10492 for inc in $inclist; do
10493 echo "#include <$inc>" >>temp.c;
10495 echo "#ifdef $type" >> temp.c;
10496 echo "printf(\"We have $type\");" >> temp.c;
10497 echo "#endif" >> temp.c;
10498 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10500 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10501 if $contains $type temp.E >/dev/null 2>&1; then
10502 echo "$type found." >&4;
10503 eval "$var=\$type";
10505 echo "$type NOT found." >&4;
10511 *) eval "$var=\$varval";;
10514 : see if this is a sys/times.h system
10515 set sys/times.h i_systimes
10518 : see if times exists
10520 if set times val -f d_times; eval $csym; $val; then
10521 echo 'times() found.' >&4
10524 case "$i_systimes" in
10525 "$define") inc='sys/times.h';;
10527 rp="What is the type returned by times() on this system?"
10528 set clock_t clocktype long stdio.h sys/types.h $inc
10531 echo 'times() NOT found, hope that will do.' >&4
10536 : see if truncate exists
10537 set truncate d_truncate
10540 : see if tzname[] exists
10542 if set tzname val -a d_tzname; eval $csym; $val; then
10544 echo 'tzname[] found.' >&4
10547 echo 'tzname[] NOT found.' >&4
10552 : see if umask exists
10556 : backward compatibility for d_hvfork
10557 if test X$d_hvfork != X; then
10558 d_vfork="$d_hvfork"
10561 : see if there is a vfork
10566 : Ok, but do we want to use it. vfork is reportedly unreliable in
10567 : perl on Solaris 2.x, and probably elsewhere.
10571 case "$usevfork" in
10577 Perl can only use a vfork() that doesn't suffer from strict
10578 restrictions on calling functions or modifying global data in
10579 the child. For example, glibc-2.1 contains such a vfork()
10580 that is unsuitable. If your system provides a proper fork()
10581 call, chances are that you do NOT want perl to use vfork().
10584 rp="Do you still want to use vfork()?"
10589 echo "Ok, we won't use vfork()."
10598 $define) usevfork='true';;
10599 *) usevfork='false';;
10602 : see if this is an sysdir system
10603 set sys/dir.h i_sysdir
10606 : see if this is an sysndir system
10607 set sys/ndir.h i_sysndir
10610 : see if closedir exists
10611 set closedir d_closedir
10614 case "$d_closedir" in
10617 echo "Checking whether closedir() returns a status..." >&4
10618 cat > closedir.c <<EOM
10619 #$i_dirent I_DIRENT /**/
10620 #$i_sysdir I_SYS_DIR /**/
10621 #$i_sysndir I_SYS_NDIR /**/
10622 #$i_systypes I_SYS_TYPES /**/
10624 #if defined(I_SYS_TYPES)
10625 #include <sys/types.h>
10627 #if defined(I_DIRENT)
10628 #include <dirent.h>
10629 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10630 #include <sys/dir.h>
10634 #include <sys/ndir.h>
10638 #include <ndir.h> /* may be wrong in the future */
10640 #include <sys/dir.h>
10645 int main() { return closedir(opendir(".")); }
10648 if eval $compile_ok; then
10649 if ./closedir > /dev/null 2>&1 ; then
10650 echo "Yes, it does."
10653 echo "No, it doesn't."
10657 echo "(I can't seem to compile the test program--assuming it doesn't)"
10665 set d_void_closedir
10668 : check for volatile keyword
10670 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10671 $cat >try.c <<'EOCP'
10674 typedef struct _goo_struct goo_struct;
10675 goo_struct * volatile goo = ((goo_struct *)0);
10676 struct _goo_struct {
10681 typedef unsigned short foo_t;
10682 char *volatile foo;
10684 volatile foo_t blech;
10688 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10690 echo "Yup, it does."
10693 echo "Nope, it doesn't."
10699 : see if there is a wait4
10703 : see if waitpid exists
10704 set waitpid d_waitpid
10707 : see if wcstombs exists
10708 set wcstombs d_wcstombs
10711 : see if wctomb exists
10712 set wctomb d_wctomb
10715 : see if writev exists
10716 set writev d_writev
10719 : preserve RCS keywords in files with variable substitution, grrr
10724 Revision='$Revision'
10726 case "$crosscompile" in
10727 ''|[nN]*) crosscompile="$undef" ;;
10731 next|rhapsody) multiarch="$define" ;;
10733 case "$multiarch" in
10734 ''|[nN]*) multiarch="$undef" ;;
10737 : check for alignment requirements
10739 case "$crosscompile$multiarch" in
10742 You seem to be either cross-compiling or doing a multiarchitecture build,
10743 skipping the memory alignment check.
10746 case "$alignbytes" in
10747 '') alignbytes=8 ;;
10751 case "$alignbytes" in
10752 '') echo "Checking alignment constraints..." >&4
10753 $cat >try.c <<'EOCP'
10760 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10764 if eval $compile_ok; then
10768 echo "(I can't seem to compile the test program...)"
10771 *) dflt="$alignbytes"
10774 rp="Doubles must be aligned on a how-many-byte boundary?"
10782 : check for ordering of bytes in a long
10784 case "$crosscompile$multiarch" in
10787 You seem to be either cross-compiling or doing a multiarchitecture build,
10788 skipping the byteorder check.
10794 case "$byteorder" in
10797 In the following, larger digits indicate more significance. A big-endian
10798 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10799 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10800 machines may have weird orders like 3412. A Cray will report 87654321,
10801 an Alpha will report 12345678. If the test program works the default is
10803 I'm now running the test program...
10805 $cat >try.c <<'EOCP'
10812 char c[sizeof(long)];
10815 if (sizeof(long) > 4)
10816 u.l = (0x08070605L << 32) | 0x04030201L;
10819 for (i = 0; i < sizeof(long); i++)
10820 printf("%c", u.c[i]+'0');
10827 if eval $compile && ./try > /dev/null; then
10830 [1-4][1-4][1-4][1-4]|12345678|87654321)
10831 echo "(The test program ran ok.)"
10832 echo "byteorder=$dflt"
10835 ????|????????) echo "(The test program ran ok.)" ;;
10836 *) echo "(The test program didn't run right for some reason.)" ;;
10841 (I can't seem to compile the test program. Guessing big-endian...)
10844 case "$xxx_prompt" in
10846 rp="What is the order of bytes in a long?"
10860 : how do we catenate cpp tokens here?
10862 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10863 $cat >cpp_stuff.c <<'EOCP'
10864 #define RCAT(a,b)a/**/b
10865 #define ACAT(a,b)a ## b
10869 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10870 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10871 echo "Oh! Smells like ANSI's been here." >&4
10872 echo "We can catify or stringify, separately or together!"
10874 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10875 echo "Ah, yes! The good old days!" >&4
10876 echo "However, in the good old days we don't know how to stringify and"
10877 echo "catify at the same time."
10881 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10882 to have to edit the values of CAT[2-5] in config.h...
10884 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10888 : see if this is a db.h system
10894 : Check db version.
10896 echo "Checking Berkeley DB version ..." >&4
10902 #include <sys/types.h>
10907 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10908 int Major, Minor, Patch ;
10909 unsigned long Version ;
10910 (void)db_version(&Major, &Minor, &Patch) ;
10911 printf("You have Berkeley DB Version 2 or greater\n");
10913 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10914 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10915 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10916 Major, Minor, Patch) ;
10918 /* check that db.h & libdb are compatible */
10919 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10920 printf("db.h and libdb are incompatible\n") ;
10924 printf("db.h and libdb are compatible\n") ;
10926 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10927 + DB_VERSION_PATCH ;
10929 /* needs to be >= 2.3.4 */
10930 if (Version < 2003004) {
10931 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10932 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10938 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10939 printf("You have Berkeley DB Version 1\n");
10940 exit(0); /* DB version < 2: the coast is clear. */
10942 exit(1); /* <db.h> not Berkeley DB? */
10948 if eval $compile && ./try; then
10949 echo 'Looks OK.' >&4
10951 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10955 : Remove db from list of libraries to use
10956 echo "Removing unusable -ldb from library list" >&4
10957 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10960 echo "libs = $libs" >&4
10970 : Check the return type needed for hash
10972 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10978 #include <sys/types.h>
10981 #ifndef DB_VERSION_MAJOR
10982 u_int32_t hash_cb (ptr, size)
10990 info.hash = hash_cb;
10994 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10995 if $contains warning try.out >>/dev/null 2>&1 ; then
10998 db_hashtype='u_int32_t'
11001 : XXX Maybe we should just give up here.
11002 db_hashtype=u_int32_t
11004 echo "Help: I can't seem to compile the db test program." >&4
11005 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11008 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11010 *) db_hashtype=u_int32_t
11015 : Check the return type needed for prefix
11017 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11023 #include <sys/types.h>
11026 #ifndef DB_VERSION_MAJOR
11027 size_t prefix_cb (key1, key2)
11035 info.prefix = prefix_cb;
11039 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11040 if $contains warning try.out >>/dev/null 2>&1 ; then
11041 db_prefixtype='int'
11043 db_prefixtype='size_t'
11046 db_prefixtype='size_t'
11047 : XXX Maybe we should just give up here.
11049 echo "Help: I can't seem to compile the db test program." >&4
11050 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11053 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11055 *) db_prefixtype='size_t'
11059 : check for void type
11061 echo "Checking to see how well your C compiler groks the void type..." >&4
11062 case "$voidflags" in
11064 $cat >try.c <<'EOCP'
11070 extern void moo(); /* function returning void */
11071 void (*goo)(); /* ptr to func returning void */
11073 void *hue; /* generic ptr */
11086 int main() { sub(); }
11088 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11089 voidflags=$defvoidused
11090 echo "Good. It appears to support void to the level $package wants.">&4
11091 if $contains warning .out >/dev/null 2>&1; then
11092 echo "However, you might get some warnings that look like this:"
11096 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11097 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11098 echo "It supports 1..."
11099 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11100 echo "It also supports 2..."
11101 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11103 echo "And it supports 4 but not 8 definitely."
11105 echo "It doesn't support 4..."
11106 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11108 echo "But it supports 8."
11111 echo "Neither does it support 8."
11115 echo "It does not support 2..."
11116 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11118 echo "But it supports 4 and 8."
11120 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11122 echo "And it supports 4 but has not heard about 8."
11124 echo "However it supports 8 but not 4."
11129 echo "There is no support at all for void."
11134 case "$voidflags" in
11136 *) $cat >&4 <<'EOM'
11137 Support flag bits are:
11138 1: basic void declarations.
11139 2: arrays of pointers to functions returning void.
11140 4: operations between pointers to and addresses of void functions.
11141 8: generic void pointers.
11144 rp="Your void support flags add up to what?"
11152 : How can we generate normalized random numbers ?
11154 echo "Looking for a random number function..." >&4
11155 case "$randfunc" in
11157 if set drand48 val -f; eval $csym; $val; then
11159 echo "Good, found drand48()." >&4
11160 elif set random val -f; eval $csym; $val; then
11162 echo "OK, found random()." >&4
11165 echo "Yick, looks like I have to use rand()." >&4
11176 *-Dmy_rand=*|*-Dmy_srand=*)
11177 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11178 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11179 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11180 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11184 while $test "$cont"; do
11185 rp="Use which function to generate random numbers?"
11187 if $test "$ans" = "$dflt"; then
11193 if set $ans val -f; eval $csym; $val; then
11197 rp="I cannot find function $ans. Use that name anyway?"
11206 case "$randfunc" in
11208 drand01="drand48()"
11214 case "$randbits" in
11216 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11218 #$i_unistd I_UNISTD
11219 #$i_stdlib I_STDLIB
11222 # include <unistd.h>
11225 # include <stdlib.h>
11230 register unsigned long tmp;
11231 register unsigned long max = 0L;
11233 for (i = 1000; i; i--) {
11234 tmp = (unsigned long) $randfunc();
11235 if (tmp > max) max = tmp;
11237 for (i = 0; max; i++)
11243 if eval $compile_ok; then
11247 echo "(I can't seem to compile the test program...)"
11254 rp="How many bits does your $randfunc() function produce?"
11258 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11259 seedfunc="s$randfunc"
11260 randseedtype=unsigned
11264 rp="How many bits does your $randfunc() function produce?"
11267 seedfunc="s$randfunc"
11268 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11269 if set $seedfunc val -f; eval $csym; $val; then
11270 echo "(Using $seedfunc() to seed random generator)"
11272 echo "(Warning: no $seedfunc() to seed random generator)"
11275 randseedtype=unsigned
11283 echo "Determining whether or not we are on an EBCDIC system..." >&4
11284 $cat >tebcdic.c <<'EOM'
11287 if ('M'==0xd4) return 0;
11294 if eval $compile_ok; then
11296 echo "You have EBCDIC." >&4
11299 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11302 echo "I'm unable to compile the test program." >&4
11303 echo "I'll assume ASCII or some ISO Latin." >&4
11305 $rm -f tebcdic.c tebcdic
11311 Checking how to flush all pending stdio output...
11313 # I only know how to find the first 32 possibly open files on SunOS.
11314 # See also hints/sunos_4_1.sh and util.c --AD
11316 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11318 $cat >>try.c <<EOCP
11320 #$i_unistd I_UNISTD
11322 # include <unistd.h>
11324 #$d_sysconf HAS_SYSCONF
11325 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11326 #ifdef HAS_STDIO_STREAM_ARRAY
11327 # define STDIO_STREAM_ARRAY $stdio_stream_array
11330 FILE* p = fopen("try.out", "w");
11334 # ifdef TRY_FPRINTF
11338 #ifdef TRY_FFLUSH_NULL
11341 #ifdef TRY_FFLUSH_ALL
11343 long open_max = -1;
11344 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11345 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11347 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11348 open_max = sysconf(_SC_OPEN_MAX);
11351 open_max = FOPEN_MAX;
11354 open_max = OPEN_MAX;
11363 # ifdef HAS_STDIO_STREAM_ARRAY
11364 if (open_max > 0) {
11366 for (i = 0; i < open_max; i++)
11367 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11368 STDIO_STREAM_ARRAY[i]._file < open_max &&
11369 STDIO_STREAM_ARRAY[i]._flag)
11370 fflush(&STDIO_STREAM_ARRAY[i]);
11378 : first we have to find out how _not_ to flush
11379 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11381 set try -DTRY_FPUTC
11382 if eval $compile; then
11384 ./try$exe_ext 2>/dev/null
11385 if $test ! -s try.out -a "X$?" = X42; then
11391 set try -DTRY_FPRINTF
11393 if eval $compile; then
11395 ./try$exe_ext 2>/dev/null
11396 if $test ! -s try.out -a "X$?" = X42; then
11397 output=-DTRY_FPRINTF
11403 : check for fflush NULL behaviour
11404 case "$fflushNULL" in
11405 '') set try -DTRY_FFLUSH_NULL $output
11406 if eval $compile; then
11408 ./try$exe_ext 2>/dev/null
11410 if $test -s try.out -a "X$code" = X42; then
11411 fflushNULL="`$cat try.out`"
11413 if $test "X$code" != X42; then
11415 (If this test failed, don't worry, we'll try another method shortly.)
11420 $rm -f core try.core core.try.*
11421 case "$fflushNULL" in
11423 Your fflush(NULL) works okay.
11425 fflushNULL="$define"
11428 Your fflush(NULL) isn't working (contrary to ANSI C).
11430 fflushNULL="$undef"
11433 Cannot figure out whether your fflush(NULL) works or not.
11434 I'm assuming it doesn't (contrary to ANSI C).
11436 fflushNULL="$undef"
11440 $define|true|[yY]*)
11441 fflushNULL="$define"
11444 fflushNULL="$undef"
11447 : check explicit looping only if NULL did not work
11448 case "$fflushNULL" in
11450 : check for fflush all behaviour
11451 case "$fflushall" in
11452 '') set try -DTRY_FFLUSH_ALL $output
11453 if eval $compile; then
11455 (Now testing the other method--but note that also this may fail.)
11458 ./try$exe_ext 2>/dev/null
11459 if $test -s try.out -a "X$?" = X42; then
11460 fflushall="`$cat try.out`"
11463 $rm -f core try.core core.try.*
11464 case "$fflushall" in
11466 Whew. Flushing explicitly all the stdio streams works.
11468 fflushall="$define"
11471 Sigh. Flushing explicitly all the stdio streams doesn't work.
11476 Cannot figure out whether flushing stdio streams explicitly works or not.
11477 I'm assuming it doesn't.
11483 "$define"|true|[yY]*)
11484 fflushall="$define"
11491 *) fflushall="$undef"
11494 case "$fflushNULL$fflushall" in
11497 I cannot figure out how to flush pending stdio output.
11501 $rm -f try.* try$exe_ext
11503 : see what type file positions are declared as in the library
11504 rp="What is the type for file position used by fsetpos()?"
11505 set fpos_t fpostype long stdio.h sys/types.h
11508 : Store the full pathname to the ar program for use in the C program
11509 : Respect a hint or command line value for full_ar.
11514 : Store the full pathname to the sed program for use in the C program
11517 : see what type gids are declared as in the kernel
11519 echo "Looking for the type for group ids returned by getgid()."
11520 set gid_t gidtype xxx stdio.h sys/types.h
11524 xxx=`./findhdr sys/user.h`
11525 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11527 unsigned) dflt="$1 $2" ;;
11531 *) dflt="$gidtype";;
11534 gid_t) echo "gid_t found." ;;
11535 *) rp="What is the type for group ids returned by getgid()?"
11541 : see if getgroups exists
11542 set getgroups d_getgrps
11545 : see if setgroups exists
11546 set setgroups d_setgrps
11550 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11552 case "$d_getgrps$d_setgrps" in
11554 case "$groupstype" in
11555 '') dflt="$gidtype" ;;
11556 *) dflt="$groupstype" ;;
11559 What type of pointer is the second argument to getgroups() and setgroups()?
11560 Usually this is the same as group ids, $gidtype, but not always.
11563 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11567 *) groupstype="$gidtype";;
11570 : see what type lseek is declared as in the kernel
11571 rp="What is the type used for lseek's offset on this system?"
11572 set off_t lseektype long stdio.h sys/types.h
11576 $echo $n "Checking to see how big your file offsets are...$c" >&4
11578 #include <sys/types.h>
11582 printf("%d\n", sizeof($lseektype));
11586 if eval $compile_ok; then
11588 $echo " $lseeksize bytes." >&4
11592 echo "(I can't seem to compile the test program. Guessing...)"
11593 rp="What is the size of your file offsets (in bytes)?"
11600 echo "Checking if your $make program sets \$(MAKE)..." >&4
11601 case "$make_set_make" in
11603 $sed 's/^X //' > testmake.mak << 'EOF'
11605 X @echo 'maketemp="$(MAKE)"'
11607 case "`$make -f testmake.mak 2>/dev/null`" in
11608 *maketemp=*) make_set_make='#' ;;
11609 *) make_set_make="MAKE=$make" ;;
11611 $rm -f testmake.mak
11614 case "$make_set_make" in
11615 '#') echo "Yup, it does.";;
11616 *) echo "Nope, it doesn't.";;
11619 : see what type is used for mode_t
11620 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11621 set mode_t modetype int stdio.h sys/types.h
11624 : define a fucntion to check prototypes
11625 $cat > protochk <<EOSH
11628 optimize="$optimize"
11630 prototype="$prototype"
11635 $cat >> protochk <<'EOSH'
11640 while test $# -ge 2; do
11642 $define) echo "#include <$2>" >> try.c ;;
11643 literal) echo "$2" >> try.c ;;
11647 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11648 cat >> try.c <<'EOCP'
11649 #ifdef CAN_PROTOTYPE
11650 #define _(args) args
11655 echo "$foo" >> try.c
11656 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11657 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11663 $eunicefix protochk
11665 : see what type is used for size_t
11666 rp="What is the type used for the length parameter for string functions?"
11667 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11670 : check for type of arguments to gethostbyaddr.
11671 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11672 case "$d_gethbyaddr" in
11676 Checking to see what type of arguments are accepted by gethostbyaddr().
11678 hdrs="$define sys/types.h
11679 $d_socket sys/socket.h
11680 $i_niin netinet/in.h
11682 $i_unistd unistd.h"
11683 : The first arg can 'char *' or 'void *'
11684 : The second arg is some of integral type
11685 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11686 for yyy in size_t long int; do
11687 case "$netdb_host_type" in
11688 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11689 if ./protochk "$try" $hdrs; then
11690 echo "Your system accepts $xxx for the first arg."
11691 echo "...and $yyy for the second arg."
11692 netdb_host_type="$xxx"
11693 netdb_hlen_type="$yyy"
11699 : In case none of those worked, prompt the user.
11700 case "$netdb_host_type" in
11701 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11704 netdb_host_type=$ans
11705 rp='What is the type for the 2nd argument to gethostbyaddr?'
11708 netdb_hlen_type=$ans
11712 *) : no gethostbyaddr, so pick harmless defaults
11713 netdb_host_type='char *'
11714 netdb_hlen_type="$sizetype"
11717 # Remove the "const" if needed. -- but then we'll have a
11719 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11722 : check for type of argument to gethostbyname.
11723 if test "X$netdb_name_type" = X ; then
11724 case "$d_gethbyname" in
11728 Checking to see what type of argument is accepted by gethostbyname().
11730 hdrs="$define sys/types.h
11731 $d_socket sys/socket.h
11732 $i_niin netinet/in.h
11734 $i_unistd unistd.h"
11735 for xxx in "const char *" "char *"; do
11736 case "$netdb_name_type" in
11737 '') try="extern struct hostent *gethostbyname($xxx);"
11738 if ./protochk "$try" $hdrs; then
11739 echo "Your system accepts $xxx."
11740 netdb_name_type="$xxx"
11745 : In case none of those worked, prompt the user.
11746 case "$netdb_name_type" in
11747 '') rp='What is the type for the 1st argument to gethostbyname?'
11750 netdb_name_type=$ans
11754 *) : no gethostbyname, so pick harmless default
11755 netdb_name_type='char *'
11760 : check for type of 1st argument to getnetbyaddr.
11761 if test "X$netdb_net_type" = X ; then
11762 case "$d_getnbyaddr" in
11766 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11768 hdrs="$define sys/types.h
11769 $d_socket sys/socket.h
11770 $i_niin netinet/in.h
11772 $i_unistd unistd.h"
11773 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11774 case "$netdb_net_type" in
11775 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11776 if ./protochk "$try" $hdrs; then
11777 echo "Your system accepts $xxx."
11778 netdb_net_type="$xxx"
11783 : In case none of those worked, prompt the user.
11784 case "$netdb_net_type" in
11785 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11788 netdb_net_type=$ans
11792 *) : no getnetbyaddr, so pick harmless default
11793 netdb_net_type='long'
11797 : locate the preferred pager for this system
11811 '') dflt=/usr/ucb/more;;
11818 rp='What pager is used on your system?'
11822 : see what type pids are declared as in the kernel
11823 rp="What is the type of process ids on this system?"
11824 set pid_t pidtype int stdio.h sys/types.h
11827 : check for length of pointer
11831 $echo $n "Checking to see how big your pointers are...$c" >&4
11832 if test "$voidflags" -gt 7; then
11833 echo '#define VOID_PTR char *' > try.c
11835 echo '#define VOID_PTR void *' > try.c
11837 $cat >>try.c <<'EOCP'
11841 printf("%d\n", sizeof(VOID_PTR));
11846 if eval $compile_ok; then
11848 $echo " $ptrsize bytes." >&4
11851 echo "(I can't seem to compile the test program. Guessing...)" >&4
11852 rp="What is the size of a pointer (in bytes)?"
11860 : see if ar generates random libraries by itself
11862 echo "Checking how to generate random libraries on your machine..." >&4
11863 echo 'int bar1() { return bar2(); }' > bar1.c
11864 echo 'int bar2() { return 2; }' > bar2.c
11865 $cat > foo.c <<'EOP'
11866 int main() { printf("%d\n", bar1()); exit(0); }
11868 $cc $ccflags -c bar1.c >/dev/null 2>&1
11869 $cc $ccflags -c bar2.c >/dev/null 2>&1
11870 $cc $ccflags -c foo.c >/dev/null 2>&1
11871 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11872 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11873 ./foobar >/dev/null 2>&1; then
11874 echo "$ar appears to generate random libraries itself."
11877 elif $ar ts bar$_a >/dev/null 2>&1 &&
11878 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11879 ./foobar >/dev/null 2>&1; then
11880 echo "a table of contents needs to be added with '$ar ts'."
11887 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11888 $test -f $ranlib || ranlib=''
11891 if $test -n "$ranlib"; then
11892 echo "your system has '$ranlib'; we'll use that."
11895 echo "your system doesn't seem to support random libraries"
11896 echo "so we'll use lorder and tsort to order the libraries."
11903 : check for type of arguments to select.
11904 case "$selecttype" in
11905 '') case "$d_select" in
11908 Checking to see what type of arguments are accepted by select().
11910 hdrs="$define sys/types.h
11911 $i_systime sys/time.h
11912 $i_sysselct sys/select.h
11913 $d_socket sys/socket.h"
11914 : The first arg can be int, unsigned, or size_t
11915 : The last arg may or may not be 'const'
11917 : void pointer has been seen but using that
11918 : breaks the selectminbits test
11919 for xxx in 'fd_set *' 'int *'; do
11920 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11921 for tmo in 'struct timeval *' 'const struct timeval *'; do
11923 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11924 if ./protochk "$try" $hdrs; then
11925 echo "Your system accepts $xxx."
11934 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11935 case "$d_fd_set" in
11936 $define) dflt="fd_set *" ;;
11945 *) : no select, so pick a harmless default
11952 : check for the select 'width'
11953 case "$selectminbits" in
11954 '') case "$d_select" in
11958 Checking to see on how many bits at a time your select() operates...
11961 #include <sys/types.h>
11963 #$i_systime I_SYS_TIME
11964 #$i_systimek I_SYS_TIME_KERNEL
11969 # ifdef I_SYS_TIME_KERNEL
11972 # include <sys/time.h>
11973 # ifdef I_SYS_TIME_KERNEL
11977 #$i_sysselct I_SYS_SELECT
11978 #ifdef I_SYS_SELECT
11979 #include <sys/select.h>
11981 #$d_socket HAS_SOCKET
11983 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11987 #define S sizeof(*(b))
11989 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11990 #define NBITS (NBYTES * 8)
11999 fp = fopen("try.c", "r");
12005 b = ($selecttype)s;
12006 for (i = 0; i < NBITS; i++)
12010 select(fd + 1, b, 0, 0, &t);
12011 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12012 printf("%d\n", i + 1);
12017 if eval $compile_ok; then
12018 selectminbits=`./try`
12019 case "$selectminbits" in
12021 Cannot figure out on how many bits at a time your select() operates.
12022 I'll play safe and guess it is 32 bits.
12028 *) bits="$selectminbits bits" ;;
12030 echo "Your select() operates on $bits at a time." >&4
12032 rp='What is the minimum number of bits your select() operates on?'
12033 case "$byteorder" in
12034 1234|12345678) dflt=32 ;;
12039 selectminbits="$val"
12043 *) : no select, so pick a harmless default
12050 : Trace out the files included by signal.h, then look for SIGxxx names.
12051 : Remove SIGARRAYSIZE used by HPUX.
12052 : Remove SIGSTKSIZE used by Linux.
12053 : Remove SIGSTKSZ used by Posix.
12054 : Remove SIGTYP void lines used by OS2.
12055 xxx=`echo '#include <signal.h>' |
12056 $cppstdin $cppminus $cppflags 2>/dev/null |
12057 $grep '^[ ]*#.*include' |
12058 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12059 : Check this list of files to be sure we have parsed the cpp output ok.
12060 : This will also avoid potentially non-existent files, such
12063 for xx in $xxx /dev/null ; do
12064 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12066 : If we have found no files, at least try signal.h
12067 case "$xxxfiles" in
12068 '') xxxfiles=`./findhdr signal.h` ;;
12071 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12072 print substr($2, 4, 20)
12074 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12075 print substr($3, 4, 20)
12077 : Append some common names just in case the awk scan failed.
12078 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12079 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12080 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12081 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12082 : generate a few handy files for later
12083 $cat > signal.c <<'EOCP'
12084 #include <sys/types.h>
12085 #include <signal.h>
12089 /* Strange style to avoid deeply-nested #if/#else/#endif */
12092 # define NSIG (_NSIG)
12098 # define NSIG (SIGMAX+1)
12104 # define NSIG (SIG_MAX+1)
12110 # define NSIG (MAXSIG+1)
12116 # define NSIG (MAX_SIG+1)
12121 # ifdef SIGARRAYSIZE
12122 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12128 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12132 /* Default to some arbitrary number that's big enough to get most
12133 of the common signals.
12139 printf("NSIG %d\n", NSIG);
12145 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12147 printf "#ifdef SIG"; printf $1; printf "\n"
12148 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12149 printf $1; printf ");\n"
12153 printf "#endif /* JUST_NSIG */\n";
12157 $cat >signal.awk <<'EOP'
12158 BEGIN { ndups = 0 }
12159 $1 ~ /^NSIG$/ { nsig = $2 }
12160 ($1 !~ /^NSIG$/) && (NF == 2) {
12161 if ($2 > maxsig) { maxsig = $2 }
12162 if (sig_name[$2]) {
12163 dup_name[ndups] = $1
12164 dup_num[ndups] = $2
12176 printf("NSIG %d\n", nsig);
12177 for (n = 1; n < nsig; n++) {
12179 printf("%s %d\n", sig_name[n], sig_num[n])
12182 printf("NUM%d %d\n", n, n)
12185 for (n = 0; n < ndups; n++) {
12186 printf("%s %d\n", dup_name[n], dup_num[n])
12190 $cat >signal_cmd <<EOS
12192 if $test -s signal.lst; then
12193 echo "Using your existing signal.lst file"
12198 $cat >>signal_cmd <<'EOS'
12201 if eval $compile_ok; then
12202 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12204 echo "(I can't seem be able to compile the whole test program)" >&4
12205 echo "(I'll try it in little pieces.)" >&4
12206 set signal -DJUST_NSIG
12207 if eval $compile_ok; then
12208 ./signal$_exe > signal.nsg
12211 echo "I can't seem to figure out how many signals you have." >&4
12212 echo "Guessing 50." >&4
12213 echo 'NSIG 50' > signal.nsg
12215 : Now look at all the signal names, one at a time.
12216 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12217 $cat > signal.c <<EOCP
12218 #include <sys/types.h>
12219 #include <signal.h>
12222 printf("$xx %d\n", SIG${xx});
12227 if eval $compile; then
12228 echo "SIG${xx} found."
12229 ./signal$_exe >> signal.ls1
12231 echo "SIG${xx} NOT found."
12234 if $test -s signal.ls1; then
12235 $cat signal.nsg signal.ls1 |
12236 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12240 if $test -s signal.lst; then
12243 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12244 echo 'kill -l' >signal
12245 set X `csh -f <signal`
12249 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12251 echo $@ | $tr ' ' $trnl | \
12252 $awk '{ printf "%s %d\n", $1, ++s; }
12253 END { printf "NSIG %d\n", ++s }' >signal.lst
12255 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12257 chmod a+x signal_cmd
12258 $eunicefix signal_cmd
12260 : generate list of signal names
12262 case "$sig_name_init" in
12264 *) case "$sig_num_init" in
12265 ''|*,*) doinit=yes ;;
12270 echo "Generating a list of signal names and numbers..." >&4
12272 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12273 sig_name=`$awk 'BEGIN { printf "ZERO " }
12274 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12275 sig_num=`$awk 'BEGIN { printf "0 " }
12276 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12277 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12278 !/^NSIG/ { printf "\"%s\", ", $1 }
12279 END { printf "0\n" }' signal.lst`
12280 sig_num_init=`$awk 'BEGIN { printf "0, " }
12281 !/^NSIG/ { printf "%d, ", $2}
12282 END { printf "0\n"}' signal.lst`
12285 echo "The following $sig_count signals are available:"
12287 echo $sig_name | $awk \
12288 'BEGIN { linelen = 0 }
12290 for (i = 1; i <= NF; i++) {
12291 name = "SIG" $i " "
12292 linelen = linelen + length(name)
12293 if (linelen > 70) {
12295 linelen = length(name)
12301 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12303 : see what type is used for signed size_t
12304 set ssize_t ssizetype int stdio.h sys/types.h
12307 $cat > ssize.c <<EOM
12309 #include <sys/types.h>
12310 #define Size_t $sizetype
12311 #define SSize_t $dflt
12314 if (sizeof(Size_t) == sizeof(SSize_t))
12316 else if (sizeof(Size_t) == sizeof(int))
12325 if eval $compile_ok && ./ssize > /dev/null; then
12326 ssizetype=`./ssize`
12327 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12330 Help! I can't compile and run the ssize_t test program: please enlighten me!
12331 (This is probably a misconfiguration in your system or libraries, and
12332 you really ought to fix it. Still, I'll try anyway.)
12334 I need a type that is the same size as $sizetype, but is guaranteed to
12335 be signed. Common values are ssize_t, int and long.
12338 rp="What signed type is the same size as $sizetype?"
12342 $rm -f ssize ssize.*
12344 : see what type of char stdio uses.
12346 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12347 echo "Your stdio uses unsigned chars." >&4
12348 stdchar="unsigned char"
12350 echo "Your stdio uses signed chars." >&4
12354 : see if time exists
12356 if test "X$d_time" = X -o X"$timetype" = X; then
12357 if set time val -f d_time; eval $csym; $val; then
12358 echo 'time() found.' >&4
12360 rp="What is the type returned by time() on this system?"
12361 set time_t timetype long stdio.h sys/types.h
12364 echo 'time() not found, hope that will do.' >&4
12372 : see what type uids are declared as in the kernel
12374 echo "Looking for the type for user ids returned by getuid()."
12375 set uid_t uidtype xxx stdio.h sys/types.h
12379 xxx=`./findhdr sys/user.h`
12380 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12382 unsigned) dflt="$1 $2" ;;
12386 *) dflt="$uidtype";;
12389 uid_t) echo "uid_t found." ;;
12390 *) rp="What is the type for user ids returned by getuid()?"
12396 : see if dbm.h is available
12397 : see if dbmclose exists
12398 set dbmclose d_dbmclose
12401 case "$d_dbmclose" in
12411 *) set rpcsvc/dbm.h i_rpcsvcdbm
12416 *) echo "We won't be including <dbm.h>"
12426 : see if this is a sys/file.h system
12431 : do we need to include sys/file.h ?
12435 if $h_sysfile; then
12437 echo "We'll be including <sys/file.h>." >&4
12440 echo "We won't be including <sys/file.h>." >&4
12450 : see if fcntl.h is there
12455 : see if we can include fcntl.h
12461 echo "We'll be including <fcntl.h>." >&4
12464 if $h_sysfile; then
12465 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12467 echo "We won't be including <fcntl.h>." >&4
12479 : see if locale.h is available
12480 set locale.h i_locale
12483 : see if mach cthreads are available
12484 if test "X$usethreads" = "X$define"; then
12485 set mach/cthreads.h i_machcthr
12488 i_machcthr="$undef"
12493 : see if this is a math.h system
12497 : see if this is a mntent.h system
12498 set mntent.h i_mntent
12501 : see if ndbm.h is available
12506 : see if dbm_open exists
12507 set dbm_open d_dbm_open
12509 case "$d_dbm_open" in
12512 echo "We won't be including <ndbm.h>"
12521 : see if net/errno.h is available
12523 set net/errno.h val
12526 : Unfortunately, it causes problems on some systems. Arrgh.
12529 cat > try.c <<'EOM'
12532 #include <net/errno.h>
12538 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12539 echo "We'll be including <net/errno.h>." >&4
12541 echo "We won't be including <net/errno.h>." >&4
12550 : see if netinet/tcp.h is available
12551 set netinet/tcp.h i_netinettcp
12554 : see if this is a poll.h system
12558 : get C preprocessor symbols handy
12560 $echo $n "Hmm... $c"
12561 echo $al | $tr ' ' $trnl >Cppsym.know
12562 $cat <<EOSS >Cppsym
12570 case "\$list\$#" in
12573 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12575 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12578 unknown="\$unknown \$sym"
12588 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12590 exit 0; _ _ _ _\1\\ \1\\
12593 echo "exit 1; _ _ _" >>Cppsym\$\$
12594 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12596 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12602 $rm -f Cppsym\$\$ Cppsym2\$\$
12607 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12609 : now check the C compiler for additional symbols
12610 postprocess_cc_v=''
12612 aix) postprocess_cc_v="|$tr , ' '" ;;
12619 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12622 -D*) echo "\$i" | $sed 's/^-D//';;
12623 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12628 postprocess_cc_v=''
12631 ./ccsym > ccsym1.raw
12632 if $test -s ccsym1.raw; then
12633 $sort ccsym1.raw | $uniq >ccsym.raw
12635 mv ccsym1.raw ccsym.raw
12638 $awk '/\=/ { print $0; next }
12639 { print $0"=1" }' ccsym.raw >ccsym.list
12640 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12641 $comm -13 ccsym.true ccsym.list >ccsym.own
12642 $comm -12 ccsym.true ccsym.list >ccsym.com
12643 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12645 if $test -z ccsym.raw; then
12646 echo "Your C compiler doesn't seem to define any symbols!" >&4
12648 echo "However, your C preprocessor defines the following symbols:"
12651 cppsymbols=`$cat Cppsym.true`
12652 cppsymbols=`echo $cppsymbols`
12653 cppccsymbols="$cppsymbols"
12655 if $test -s ccsym.com; then
12656 echo "Your C compiler and pre-processor define these symbols:"
12657 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12660 cppccsymbols=`$cat ccsym.com`
12661 cppccsymbols=`echo $cppccsymbols`
12662 $test "$silent" || sleep 1
12664 if $test -s ccsym.cpp; then
12665 $test "$also" && echo " "
12666 echo "Your C pre-processor ${also}defines the following symbols:"
12667 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12669 cppsymbols=`$cat ccsym.cpp`
12670 cppsymbols=`echo $cppsymbols`
12671 $test "$silent" || sleep 1
12673 if $test -s ccsym.own; then
12674 $test "$also" && echo " "
12675 echo "Your C compiler ${also}defines the following cpp symbols:"
12676 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12677 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12678 ccsymbols=`$cat ccsym.own`
12679 ccsymbols=`echo $ccsymbols`
12680 $test "$silent" || sleep 1
12685 : see if this is a termio system
12689 if $test `./findhdr termios.h`; then
12690 set tcsetattr i_termios
12696 "$define") echo "You have POSIX termios.h... good!" >&4;;
12697 *) if ./Cppsym pyr; then
12698 case "`/bin/universe`" in
12699 ucb) if $test `./findhdr sgtty.h`; then
12701 echo "<sgtty.h> found." >&4
12703 echo "System is pyramid with BSD universe."
12704 echo "<sgtty.h> not found--you could have problems." >&4
12706 *) if $test `./findhdr termio.h`; then
12708 echo "<termio.h> found." >&4
12710 echo "System is pyramid with USG universe."
12711 echo "<termio.h> not found--you could have problems." >&4
12715 if $test `./findhdr termio.h`; then
12716 echo "<termio.h> found." >&4
12718 elif $test `./findhdr sgtty.h`; then
12719 echo "<sgtty.h> found." >&4
12722 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12725 if $test `./findhdr sgtty.h`; then
12726 echo "<sgtty.h> found." >&4
12728 elif $test `./findhdr termio.h`; then
12729 echo "<termio.h> found." >&4
12732 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12736 set i_termio; eval $setvar
12737 val=$val2; set i_sgtty; eval $setvar
12738 val=$val3; set i_termios; eval $setvar
12740 : see if this is a shadow.h system
12741 set shadow.h i_shadow
12744 : see if this is a socks.h system
12745 set socks.h i_socks
12748 : see if stdarg is available
12750 if $test `./findhdr stdarg.h`; then
12751 echo "<stdarg.h> found." >&4
12754 echo "<stdarg.h> NOT found." >&4
12758 : see if varags is available
12760 if $test `./findhdr varargs.h`; then
12761 echo "<varargs.h> found." >&4
12763 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12766 : set up the varargs testing programs
12767 $cat > varargs.c <<EOP
12769 #include <stdarg.h>
12772 #include <varargs.h>
12776 int f(char *p, ...)
12790 p = va_arg(ap, char *);
12795 $cat > varargs <<EOP
12797 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12806 : now check which varargs header should be included
12811 if `./varargs I_STDARG`; then
12813 elif `./varargs I_VARARGS`; then
12818 if `./varargs I_VARARGS`; then
12825 echo "I could not find the definition for va_dcl... You have problems..." >&4
12826 val="$undef"; set i_stdarg; eval $setvar
12827 val="$undef"; set i_varargs; eval $setvar
12832 case "$i_varhdr" in
12834 val="$define"; set i_stdarg; eval $setvar
12835 val="$undef"; set i_varargs; eval $setvar
12838 val="$undef"; set i_stdarg; eval $setvar
12839 val="$define"; set i_varargs; eval $setvar
12842 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12846 : see if stddef is available
12847 set stddef.h i_stddef
12850 : see if sys/access.h is available
12851 set sys/access.h i_sysaccess
12854 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12855 set sys/filio.h i_sysfilio
12858 if $test `./findhdr sys/ioctl.h`; then
12860 echo '<sys/ioctl.h> found.' >&4
12863 if $test $i_sysfilio = "$define"; then
12864 echo '<sys/ioctl.h> NOT found.' >&4
12866 $test $i_sgtty = "$define" && xxx="sgtty.h"
12867 $test $i_termio = "$define" && xxx="termio.h"
12868 $test $i_termios = "$define" && xxx="termios.h"
12869 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12875 : see if sys/resource.h has to be included
12876 set sys/resource.h i_sysresrc
12879 : see if sys/security.h is available
12880 set sys/security.h i_syssecrt
12883 : see if this is a sys/statvfs.h system
12884 set sys/statvfs.h i_sysstatvfs
12887 : see if this is a sys/un.h system
12888 set sys/un.h i_sysun
12891 : see if this is a syswait system
12892 set sys/wait.h i_syswait
12895 : see if this is an utime system
12896 set utime.h i_utime
12899 : see if this is a values.h system
12900 set values.h i_values
12903 : see if this is a vfork system
12906 set vfork.h i_vfork
12914 : see if gdbm.h is available
12919 : see if gdbm_open exists
12920 set gdbm_open d_gdbm_open
12922 case "$d_gdbm_open" in
12925 echo "We won't be including <gdbm.h>"
12935 echo "Looking for extensions..." >&4
12936 : If we are using the old config.sh, known_extensions may contain
12937 : old or inaccurate or duplicate values.
12938 known_extensions=''
12939 nonxs_extensions=''
12940 : We do not use find because it might not be available.
12941 : We do not just use MANIFEST because the user may have dropped
12942 : some additional extensions into the source tree and expect them
12945 : Function to recursively find available extensions, ignoring DynaLoader
12946 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
12950 DynaLoader|dynaload) ;;
12952 if $test -f $xxx/$xxx.xs; then
12953 known_extensions="$known_extensions $1$xxx";
12954 elif $test -f $xxx/Makefile.PL; then
12955 nonxs_extensions="$nonxs_extensions $1$xxx";
12957 if $test -d $xxx -a $# -lt 10; then
12960 eval $find_extensions;
12972 eval $find_extensions
12973 set X $nonxs_extensions
12975 nonxs_extensions="$*"
12976 set X $known_extensions
12978 known_extensions="$*"
12981 : Now see which are supported on this system.
12983 for xxx in $known_extensions ; do
12987 $define) avail_ext="$avail_ext $xxx" ;;
12990 GDBM_File|gdbm_fil)
12992 $define) avail_ext="$avail_ext $xxx" ;;
12995 NDBM_File|ndbm_fil)
12997 $define) avail_ext="$avail_ext $xxx" ;;
13000 ODBM_File|odbm_fil)
13001 case "${i_dbm}${i_rpcsvcdbm}" in
13002 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13006 case "$useposix" in
13007 true|define|y) avail_ext="$avail_ext $xxx" ;;
13011 case "$useopcode" in
13012 true|define|y) avail_ext="$avail_ext $xxx" ;;
13016 case "$d_socket" in
13017 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13021 case "$usethreads" in
13022 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13026 : XXX Do we need a useipcsysv variable here
13027 case "${d_msg}${d_sem}${d_shm}" in
13028 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13031 *) avail_ext="$avail_ext $xxx"
13040 : Now see which nonxs extensions are supported on this system.
13041 : For now assume all are.
13043 for xxx in $nonxs_extensions ; do
13045 *) nonxs_ext="$nonxs_ext $xxx"
13057 A number of extensions are supplied with $package. You may choose to
13058 compile these extensions for dynamic loading (the default), compile
13059 them into the $package executable (static loading), or not include
13060 them at all. Answer "none" to include no extensions.
13061 Note that DynaLoader is always built and need not be mentioned here.
13064 case "$dynamic_ext" in
13065 '') dflt="$avail_ext" ;;
13066 *) dflt="$dynamic_ext"
13067 # Perhaps we are reusing an old out-of-date config.sh.
13070 if test X"$dynamic_ext" != X"$avail_ext"; then
13072 NOTICE: Your previous config.sh list may be incorrect.
13073 The extensions now available to you are
13075 but the default list from your previous config.sh is
13087 rp="What extensions do you wish to load dynamically?"
13090 none) dynamic_ext=' ' ;;
13091 *) dynamic_ext="$ans" ;;
13094 case "$static_ext" in
13096 : Exclude those already listed in dynamic linking
13098 for xxx in $avail_ext; do
13099 case " $dynamic_ext " in
13101 *) dflt="$dflt $xxx" ;;
13108 *) dflt="$static_ext"
13115 rp="What extensions do you wish to load statically?"
13118 none) static_ext=' ' ;;
13119 *) static_ext="$ans" ;;
13124 A number of extensions are supplied with $package. Answer "none"
13125 to include no extensions.
13126 Note that DynaLoader is always built and need not be mentioned here.
13129 case "$static_ext" in
13130 '') dflt="$avail_ext" ;;
13131 *) dflt="$static_ext"
13132 # Perhaps we are reusing an old out-of-date config.sh.
13135 if test X"$static_ext" != X"$avail_ext"; then
13137 NOTICE: Your previous config.sh list may be incorrect.
13138 The extensions now available to you are
13140 but the default list from your previous config.sh is
13149 : Exclude those that are not xs extensions
13153 rp="What extensions do you wish to include?"
13156 none) static_ext=' ' ;;
13157 *) static_ext="$ans" ;;
13162 set X $dynamic_ext $static_ext $nonxs_ext
13166 : Remove build directory name from cppstdin so it can be used from
13167 : either the present location or the final installed location.
13169 : Get out of the UU directory to get correct path name.
13171 case "$cppstdin" in
13173 echo "Stripping down cppstdin path name"
13179 : end of configuration questions
13181 echo "End of configuration questions."
13184 : back to where it started
13185 if test -d ../UU; then
13189 : configuration may be patched via a 'config.over' file
13190 if $test -f config.over; then
13193 rp='I see a config.over file. Do you wish to load it?'
13196 n*) echo "OK, I'll ignore it.";;
13198 echo "Configuration override changes have been loaded."
13203 : in case they want portability, strip down executable paths
13204 case "$d_portable" in
13207 echo "Stripping down executable paths..." >&4
13208 for file in $loclist $trylist; do
13210 eval $file=`basename $temp`
13215 : create config.sh file
13217 echo "Creating config.sh..." >&4
13218 $spitshell <<EOT >config.sh
13221 # This file was produced by running the Configure script. It holds all the
13222 # definitions figured out by Configure. Should you modify one of these values,
13223 # do not forget to propagate your changes by running "Configure -der". You may
13224 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13227 # Package name : $package
13228 # Source directory : $src
13229 # Configuration time: $cf_time
13230 # Configured by : $cf_by
13231 # Target system : $myuname
13241 Revision='$Revision'
13248 alignbytes='$alignbytes'
13249 ansi2knr='$ansi2knr'
13250 aphostname='$aphostname'
13251 apiversion='$apiversion'
13254 archlibexp='$archlibexp'
13255 archname64='$archname64'
13256 archname='$archname'
13257 archobjs='$archobjs'
13262 bincompat5005='$bincompat5005'
13266 byteorder='$byteorder'
13268 castflags='$castflags'
13271 cccdlflags='$cccdlflags'
13272 ccdlflags='$ccdlflags'
13274 ccsymbols='$ccsymbols'
13276 cf_email='$cf_email'
13281 clocktype='$clocktype'
13283 compress='$compress'
13284 contains='$contains'
13288 cpp_stuff='$cpp_stuff'
13289 cppccsymbols='$cppccsymbols'
13290 cppflags='$cppflags'
13292 cppminus='$cppminus'
13294 cppstdin='$cppstdin'
13295 cppsymbols='$cppsymbols'
13296 crosscompile='$crosscompile'
13297 cryptlib='$cryptlib'
13299 d_Gconvert='$d_Gconvert'
13300 d_PRIEldbl='$d_PRIEldbl'
13301 d_PRIFldbl='$d_PRIFldbl'
13302 d_PRIGldbl='$d_PRIGldbl'
13303 d_PRIX64='$d_PRIX64'
13304 d_PRId64='$d_PRId64'
13305 d_PRIeldbl='$d_PRIeldbl'
13306 d_PRIfldbl='$d_PRIfldbl'
13307 d_PRIgldbl='$d_PRIgldbl'
13308 d_PRIi64='$d_PRIi64'
13309 d_PRIo64='$d_PRIo64'
13310 d_PRIu64='$d_PRIu64'
13311 d_PRIx64='$d_PRIx64'
13312 d_access='$d_access'
13313 d_accessx='$d_accessx'
13315 d_archlib='$d_archlib'
13318 d_attribut='$d_attribut'
13321 d_bincompat5005='$d_bincompat5005'
13323 d_bsdgetpgrp='$d_bsdgetpgrp'
13324 d_bsdsetpgrp='$d_bsdsetpgrp'
13326 d_casti32='$d_casti32'
13327 d_castneg='$d_castneg'
13328 d_charvspr='$d_charvspr'
13330 d_chroot='$d_chroot'
13331 d_chsize='$d_chsize'
13332 d_closedir='$d_closedir'
13333 d_cmsghdr_s='$d_cmsghdr_s'
13337 d_cuserid='$d_cuserid'
13338 d_dbl_dig='$d_dbl_dig'
13339 d_difftime='$d_difftime'
13340 d_dirnamlen='$d_dirnamlen'
13341 d_dlerror='$d_dlerror'
13342 d_dlopen='$d_dlopen'
13343 d_dlsymun='$d_dlsymun'
13344 d_dosuid='$d_dosuid'
13345 d_drand48proto='$d_drand48proto'
13347 d_eaccess='$d_eaccess'
13348 d_endgrent='$d_endgrent'
13349 d_endhent='$d_endhent'
13350 d_endnent='$d_endnent'
13351 d_endpent='$d_endpent'
13352 d_endpwent='$d_endpwent'
13353 d_endsent='$d_endsent'
13354 d_endspent='$d_endspent'
13355 d_eofnblk='$d_eofnblk'
13356 d_eunice='$d_eunice'
13357 d_fchmod='$d_fchmod'
13358 d_fchown='$d_fchown'
13360 d_fd_macros='$d_fd_macros'
13361 d_fd_set='$d_fd_set'
13362 d_fds_bits='$d_fds_bits'
13363 d_fgetpos='$d_fgetpos'
13364 d_flexfnam='$d_flexfnam'
13367 d_fpathconf='$d_fpathconf'
13368 d_fpos64_t='$d_fpos64_t'
13369 d_fseeko='$d_fseeko'
13370 d_fsetpos='$d_fsetpos'
13371 d_fstatfs='$d_fstatfs'
13372 d_fstatvfs='$d_fstatvfs'
13373 d_ftello='$d_ftello'
13375 d_getgrent='$d_getgrent'
13376 d_getgrps='$d_getgrps'
13377 d_gethbyaddr='$d_gethbyaddr'
13378 d_gethbyname='$d_gethbyname'
13379 d_gethent='$d_gethent'
13380 d_gethname='$d_gethname'
13381 d_gethostprotos='$d_gethostprotos'
13382 d_getlogin='$d_getlogin'
13383 d_getmntent='$d_getmntent'
13384 d_getnbyaddr='$d_getnbyaddr'
13385 d_getnbyname='$d_getnbyname'
13386 d_getnent='$d_getnent'
13387 d_getnetprotos='$d_getnetprotos'
13388 d_getpbyname='$d_getpbyname'
13389 d_getpbynumber='$d_getpbynumber'
13390 d_getpent='$d_getpent'
13391 d_getpgid='$d_getpgid'
13392 d_getpgrp2='$d_getpgrp2'
13393 d_getpgrp='$d_getpgrp'
13394 d_getppid='$d_getppid'
13395 d_getprior='$d_getprior'
13396 d_getprotoprotos='$d_getprotoprotos'
13397 d_getpwent='$d_getpwent'
13398 d_getsbyname='$d_getsbyname'
13399 d_getsbyport='$d_getsbyport'
13400 d_getsent='$d_getsent'
13401 d_getservprotos='$d_getservprotos'
13402 d_getspent='$d_getspent'
13403 d_getspnam='$d_getspnam'
13404 d_gettimeod='$d_gettimeod'
13405 d_gnulibc='$d_gnulibc'
13406 d_grpasswd='$d_grpasswd'
13407 d_hasmntopt='$d_hasmntopt'
13410 d_inetaton='$d_inetaton'
13411 d_int64t='$d_int64t'
13412 d_iovec_s='$d_iovec_s'
13413 d_isascii='$d_isascii'
13414 d_killpg='$d_killpg'
13415 d_lchown='$d_lchown'
13416 d_ldbl_dig='$d_ldbl_dig'
13418 d_llseek='$d_llseek'
13419 d_locconv='$d_locconv'
13421 d_longdbl='$d_longdbl'
13422 d_longlong='$d_longlong'
13424 d_madvise='$d_madvise'
13426 d_mbstowcs='$d_mbstowcs'
13427 d_mbtowc='$d_mbtowc'
13428 d_memchr='$d_memchr'
13429 d_memcmp='$d_memcmp'
13430 d_memcpy='$d_memcpy'
13431 d_memmove='$d_memmove'
13432 d_memset='$d_memset'
13434 d_mkfifo='$d_mkfifo'
13435 d_mktime='$d_mktime'
13437 d_mprotect='$d_mprotect'
13439 d_msg_ctrunc='$d_msg_ctrunc'
13440 d_msg_dontroute='$d_msg_dontroute'
13441 d_msg_oob='$d_msg_oob'
13442 d_msg_peek='$d_msg_peek'
13443 d_msg_proxy='$d_msg_proxy'
13444 d_msgctl='$d_msgctl'
13445 d_msgget='$d_msgget'
13446 d_msghdr_s='$d_msghdr_s'
13447 d_msgrcv='$d_msgrcv'
13448 d_msgsnd='$d_msgsnd'
13450 d_munmap='$d_munmap'
13451 d_mymalloc='$d_mymalloc'
13453 d_off64_t='$d_off64_t'
13454 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13455 d_oldpthreads='$d_oldpthreads'
13456 d_oldsock='$d_oldsock'
13458 d_pathconf='$d_pathconf'
13460 d_phostname='$d_phostname'
13463 d_portable='$d_portable'
13464 d_pthread_yield='$d_pthread_yield'
13466 d_pwchange='$d_pwchange'
13467 d_pwclass='$d_pwclass'
13468 d_pwcomment='$d_pwcomment'
13469 d_pwexpire='$d_pwexpire'
13470 d_pwgecos='$d_pwgecos'
13471 d_pwpasswd='$d_pwpasswd'
13472 d_pwquota='$d_pwquota'
13473 d_readdir='$d_readdir'
13474 d_readlink='$d_readlink'
13476 d_recvmsg='$d_recvmsg'
13477 d_rename='$d_rename'
13478 d_rewinddir='$d_rewinddir'
13480 d_safebcpy='$d_safebcpy'
13481 d_safemcpy='$d_safemcpy'
13482 d_sanemcmp='$d_sanemcmp'
13483 d_sched_yield='$d_sched_yield'
13484 d_scm_rights='$d_scm_rights'
13485 d_seekdir='$d_seekdir'
13486 d_select='$d_select'
13488 d_semctl='$d_semctl'
13489 d_semctl_semid_ds='$d_semctl_semid_ds'
13490 d_semctl_semun='$d_semctl_semun'
13491 d_semget='$d_semget'
13493 d_sendmsg='$d_sendmsg'
13494 d_setegid='$d_setegid'
13495 d_seteuid='$d_seteuid'
13496 d_setgrent='$d_setgrent'
13497 d_setgrps='$d_setgrps'
13498 d_sethent='$d_sethent'
13499 d_setlinebuf='$d_setlinebuf'
13500 d_setlocale='$d_setlocale'
13501 d_setnent='$d_setnent'
13502 d_setpent='$d_setpent'
13503 d_setpgid='$d_setpgid'
13504 d_setpgrp2='$d_setpgrp2'
13505 d_setpgrp='$d_setpgrp'
13506 d_setprior='$d_setprior'
13507 d_setpwent='$d_setpwent'
13508 d_setregid='$d_setregid'
13509 d_setresgid='$d_setresgid'
13510 d_setresuid='$d_setresuid'
13511 d_setreuid='$d_setreuid'
13512 d_setrgid='$d_setrgid'
13513 d_setruid='$d_setruid'
13514 d_setsent='$d_setsent'
13515 d_setsid='$d_setsid'
13516 d_setspent='$d_setspent'
13517 d_setvbuf='$d_setvbuf'
13521 d_shmatprototype='$d_shmatprototype'
13522 d_shmctl='$d_shmctl'
13524 d_shmget='$d_shmget'
13525 d_sigaction='$d_sigaction'
13526 d_sigsetjmp='$d_sigsetjmp'
13527 d_socket='$d_socket'
13528 d_sockpair='$d_sockpair'
13529 d_statblks='$d_statblks'
13530 d_statfs='$d_statfs'
13531 d_statfsflags='$d_statfsflags'
13532 d_statvfs='$d_statvfs'
13533 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13534 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13535 d_stdio_stream_array='$d_stdio_stream_array'
13536 d_stdiobase='$d_stdiobase'
13537 d_stdstdio='$d_stdstdio'
13538 d_strchr='$d_strchr'
13539 d_strcoll='$d_strcoll'
13540 d_strctcpy='$d_strctcpy'
13541 d_strerrm='$d_strerrm'
13542 d_strerror='$d_strerror'
13543 d_strtod='$d_strtod'
13544 d_strtol='$d_strtol'
13545 d_strtoul='$d_strtoul'
13546 d_strtoull='$d_strtoull'
13547 d_strxfrm='$d_strxfrm'
13548 d_suidsafe='$d_suidsafe'
13549 d_symlink='$d_symlink'
13550 d_syscall='$d_syscall'
13551 d_sysconf='$d_sysconf'
13552 d_sysernlst='$d_sysernlst'
13553 d_syserrlst='$d_syserrlst'
13554 d_system='$d_system'
13555 d_tcgetpgrp='$d_tcgetpgrp'
13556 d_tcsetpgrp='$d_tcsetpgrp'
13557 d_telldir='$d_telldir'
13558 d_telldirproto='$d_telldirproto'
13561 d_truncate='$d_truncate'
13562 d_tzname='$d_tzname'
13565 d_union_semun='$d_union_semun'
13566 d_vendorlib='$d_vendorlib'
13568 d_void_closedir='$d_void_closedir'
13569 d_voidsig='$d_voidsig'
13570 d_voidtty='$d_voidtty'
13571 d_volatile='$d_volatile'
13572 d_vprintf='$d_vprintf'
13574 d_waitpid='$d_waitpid'
13575 d_wcstombs='$d_wcstombs'
13576 d_wctomb='$d_wctomb'
13577 d_writev='$d_writev'
13580 db_hashtype='$db_hashtype'
13581 db_prefixtype='$db_prefixtype'
13582 defvoidused='$defvoidused'
13583 direntrytype='$direntrytype'
13586 doublesize='$doublesize'
13588 dynamic_ext='$dynamic_ext'
13594 eunicefix='$eunicefix'
13597 extensions='$extensions'
13598 fflushNULL='$fflushNULL'
13599 fflushall='$fflushall'
13601 firstmakefile='$firstmakefile'
13603 fpostype='$fpostype'
13604 freetype='$freetype'
13606 full_csh='$full_csh'
13607 full_sed='$full_sed'
13608 gccversion='$gccversion'
13612 groupcat='$groupcat'
13613 groupstype='$groupstype'
13616 h_sysfile='$h_sysfile'
13620 i_arpainet='$i_arpainet'
13621 i_bsdioctl='$i_bsdioctl'
13624 i_dirent='$i_dirent'
13631 i_inttypes='$i_inttypes'
13632 i_limits='$i_limits'
13633 i_locale='$i_locale'
13634 i_machcthr='$i_machcthr'
13635 i_malloc='$i_malloc'
13637 i_memory='$i_memory'
13638 i_mntent='$i_mntent'
13641 i_neterrno='$i_neterrno'
13642 i_netinettcp='$i_netinettcp'
13645 i_pthread='$i_pthread'
13647 i_rpcsvcdbm='$i_rpcsvcdbm'
13650 i_shadow='$i_shadow'
13652 i_stdarg='$i_stdarg'
13653 i_stddef='$i_stddef'
13654 i_stdlib='$i_stdlib'
13655 i_string='$i_string'
13656 i_sysaccess='$i_sysaccess'
13657 i_sysdir='$i_sysdir'
13658 i_sysfile='$i_sysfile'
13659 i_sysfilio='$i_sysfilio'
13661 i_sysioctl='$i_sysioctl'
13662 i_sysmman='$i_sysmman'
13663 i_sysmount='$i_sysmount'
13664 i_sysndir='$i_sysndir'
13665 i_sysparam='$i_sysparam'
13666 i_sysresrc='$i_sysresrc'
13667 i_syssecrt='$i_syssecrt'
13668 i_sysselct='$i_sysselct'
13669 i_syssockio='$i_syssockio'
13670 i_sysstat='$i_sysstat'
13671 i_sysstatvfs='$i_sysstatvfs'
13672 i_systime='$i_systime'
13673 i_systimek='$i_systimek'
13674 i_systimes='$i_systimes'
13675 i_systypes='$i_systypes'
13676 i_sysuio='$i_sysuio'
13678 i_syswait='$i_syswait'
13679 i_termio='$i_termio'
13680 i_termios='$i_termios'
13682 i_unistd='$i_unistd'
13684 i_values='$i_values'
13685 i_varargs='$i_varargs'
13686 i_varhdr='$i_varhdr'
13688 ignore_versioned_solibs='$ignore_versioned_solibs'
13691 installarchlib='$installarchlib'
13692 installbin='$installbin'
13693 installman1dir='$installman1dir'
13694 installman3dir='$installman3dir'
13695 installprefix='$installprefix'
13696 installprefixexp='$installprefixexp'
13697 installprivlib='$installprivlib'
13698 installscript='$installscript'
13699 installsitearch='$installsitearch'
13700 installsitelib='$installsitelib'
13701 installstyle='$installstyle'
13702 installusrbinperl='$installusrbinperl'
13703 installvendorlib='$installvendorlib'
13705 known_extensions='$known_extensions'
13709 lddlflags='$lddlflags'
13711 ldlibpthname='$ldlibpthname'
13718 libswanted='$libswanted'
13724 locincpth='$locincpth'
13725 loclibpth='$loclibpth'
13726 longdblsize='$longdblsize'
13727 longlongsize='$longlongsize'
13728 longsize='$longsize'
13732 lseeksize='$lseeksize'
13733 lseektype='$lseektype'
13737 make_set_make='$make_set_make'
13738 mallocobj='$mallocobj'
13739 mallocsrc='$mallocsrc'
13740 malloctype='$malloctype'
13742 man1direxp='$man1direxp'
13745 man3direxp='$man3direxp'
13749 mips_type='$mips_type'
13751 mmaptype='$mmaptype'
13753 modetype='$modetype'
13755 multiarch='$multiarch'
13757 myarchname='$myarchname'
13758 mydomain='$mydomain'
13759 myhostname='$myhostname'
13762 netdb_hlen_type='$netdb_hlen_type'
13763 netdb_host_type='$netdb_host_type'
13764 netdb_name_type='$netdb_name_type'
13765 netdb_net_type='$netdb_net_type'
13768 nm_so_opt='$nm_so_opt'
13769 nonxs_ext='$nonxs_ext'
13771 o_nonblock='$o_nonblock'
13773 old_pthread_create_joinable='$old_pthread_create_joinable'
13774 optimize='$optimize'
13775 orderlib='$orderlib'
13781 patchlevel='$patchlevel'
13782 path_sep='$path_sep'
13784 perladmin='$perladmin'
13785 perlpath='$perlpath'
13787 phostname='$phostname'
13793 prefixexp='$prefixexp'
13795 privlibexp='$privlibexp'
13796 prototype='$prototype'
13798 randbits='$randbits'
13799 randfunc='$randfunc'
13800 randseedtype='$randseedtype'
13802 rd_nodata='$rd_nodata'
13806 sPRIEldbl='$sPRIEldbl'
13807 sPRIFldbl='$sPRIFldbl'
13808 sPRIGldbl='$sPRIGldbl'
13811 sPRIeldbl='$sPRIeldbl'
13812 sPRIfldbl='$sPRIfldbl'
13813 sPRIgldbl='$sPRIgldbl'
13818 sched_yield='$sched_yield'
13819 scriptdir='$scriptdir'
13820 scriptdirexp='$scriptdirexp'
13822 seedfunc='$seedfunc'
13823 selectminbits='$selectminbits'
13824 selecttype='$selecttype'
13825 sendmail='$sendmail'
13828 sharpbang='$sharpbang'
13829 shmattype='$shmattype'
13830 shortsize='$shortsize'
13833 sig_count='$sig_count'
13834 sig_name='$sig_name'
13835 sig_name_init='$sig_name_init'
13837 sig_num_init='$sig_num_init'
13838 signal_t='$signal_t'
13839 sitearch='$sitearch'
13840 sitearchexp='$sitearchexp'
13842 sitelibexp='$sitelibexp'
13843 siteprefix='$siteprefix'
13844 siteprefixexp='$siteprefixexp'
13845 sizetype='$sizetype'
13850 sockethdr='$sockethdr'
13851 socketlib='$socketlib'
13853 spackage='$spackage'
13854 spitshell='$spitshell'
13857 ssizetype='$ssizetype'
13858 startperl='$startperl'
13860 static_ext='$static_ext'
13862 stdio_base='$stdio_base'
13863 stdio_bufsiz='$stdio_bufsiz'
13864 stdio_cnt='$stdio_cnt'
13865 stdio_filbuf='$stdio_filbuf'
13866 stdio_ptr='$stdio_ptr'
13867 stdio_stream_array='$stdio_stream_array'
13870 subversion='$subversion'
13877 timeincl='$timeincl'
13878 timetype='$timetype'
13886 use64bits='$use64bits'
13888 uselongdouble='$uselongdouble'
13889 usemultiplicity='$usemultiplicity'
13890 usemymalloc='$usemymalloc'
13892 useopcode='$useopcode'
13893 useperlio='$useperlio'
13894 useposix='$useposix'
13896 useshrplib='$useshrplib'
13897 usesocks='$usesocks'
13898 usethreads='$usethreads'
13899 usevendorprefix='$usevendorprefix'
13900 usevfork='$usevfork'
13903 vendorlib='$vendorlib'
13904 vendorlibexp='$vendorlibexp'
13905 vendorprefix='$vendorprefix'
13906 vendorprefixexp='$vendorprefixexp'
13909 voidflags='$voidflags'
13915 : Add in command line options if available
13916 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13918 : add special variables
13919 $test -f $src/patchlevel.h && \
13920 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13921 echo "CONFIGDOTSH=true" >>config.sh
13923 : propagate old symbols
13924 if $test -f UU/config.sh; then
13925 <UU/config.sh sort | uniq >UU/oldconfig.sh
13926 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13927 sort | uniq -u >UU/oldsyms
13928 set X `cat UU/oldsyms`
13934 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13936 echo "# Variables propagated from previous config.sh file." >>config.sh
13937 for sym in `cat UU/oldsyms`; do
13938 echo " Propagating $hint variable "'$'"$sym..."
13939 eval 'tmp="$'"${sym}"'"'
13941 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13947 : Finish up by extracting the .SH files
13961 If you'd like to make any changes to the config.sh file before I begin
13962 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13965 rp="Press return or use a shell escape to edit config.sh:"
13970 *) : in case they cannot read
13971 sh 1>&4 -c "$ans";;
13976 : if this fails, just run all the .SH files by hand
13983 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
13990 Now you need to generate make dependencies by running "$make depend".
13991 You might prefer to run it in background: "$make depend > makedepend.out &"
13992 It can take a while, so you might not want to run it right now.
13997 rp="Run $make depend now?"
14001 $make depend && echo "Now you must run a $make."
14004 echo "You must run '$make depend' then '$make'."
14007 elif test -f [Mm]akefile; then
14009 echo "Now you must run a $make."
14014 if $test -f Policy.sh; then
14017 If you compile $package on a different machine or from a different object
14018 directory, copy the Policy.sh file from this object directory to the
14019 new one before you run Configure -- this will help you with most of
14020 the policy defaults.
14024 if $test -f config.msg; then
14025 echo "Hmm. I also noted the following information while running:"
14027 $cat config.msg >&4
14030 $rm -f kit*isdone ark*isdone