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 Fri Sep 17 12:06:13 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 = "A: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
1164 rm -f optdef.sh posthint.sh
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;;
1223 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1224 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1233 *=*) zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1234 yyy=`echo $yyy|sed 's!=.*!!'`
1242 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh
1245 echo "$yyy=''" >> posthint.sh
1251 echo "$yyy='$zzz'" >> posthint.sh
1254 echo "eval \"$yyy=$zzz\"" >> posthint.sh
1257 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh
1263 echo "$yyy=$zzz" >> posthint.sh
1265 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2
1269 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1272 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1280 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1281 [-U symbol] [-U symbol=] [-A command:symbol...]
1282 -d : use defaults for all answers.
1283 -e : go on without questioning past the production of config.sh.
1284 -f : specify an alternate default configuration file.
1285 -h : print this help message and exit (with an error status).
1286 -r : reuse C symbols value if possible (skips costly nm extraction).
1287 -s : silent mode, only echoes questions and essential information.
1288 -D : define symbol to have some value:
1289 -D symbol symbol gets the value 'define'
1290 -D symbol=value symbol gets the value 'value'
1291 -E : stop at the end of questions, after having produced config.sh.
1292 -K : do not use unless you know what you are doing.
1293 -O : let -D and -U override definitions from loaded configuration file.
1294 -S : perform variable substitutions on all .SH files (can mix with -f)
1295 -U : undefine symbol:
1296 -U symbol symbol gets the value 'undef'
1297 -U symbol= symbol gets completely empty
1298 -A : manipulate symbol after the platform specific hints have been applied:
1299 -A append:symbol=value append value to symbol
1300 -A define:symbol=value define symbol to have value
1301 -A symbol=value define symbol to have value
1302 -A clear:symbol define symbol to be ''
1303 -A define:symbol define symbol to be 'define'
1304 -A eval:symbol=value define symbol to be eval of value
1305 -A prepend:symbol=value prepend value to symbol
1306 -A undef:symbol define symbol to be 'undef'
1307 -A undef:symbol= define symbol to be ''
1308 -V : print version number and exit (with a zero status).
1315 case "$fastread$alldone" in
1318 if test ! -t 0; then
1319 echo "Say 'sh Configure', not 'sh <Configure'"
1327 true) exec 1>/dev/null;;
1330 : run the defines and the undefines, if any, but leave the file out there...
1333 : create the posthint manipulation script and leave the file out there...
1339 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1340 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1341 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1342 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1343 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1346 : Some greps do not return status, grrr.
1347 echo "grimblepritz" >grimble
1348 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1350 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1356 : the following should work in any shell
1360 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1361 cat >contains <<'EOSS'
1362 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1367 : Find the path to the source tree
1370 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1373 *) src=`cd ../$src && pwd` ;;
1386 if test -f $rsrc/Configure && \
1387 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1389 : found it, so we are ok.
1392 for src in . .. ../.. ../../.. ../../../..; do
1393 if test -f ../$src/Configure && \
1394 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1405 Sorry, I can't seem to locate the source dir for $package. Please start
1406 Configure with an explicit path -- i.e. /some/path/Configure.
1414 echo "Sources for $package found in \"$src\"." >&4
1418 : script used to extract .SH files with variable substitutions
1419 cat >extract <<'EOS'
1421 echo "Doing variable substitutions on .SH files..."
1422 if test -f $src/MANIFEST; then
1423 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1425 echo "(Looking for .SH files under the source directory.)"
1426 set x `(cd $src; find . -name "*.SH" -print)`
1430 0) set x `(cd $src; echo *.SH)`; shift;;
1432 if test ! -f $src/$1; then
1438 while test $name; do
1439 if test ! -d "$name"; then
1440 create="$name $create";
1441 name=`echo $name | sed -e "s|^[^/]*$||"`;
1442 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1447 for file in $create; do
1456 dir=`expr X$file : 'X\(.*\)/'`
1457 file=`expr X$file : 'X.*/\(.*\)'`
1458 (cd $dir && . ./$file)
1468 dir=`expr X$file : 'X\(.*\)/'`
1469 file=`expr X$file : 'X.*/\(.*\)'`
1470 (set x $dir; shift; eval $mkdir_p)
1480 if test -f $src/config_h.SH; then
1481 if test ! -f config.h; then
1482 : oops, they left it out of MANIFEST, probably, so do it anyway.
1488 : extract files and exit if asked to do so
1489 case "$extractsh" in
1491 case "$realsilent" in
1495 case "$config_sh" in
1496 '') config_sh='config.sh';;
1499 echo "Fetching answers from $config_sh..."
1502 test "$override" && . ./optdef.sh
1511 : Eunice requires " " instead of "", can you believe it
1514 echo "Beginning of configuration questions for $package."
1516 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1518 : first determine how to suppress newline on echo command
1520 echo "Checking echo to see how to suppress newlines..."
1521 (echo "hi there\c" ; echo " ") >.echotmp
1522 if $contains c .echotmp >/dev/null 2>&1 ; then
1533 echo $n "The star should be here-->$c"
1537 : Now test for existence of everything in MANIFEST
1539 if test -f $rsrc/MANIFEST; then
1540 echo "First let's make sure your kit is complete. Checking..." >&4
1541 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1544 for filelist in x??; do
1545 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1547 if test -s missing; then
1551 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1553 You have the option of continuing the configuration process, despite the
1554 distinct possibility that your kit is damaged, by typing 'y'es. If you
1555 do, don't blame me if something goes wrong. I advise you to type 'n'o
1556 and contact the author (perlbug@perl.com).
1559 echo $n "Continue? [n] $c" >&4
1563 echo "Continuing..." >&4
1567 echo "ABORTING..." >&4
1572 echo "Looks good..."
1575 echo "There is no MANIFEST file. I hope your kit is complete !"
1580 : Find the appropriate value for a newline for tr
1581 if test -n "$DJGPP"; then
1584 if test X"$trnl" = X; then
1585 case "`echo foo|tr '\n' x 2>/dev/null`" in
1589 if test X"$trnl" = X; then
1590 case "`echo foo|tr '\012' x 2>/dev/null`" in
1591 foox) trnl='\012' ;;
1594 if test X"$trnl" = X; then
1597 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1603 : compute the number of columns on the terminal for proper question formatting
1608 : set up the echo used in my read
1609 myecho="case \"\$xxxm\" in
1610 '') echo $n \"\$rp $c\" >&4;;
1612 '') echo $n \"[\$xxxm] $c\";;
1614 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1616 echo $n \"[\$xxxm] $c\" >&4
1618 echo $n \"\$rp [\$xxxm] $c\" >&4
1624 : now set up to do reads with possible shell escape and default assignment
1630 case "\$fastread" in
1631 yes) case "\$dflt" in
1634 case "\$silent-\$rp" in
1639 *) case "\$silent" in
1640 true) case "\$rp" in
1645 while expr "X\$ans" : "X!" >/dev/null; do
1649 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1657 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1666 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1671 echo "(OK, I'll run with -d after this question.)" >&4
1674 echo "*** Sorry, \$1 not supported yet." >&4
1684 echo "*** Substitution done -- please confirm."
1686 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1691 echo "*** Error -- try again."
1698 case "\$ans\$xxxm\$nostick" in
1710 : create .config dir to save info across Configure sessions
1711 test -d ../.config || mkdir ../.config
1712 cat >../.config/README <<EOF
1713 This directory created by Configure to save information that should
1714 persist across sessions for $package.
1716 You may safely delete it if you wish.
1719 : general instructions
1722 user=`(logname) 2>/dev/null`
1724 '') user=`whoami 2>&1`;;
1726 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1729 rp='Would you like to see the instructions?'
1740 This installation shell script will examine your system and ask you questions
1741 to determine how the perl5 package should be installed. If you get
1742 stuck on a question, you may use a ! shell escape to start a subshell or
1743 execute a command. Many of the questions will have default answers in square
1744 brackets; typing carriage return will give you the default.
1746 On some of the questions which ask for file or directory names you are allowed
1747 to use the ~name construct to specify the login directory belonging to "name",
1748 even if you don't have a shell which knows about that. Questions where this is
1749 allowed will be marked "(~name ok)".
1753 dflt='Type carriage return to continue'
1757 The prompter used in this script allows you to use shell variables and
1758 backticks in your answers. You may use $1, $2, etc... to refer to the words
1759 in the default answer, as if the default line was a set of arguments given to a
1760 script shell. This means you may also use $* to repeat the whole default line,
1761 so you do not have to re-type everything to add something to the default.
1763 Everytime there is a substitution, you will have to confirm. If there is an
1764 error (e.g. an unmatched backtick), the default answer will remain unchanged
1765 and you will be prompted again.
1767 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1768 the questions and use the computed defaults (or the previous answers if there
1769 was already a config.sh file). Type 'Configure -h' for a list of options.
1770 You may also start interactively and then answer '& -d' at any prompt to turn
1771 on the non-interactive behaviour for the remainder of the execution.
1777 Much effort has been expended to ensure that this shell script will run on any
1778 Unix system. If despite that it blows up on yours, your best bet is to edit
1779 Configure and run it again. If you can't run Configure for some reason,
1780 you'll have to generate a config.sh file by hand. Whatever problems you
1781 have, let me (perlbug@perl.com) know how I blew it.
1783 This installation script affects things in two ways:
1785 1) it may do direct variable substitutions on some of the files included
1787 2) it builds a config.h file for inclusion in C programs. You may edit
1788 any of these files as the need arises after running this script.
1790 If you make a mistake on a question, there is no easy way to back up to it
1791 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1792 files. Configure will offer to let you do this before it runs the SH files.
1795 dflt='Type carriage return to continue'
1797 case "$firsttime" in
1798 true) echo $user >>../.config/instruct;;
1802 : find out where common programs are
1804 echo "Locating common programs..." >&4
1817 if test -d \$dir/\$thing; then
1823 for thisthing in \$dir/\$thing; do
1824 : just loop through to pick last item
1826 if test -f \$thisthing; then
1829 elif test -f \$dir/\$thing.exe; then
1830 if test -n "$DJGPP"; then
1831 echo \$dir/\$thing.exe
1833 : on Eunice apparently
1883 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1884 pth="$pth /lib /usr/lib"
1885 for file in $loclist; do
1889 if test -f "$xxx"; then
1892 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1893 xxx=`./loc $file $file $pth`
1896 '') xxx=`./loc $file $file $pth`;;
1897 *) xxx=`./loc $xxx $xxx $pth`;;
1903 echo $file is in $xxx.
1906 echo $file is in $xxx.
1909 echo "I don't know where '$file' is, and my life depends on it." >&4
1910 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1916 echo "Don't worry if any of the following aren't found..."
1918 for file in $trylist; do
1922 if test -f "$xxx"; then
1925 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1926 xxx=`./loc $file $file $pth`
1929 '') xxx=`./loc $file $file $pth`;;
1930 *) xxx=`./loc $xxx $xxx $pth`;;
1936 echo $file is in $xxx.
1939 echo $file is in $xxx.
1942 echo "I don't see $file out there, $say."
1949 echo "Substituting grep for egrep."
1955 echo "Substituting cp for ln."
1961 echo "Hopefully test is built into your sh."
1964 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1965 echo "Using the test built into your sh."
1973 echo "Hopefully echo is built into your sh."
1978 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1979 $echo $n "hi there$c" >foo1
1980 echo $n "hi there$c" >foo2
1981 if cmp foo1 foo2 >/dev/null 2>&1; then
1982 echo "They are compatible. In fact, they may be identical."
1989 They are not compatible! You are probably running ksh on a non-USG system.
1990 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1991 have echo built in and we may have to run some Bourne shell scripts. That
1992 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1995 $echo $n "The star should be here-->$c"
2002 : determine whether symbolic links are supported
2005 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2006 echo "Symbolic links are supported." >&4
2009 echo "Symbolic links are NOT supported." >&4
2014 : see whether [:lower:] and [:upper:] are supported character classes
2016 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2018 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2022 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2023 # (0xc9 and 0xd1), therefore that is a nice testing point.
2024 if test "X$up" = X -o "X$low" = X; then
2025 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2031 if test "X$up" = X -o "X$low" = X; then
2032 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2038 if test "X$up" = X -o "X$low" = X; then
2039 case "`echo IJ | od -x 2>/dev/null`" in
2041 echo "Hey, this might be EBCDIC." >&4
2042 if test "X$up" = X -o "X$low" = X; then
2043 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2044 ij) up='[A-IJ-RS-Z]'
2049 if test "X$up" = X -o "X$low" = X; then
2050 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2060 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2062 echo "Using $up and $low to convert case." >&4
2065 echo "I don't know how to translate letters from upper to lower case." >&4
2066 echo "Your tr is not acting any way I know of." >&4
2070 : set up the translation script tr, must be called with ./tr of course
2074 '[A-Z][a-z]') exec $tr '$up' '$low';;
2075 '[a-z][A-Z]') exec $tr '$low' '$up';;
2082 : Try to determine whether config.sh was made on this system
2083 case "$config_sh" in
2085 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2086 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2087 # because the A-Z/a-z are not consecutive.
2088 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2089 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2090 newmyuname="$myuname"
2092 case "$knowitall" in
2094 if test -f ../config.sh; then
2095 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2096 eval "`grep myuname= ../config.sh`"
2098 if test "X$myuname" = "X$newmyuname"; then
2106 : Get old answers from old config file if Configure was run on the
2107 : same system, otherwise use the hints.
2110 if test -f config.sh; then
2112 rp="I see a config.sh file. Shall I use it to set the defaults?"
2115 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2116 *) echo "Fetching default answers from your old config.sh file..." >&4
2124 : Older versions did not always set $sh. Catch re-use of such
2133 if test ! -f config.sh; then
2136 First time through, eh? I have some defaults handy for some systems
2137 that need some extra help getting the Configure answers right:
2140 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2142 : Half the following guesses are probably wrong... If you have better
2143 : tests or hints, please send them to perlbug@perl.com
2144 : The metaconfig authors would also appreciate a copy...
2145 $test -f /irix && osname=irix
2146 $test -f /xenix && osname=sco_xenix
2147 $test -f /dynix && osname=dynix
2148 $test -f /dnix && osname=dnix
2149 $test -f /lynx.os && osname=lynxos
2150 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2151 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2152 $test -f /bin/mips && /bin/mips && osname=mips
2153 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2154 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2155 $test -d /usr/apollo/bin && osname=apollo
2156 $test -f /etc/saf/_sactab && osname=svr4
2157 $test -d /usr/include/minix && osname=minix
2158 if $test -d /MachTen -o -d /MachTen_Folder; then
2160 if $test -x /sbin/version; then
2161 osvers=`/sbin/version | $awk '{print $2}' |
2162 $sed -e 's/[A-Za-z]$//'`
2163 elif $test -x /usr/etc/version; then
2164 osvers=`/usr/etc/version | $awk '{print $2}' |
2165 $sed -e 's/[A-Za-z]$//'`
2170 $test -f /sys/posix.dll &&
2171 $test -f /usr/bin/what &&
2172 set X `/usr/bin/what /sys/posix.dll` &&
2173 $test "$3" = UWIN &&
2176 if $test -f $uname; then
2184 umips) osname=umips ;;
2187 [23]100) osname=mips ;;
2188 next*) osname=next ;;
2190 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2191 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2194 elif $test -f /etc/kconfig; then
2196 if test "$lns" = "$ln -s"; then
2198 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2200 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2207 if test -n "$DJGPP"; then
2216 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2218 'not found') osvers="$4"."$3" ;;
2219 '<3240'|'<>3240') osvers=3.2.0 ;;
2220 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2221 '=3250'|'>3250') osvers=3.2.5 ;;
2225 *dc.osx) osname=dcosx
2231 domainos) osname=apollo
2237 dynixptx*) osname=dynixptx
2238 osvers=`echo "$4"|sed 's/^v//'`
2240 freebsd) osname=freebsd
2242 genix) osname=genix ;;
2244 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2260 netbsd*) osname=netbsd
2263 news-os) osvers="$3"
2265 4*) osname=newsos4 ;;
2269 bsd386) osname=bsd386
2272 POSIX-BC | posix-bc ) osname=posix-bc
2275 powerux | power_ux | powermax_os | powermaxos | \
2276 powerunix | power_unix) osname=powerux
2279 next*) osname=next ;;
2280 solaris) osname=solaris
2282 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2289 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2293 titanos) osname=titanos
2302 ultrix) osname=ultrix
2305 osf1|mls+) case "$5" in
2308 osvers=`echo "$3" | sed 's/^[xvt]//'`
2310 hp*) osname=hp_osf1 ;;
2311 mips) osname=mips_osf1 ;;
2320 $2) case "$osname" in
2324 : svr4.x or possibly later
2334 if test -f /stand/boot ; then
2335 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2336 if test -n "$INITPROG" -a -f "$INITPROG"; then
2337 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2338 if test -n "$isesix"; then
2346 *) if test -f /etc/systemid; then
2348 set `echo $3 | $sed 's/\./ /g'` $4
2349 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2351 elif $test -f $src/hints/sco_$1_$2.sh; then
2353 elif $test -f $src/hints/sco_$1.sh; then
2358 '') : Still unknown. Probably a generic Sys V.
2367 *) case "$osname" in
2368 '') : Still unknown. Probably a generic BSD.
2376 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2377 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2378 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2381 $rm -f UU/kernel.what
2382 elif test -d c:/.; then
2389 : Now look for a hint file osname_osvers, unless one has been
2390 : specified already.
2393 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2394 : Also try without trailing minor version numbers.
2395 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2396 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2397 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2398 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2401 *) case "$osvers" in
2404 *) if $test -f $src/hints/$file.sh ; then
2406 elif $test -f $src/hints/$xfile.sh ; then
2408 elif $test -f $src/hints/$xxfile.sh ; then
2410 elif $test -f $src/hints/$xxxfile.sh ; then
2412 elif $test -f $src/hints/$xxxxfile.sh ; then
2414 elif $test -f "$src/hints/${osname}.sh" ; then
2423 if $test -f Policy.sh ; then
2426 none) dflt="Policy" ;;
2427 *) dflt="Policy $dflt" ;;
2432 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2436 if $test -f Policy.sh ; then
2439 There's also a Policy hint file available, which should make the
2440 site-specific (policy) questions easier to answer.
2447 You may give one or more space-separated answers, or "none" if appropriate.
2448 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2449 is a good thing. DO NOT give a wrong version or a wrong OS.
2453 rp="Which of these apply, if any?"
2456 for file in $tans; do
2457 if $test X$file = XPolicy -a -f Policy.sh; then
2459 $cat Policy.sh >> UU/config.sh
2460 elif $test -f $src/hints/$file.sh; then
2461 . $src/hints/$file.sh
2462 $cat $src/hints/$file.sh >> UU/config.sh
2463 elif $test X$tans = X -o X$tans = Xnone ; then
2466 : Give one chance to correct a possible typo.
2467 echo "$file.sh does not exist"
2469 rp="hint to use instead?"
2471 for file in $ans; do
2472 if $test -f "$src/hints/$file.sh"; then
2473 . $src/hints/$file.sh
2474 $cat $src/hints/$file.sh >> UU/config.sh
2475 elif $test X$ans = X -o X$ans = Xnone ; then
2478 echo "$file.sh does not exist -- ignored."
2485 : Remember our hint file for later.
2486 if $test -f "$src/hints/$file.sh" ; then
2496 echo "Fetching default answers from $config_sh..." >&4
2500 cp $config_sh config.sh 2>/dev/null
2510 test "$override" && . ./optdef.sh
2511 myuname="$newmyuname"
2513 : Restore computed paths
2514 for file in $loclist $trylist; do
2515 eval $file="\$_$file"
2520 Configure uses the operating system name and version to set some defaults.
2521 The default value is probably right if the name rings a bell. Otherwise,
2522 since spelling matters for me, either accept the default or answer "none"
2529 ''|' '|none) dflt=none ;;
2530 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2533 *) dflt="$osname" ;;
2535 rp="Operating system name?"
2539 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2545 ''|' '|none) dflt=none ;;
2546 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2547 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2549 ''|' ') dflt=none ;;
2554 *) dflt="$osvers" ;;
2556 rp="Operating system version?"
2566 : who configured the system
2567 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2568 cf_by=`(logname) 2>/dev/null`
2571 cf_by=`(whoami) 2>/dev/null`
2573 "") cf_by=unknown ;;
2577 : set up the script used to warn in case of inconsistency
2584 echo "*** WHOA THERE!!! ***" >&4
2585 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2586 rp=" Keep the $hint value?"
2589 y) td=$was; tu=$was;;
2593 : function used to set $1 to $val
2594 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2596 $define$undef) . ./whoa; eval "$var=\$td";;
2597 $undef$define) . ./whoa; eval "$var=\$tu";;
2598 *) eval "$var=$val";;
2603 Perl can be built to take advantage of threads, on some systems.
2604 To do so, Configure must be run with -Dusethreads.
2606 Note that threading is a highly experimental feature, and
2607 some known race conditions still remain. If you choose to try
2608 it, be very sure to not actually deploy it for production
2609 purposes. README.threads has more details, and is required
2610 reading if you enable threads.
2612 case "$usethreads" in
2613 $define|true|[yY]*) dflt='y';;
2616 rp='Build a threading Perl?'
2619 y|Y) val="$define" ;;
2625 case "$d_oldpthreads" in
2626 '') : Configure tests would be welcome here. For now, assume undef.
2628 *) val="$d_oldpthreads" ;;
2634 case "$usethreads" in
2635 "$define"|true|[yY]*)
2636 : Look for a hint-file generated 'call-back-unit'. If the
2637 : user has specified that a threading perl is to be built,
2638 : we may need to set or change some other defaults.
2639 if $test -f usethreads.cbu; then
2640 echo "Your platform has some specific hints for threaded builds, using them..."
2644 (Your platform doesn't have any specific hints for threaded builds.
2645 Assuming POSIX threads, then.)
2653 Perl can be built so that multiple Perl interpreters can coexist
2654 within the same Perl executable. To do so, Configure must be run with
2657 Normally you do not need this and you should answer no.
2660 case "$usemultiplicity" in
2661 $define|true|[yY]*) dflt='y';;
2664 rp='Build Perl for multiplicity?'
2667 y|Y) val="$define" ;;
2673 : determine where manual pages are on this system
2677 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2678 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2679 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2680 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2681 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2682 sysman=`./loc . /usr/man/man1 $syspath`
2685 if $test -d "$sysman"; then
2686 echo "System manual is in $sysman." >&4
2688 echo "Could not find manual pages in source form." >&4
2691 : see what memory models we can support
2694 $cat >pdp11.c <<'EOP'
2703 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2704 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2705 dflt='unsplit split'
2707 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2710 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2715 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2718 if $test -d /lib/large || $test -d /usr/lib/large; then
2721 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2730 Some systems have different model sizes. On most systems they are called
2731 small, medium, large, and huge. On the PDP11 they are called unsplit and
2732 split. If your system doesn't support different memory models, say "none".
2733 If you wish to force everything to one memory model, say "none" here and
2734 put the appropriate flags later when it asks you for other cc and ld flags.
2735 Venix systems may wish to put "none" and let the compiler figure things out.
2736 (In the following question multiple model names should be space separated.)
2738 The default for most systems is "none".
2741 rp="Which memory models are supported?"
2756 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2757 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2764 rp="What flag indicates separate I and D space?"
2772 *large*|*small*|*medium*|*huge*)
2779 rp="What flag indicates large model?"
2789 *huge*) case "$huge" in
2793 rp="What flag indicates huge model?"
2803 *medium*) case "$medium" in
2807 rp="What flag indicates medium model?"
2814 *) medium="$large";;
2817 *small*) case "$small" in
2821 rp="What flag indicates small model?"
2832 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2835 $rm -f pdp11.* pdp11
2837 : make some quick guesses about what we are up against
2839 $echo $n "Hmm... $c"
2849 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2850 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2852 echo "Looks kind of like an OSF/1 system, but we'll see..."
2854 elif test `echo abc | tr a-z A-Z` = Abc ; then
2855 xxx=`./loc addbib blurfl $pth`
2856 if $test -f $xxx; then
2857 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2861 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2862 echo "Looks kind of like an extended USG system, but we'll see..."
2864 echo "Looks kind of like a USG system, but we'll see..."
2868 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2869 echo "Looks kind of like a BSD system, but we'll see..."
2873 echo "Looks kind of like a Version 7 system, but we'll see..."
2876 case "$eunicefix" in
2879 There is, however, a strange, musty smell in the air that reminds me of
2880 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2884 : it so happens the Eunice I know will not run shell scripts in Unix format
2888 echo "Congratulations. You aren't running Eunice."
2892 : Detect OS2. The p_ variable is set above in the Head.U unit.
2897 I have the feeling something is not exactly right, however...don't tell me...
2898 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2903 if test -f /xenix; then
2904 echo "Actually, this looks more like a XENIX system..."
2909 echo "It's not Xenix..."
2914 if test -f /venix; then
2915 echo "Actually, this looks more like a VENIX system..."
2922 echo "Nor is it Venix..."
2925 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2926 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2929 : see if we need a special compiler
2937 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2938 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2952 On some older systems the default C compiler will not resolve multiple global
2953 references that happen to have the same name. On some such systems the "Mcc"
2954 command may be used to force these to be resolved. On other systems a "cc -M"
2955 command is required. (Note that the -M flag on other systems indicates a
2956 memory model to use!) If you have the Gnu C compiler, you might wish to use
2962 rp="Use which C compiler?"
2970 rp="Use which C compiler?"
2974 : Look for a hint-file generated 'call-back-unit'. Now that the
2975 : user has specified the compiler, we may need to set or change some
2977 if $test -f cc.cbu; then
2981 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2982 $cat >gccvers.c <<EOM
2987 printf("%s\n", __VERSION__);
2989 printf("%s\n", "1");
2995 if $cc -o gccvers gccvers.c; then
2996 gccversion=`./gccvers`
2997 case "$gccversion" in
2998 '') echo "You are not using GNU cc." ;;
2999 *) echo "You are using GNU cc $gccversion." ;;
3003 echo "*** WHOA THERE!!! ***" >&4
3004 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3005 case "$knowitall" in
3007 echo " You'd better start hunting for one and let me know about it." >&4
3013 case "$gccversion" in
3014 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3019 Perl can be built to take advantage of explicit 64-bit interfaces,
3020 on some systems. To do so, Configure must be run with -Duse64bits.
3022 If this doesn't make any sense to you, just accept the default 'n'.
3024 case "$use64bits" in
3025 $define|true|[yY]*) dflt='y';;
3028 rp='Try to use explicit 64-bit interfaces, if available?'
3041 case "$archname64" in
3042 '') archname64='' ;; # not a typo
3045 case "$use64bits" in
3046 "$define"|true|[yY]*)
3047 : Look for a hint-file generated 'call-back-unit'. If the
3048 : user has specified that a 64 bit perl is to be built,
3049 : we may need to set or change some other defaults.
3050 if $test -f use64bits.cbu; then
3051 echo "Your platform has some specific hints for 64-bit builds, using them..."
3055 (Your platform doesn't have any specific hints for 64-bit builds.
3056 This is probably okay, especially if your system is a true 64-bit system.)
3058 case "$gccversion" in
3061 But since you seem to be using gcc,
3062 I will now add -DUSE_LONG_LONG to the compilation flags.
3064 ccflags="$ccflags -DUSE_LONG_LONG"
3071 : determine the architecture name
3073 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3074 tarch=`arch`"-$osname"
3075 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3076 if uname -m > tmparch 2>&1 ; then
3077 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3078 -e 's/$/'"-$osname/" tmparch`
3086 case "$myarchname" in
3089 echo "(Your architecture name used to be $myarchname.)"
3096 *) dflt="$archname";;
3098 rp='What is your architecture name'
3101 case "$usethreads" in
3103 echo "Threads selected." >&4
3105 *-thread*) echo "...and architecture name already has -thread." >&4
3107 *) archname="$archname-thread"
3108 echo "...setting architecture name to $archname." >&4
3113 case "$usemultiplicity" in
3115 echo "Multiplicity selected." >&4
3117 *-multi*) echo "...and architecture name already has -multi." >&4
3119 *) archname="$archname-multi"
3120 echo "...setting architecture name to $archname." >&4
3125 case "$use64bits" in
3127 echo "Explicit 64-bitness selected." >&4
3128 case "$archname64" in
3133 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3135 *) archname="$archname-$archname64"
3136 echo "...setting architecture name to $archname." >&4
3143 : decide how portable to be. Allow command line overrides.
3144 case "$d_portable" in
3146 *) d_portable="$define" ;;
3149 : set up shell script to do ~ expansion
3155 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3158 if $test -f /bin/csh; then
3159 /bin/csh -f -c "glob \$1"
3164 name=\`$expr x\$1 : '..\([^/]*\)'\`
3165 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3166 if $test ! -d "\$dir"; then
3168 echo "\$me: can't locate home directory for: \$name" >&2
3173 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3189 : now set up to get a file name
3193 cat <<'EOSC' >>getfile
3209 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3210 fn=`echo $fn | sed 's/(.*)//'`
3216 loc_file=`expr $fn : '.*:\(.*\)'`
3217 fn=`expr $fn : '\(.*\):.*'`
3225 */*) fullpath=true;;
3234 *e*) exp_file=true;;
3237 *p*) nopath_ok=true;;
3242 *d*) type='Directory';;
3243 *l*) type='Locate';;
3248 Locate) what='File';;
3253 case "$d_portable" in
3261 while test "$type"; do
3266 true) rp="$rp (~name ok)";;
3269 if test -f UU/getfile.ok && \
3270 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3289 value=`UU/filexp $ans`
3292 if test "$ans" != "$value"; then
3293 echo "(That expands to $value on this system.)"
3307 /*) value="$ansexp" ;;
3312 echo "I shall only accept a full path name, as in /bin/ls." >&4
3313 echo "Use a ! shell escape if you wish to check pathnames." >&4
3316 echo "Please give a full path name, starting with slash." >&4
3319 echo "Note that using ~name is ok provided it expands well." >&4
3332 for fp in $gfpth; do
3333 if test "X$fp" = X.; then
3338 if test -f "$pf"; then
3340 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3342 echo "($value is not a plain file, but that's ok.)"
3345 if test X"$type" = X; then
3352 for fp in $gfpth; do
3353 if test "X$fp" = X.; then
3358 if test -d "$pf"; then
3366 if test -d "$ansexp"; then
3367 echo "(Looking for $loc_file in directory $value.)"
3368 value="$value/$loc_file"
3369 ansexp="$ansexp/$loc_file"
3371 if test -f "$ansexp"; then
3374 case "$nopath_ok" in
3375 true) case "$value" in
3377 *) echo "Assuming $value will be in people's path."
3393 if test "$fastread" = yes; then
3398 rp="$what $value doesn't exist. Use that name anyway?"
3417 test "X$gfpthkeep" != Xy && gfpth=""
3420 : determine root of directory hierarchy where package will be installed.
3423 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3431 By default, $package will be installed in $dflt/bin, manual pages
3432 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3433 installation directories. Typically this is something like /usr/local.
3434 If you wish to have binaries under /usr/bin but other parts of the
3435 installation under /usr/local, that's ok: you will be prompted
3436 separately for each of the installation directories, the prefix being
3437 only used to set the defaults.
3441 rp='Installation prefix to use?'
3449 *) oldprefix="$prefix";;
3459 $define|true) afs=true ;;
3460 $undef|false) afs=false ;;
3461 *) if test -d /afs; then
3469 echo "AFS may be running... I'll be extra cautious then..." >&4
3471 echo "AFS does not seem to be running..." >&4
3474 : determine installation prefix for where package is to be installed.
3478 Since you are running AFS, I need to distinguish the directory in which
3479 files will reside from the directory in which they are installed (and from
3480 which they are presumably copied to the former directory by occult means).
3483 case "$installprefix" in
3484 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3485 *) dflt="$installprefix";;
3490 In some special cases, particularly when building $package for distribution,
3491 it is convenient to distinguish between the directory in which files should
3492 be installed from the directory ($prefix) in which they
3493 will eventually reside. For most users, these two directories are the same.
3496 case "$installprefix" in
3498 *) dflt=$installprefix;;
3502 rp='What installation prefix should I use for installing files?'
3504 installprefix="$ans"
3505 installprefixexp="$ansexp"
3507 : set the prefixit variable, to compute a suitable default value
3508 prefixit='case "$3" in
3510 case "$oldprefix" in
3511 "") eval "$1=\"\$$2\"";;
3518 ""|" ") eval "$1=\"\$$2\"";;
3524 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3526 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3527 /*-$oldprefix/*|\~*-$oldprefix/*)
3528 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3529 *) eval "$1=\"\$$2\"";;
3533 : set the base revision
3536 : get the patchlevel
3538 echo "Getting the current patchlevel..." >&4
3539 if $test -r $rsrc/patchlevel.h;then
3540 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3541 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3546 $echo $n "(You have $package" $c
3549 *) $echo $n " $baserev" $c ;;
3551 $echo $n " patchlevel $patchlevel" $c
3552 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3555 if test 0 -eq "$subversion"; then
3556 version=`LC_ALL=C; export LC_ALL; \
3557 echo $baserev $patchlevel | \
3558 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3560 version=`LC_ALL=C; export LC_ALL; \
3561 echo $baserev $patchlevel $subversion | \
3562 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3564 : Figure out perl API version. Perhaps this should be in patchlevel.h
3565 if test "$subversion" -lt 50; then
3566 apiversion=`LC_ALL=C; export LC_ALL; \
3567 LANGUAGE=C; export LANGUAGE; \
3568 echo $baserev $patchlevel | \
3569 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3571 apiversion="$version"
3574 : determine installation style
3575 : For now, try to deduce it from prefix unless it is already set.
3576 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3577 case "$installstyle" in
3578 '') case "$prefix" in
3579 *perl*) dflt='lib';;
3580 *) dflt='lib/perl5' ;;
3583 *) dflt='lib/perl5' ;;
3585 : Probably not worth prompting for this since we prompt for all
3586 : the directories individually, and the prompt would be too long and
3590 : determine where private library files go
3591 : Usual default is /usr/local/lib/perl5/$version.
3592 : Also allow things like /opt/perl/lib/$version, since
3593 : /opt/perl/lib/perl5... would be redundant.
3594 : The default "style" setting is made in installstyle.U
3595 case "$installstyle" in
3596 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3597 *) set dflt privlib lib/$version ;;
3602 There are some auxiliary files for $package that need to be put into a
3603 private library directory that is accessible by everyone.
3607 rp='Pathname where the private library files will reside?'
3610 privlibexp="$ansexp"
3611 : Change installation prefix, if necessary.
3612 if $test X"$prefix" != X"$installprefix"; then
3613 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3615 installprivlib="$privlibexp"
3618 : set the prefixup variable, to restore leading tilda escape
3619 prefixup='case "$prefixexp" in
3621 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3624 : determine where public architecture dependent libraries go
3627 : privlib default is /usr/local/lib/$package/$version
3628 : archlib default is /usr/local/lib/$package/$version/$archname
3629 : privlib may have an optional trailing /share.
3630 tdflt=`echo $privlib | $sed 's,/share$,,'`
3631 tdflt=$tdflt/$archname
3640 $spackage contains architecture-dependent library files. If you are
3641 sharing libraries in a heterogeneous environment, you might store
3642 these files in a separate location. Otherwise, you can just include
3643 them with the rest of the public library files.
3647 rp='Where do you want to put the public architecture-dependent libraries?'
3650 archlibexp="$ansexp"
3651 if $test X"$archlib" = X"$privlib"; then
3656 : Change installation prefix, if necessary.
3657 if $test X"$prefix" != X"$installprefix"; then
3658 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3660 installarchlib="$archlibexp"
3664 : Binary compatibility with 5.005 is not possible for builds
3665 : with advanced features
3666 case "$usethreads$usemultiplicity" in
3668 bincompat5005="$undef"
3669 d_bincompat5005="$undef"
3673 Perl 5.006 can be compiled for binary compatibility with 5.005.
3674 If you decide to do so, you will be able to continue using most
3675 of the extensions that were compiled for Perl 5.005.
3678 case "$bincompat5005$d_bincompat5005" in
3679 *"$undef"*) dflt=n ;;
3682 rp='Binary compatibility with Perl 5.005?'
3685 y*) val="$define" ;;
3690 case "$d_bincompat5005" in
3692 bincompat5005="$define"
3694 *) bincompat5005="$undef"
3695 d_bincompat5005="$undef"
3702 : see if setuid scripts can be secure
3705 Some kernels have a bug that prevents setuid #! scripts from being
3706 secure. Some sites have disabled setuid #! scripts because of this.
3708 First let's decide if your kernel supports secure setuid #! scripts.
3709 (If setuid #! scripts would be secure but have been disabled anyway,
3710 don't say that they are secure if asked.)
3715 if $test -d /dev/fd; then
3716 echo "#!$ls" >reflect
3717 chmod +x,u+s reflect
3718 ./reflect >flect 2>&1
3719 if $contains "/dev/fd" flect >/dev/null; then
3720 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3724 If you are not sure if they are secure, I can check but I'll need a
3725 username and password different from the one you are using right now.
3726 If you don't have such a username or don't want me to test, simply
3730 rp='Other username to test security of setuid scripts with?'
3735 case "$d_suidsafe" in
3736 '') echo "I'll assume setuid scripts are *not* secure." >&4
3739 echo "Well, the $hint value is *not* secure." >&4
3741 *) echo "Well, the $hint value *is* secure." >&4
3746 $rm -f reflect flect
3747 echo "#!$ls" >reflect
3748 chmod +x,u+s reflect
3751 echo '"su" will (probably) prompt you for '"$ans's password."
3752 su $ans -c './reflect >flect'
3753 if $contains "/dev/fd" flect >/dev/null; then
3754 echo "Okay, it looks like setuid scripts are secure." >&4
3757 echo "I don't think setuid scripts are secure." >&4
3762 rp='Does your kernel have *secure* setuid scripts?'
3765 [yY]*) val="$define";;
3770 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3771 echo "(That's for file descriptors, not floppy disks.)"
3777 $rm -f reflect flect
3779 : now see if they want to do setuid emulation
3782 case "$d_suidsafe" in
3785 echo "No need to emulate SUID scripts since they are secure here." >& 4
3789 Some systems have disabled setuid scripts, especially systems where
3790 setuid scripts cannot be secure. On systems where setuid scripts have
3791 been disabled, the setuid/setgid bits on scripts are currently
3792 useless. It is possible for $package to detect those bits and emulate
3793 setuid/setgid in a secure fashion. This emulation will only work if
3794 setuid scripts have been disabled in your kernel.
3798 "$define") dflt=y ;;
3801 rp="Do you want to do setuid/setgid emulation?"
3804 [yY]*) val="$define";;
3812 : What should the include directory be ?
3814 $echo $n "Hmm... $c"
3818 if $test -f /bin/mips && /bin/mips; then
3819 echo "Looks like a MIPS system..."
3820 $cat >usr.c <<'EOCP'
3821 #ifdef SYSTYPE_BSD43
3825 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3826 dflt='/bsd43/usr/include'
3830 mips_type='System V'
3832 $rm -f usr.c usr.out
3833 echo "and you're compiling with the $mips_type compiler and libraries."
3837 echo "Doesn't look like a MIPS system."
3847 case "$xxx_prompt" in
3850 rp='Where are the include files you want to use?'
3858 : see how we invoke the C preprocessor
3860 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3861 cat <<'EOT' >testcpp.c
3867 if test ! -f cppstdin; then
3868 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3869 # AIX cc -E doesn't show the absolute headerfile
3870 # locations but we'll cheat by using the -M flag.
3871 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
3873 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3876 echo "Keeping your $hint cppstdin wrapper."
3879 wrapper=`pwd`/cppstdin
3883 if $test "X$cppstdin" != "X" && \
3884 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3887 echo "You used to use $cppstdin $cppminus so we'll use that again."
3889 '') echo "But let's see if we can live without a wrapper..." ;;
3891 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3894 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3897 echo "(However, $cpprun $cpplast does not work, let's see...)"
3905 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3912 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3913 $cc -E <testcpp.c >testcpp.out 2>&1; \
3914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3915 echo "Yup, it does."
3918 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3919 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3920 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3921 echo "Yup, it does."
3924 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3925 $cc -P <testcpp.c >testcpp.out 2>&1; \
3926 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3927 echo "Yipee, that works!"
3930 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3931 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3932 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3933 echo "At long last!"
3936 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3937 $cpp <testcpp.c >testcpp.out 2>&1; \
3938 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3942 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3943 $cpp - <testcpp.c >testcpp.out 2>&1; \
3944 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3945 echo "Hooray, it works! I was beginning to wonder."
3948 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3949 $wrapper <testcpp.c >testcpp.out 2>&1; \
3950 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3956 rp="No dice. I can't find a C preprocessor. Name one:"
3960 $x_cpp <testcpp.c >testcpp.out 2>&1
3961 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3962 echo "OK, that will do." >&4
3964 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3979 echo "Perhaps can we force $cc -E using a wrapper..."
3980 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3981 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3987 echo "Nope, we'll have to live without it..."
4001 "$wrapper"|'cppstdin') ;;
4002 *) $rm -f $wrapper;;
4004 $rm -f testcpp.c testcpp.out
4006 : Set private lib path
4009 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4014 '') dlist="$loclibpth $plibpth $glibpth";;
4015 *) dlist="$libpth";;
4018 : Now check and see which directories actually exist, avoiding duplicates
4022 if $test -d $xxx; then
4025 *) libpth="$libpth $xxx";;
4031 Some systems have incompatible or broken versions of libraries. Among
4032 the directories listed in the question below, please remove any you
4033 know not to be holding relevant libraries, and add any that are needed.
4034 Say "none" for none.
4045 rp="Directories to use for library searches?"
4052 : compute shared library extension
4055 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4065 On some systems, shared libraries may be available. Answer 'none' if
4066 you want to suppress searching of shared libraries for the remaining
4067 of this configuration.
4070 rp='What is the file extension used for shared libraries?'
4074 : Define several unixisms.
4075 : Hints files or command line option can be used to override them.
4076 : The convoluted testing is in case hints files set either the old
4079 '') case "$exe_ext" in
4081 *) _exe="$exe_ext" ;;
4086 '') case "$lib_ext" in
4093 '') case "$obj_ext" in
4100 '') case "$path_sep" in
4111 : Which makefile gets called first. This is used by make depend.
4112 case "$firstmakefile" in
4113 '') firstmakefile='makefile';;
4118 Perl can be built to use the SOCKS proxy protocol library. To do so,
4119 Configure must be run with -Dusesocks.
4121 Normally you do not need this and you should answer no.
4125 $define|true|[yY]*) dflt='y';;
4128 rp='Build Perl for SOCKS?'
4131 y|Y) val="$define" ;;
4137 : Looking for optional libraries
4139 echo "Checking for optional libraries..." >&4
4144 case "$libswanted" in
4145 '') libswanted='c_s';;
4149 libswanted="$libswanted socks5 socks5_sh"
4152 for thislib in $libswanted; do
4154 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4155 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4156 echo "Found -l$thislib (shared)."
4159 *) dflt="$dflt -l$thislib";;
4161 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4162 echo "Found -l$thislib (shared)."
4165 *) dflt="$dflt -l$thislib";;
4167 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4168 echo "Found -l$thislib."
4171 *) dflt="$dflt -l$thislib";;
4173 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4174 echo "Found -l$thislib."
4177 *) dflt="$dflt -l$thislib";;
4179 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4180 echo "Found -l${thislib}_s."
4183 *) dflt="$dflt -l${thislib}_s";;
4185 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4186 echo "Found -l$thislib."
4189 *) dflt="$dflt -l$thislib";;
4192 echo "No -l$thislib."
4203 ' '|'') dflt='none';;
4208 In order to compile $package on your machine, a number of libraries
4209 are usually needed. Include any other special libraries here as well.
4210 Say "none" for none. The default list is almost always right.
4214 rp="What libraries to use?"
4221 : determine optimization, if desired, or use for debug flag also
4223 ' '|$undef) dflt='none';;
4225 *) dflt="$optimize";;
4229 By default, $package compiles with the -O flag to use the optimizer.
4230 Alternately, you might want to use the symbolic debugger, which uses
4231 the -g flag (on traditional Unix systems). Either flag can be
4232 specified here. To use neither flag, specify the word "none".
4235 rp="What optimizer/debugger flag should be used?"
4239 'none') optimize=" ";;
4243 : We will not override a previous value, but we might want to
4244 : augment a hint file
4246 default|recommended)
4247 case "$gccversion" in
4248 1*) dflt='-fpcc-struct-return' ;;
4251 *-g*) dflt="$dflt -DDEBUGGING";;
4253 case "$gccversion" in
4254 2*) if test -d /etc/conf/kconfig.d &&
4255 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4261 case "$gccversion" in
4265 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4266 echo 'int main(void) { return 0; }' > gcctest.c
4267 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4268 echo "Yes, it does." 2>&1
4271 echo "Leaving current flags $ccflags alone." 2>&1
4273 *) dflt="$dflt -fno-strict-aliasing" ;;
4276 echo "Nope, it doesn't, but that's ok." 2>&1
4283 case "$mips_type" in
4284 *BSD*|'') inclwanted="$locincpth $usrinc";;
4285 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4287 for thisincl in $inclwanted; do
4288 if $test -d $thisincl; then
4289 if $test x$thisincl != x$usrinc; then
4292 *) dflt="$dflt -I$thisincl";;
4298 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4300 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4308 *) dflt="$dflt -D$2";;
4312 set signal.h LANGUAGE_C; eval $inctest
4316 ccflags="$ccflags -DSOCKS"
4321 default|recommended) dflt="$ccflags $dflt" ;;
4322 *) dflt="$ccflags";;
4330 Your C compiler may want other flags. For this question you should include
4331 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4332 but you should NOT include libraries or ld flags like -lwhatever. If you
4333 want $package to honor its debug switch, you should include -DDEBUGGING here.
4334 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4336 To use no flags, specify the word "none".
4342 rp="Any additional cc flags?"
4349 : the following weeds options from ccflags that are of no interest to cpp
4351 case "$gccversion" in
4352 1*) cppflags="$cppflags -D__GNUC__"
4354 case "$mips_type" in
4356 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4362 echo "Let me guess what the preprocessor flags are..." >&4
4376 *) ftry="$previous $flag";;
4378 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4379 >cpp1.out 2>/dev/null && \
4380 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4381 >cpp2.out 2>/dev/null && \
4382 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4383 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4385 cppflags="$cppflags $ftry"
4395 *-*) echo "They appear to be: $cppflags";;
4397 $rm -f cpp.c cpp?.out
4401 : flags used in final linking phase
4403 '') if ./venix; then
4409 *-posix*) dflt="$dflt -posix" ;;
4412 *) dflt="$ldflags";;
4415 : Try to guess additional flags to pick up local libraries.
4416 for thislibdir in $libpth; do
4417 case " $loclibpth " in
4420 *"-L$thislibdir "*) ;;
4421 *) dflt="$dflt -L$thislibdir" ;;
4433 Your C linker may need flags. For this question you should
4434 include -L/whatever and any other flags used by the C linker, but you
4435 should NOT include libraries like -lwhatever.
4437 Make sure you include the appropriate -L/path flags if your C linker
4438 does not normally search all of the directories you specified above,
4441 To use no flags, specify the word "none".
4445 rp="Any additional ld flags (NOT including libraries)?"
4451 rmlist="$rmlist pdp11"
4455 echo "Checking your choice of C compiler and flags for coherency..." >&4
4456 $cat > try.c <<'EOF'
4458 int main() { printf("Ok\n"); exit(0); }
4460 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4462 $cat >try.msg <<'EOM'
4463 I've tried to compile and run the following simple program:
4466 $cat try.c >> try.msg
4468 $cat >> try.msg <<EOM
4475 and I got the following output:
4479 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4480 if sh -c './try' >>try.msg 2>&1; then
4484 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4487 cat >> try.msg <<'EOQS'
4488 If $libs contains -lsfio, and sfio is mis-configured, then it
4489 sometimes (apparently) runs and exits with a 0 status, but with no
4490 output! It may have to do with sfio's use of _exit vs. exit.
4493 rp="You have a big problem. Shall I abort Configure"
4500 echo "The program compiled OK, but exited with status $?." >>try.msg
4501 rp="You have a problem. Shall I abort Configure"
4505 echo "I can't compile the test program." >>try.msg
4506 rp="You have a BIG problem. Shall I abort Configure"
4512 case "$knowitall" in
4514 echo "(The supplied flags or libraries might be incorrect.)"
4522 *) echo "Ok. Stopping Configure." >&4
4527 n) echo "OK, that should do.";;
4529 $rm -f try try.* core
4531 : determine filename position in cpp output
4533 echo "Computing filename position in cpp output for #include directives..." >&4
4534 echo '#include <stdio.h>' > foo.c
4537 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4538 $grep '^[ ]*#.*stdio\.h' | \
4539 while read cline; do
4542 while $test \$# -gt 0; do
4543 if $test -r \`echo \$1 | $tr -d '"'\`; then
4548 pos=\`expr \$pos + 1\`
4560 *) pos="${fieldn}th";;
4562 echo "Your cpp writes the filename in the $pos field of the line."
4564 : locate header file
4569 for usrincdir in $usrinc
4571 if test -f \$usrincdir/\$wanted; then
4572 echo "\$usrincdir/\$wanted"
4576 awkprg='{ print \$$fieldn }'
4577 echo "#include <\$wanted>" > foo\$\$.c
4578 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4579 $grep "^[ ]*#.*\$wanted" | \
4580 while read cline; do
4581 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4583 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4584 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4589 # status = 0: grep returned 0 lines, case statement not executed
4590 # status = 1: headerfile found
4591 # status = 2: while loop executed, no headerfile found
4595 if test \$status -eq 1; then
4602 : define an alternate in-header-list? function
4603 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4604 cont=true; xxf="echo \"<\$1> found.\" >&4";
4605 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4606 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4608 case $# in 4) instead=instead;; *) instead="at last";; esac;
4609 while $test "$cont"; do
4611 var=$2; eval "was=\$$2";
4612 if $test "$xxx" && $test -r "$xxx";
4614 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4617 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4618 set $yyy; shift; shift; yyy=$@;
4619 case $# in 0) cont="";;
4620 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4621 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4622 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4623 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4627 do set $yyy; var=$2; eval "was=\$$2";
4628 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4629 set $yyy; shift; shift; yyy=$@;
4632 : see if this is a malloc.h system
4633 set malloc.h i_malloc
4636 : see if stdlib is available
4637 set stdlib.h i_stdlib
4640 : determine which malloc to compile in
4642 case "$usemymalloc" in
4643 ''|[yY]*|true|$define) dflt='y' ;;
4646 rp="Do you wish to attempt to use the malloc that comes with $package?"
4652 mallocsrc='malloc.c'
4653 mallocobj="malloc$_o"
4654 d_mymalloc="$define"
4657 : Remove malloc from list of libraries to use
4658 echo "Removing unneeded -lmalloc from library list" >&4
4659 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4662 echo "libs = $libs" >&4
4674 : compute the return types of malloc and free
4676 $cat >malloc.c <<END
4680 #include <sys/types.h>
4694 case "$malloctype" in
4696 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4703 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4707 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4714 echo "Your system uses $freetype free(), it would seem." >&4
4718 The installation process will also create a directory for
4719 vendor-supplied add-ons. Vendors who supply perl with their system
4720 may find it convenient to place all vendor-supplied files in this
4721 directory rather than in the main distribution directory. This will
4722 ease upgrades between binary-compatible maintenance versions of perl.
4724 Of course you may also use these directories in whatever way you see
4725 fit. For example, you might use them to access modules shared over a
4726 company-wide network.
4728 The default answer should be fine for most people.
4729 This causes further questions about vendor add-ons to be skipped
4730 and no vendor-specific directories will be configured for perl.
4733 rp='Do you want to configure vendor-specific add-on directories?'
4734 case "$usevendorprefix" in
4735 define|true|[yY]*) dflt=y ;;
4741 rp='Installation prefix to use for vendor-supplied add-ons?'
4742 case "$vendorprefix" in
4744 *) dflt=$vendorprefix ;;
4748 case "$vendorprefix" in
4752 *) oldvendorprefix="$prefix";;
4756 usevendorprefix="$define"
4758 vendorprefixexp="$ansexp"
4760 *) usevendorprefix="$undef"
4766 case "$vendorprefix" in
4767 '') d_vendorlib="$undef"
4771 *) d_vendorlib="$define"
4772 : determine where vendor-supplied modules go.
4773 : Usual default is /usr/local/lib/perl5/vendor_perl
4774 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4775 case "$installstyle" in
4776 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4777 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4780 rp='Pathname for the vendor-supplied library files?'
4783 vendorlibexp="$ansexp"
4784 : Change installation prefix, if necessary.
4785 if $test X"$prefix" != X"$installprefix"; then
4786 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4788 installvendorlib="$vendorlibexp"
4793 : Cruising for prototypes
4795 echo "Checking out function prototypes..." >&4
4796 $cat >prototype.c <<'EOCP'
4797 int main(int argc, char *argv[]) {
4800 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4801 echo "Your C compiler appears to support function prototypes."
4804 echo "Your C compiler doesn't seem to understand function prototypes."
4811 case "$prototype" in
4813 *) ansi2knr='ansi2knr'
4818 This version of $package can only be compiled by a compiler that
4819 understands function prototypes. Unfortunately, your C compiler
4821 doesn't seem to understand them. Sorry about that.
4823 If GNU cc is available for your system, perhaps you could try that instead.
4825 Eventually, we hope to support building Perl with pre-ANSI compilers.
4826 If you would like to help in that effort, please contact <perlbug@perl.org>.
4828 Aborting Configure now.
4834 : determine where public executables go
4839 rp='Pathname where the public executables will reside?'
4841 if $test "X$ansexp" != "X$binexp"; then
4846 : Change installation prefix, if necessary.
4847 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4848 if $test X"$prefix" != X"$installprefix"; then
4849 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4851 installbin="$binexp"
4854 : determine whether to install perl also as /usr/bin/perl
4857 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4859 Many scripts expect to perl to be installed as /usr/bin/perl.
4860 I can install the perl you are about to compile also as /usr/bin/perl
4861 (in addition to $installbin/perl).
4863 case "$installusrbinperl" in
4864 "$undef"|[nN]*) dflt='n';;
4867 rp="Do you want to install perl as /usr/bin/perl?"
4870 [yY]*) val="$define";;
4876 set installusrbinperl
4879 : define a shorthand compile call
4883 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4884 : define a shorthand compile call for compilations that should be ok.
4888 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4891 echo "Checking for GNU C Library..." >&4
4892 cat >gnulibc.c <<EOM
4904 if eval $compile_ok && ./gnulibc; then
4906 echo "You are using the GNU C Library"
4909 echo "You are not using the GNU C Library"
4915 : see if nm is to be used to determine whether a symbol is defined or not
4919 case "$d_gnulibc" in
4922 echo "nm probably won't work on the GNU C Library." >&4
4928 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4930 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4931 echo "'nm' won't be sufficient on this sytem." >&4
4937 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4938 if $test $dflt -gt 20; then
4948 true|$define) dflt=y;;
4955 I can use $nm to extract the symbols from your C libraries. This
4956 is a time consuming task which may generate huge output on the disk (up
4957 to 3 megabytes) but that should make the symbols extraction faster. The
4958 alternative is to skip the 'nm' extraction part and to compile a small
4959 test program instead to determine whether each symbol is present. If
4960 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4961 this may be the best solution.
4963 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4966 rp="Shall I use $nm to extract C symbols from the libraries?"
4969 [Nn]*) usenm=false;;
4978 : nm options which may be necessary
4980 '') if $test -f /mach_boot; then
4982 elif $test -d /usr/ccs/lib; then
4983 nm_opt='-p' # Solaris (and SunOS?)
4984 elif $test -f /dgux; then
4986 elif $test -f /lib64/rld; then
4987 nm_opt='-p' # 64-bit Irix
4993 : nm options which may be necessary for shared libraries but illegal
4994 : for archive libraries. Thank you, Linux.
4995 case "$nm_so_opt" in
4996 '') case "$myuname" in
4998 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4999 nm_so_opt='--dynamic'
5008 : get list of predefined functions in a handy place
5013 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5020 *) for thislib in $libs; do
5023 : Handle C library specially below.
5026 thislib=`echo $thislib | $sed -e 's/^-l//'`
5027 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5029 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5031 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5033 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5035 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5037 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5039 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5044 libnames="$libnames $try"
5046 *) libnames="$libnames $thislib" ;;
5055 for xxx in $libpth; do
5056 $test -r $1 || set $xxx/libc.$so
5057 : The messy sed command sorts on library version numbers.
5059 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5060 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5062 s/[0-9][0-9]*/0000&/g
5063 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5066 sort | $sed -e 's/^.* //'`
5069 $test -r $1 || set /usr/ccs/lib/libc.$so
5070 $test -r $1 || set /lib/libsys_s$_a
5076 if $test -r "$1"; then
5077 echo "Your (shared) C library seems to be in $1."
5079 elif $test -r /lib/libc && $test -r /lib/clib; then
5080 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5082 libc='/lib/clib /lib/libc'
5083 if $test -r /lib/syslib; then
5084 echo "(Your math library is in /lib/syslib.)"
5085 libc="$libc /lib/syslib"
5087 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5088 echo "Your C library seems to be in $libc, as you said before."
5089 elif $test -r $incpath/usr/lib/libc$_a; then
5090 libc=$incpath/usr/lib/libc$_a;
5091 echo "Your C library seems to be in $libc. That's fine."
5092 elif $test -r /lib/libc$_a; then
5094 echo "Your C library seems to be in $libc. You're normal."
5096 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5098 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5099 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5100 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5102 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5104 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5107 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5109 if $test -r "$tans"; then
5110 echo "Your C library seems to be in $tans, of all places."
5116 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5120 If the guess above is wrong (which it might be if you're using a strange
5121 compiler, or your machine supports multiple models), you can override it here.
5126 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5128 I can't seem to find your C library. I've looked in the following places:
5131 $sed 's/^/ /' libpath
5134 None of these seems to contain your C library. I need to get its name...
5139 rp='Where is your C library?'
5144 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5145 set X `cat libnames`
5148 case $# in 1) xxx=file; esac
5149 echo "Extracting names from the following $xxx for later perusal:" >&4
5151 $sed 's/^/ /' libnames >&4
5153 $echo $n "This may take a while...$c" >&4
5157 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5158 *) $nm $nm_opt $file 2>/dev/null;;
5163 $grep fprintf libc.tmp > libc.ptf
5164 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5165 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5167 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5169 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5171 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5173 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5175 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5177 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5179 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5181 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5183 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5185 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5187 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5189 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5191 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5192 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5194 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5196 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5198 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5200 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5202 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5204 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5206 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5208 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5210 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5212 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5214 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5216 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5218 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5220 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5222 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 $nm -p $* 2>/dev/null >libc.tmp
5226 $grep fprintf libc.tmp > libc.ptf
5227 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5228 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5234 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5236 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5237 for thisname in $libnames $libc; do
5238 $ar t $thisname >>libc.tmp
5240 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5242 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5243 # Repeat libc to extract forwarders to DLL entries too
5244 for thisname in $libnames $libc; do
5245 $ar tv $thisname >>libc.tmp
5246 # Revision 50 of EMX has bug in $ar.
5247 # it will not extract forwarders to DLL entries
5248 # Use emximp which will extract exactly them.
5249 emximp -o tmp.imp $thisname \
5251 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5252 < tmp.imp >>libc.tmp
5255 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5258 echo "$ar didn't seem to work right." >&4
5259 echo "Maybe this is a Cray...trying bld instead..." >&4
5260 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5262 for thisname in $libnames; do
5264 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5265 $ar t $thisname >>libc.tmp
5269 echo "That didn't work either. Giving up." >&4
5276 if $test -f /lib/syscalls.exp; then
5278 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5279 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5283 $rm -f libnames libpath
5285 : see if dld is available
5289 : is a C symbol defined?
5292 -v) tf=libc.tmp; tc=""; tdc="";;
5293 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5294 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5297 case "$reuseval-$4" in
5299 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5305 if $contains $tlook $tf >/dev/null 2>&1;
5310 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5311 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5319 $define) tval=true;;
5325 : define an is-in-libc? function
5326 inlibc='echo " "; td=$define; tu=$undef;
5327 sym=$1; var=$2; eval "was=\$$2";
5329 case "$reuseval$was" in
5339 echo "$sym() found." >&4;
5340 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5342 echo "$sym() NOT found." >&4;
5343 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5347 $define) echo "$sym() found." >&4;;
5348 *) echo "$sym() NOT found." >&4;;
5352 : see if dlopen exists
5359 : determine which dynamic loading, if any, to compile in
5361 dldir="ext/DynaLoader"
5374 $define) dflt='y' ;;
5377 $define) dflt='y' ;;
5379 : Does a dl_xxx.xs file exist for this operating system
5380 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5383 rp="Do you wish to use dynamic loading?"
5390 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5391 dflt="$dldir/dl_${osname}.xs"
5392 elif $test "$d_dlopen" = "$define" ; then
5393 dflt="$dldir/dl_dlopen.xs"
5394 elif $test "$i_dld" = "$define" ; then
5395 dflt="$dldir/dl_dld.xs"
5400 *) dflt="$dldir/$dlsrc"
5403 echo "The following dynamic loading files are available:"
5404 : Can not go over to $dldir because getfile has path hard-coded in.
5405 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5406 rp="Source file to use for dynamic loading"
5412 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5416 Some systems may require passing special flags to $cc -c to
5417 compile modules that will be used to create a shared library.
5418 To use no flags, say "none".
5421 case "$cccdlflags" in
5422 '') case "$gccversion" in
5423 '') case "$osname" in
5425 next) dflt='none' ;;
5426 irix*) dflt='-KPIC' ;;
5427 svr4*|esix*|solaris) dflt='-KPIC' ;;
5428 sunos) dflt='-pic' ;;
5432 *) case "$osname" in
5433 svr4*|esix*|solaris) dflt='-fPIC' ;;
5438 *) dflt="$cccdlflags" ;;
5440 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5443 none) cccdlflags=' ' ;;
5444 *) cccdlflags="$ans" ;;
5449 Some systems use ld to create libraries that can be dynamically loaded,
5450 while other systems (such as those using ELF) use $cc.
5454 '') $cat >try.c <<'EOM'
5455 /* Test for whether ELF binaries are produced */
5460 int i = open("a.out",O_RDONLY);
5463 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5464 exit(0); /* succeed (yes, it's ELF) */
5469 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5471 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5475 echo "I'll use ld to build dynamic libraries."
5484 rp="What command should be used to create dynamic libraries?"
5490 Some systems may require passing special flags to $ld to create a
5491 library that can be dynamically loaded. If your ld flags include
5492 -L/other/path options to locate libraries outside your loader's normal
5493 search path, you may need to specify those -L options here as well. To
5494 use no flags, say "none".
5497 case "$lddlflags" in
5498 '') case "$osname" in
5499 beos) dflt='-nostart' ;;
5501 linux|irix*) dflt='-shared' ;;
5502 next) dflt='none' ;;
5503 solaris) dflt='-G' ;;
5504 sunos) dflt='-assert nodefinitions' ;;
5505 svr4*|esix*) dflt="-G $ldflags" ;;
5509 *) dflt="$lddlflags" ;;
5512 : Try to guess additional flags to pick up local libraries.
5513 : Be careful not to append to a plain 'none'
5517 for thisflag in $ldflags; do
5522 *) dflt="$dflt $thisflag" ;;
5529 ''|' ') dflt='none' ;;
5532 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5535 none) lddlflags=' ' ;;
5536 *) lddlflags="$ans" ;;
5541 Some systems may require passing special flags to $cc to indicate that
5542 the resulting executable will use dynamic linking. To use no flags,
5546 case "$ccdlflags" in
5547 '') case "$osname" in
5548 hpux) dflt='-Wl,-E' ;;
5549 linux) dflt='-rdynamic' ;;
5550 next) dflt='none' ;;
5551 sunos) dflt='none' ;;
5555 *) dflt="$ccdlflags" ;;
5557 rp="Any special flags to pass to $cc to use dynamic loading?"
5560 none) ccdlflags=' ' ;;
5561 *) ccdlflags="$ans" ;;
5575 # No dynamic loading being used, so don't bother even to prompt.
5578 *) case "$useshrplib" in
5579 '') case "$osname" in
5580 svr4*|dgux|dynixptx|esix|powerux|beos)
5582 also='Building a shared libperl is required for dynamic loading to work on your system.'
5587 also='Building a shared libperl is needed for MAB support.'
5605 The perl executable is normally obtained by linking perlmain.c with
5606 libperl${_a}, any static extensions (usually just DynaLoader), and
5607 any other libraries needed on this system (such as -lm, etc.). Since
5608 your system supports dynamic loading, it is probably possible to build
5609 a shared libperl.$so. If you will have more than one executable linked
5610 to libperl.$so, this will significantly reduce the size of each
5611 executable, but it may have a noticeable affect on performance. The
5612 default is probably sensible for your system.
5616 rp="Build a shared libperl.$so (y/n)"
5620 useshrplib='true' ;;
5621 *) useshrplib='false' ;;
5626 case "$useshrplib" in
5630 # Figure out a good name for libperl.so. Since it gets stored in
5631 # a version-specific architecture-dependent library, the version
5632 # number isn't really that important, except for making cc/ld happy.
5634 # A name such as libperl.so.3.1
5635 majmin="libperl.$so.$patchlevel.$subversion"
5636 # A name such as libperl.so.301
5637 majonly=`echo $patchlevel $subversion |
5638 $awk '{printf "%d%02d", $1, $2}'`
5639 majonly=libperl.$so.$majonly
5640 # I'd prefer to keep the os-specific stuff here to a minimum, and
5641 # rely on figuring it out from the naming of libc.
5642 case "${osname}${osvers}" in
5645 # XXX How handle the --version stuff for MAB?
5647 linux*) # ld won't link with a bare -lperl otherwise.
5650 *) # Try to guess based on whether libc has major.minor.
5652 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5653 *libc.$so.[0-9]*) dflt=$majonly ;;
5654 *) dflt=libperl.$so ;;
5664 I need to select a good name for the shared libperl. If your system uses
5665 library names with major and minor numbers, then you might want something
5666 like $majmin. Alternatively, if your system uses a single version
5667 number for shared libraries, then you might want to use $majonly.
5668 Or, your system might be quite happy with a simple libperl.$so.
5670 Since the shared libperl will get installed into a version-specific
5671 architecture-dependent directory, the version number of the shared perl
5672 library probably isn't important, so the default should be o.k.
5675 rp='What name do you want to give to the shared libperl?'
5678 echo "Ok, I'll use $libperl"
5681 libperl="libperl${_a}"
5685 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5689 WARNING: Use of the shrpdir variable for the installation location of
5690 the shared $libperl is not supported. It was never documented and
5691 will not work in this version. Let me (perlbug@perl.com)
5692 know of any problems this may cause.
5698 But your current setting of $shrpdir is
5699 the default anyway, so it's harmless.
5704 Further, your current attempted setting of $shrpdir
5705 conflicts with the value of $archlibexp/CORE
5706 that installperl will use.
5713 # How will the perl executable find the installed shared $libperl?
5714 # Add $xxx to ccdlflags.
5715 # If we can't figure out a command-line option, use $shrpenv to
5716 # set env LD_RUN_PATH. The main perl makefile uses this.
5717 shrpdir=$archlibexp/CORE
5720 if "$useshrplib"; then
5723 # We'll set it in Makefile.SH...
5729 xxx="-Wl,-R$shrpdir"
5731 linux|irix*|dec_osf)
5732 xxx="-Wl,-rpath,$shrpdir"
5735 # next doesn't like the default...
5738 # beos doesn't like the default, either.
5741 # hpux doesn't like the default, either.
5742 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5745 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5751 # Only add $xxx if it isn't already in ccdlflags.
5752 case " $ccdlflags " in
5754 *) ccdlflags="$ccdlflags $xxx"
5757 Adding $xxx to the flags
5758 passed to $ld so that the perl executable will find the
5759 installed shared $libperl.
5767 # Fix ccdlflags in AIX for building external extensions.
5768 # (For building Perl itself bare -bE:perl.exp is needed,
5769 # Makefile.SH takes care of this.)
5771 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5773 # Respect a hint or command-line value.
5775 '') shrpenv="$tmp_shrpenv" ;;
5777 case "$ldlibpthname" in
5778 '') ldlibpthname=LD_LIBRARY_PATH ;;
5779 none) ldlibpthname='' ;;
5782 : determine where manual pages go
5783 set man1dir man1dir none
5787 $spackage has manual pages available in source form.
5791 echo "However, you don't have nroff, so they're probably useless to you."
5793 '') man1dir="none";;
5796 echo "If you don't want the manual sources installed, answer 'none'."
5801 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5802 lookpath="$lookpath $prefixexp/man/p_man/man1"
5803 lookpath="$lookpath $prefixexp/man/u_man/man1"
5804 lookpath="$lookpath $prefixexp/man/man.1"
5806 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5807 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5817 rp="Where do the main $spackage manual pages (source) go?"
5819 if $test "X$man1direxp" != "X$ansexp"; then
5823 man1direxp="$ansexp"
5829 : Change installation prefix, if necessary.
5830 if $test X"$prefix" != X"$installprefix"; then
5831 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5833 installman1dir="$man1direxp"
5836 : What suffix to use on installed man pages
5843 rp="What suffix should be used for the main $spackage man pages?"
5845 '') case "$man1dir" in
5859 *) dflt="$man1ext";;
5866 : see if we can have long filenames
5868 rmlist="$rmlist /tmp/cf$$"
5869 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5870 first=123456789abcdef
5871 second=/tmp/cf$$/$first
5872 $rm -f $first $second
5873 if (echo hi >$first) 2>/dev/null; then
5874 if $test -f 123456789abcde; then
5875 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5878 if (echo hi >$second) 2>/dev/null; then
5879 if $test -f /tmp/cf$$/123456789abcde; then
5881 That's peculiar... You can have filenames longer than 14 characters, but only
5882 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5883 I shall consider your system cannot support long filenames at all.
5887 echo 'You can have filenames longer than 14 characters.' >&4
5892 How confusing! Some of your filesystems are sane enough to allow filenames
5893 longer than 14 characters but some others like /tmp can't even think about them.
5894 So, for now on, I shall assume your kernel does not allow them at all.
5901 You can't have filenames longer than 14 chars. You can't even think about them!
5907 $rm -rf /tmp/cf$$ 123456789abcde*
5909 : determine where library module manual pages go
5910 set man3dir man3dir none
5914 $spackage has manual pages for many of the library modules.
5920 However, you don't have nroff, so they're probably useless to you.
5923 '') man3dir="none";;
5927 case "$d_flexfnam" in
5930 However, your system can't handle the long file names like File::Basename.3.
5933 '') man3dir="none";;
5937 echo "If you don't want the manual sources installed, answer 'none'."
5938 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5940 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5941 if $test -d "$privlib/man/man3"; then
5944 WARNING: Previous versions of perl installed man3 pages into
5945 $privlib/man/man3. This version will suggest a
5946 new default of $dflt.
5950 rp='Do you wish to preserve the old behavior?(y/n)'
5953 y*) dflt="$privlib/man/man3" ;;
5959 *) dflt="$man3dir" ;;
5963 rp="Where do the $package library man pages (source) go?"
5966 man3direxp="$ansexp"
5972 : Change installation prefix, if necessary.
5973 if $test X"$prefix" != X"$installprefix"; then
5974 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
5976 installman3dir="$man3direxp"
5979 : What suffix to use on installed man pages
5985 rp="What suffix should be used for the $package library man pages?"
5987 '') case "$man3dir" in
6001 *) dflt="$man3ext";;
6008 : see if we have to deal with yellow pages, now NIS.
6009 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6010 if $test -f /usr/etc/nibindd; then
6012 echo "I'm fairly confident you're on a NeXT."
6014 rp='Do you get the hosts file via NetInfo?'
6023 y*) hostcat='nidump hosts .';;
6024 *) case "$hostcat" in
6025 nidump*) hostcat='';;
6035 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6043 rp='Are you getting the hosts file via yellow pages?'
6046 y*) hostcat='ypcat hosts';;
6047 *) hostcat='cat /etc/hosts';;
6053 '') hostcat='cat /etc/hosts';;
6056 '') groupcat='cat /etc/group';;
6059 '') passcat='cat /etc/passwd';;
6062 : now get the host name
6064 echo "Figuring out host name..." >&4
6065 case "$myhostname" in
6067 echo 'Maybe "hostname" will work...'
6068 if tans=`sh -c hostname 2>&1` ; then
6076 if $test "$cont"; then
6078 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6079 if tans=`cat /etc/systemid 2>&1` ; then
6081 phostname='cat /etc/systemid'
6082 echo "Whadyaknow. Xenix always was a bit strange..."
6085 elif $test -r /etc/systemid; then
6086 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6089 if $test "$cont"; then
6090 echo 'No, maybe "uuname -l" will work...'
6091 if tans=`sh -c 'uuname -l' 2>&1` ; then
6093 phostname='uuname -l'
6095 echo 'Strange. Maybe "uname -n" will work...'
6096 if tans=`sh -c 'uname -n' 2>&1` ; then
6098 phostname='uname -n'
6100 echo 'Oh well, maybe I can mine it out of whoami.h...'
6101 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6102 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6103 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6105 case "$myhostname" in
6106 '') echo "Does this machine have an identity crisis or something?"
6109 echo "Well, you said $myhostname before..."
6110 phostname='echo $myhostname';;
6116 : you do not want to know about this
6121 if $test "$myhostname" ; then
6123 rp='Your host name appears to be "'$myhostname'".'" Right?"
6131 : bad guess or no guess
6132 while $test "X$myhostname" = X ; do
6134 rp="Please type the (one word) name of your host:"
6139 : translate upper to lower if necessary
6140 case "$myhostname" in
6142 echo "(Normalizing case in your host name)"
6143 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6147 case "$myhostname" in
6149 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6150 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6151 echo "(Trimming domain name from host name--host name is now $myhostname)"
6153 *) case "$mydomain" in
6156 test "X$hostcat" = "Xypcat hosts" &&
6157 ypmatch "$myhostname" hosts 2>/dev/null |\
6158 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6161 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6162 /[ ]$myhostname[ . ]/p" > hosts
6165 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6166 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6167 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6168 hosts | $sort | $uniq | \
6169 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6170 case `$echo X$dflt` in
6171 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6174 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6179 tans=`./loc resolv.conf X /etc /usr/etc`
6180 if $test -f "$tans"; then
6181 echo "(Attempting domain name extraction from $tans)"
6182 dflt=.`$sed -n -e 's/ / /g' \
6183 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6184 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6186 .) dflt=.`$sed -n -e 's/ / /g' \
6187 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6188 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6195 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6196 dflt=.`sh -c domainname 2>/dev/null`
6199 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6204 .) echo "(Lost all hope -- silly guess then)"
6210 *) dflt="$mydomain";;
6214 rp="What is your domain name?"
6224 : translate upper to lower if necessary
6227 echo "(Normalizing case in your domain name)"
6228 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6232 : a little sanity check here
6233 case "$phostname" in
6236 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6237 $myhostname$mydomain|$myhostname) ;;
6239 case "$phostname" in
6241 echo "(That doesn't agree with your whoami.h file, by the way.)"
6244 echo "(That doesn't agree with your $phostname command, by the way.)"
6254 I need to get your e-mail address in Internet format if possible, i.e.
6255 something like user@host.domain. Please answer accurately since I have
6256 no easy means to double check it. The default value provided below
6257 is most probably close to the reality but may not be valid from outside
6258 your organization...
6262 while test "$cont"; do
6264 '') dflt="$cf_by@$myhostname$mydomain";;
6265 *) dflt="$cf_email";;
6267 rp='What is your e-mail address?'
6273 rp='Address does not look like an Internet one. Use it anyway?'
6289 If you or somebody else will be maintaining perl at your site, please
6290 fill in the correct e-mail address here so that they may be contacted
6291 if necessary. Currently, the "perlbug" program included with perl
6292 will send mail to this address in addition to perlbug@perl.com. You may
6293 enter "none" for no administrator.
6296 case "$perladmin" in
6297 '') dflt="$cf_email";;
6298 *) dflt="$perladmin";;
6300 rp='Perl administrator e-mail address'
6304 : figure out how to guarantee perl startup
6305 case "$startperl" in
6307 case "$sharpbang" in
6311 I can use the #! construct to start perl on your system. This will
6312 make startup of perl scripts faster, but may cause problems if you
6313 want to share those scripts and perl is not in a standard place
6314 ($binexp/perl) on all your platforms. The alternative is to force
6315 a shell by starting the script with a single ':' character.
6319 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6322 none) startperl=": # use perl";;
6323 *) startperl="#!$ans"
6324 if $test 30 -lt `echo "$ans" | wc -c`; then
6327 WARNING: Some systems limit the #! command to 32 characters.
6328 If you experience difficulty running Perl scripts with #!, try
6329 installing Perl in a directory with a shorter pathname.
6335 *) startperl=": # use perl"
6340 echo "I'll use $startperl to start perl scripts."
6342 : figure best path for perl in scripts
6345 perlpath="$binexp/perl"
6346 case "$startperl" in
6351 I will use the "eval 'exec'" idiom to start Perl on your system.
6352 I can use the full path of your Perl binary for this purpose, but
6353 doing so may cause problems if you want to share those scripts and
6354 Perl is not always in a standard place ($binexp/perl).
6358 rp="What path shall I use in \"eval 'exec'\"?"
6365 case "$startperl" in
6367 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6370 : determine where public executable scripts go
6371 set scriptdir scriptdir
6373 case "$scriptdir" in
6376 : guess some guesses
6377 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6378 $test -d /usr/share/bin && dflt=/usr/share/bin
6379 $test -d /usr/local/script && dflt=/usr/local/script
6380 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6381 $test -d $prefixexp/script && dflt=$prefixexp/script
6385 *) dflt="$scriptdir"
6390 Some installations have a separate directory just for executable scripts so
6391 that they can mount it across multiple architectures but keep the scripts in
6392 one spot. You might, for example, have a subdirectory of /usr/share for this.
6393 Or you might just lump your scripts in with all your other executables.
6397 rp='Where do you keep publicly executable scripts?'
6399 if $test "X$ansexp" != "X$scriptdirexp"; then
6403 scriptdirexp="$ansexp"
6404 : Change installation prefix, if necessary.
6405 if $test X"$prefix" != X"$installprefix"; then
6406 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6408 installscript="$scriptdirexp"
6413 After $package is installed, you may wish to install various
6414 add-on modules and utilities. Typically, these add-ons will
6415 be installed under $prefix with the rest
6416 of this package. However, you may wish to install such add-ons
6417 elsewhere under a different prefix.
6419 If you do not wish to put everything under a single prefix, that's
6420 ok. You will be prompted for the individual locations; this siteprefix
6421 is only used to suggest the defaults.
6423 The default should be fine for most people.
6427 rp='Installation prefix to use for add-on modules and utilities?'
6428 : XXX Here might be another good place for an installstyle setting.
6429 case "$siteprefix" in
6431 *) dflt=$siteprefix ;;
6435 case "$siteprefix" in
6440 *) oldsiteprefix="$prefix";;
6445 siteprefixexp="$ansexp"
6447 : determine where site specific libraries go.
6448 : Usual default is /usr/local/lib/perl5/site_perl
6449 : The default "style" setting is made in installstyle.U
6450 : XXX No longer works with Prefixit stuff.
6451 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6452 case "$installstyle" in
6453 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6454 *) dflt=$siteprefix/lib/site_$prog ;;
6458 The installation process will create a directory for
6459 site-specific extensions and modules. Most users find it convenient
6460 to place all site-specific files in this directory rather than in the
6461 main distribution directory.
6465 rp='Pathname for the site-specific library files?'
6468 sitelibexp="$ansexp"
6469 : Change installation prefix, if necessary.
6470 if $test X"$prefix" != X"$installprefix"; then
6471 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6473 installsitelib="$sitelibexp"
6476 : determine where site specific architecture-dependent libraries go.
6477 : sitelib default is /usr/local/lib/perl5/site_perl/
6478 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6479 : sitelib may have an optional trailing /share.
6480 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6481 tdflt="$tdflt/$apiversion/$archname"
6482 set sitearch sitearch none
6485 '') dflt="$tdflt" ;;
6486 *) dflt="$sitearch" ;;
6490 The installation process will also create a directory for
6491 architecture-dependent site-specific extensions and modules.
6495 rp='Pathname for the site-specific architecture-dependent library files?'
6498 sitearchexp="$ansexp"
6499 : Change installation prefix, if necessary.
6500 if $test X"$prefix" != X"$installprefix"; then
6501 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6503 installsitearch="$sitearchexp"
6508 Perl can be built to take advantage of long doubles which
6509 (if available) may give more accuracy and range for floating point
6510 numbers. To do so, Configure must be run with -Duselongdouble.
6512 If this doesn't make any sense to you, just accept the default 'n'.
6514 case "$uselongdouble" in
6515 $define|true|[yY]*) dflt='y';;
6518 rp='Try to use long doubles if available?'
6521 y|Y) val="$define" ;;
6527 case "$uselongdouble" in
6528 "$define"|true|[yY]*)
6529 : Look for a hint-file generated 'call-back-unit'. If the
6530 : user has specified that long doubles should be used,
6531 : we may need to set or change some other defaults.
6532 if $test -f uselongdouble.cbu; then
6533 echo "Your platform has some specific hints for long doubles, using them..."
6534 . ./uselongdouble.cbu
6537 (Your platform doesn't have any specific hints for long doubles.)
6545 Previous version of $package used the standard IO mechanisms as defined
6546 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6547 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6548 the default. This abstraction layer can use AT&T's sfio (if you already
6549 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6550 problems with some extension modules. Using PerlIO with stdio is safe,
6551 but it is slower than plain stdio and therefore is not the default.
6553 If this doesn't make any sense to you, just accept the default 'n'.
6555 case "$useperlio" in
6556 $define|true|[yY]*) dflt='y';;
6559 rp='Use the experimental PerlIO abstraction layer?'
6566 echo "Ok, doing things the stdio way"
6573 : Check how to convert floats to strings.
6574 if test "X$d_Gconvert" = X; then
6576 echo "Checking for an efficient way to convert floats to strings."
6579 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6580 char *myname = "gconvert";
6583 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6584 char *myname = "gcvt";
6587 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6588 char *myname = "sprintf";
6594 checkit(expect, got)
6598 if (strcmp(expect, got)) {
6599 printf("%s oddity: Expected %s, got %s\n",
6600 myname, expect, got);
6610 /* This must be 1st test on (which?) platform */
6611 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6612 Gconvert(0.1, 8, 0, buf);
6613 checkit("0.1", buf);
6615 Gconvert(1.0, 8, 0, buf);
6618 Gconvert(0.0, 8, 0, buf);
6621 Gconvert(-1.0, 8, 0, buf);
6624 /* Some Linux gcvt's give 1.e+5 here. */
6625 Gconvert(100000.0, 8, 0, buf);
6626 checkit("100000", buf);
6628 /* Some Linux gcvt's give -1.e+5 here. */
6629 Gconvert(-100000.0, 8, 0, buf);
6630 checkit("-100000", buf);
6635 case "$d_Gconvert" in
6636 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6637 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6638 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6639 *) xxx_list='gconvert gcvt sprintf' ;;
6642 for xxx_convert in $xxx_list; do
6643 echo "Trying $xxx_convert"
6645 set try -DTRY_$xxx_convert
6646 if eval $compile; then
6647 echo "$xxx_convert" found. >&4
6649 echo "I'll use $xxx_convert to convert floats into a string." >&4
6652 echo "...But $xxx_convert didn't work as I expected."
6655 echo "$xxx_convert NOT found." >&4
6659 case "$xxx_convert" in
6660 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6661 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6662 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6666 : see if inttypes.h is available
6667 : we want a real compile instead of Inhdr because some systems
6668 : have an inttypes.h which includes non-existent headers
6671 #include <inttypes.h>
6673 static int32_t foo32 = 0x12345678;
6677 if eval $compile; then
6678 echo "<inttypes.h> found." >&4
6681 echo "<inttypes.h> NOT found." >&4
6689 case "$use64bits" in
6692 echo $n "Checking to see if your system supports int64_t...$c" >&4
6694 #include <sys/types.h>
6695 #$i_inttypes I_INTTYPES
6697 #include <inttypes.h>
6699 int64_t foo() { int64_t x; x = 7; return x; }
6701 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6703 echo " Yup, it does." >&4
6706 echo " Nope, it doesn't." >&4
6717 : check for lengths of integral types
6721 echo "Checking to see how big your integers are..." >&4
6722 $cat >intsize.c <<'EOCP'
6726 printf("intsize=%d;\n", sizeof(int));
6727 printf("longsize=%d;\n", sizeof(long));
6728 printf("shortsize=%d;\n", sizeof(short));
6733 if eval $compile_ok && ./intsize > /dev/null; then
6735 echo "Your integers are $intsize bytes long."
6736 echo "Your long integers are $longsize bytes long."
6737 echo "Your short integers are $shortsize bytes long."
6741 Help! I can't compile and run the intsize test program: please enlighten me!
6742 (This is probably a misconfiguration in your system or libraries, and
6743 you really ought to fix it. Still, I'll try anyway.)
6747 rp="What is the size of an integer (in bytes)?"
6751 rp="What is the size of a long integer (in bytes)?"
6755 rp="What is the size of a short integer (in bytes)?"
6761 $rm -f intsize intsize.*
6763 : check for long long
6765 echo $n "Checking to see if your system supports long long...$c" >&4
6766 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6767 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6769 echo " Yup, it does." >&4
6772 echo " Nope, it doesn't." >&4
6778 : check for length of long long
6779 case "${d_longlong}${longlongsize}" in
6782 $echo $n "Checking to see how big your long longs are...$c" >&4
6783 $cat >try.c <<'EOCP'
6787 printf("%d\n", sizeof(long long));
6791 if eval $compile_ok; then
6792 longlongsize=`./try`
6793 $echo " $longlongsize bytes." >&4
6797 echo "(I can't seem to compile the test program. Guessing...)"
6798 rp="What is the size of a long long (in bytes)?"
6802 if $test "X$longsize" = "X$longlongsize"; then
6803 echo "(That isn't any different from an ordinary long.)"
6811 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6813 echo "Checking how to print 64-bit integers..." >&4
6815 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6817 $cat >try.c <<'EOCP'
6818 #include <sys/types.h>
6821 int q = 12345678901;
6826 if eval $compile; then
6830 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6831 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6832 echo "We will use %d."
6838 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6840 $cat >try.c <<'EOCP'
6841 #include <sys/types.h>
6844 long q = 12345678901;
6849 if eval $compile; then
6853 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6854 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6855 echo "We will use %ld."
6861 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6863 $cat >try.c <<'EOCP'
6864 #include <sys/types.h>
6865 #include <inttypes.h>
6868 int64_t q = 12345678901;
6869 printf("%" PRId64 "\n", q);
6873 if eval $compile; then
6877 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6878 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6879 echo "We will use the C9X style."
6885 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6887 $cat >try.c <<'EOCP'
6888 #include <sys/types.h>
6891 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6892 printf("%lld\n", q);
6896 if eval $compile; then
6900 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6901 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6902 echo "We will use the %lld style."
6908 if $test X"$sPRId64" = X -a X"$quad" != X; then
6910 #include <sys/types.h>
6913 $quad q = 12345678901;
6918 if eval $compile; then
6922 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6923 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6924 echo "We will use %lld."
6930 if $test X"$sPRId64" = X -a X"$quad" != X; then
6932 #include <sys/types.h>
6935 $quad q = 12345678901;
6940 if eval $compile; then
6944 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6945 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6946 echo "We will use %qd."
6952 if $test X"$sPRId64" = X; then
6953 echo "Cannot figure out how to print 64-bit integers." >&4
6958 fi # intsize -o longsize -o d_int64t -o d_longlong
6961 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6962 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6964 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6965 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6969 : check for length of double
6971 case "$doublesize" in
6973 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6974 $cat >try.c <<'EOCP'
6978 printf("%d\n", sizeof(double));
6982 if eval $compile_ok; then
6984 $echo " $doublesize bytes." >&4
6987 echo "(I can't seem to compile the test program. Guessing...)"
6988 rp="What is the size of a double precision number (in bytes)?"
6996 : check for long doubles
6998 echo $n "Checking to see if your system supports long double...$c" >&4
6999 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7000 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7002 echo " Yup, it does." >&4
7005 echo " Nope, it doesn't." >&4
7011 : check for length of long double
7012 case "${d_longdbl}${longdblsize}" in
7015 $echo $n "Checking to see how big your long doubles are...$c" >&4
7016 $cat >try.c <<'EOCP'
7020 printf("%d\n", sizeof(long double));
7024 if eval $compile; then
7026 $echo " $longdblsize bytes." >&4
7030 echo "(I can't seem to compile the test program. Guessing...)" >&4
7031 rp="What is the size of a long double (in bytes)?"
7035 if $test "X$doublesize" = "X$longdblsize"; then
7036 echo "(That isn't any different from an ordinary double.)"
7044 if $test X"$d_longdbl" = X"$define"; then
7046 echo "Checking how to print long doubles..." >&4
7048 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7049 $cat >try.c <<'EOCP'
7050 #include <sys/types.h>
7054 printf("%.3f\n", d);
7058 if eval $compile; then
7062 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7063 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7064 echo "We will use %f."
7070 if $test X"$sPRIfldbl" = X; then
7071 $cat >try.c <<'EOCP'
7072 #include <sys/types.h>
7075 long double d = 123.456;
7076 printf("%.3llf\n", d);
7080 if eval $compile; then
7084 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7085 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7086 echo "We will use %llf."
7092 if $test X"$sPRIfldbl" = X; then
7093 $cat >try.c <<'EOCP'
7094 #include <sys/types.h>
7097 long double d = 123.456;
7098 printf("%.3Lf\n", d);
7102 if eval $compile; then
7106 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7107 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7108 echo "We will use %Lf."
7114 if $test X"$sPRIfldbl" = X; then
7115 $cat >try.c <<'EOCP'
7116 #include <sys/types.h>
7119 long double d = 123.456;
7120 printf("%.3lf\n", d);
7124 if eval $compile; then
7128 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7129 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7130 echo "We will use %lf."
7136 if $test X"$sPRIfldbl" = X; then
7137 echo "Cannot figure out how to print long doubles." >&4
7144 case "$sPRIfldbl" in
7145 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7146 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7148 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7149 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7153 : Initialize h_fcntl
7156 : Initialize h_sysfile
7159 : access call always available on UNIX
7163 : locate the flags for 'access()'
7167 $cat >access.c <<'EOCP'
7168 #include <sys/types.h>
7173 #include <sys/file.h>
7182 : check sys/file.h first, no particular reason here
7183 if $test `./findhdr sys/file.h` && \
7184 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7186 echo "<sys/file.h> defines the *_OK access constants." >&4
7187 elif $test `./findhdr fcntl.h` && \
7188 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7190 echo "<fcntl.h> defines the *_OK access constants." >&4
7191 elif $test `./findhdr unistd.h` && \
7192 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7193 echo "<unistd.h> defines the *_OK access constants." >&4
7195 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7201 : see if accessx exists
7202 set accessx d_accessx
7205 : see if alarm exists
7209 : see if atolf exists
7213 : see if atoll exists
7217 : Look for GNU-cc style attribute checking
7219 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7220 $cat >attrib.c <<'EOCP'
7222 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7224 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7225 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7226 echo "Your C compiler doesn't fully support __attribute__."
7229 echo "Your C compiler supports __attribute__."
7233 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7240 : see if bcmp exists
7244 : see if bcopy exists
7248 : see if this is a unistd.h system
7249 set unistd.h i_unistd
7252 : see if getpgrp exists
7253 set getpgrp d_getpgrp
7256 case "$d_getpgrp" in
7259 echo "Checking to see which flavor of getpgrp is in use..."
7262 #include <sys/types.h>
7264 # include <unistd.h>
7268 if (getuid() == 0) {
7269 printf("(I see you are running Configure as super-user...)\n");
7273 if (getpgrp(1) == 0)
7282 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7283 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7285 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7286 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7289 echo "I can't seem to compile and run the test program."
7291 xxx="a USG one, i.e. you use getpgrp()."
7293 # SVR4 systems can appear rather BSD-ish.
7296 xxx="a BSD one, i.e. you use getpgrp(pid)."
7300 xxx="probably a USG one, i.e. you use getpgrp()."
7305 echo "Assuming your getpgrp is $xxx" >&4
7314 : see if setpgrp exists
7315 set setpgrp d_setpgrp
7318 case "$d_setpgrp" in
7321 echo "Checking to see which flavor of setpgrp is in use..."
7324 #include <sys/types.h>
7326 # include <unistd.h>
7330 if (getuid() == 0) {
7331 printf("(I see you are running Configure as super-user...)\n");
7335 if (-1 == setpgrp(1, 1))
7338 if (setpgrp() != -1)
7344 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7345 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7347 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7348 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7351 echo "(I can't seem to compile and run the test program.)"
7353 xxx="a USG one, i.e. you use setpgrp()."
7355 # SVR4 systems can appear rather BSD-ish.
7358 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7362 xxx="probably a USG one, i.e. you use setpgrp()."
7367 echo "Assuming your setpgrp is $xxx" >&4
7375 : see if bzero exists
7379 : see if signal is declared as pointer to function returning int or void
7381 xxx=`./findhdr signal.h`
7382 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7383 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7384 echo "You have int (*signal())() instead of void." >&4
7386 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7387 echo "You have void (*signal())()." >&4
7389 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7390 echo "You have int (*signal())() instead of void." >&4
7392 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7393 echo "You have void (*signal())()." >&4
7396 case "$d_voidsig" in
7398 echo "I can't determine whether signal handler returns void or int..." >&4
7400 rp="What type does your signal handler return?"
7407 echo "As you already told me, signal handler returns void." >&4
7410 *) echo "As you already told me, signal handler returns int." >&4
7417 case "$d_voidsig" in
7418 "$define") signal_t="void";;
7423 : check for ability to cast large floats to 32-bit ints.
7425 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7426 if $test "$intsize" -ge 4; then
7433 #include <sys/types.h>
7435 $signal_t blech(s) int s; { exit(3); }
7442 signal(SIGFPE, blech);
7444 /* Don't let compiler optimize the test away. Store the number
7445 in a writable string for gcc to pass to sscanf under HP/UX.
7447 sprintf(str, "2147483647");
7448 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7452 /* x86 processors will probably give 0x8000 0000, which is a
7453 sign change. We don't want that. We want to mimic SPARC
7454 behavior here, which is to preserve the sign and give
7457 if (i32 != ($xxx) f)
7463 if eval $compile_ok; then
7467 echo "(I can't seem to compile the test program--assuming it can't)"
7475 echo "Nope, it can't."
7482 : check for ability to cast negative floats to unsigned
7484 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7487 #include <sys/types.h>
7489 $signal_t blech(s) int s; { exit(7); }
7490 $signal_t blech_in_list(s) int s; { exit(4); }
7491 unsigned long dummy_long(p) unsigned long p; { return p; }
7492 unsigned int dummy_int(p) unsigned int p; { return p; }
7493 unsigned short dummy_short(p) unsigned short p; { return p; }
7497 unsigned long along;
7499 unsigned short ashort;
7503 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7504 a direct f = -123. assignment. gcc-2.8.0 reportedly
7505 optimized the whole file away
7507 /* Store the number in a writable string for gcc to pass to
7510 sprintf(str, "-123");
7511 sscanf(str, "%lf", &f); /* f = -123.; */
7513 signal(SIGFPE, blech);
7514 along = (unsigned long)f;
7515 aint = (unsigned int)f;
7516 ashort = (unsigned short)f;
7517 if (along != (unsigned long)-123)
7519 if (aint != (unsigned int)-123)
7521 if (ashort != (unsigned short)-123)
7523 sprintf(str, "1073741824.");
7524 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7527 along = (unsigned long)f;
7528 if (along != 0x80000000)
7532 along = (unsigned long)f;
7533 if (along != 0x7fffffff)
7537 along = (unsigned long)f;
7538 if (along != 0x80000001)
7542 signal(SIGFPE, blech_in_list);
7543 sprintf(str, "123.");
7544 sscanf(str, "%lf", &f); /* f = 123.; */
7545 along = dummy_long((unsigned long)f);
7546 aint = dummy_int((unsigned int)f);
7547 ashort = dummy_short((unsigned short)f);
7548 if (along != (unsigned long)123)
7550 if (aint != (unsigned int)123)
7552 if (ashort != (unsigned short)123)
7559 if eval $compile_ok; then
7563 echo "(I can't seem to compile the test program--assuming it can't)"
7566 case "$castflags" in
7571 echo "Nope, it can't."
7578 : see if vprintf exists
7580 if set vprintf val -f d_vprintf; eval $csym; $val; then
7581 echo 'vprintf() found.' >&4
7583 $cat >vprintf.c <<'EOF'
7584 #include <varargs.h>
7586 int main() { xxx("foo"); }
7595 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7599 if eval $compile && ./vprintf; then
7600 echo "Your vsprintf() returns (int)." >&4
7603 echo "Your vsprintf() returns (char*)." >&4
7607 echo 'vprintf() NOT found.' >&4
7617 : see if chown exists
7621 : see if chroot exists
7625 : see if chsize exists
7629 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7630 while $test $# -ge 2; do
7632 $define) echo "#include <$2>";;
7636 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7637 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7646 : see if this is a sys/uio.h system
7647 set sys/uio.h i_sysuio
7650 echo "Checking to see if your system supports struct iovec..." >&4
7651 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7653 case "$d_iovec_s" in
7654 "$define") echo "Yup, it does." >&4
7656 *) echo "Nope, it doesn't." >&4
7662 : see whether socket exists
7664 $echo $n "Hmm... $c" >&4
7665 if set socket val -f d_socket; eval $csym; $val; then
7666 echo "Looks like you have Berkeley networking support." >&4
7668 if set setsockopt val -f; eval $csym; $val; then
7671 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7675 if $contains socklib libc.list >/dev/null 2>&1; then
7676 echo "Looks like you have Berkeley networking support." >&4
7678 : we will have to assume that it supports the 4.2 BSD interface
7681 echo "You don't have Berkeley networking in libc$_a..." >&4
7682 if test "X$d_socket" = "X$define"; then
7683 echo "...but you seem to believe that you have sockets." >&4
7685 for net in net socket
7687 if test -f /usr/lib/lib$net$_a; then
7688 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7689 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7690 if $contains socket libc.list >/dev/null 2>&1; then
7695 echo "...but the Wollongong group seems to have hacked it in." >&4
7696 sockethdr="-I/usr/netinclude"
7699 echo "Found Berkeley sockets interface in lib$net." >& 4
7700 if $contains setsockopt libc.list >/dev/null 2>&1; then
7703 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7710 if test "X$d_socket" != "X$define"; then
7711 echo "or anywhere else I see." >&4
7719 : see if socketpair exists
7720 set socketpair d_sockpair
7725 echo "Checking the availability of certain socket constants..." >& 4
7726 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7727 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7729 #include <sys/types.h>
7730 #include <sys/socket.h>
7736 set try; if eval $compile; then
7739 set d_${enum}; eval $setvar
7743 set sendmsg d_sendmsg
7746 set recvmsg d_recvmsg
7750 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7751 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7753 case "$d_msghdr_s" in
7754 "$define") echo "Yup, it does." >&4
7756 *) echo "Nope, it doesn't." >&4
7760 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7761 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7763 case "$d_cmsghdr_s" in
7764 "$define") echo "Yup, it does." >&4
7766 *) echo "Nope, it doesn't." >&4
7770 : check for const keyword
7772 echo 'Checking to see if your C compiler knows about "const"...' >&4
7773 $cat >const.c <<'EOCP'
7774 typedef struct spug { int drokk; } spug;
7781 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7783 echo "Yup, it does."
7786 echo "Nope, it doesn't."
7791 : see if crypt exists
7793 if set crypt val -f d_crypt; eval $csym; $val; then
7794 echo 'crypt() found.' >&4
7798 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7799 if $test -z "$cryptlib"; then
7800 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7804 if $test -z "$cryptlib"; then
7805 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7809 if $test -z "$cryptlib"; then
7810 cryptlib=`./loc libcrypt$_a "" $libpth`
7814 if $test -z "$cryptlib"; then
7815 echo 'crypt() NOT found.' >&4
7824 : get csh whereabouts
7826 'csh') val="$undef" ;;
7831 : Respect a hint or command line value for full_csh.
7833 '') full_csh=$csh ;;
7836 : see if cuserid exists
7837 set cuserid d_cuserid
7840 : see if this is a limits.h system
7841 set limits.h i_limits
7844 : see if this is a float.h system
7848 : See if number of significant digits in a double precision number is known
7850 $cat >dbl_dig.c <<EOM
7860 printf("Contains DBL_DIG");
7863 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7864 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7865 echo "DBL_DIG found." >&4
7868 echo "DBL_DIG NOT found." >&4
7875 : see if difftime exists
7876 set difftime d_difftime
7879 : see if this is a dirent system
7881 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7883 echo "<dirent.h> found." >&4
7886 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7887 echo "<sys/dir.h> found." >&4
7890 xinc=`./findhdr sys/ndir.h`
7892 echo "<dirent.h> NOT found." >&4
7897 : Look for type of directory structure.
7899 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7901 case "$direntrytype" in
7904 $define) guess1='struct dirent' ;;
7905 *) guess1='struct direct' ;;
7908 *) guess1="$direntrytype"
7913 'struct dirent') guess2='struct direct' ;;
7914 *) guess2='struct dirent' ;;
7917 if $contains "$guess1" try.c >/dev/null 2>&1; then
7918 direntrytype="$guess1"
7919 echo "Your directory entries are $direntrytype." >&4
7920 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7921 direntrytype="$guess2"
7922 echo "Your directory entries seem to be $direntrytype." >&4
7924 echo "I don't recognize your system's directory entries." >&4
7925 rp="What type is used for directory entries on this system?"
7933 : see if the directory entry stores field length
7935 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7936 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7937 echo "Good, your directory entry keeps length information in d_namlen." >&4
7940 echo "Your directory entry does not know about the d_namlen field." >&4
7947 : see if dlerror exists
7950 set dlerror d_dlerror
7954 : see if dlfcn is available
7962 On a few systems, the dynamically loaded modules that perl generates and uses
7963 will need a different extension than shared libs. The default will probably
7971 rp='What is the extension of dynamically loaded modules'
7980 : Check if dlsym need a leading underscore
7986 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7987 $cat >dyna.c <<'EOM'
7996 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7998 #include <sys/types.h>
8012 int mode = RTLD_LAZY ;
8014 handle = dlopen("./dyna.$dlext", mode) ;
8015 if (handle == NULL) {
8020 symbol = dlsym(handle, "fred") ;
8021 if (symbol == NULL) {
8022 /* try putting a leading underscore */
8023 symbol = dlsym(handle, "_fred") ;
8024 if (symbol == NULL) {
8037 : Call the object file tmp-dyna.o in case dlext=o.
8038 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8039 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8040 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8041 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8044 1) echo "Test program failed using dlopen." >&4
8045 echo "Perhaps you should not use dynamic loading." >&4;;
8046 2) echo "Test program failed using dlsym." >&4
8047 echo "Perhaps you should not use dynamic loading." >&4;;
8048 3) echo "dlsym needs a leading underscore" >&4
8050 4) echo "dlsym doesn't need a leading underscore." >&4;;
8053 echo "I can't compile and run the test program." >&4
8054 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8059 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8064 hasproto='varname=$1; func=$2; shift; shift;
8065 while $test $# -ge 2; do
8067 $define) echo "#include <$2>";;
8071 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8072 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8073 echo "$func() prototype found.";
8076 echo "$func() prototype NOT found.";
8081 $rm -f try.c tryout.c'
8083 : see if prototype for drand48 is available
8085 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8088 : see if dup2 exists
8092 : see if eaccess exists
8093 set eaccess d_eaccess
8096 : see if endgrent exists
8097 set endgrent d_endgrent
8100 : see if endhostent exists
8101 set endhostent d_endhent
8104 : see if endnetent exists
8105 set endnetent d_endnent
8108 : see if endprotoent exists
8109 set endprotoent d_endpent
8112 : see if endpwent exists
8113 set endpwent d_endpwent
8116 : see if endservent exists
8117 set endservent d_endsent
8120 : see if endspent exists
8121 set endspent d_endspent
8124 : Locate the flags for 'open()'
8126 $cat >open3.c <<'EOCP'
8127 #include <sys/types.h>
8132 #include <sys/file.h>
8143 : check sys/file.h first to get FREAD on Sun
8144 if $test `./findhdr sys/file.h` && \
8145 set open3 -DI_SYS_FILE && eval $compile; then
8147 echo "<sys/file.h> defines the O_* constants..." >&4
8149 echo "and you have the 3 argument form of open()." >&4
8152 echo "but not the 3 argument form of open(). Oh, well." >&4
8155 elif $test `./findhdr fcntl.h` && \
8156 set open3 -DI_FCNTL && eval $compile; then
8158 echo "<fcntl.h> defines the O_* constants..." >&4
8160 echo "and you have the 3 argument form of open()." >&4
8163 echo "but not the 3 argument form of open(). Oh, well." >&4
8168 echo "I can't find the O_* constant definitions! You got problems." >&4
8174 : check for non-blocking I/O stuff
8175 case "$h_sysfile" in
8176 true) echo "#include <sys/file.h>" > head.c;;
8179 true) echo "#include <fcntl.h>" > head.c;;
8180 *) echo "#include <sys/fcntl.h>" > head.c;;
8185 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8186 case "$o_nonblock" in
8189 $cat >>try.c <<'EOCP'
8192 printf("O_NONBLOCK\n");
8196 printf("O_NDELAY\n");
8200 printf("FNDELAY\n");
8207 if eval $compile_ok; then
8209 case "$o_nonblock" in
8210 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8211 *) echo "Seems like we can use $o_nonblock.";;
8214 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8217 *) echo "Using $hint value $o_nonblock.";;
8219 $rm -f try try.* .out core
8222 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8228 #include <sys/types.h>
8230 #define MY_O_NONBLOCK $o_nonblock
8231 #ifndef errno /* XXX need better Configure test */
8234 $signal_t blech(x) int x; { exit(3); }
8236 $cat >> try.c <<'EOCP'
8244 pipe(pd); /* Down: child -> parent */
8245 pipe(pu); /* Up: parent -> child */
8248 close(pd[1]); /* Parent reads from pd[0] */
8249 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8250 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8252 signal(SIGALRM, blech);
8254 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8256 sprintf(string, "%d\n", ret);
8257 write(2, string, strlen(string));
8260 if (errno == EAGAIN) {
8266 if (errno == EWOULDBLOCK)
8267 printf("EWOULDBLOCK\n");
8270 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8271 sleep(2); /* Give it time to close our pipe */
8273 ret = read(pd[0], buf, 1); /* Should read EOF */
8275 sprintf(string, "%d\n", ret);
8276 write(3, string, strlen(string));
8280 close(pd[0]); /* We write to pd[1] */
8281 close(pu[1]); /* We read from pu[0] */
8282 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8283 close(pd[1]); /* Pipe pd is now fully closed! */
8284 exit(0); /* Bye bye, thank you for playing! */
8288 if eval $compile_ok; then
8289 echo "$startsh" >mtry
8290 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8292 ./mtry >/dev/null 2>&1
8294 0) eagain=`$cat try.out`;;
8295 1) echo "Could not perform non-blocking setting!";;
8296 2) echo "I did a successful read() for something that was not there!";;
8297 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8298 *) echo "Something terribly wrong happened during testing.";;
8300 rd_nodata=`$cat try.ret`
8301 echo "A read() system call with no data present returns $rd_nodata."
8302 case "$rd_nodata" in
8305 echo "(That's peculiar, fixing that to be -1.)"
8311 echo "Forcing errno EAGAIN on read() with no data available."
8315 echo "Your read() sets errno to $eagain when no data is available."
8318 status=`$cat try.err`
8320 0) echo "And it correctly returns 0 to signal EOF.";;
8321 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8322 *) echo "However, your read() returns '$status' on EOF??";;
8325 if test "$status" = "$rd_nodata"; then
8326 echo "WARNING: you can't distinguish between EOF and no data!"
8330 echo "I can't compile the test program--assuming errno EAGAIN will do."
8337 echo "Using $hint value $eagain."
8338 echo "Your read() returns $rd_nodata when no data is present."
8339 case "$d_eofnblk" in
8340 "$define") echo "And you can see EOF because read() returns 0.";;
8341 "$undef") echo "But you can't see EOF status from read() returned value.";;
8343 echo "(Assuming you can't see EOF status from read anyway.)"
8349 $rm -f try try.* .out core head.c mtry
8351 : see if fchmod exists
8355 : see if fchown exists
8359 : see if this is an fcntl system
8363 : see if sys/select.h has to be included
8364 set sys/select.h i_sysselct
8367 : see if we should include time.h, sys/time.h, or both
8369 if test "X$timeincl" = X; then
8370 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8371 $echo $n "I'm now running the test program...$c"
8372 $cat >try.c <<'EOCP'
8373 #include <sys/types.h>
8378 #ifdef SYSTIMEKERNEL
8381 #include <sys/time.h>
8384 #include <sys/select.h>
8393 struct timezone tzp;
8395 if (foo.tm_sec == foo.tm_sec)
8398 if (bar.tv_sec == bar.tv_sec)
8405 for s_timezone in '-DS_TIMEZONE' ''; do
8407 for s_timeval in '-DS_TIMEVAL' ''; do
8408 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8409 for i_time in '' '-DI_TIME'; do
8410 for i_systime in '-DI_SYSTIME' ''; do
8413 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8414 if eval $compile; then
8415 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8419 $echo $n "Succeeded with $flags$c"
8431 *SYSTIMEKERNEL*) i_systimek="$define"
8432 timeincl=`./findhdr sys/time.h`
8433 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8434 *) i_systimek="$undef";;
8437 *I_TIME*) i_time="$define"
8438 timeincl=`./findhdr time.h`" $timeincl"
8439 echo "We'll include <time.h>." >&4;;
8440 *) i_time="$undef";;
8443 *I_SYSTIME*) i_systime="$define"
8444 timeincl=`./findhdr sys/time.h`" $timeincl"
8445 echo "We'll include <sys/time.h>." >&4;;
8446 *) i_systime="$undef";;
8451 : check for fd_set items
8454 Checking to see how well your C compiler handles fd_set and friends ...
8456 $cat >fd_set.c <<EOCP
8457 #$i_systime I_SYS_TIME
8458 #$i_sysselct I_SYS_SELECT
8459 #$d_socket HAS_SOCKET
8460 #include <sys/types.h>
8462 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8465 #include <sys/time.h>
8468 #include <sys/select.h>
8477 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8484 set fd_set -DTRYBITS
8485 if eval $compile; then
8486 d_fds_bits="$define"
8488 echo "Well, your system knows about the normal fd_set typedef..." >&4
8490 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8491 d_fd_macros="$define"
8494 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8496 d_fd_macros="$undef"
8500 Hmm, your compiler has some difficulty with fd_set. Checking further...
8503 if eval $compile; then
8506 echo "Well, your system has some sort of fd_set available..." >&4
8508 echo "and you have the normal fd_set macros." >&4
8509 d_fd_macros="$define"
8512 but not the normal fd_set macros! Gross! More work for me...
8514 d_fd_macros="$undef"
8517 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8520 d_fd_macros="$undef"
8525 : see if fgetpos exists
8526 set fgetpos d_fgetpos
8529 : see if flock exists
8533 : see if fork exists
8537 : see if pathconf exists
8538 set pathconf d_pathconf
8541 : see if fpathconf exists
8542 set fpathconf d_fpathconf
8546 : see if llseek exists
8552 echo $n "Checking to see if your system supports off64_t...$c" >&4
8554 #include <sys/types.h>
8556 off64_t foo() { off64_t x; x = 7; return x; }'
8558 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8560 echo " Yup, it does." >&4
8563 echo " Nope, it doesn't." >&4
8569 : check for fpos64_t
8571 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8573 #include <sys/stdio.h>
8574 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8576 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8578 echo " Yup, it does." >&4
8581 echo " Nope, it doesn't." >&4
8587 : see if fseeko exists
8591 : see if fsetpos exists
8592 set fsetpos d_fsetpos
8595 : see if this is a sys/param system
8596 set sys/param.h i_sysparam
8599 : see if this is a sys/mount.h system
8600 set sys/mount.h i_sysmount
8604 : see if statfs exists
8608 : see if fstatfs exists
8609 set fstatfs d_fstatfs
8612 : see if statfs knows about mount flags
8613 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8617 : see if statvfs exists
8618 set statvfs d_statvfs
8621 : see if fstatvfs exists
8622 set fstatvfs d_fstatvfs
8626 : see if ftello exists
8630 : see if getgrent exists
8631 set getgrent d_getgrent
8634 : see if gethostbyaddr exists
8635 set gethostbyaddr d_gethbyaddr
8638 : see if gethostbyname exists
8639 set gethostbyname d_gethbyname
8642 : see if gethostent exists
8643 set gethostent d_gethent
8646 : see how we will look up host name
8649 if set gethostname val -f d_gethname; eval $csym; $val; then
8650 echo 'gethostname() found.' >&4
8651 d_gethname="$define"
8654 if set uname val -f d_uname; eval $csym; $val; then
8657 uname() was found, but you're running xenix, and older versions of xenix
8658 have a broken uname(). If you don't really know whether your xenix is old
8659 enough to have a broken system call, use the default answer.
8666 rp='Is your uname() broken?'
8669 n*) d_uname="$define"; call=uname;;
8672 echo 'uname() found.' >&4
8679 case "$d_gethname" in
8680 '') d_gethname="$undef";;
8683 '') d_uname="$undef";;
8685 case "$d_uname$d_gethname" in
8690 Every now and then someone has a $call() that lies about the hostname
8691 but can't be fixed for political or economic reasons. If you wish, I can
8692 pretend $call() isn't there and maybe compute hostname at run-time
8693 thanks to the '$phostname' command.
8696 rp="Shall I ignore $call() from now on?"
8699 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8702 case "$phostname" in
8704 *) case "$aphostname" in
8710 file=`./loc $file $file $pth`
8711 aphostname=`echo $file $*`
8716 case "$d_uname$d_gethname" in
8719 case "$phostname" in
8721 echo "There will be no way for $package to get your hostname." >&4;;
8723 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8727 case "$d_phostname" in
8728 '') d_phostname="$undef";;
8731 : see if this is a netdb.h system
8735 : see if prototypes for various gethostxxx netdb.h functions are available
8737 set d_gethostprotos gethostent $i_netdb netdb.h
8740 : see if getlogin exists
8741 set getlogin d_getlogin
8744 : see if getmntent exists
8745 set getmntent d_getmntent
8748 : see if getnetbyaddr exists
8749 set getnetbyaddr d_getnbyaddr
8752 : see if getnetbyname exists
8753 set getnetbyname d_getnbyname
8756 : see if getnetent exists
8757 set getnetent d_getnent
8760 : see if prototypes for various getnetxxx netdb.h functions are available
8762 set d_getnetprotos getnetent $i_netdb netdb.h
8766 : see if getprotobyname exists
8767 set getprotobyname d_getpbyname
8770 : see if getprotobynumber exists
8771 set getprotobynumber d_getpbynumber
8774 : see if getprotoent exists
8775 set getprotoent d_getpent
8778 : see if getpgid exists
8779 set getpgid d_getpgid
8782 : see if getpgrp2 exists
8783 set getpgrp2 d_getpgrp2
8786 : see if getppid exists
8787 set getppid d_getppid
8790 : see if getpriority exists
8791 set getpriority d_getprior
8794 : see if prototypes for various getprotoxxx netdb.h functions are available
8796 set d_getprotoprotos getprotoent $i_netdb netdb.h
8799 : see if getpwent exists
8800 set getpwent d_getpwent
8804 : see if getservbyname exists
8805 set getservbyname d_getsbyname
8808 : see if getservbyport exists
8809 set getservbyport d_getsbyport
8812 : see if getservent exists
8813 set getservent d_getsent
8816 : see if prototypes for various getservxxx netdb.h functions are available
8818 set d_getservprotos getservent $i_netdb netdb.h
8821 : see if getspent exists
8822 set getspent d_getspent
8825 : see if getspnam exists
8826 set getspnam d_getspnam
8829 : see if gettimeofday or ftime exists
8830 set gettimeofday d_gettimeod
8832 case "$d_gettimeod" in
8838 val="$undef"; set d_ftime; eval $setvar
8841 case "$d_gettimeod$d_ftime" in
8844 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8848 : see if this is an grp system
8854 xxx=`./findhdr grp.h`
8855 $cppstdin $cppflags $cppminus < $xxx >$$.h
8857 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8869 set d_grpasswd; eval $setvar
8873 : see if hasmntopt exists
8874 set hasmntopt d_hasmntopt
8877 : see if this is a netinet/in.h or sys/in.h system
8878 set netinet/in.h i_niin sys/in.h i_sysin
8881 : see if arpa/inet.h has to be included
8882 set arpa/inet.h i_arpainet
8885 : see if htonl --and friends-- exists
8890 : Maybe they are macros.
8895 #include <sys/types.h>
8896 #$i_niin I_NETINET_IN
8898 #$i_arpainet I_ARPA_INET
8900 #include <netinet/in.h>
8906 #include <arpa/inet.h>
8909 printf("Defined as a macro.");
8912 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8913 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8915 echo "But it seems to be defined as a macro." >&4
8923 : see which of string.h or strings.h is needed
8925 strings=`./findhdr string.h`
8926 if $test "$strings" && $test -r "$strings"; then
8927 echo "Using <string.h> instead of <strings.h>." >&4
8931 strings=`./findhdr strings.h`
8932 if $test "$strings" && $test -r "$strings"; then
8933 echo "Using <strings.h> instead of <string.h>." >&4
8935 echo "No string header found -- You'll surely have problems." >&4
8941 "$undef") strings=`./findhdr strings.h`;;
8942 *) strings=`./findhdr string.h`;;
8947 if set index val -f; eval $csym; $val; then
8948 if set strchr val -f d_strchr; eval $csym; $val; then
8949 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8952 echo "strchr() found." >&4
8956 echo "index() found." >&4
8961 echo "index() found." >&4
8964 if set strchr val -f d_strchr; eval $csym; $val; then
8967 echo "strchr() found." >&4
8969 echo "No index() or strchr() found!" >&4
8974 set d_strchr; eval $setvar
8976 set d_index; eval $setvar
8978 : check whether inet_aton exists
8979 set inet_aton d_inetaton
8984 $cat >isascii.c <<'EOCP'
8996 if eval $compile; then
8997 echo "isascii() found." >&4
9000 echo "isascii() NOT found." >&4
9007 : see if killpg exists
9011 : see if lchown exists
9013 $cat > try.c <<'EOCP'
9014 /* System header to define __stub macros and hopefully few prototypes,
9015 which can conflict with char lchown(); below. */
9017 /* Override any gcc2 internal prototype to avoid an error. */
9018 /* We use char because int might match the return type of a gcc2
9019 builtin and then its argument prototype would still apply. */
9022 /* The GNU C library defines this for functions which it implements
9023 to always fail with ENOSYS. Some functions are actually named
9024 something starting with __ and the normal name is an alias. */
9025 #if defined (__stub_lchown) || defined (__stub___lchown)
9033 if eval $compile; then
9034 $echo "lchown() found." >&4
9037 $echo "lchown() NOT found." >&4
9043 : See if number of significant digits in a double precision number is known
9045 $cat >ldbl_dig.c <<EOM
9055 printf("Contains LDBL_DIG");
9058 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9059 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9060 echo "LDBL_DIG found." >&4
9063 echo "LDBL_DIG NOT found." >&4
9070 : see if link exists
9074 : see if localeconv exists
9075 set localeconv d_locconv
9078 : see if lockf exists
9082 : see if lstat exists
9086 : see if madvise exists
9087 set madvise d_madvise
9090 : see if mblen exists
9094 : see if mbstowcs exists
9095 set mbstowcs d_mbstowcs
9098 : see if mbtowc exists
9102 : see if memchr exists
9106 : see if memcmp exists
9110 : see if memcpy exists
9114 : see if memmove exists
9115 set memmove d_memmove
9118 : see if memset exists
9122 : see if mkdir exists
9126 : see if mkfifo exists
9130 : see if mktime exists
9134 : see if this is a sys/mman.h system
9135 set sys/mman.h i_sysmman
9138 : see if mmap exists
9141 : see what shmat returns
9142 : default to something harmless
9144 case "$i_sysmman$d_mmap" in
9146 $cat >mmap.c <<'END'
9147 #include <sys/mman.h>
9150 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9155 echo "and it returns ($mmaptype)." >&4
9161 : see if mprotect exists
9162 set mprotect d_mprotect
9165 : see if msgctl exists
9169 : see if msgget exists
9173 : see if msgsnd exists
9177 : see if msgrcv exists
9181 : see how much of the 'msg*(2)' library is present.
9184 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9185 *"$undef"*) h_msg=false;;
9189 case "`ipcs 2>&1`" in
9190 "SVID messages"*"not configured"*)
9191 echo "Your $osname does not have the msg*(2) configured." >&4
9206 : we could also check for sys/ipc.h ...
9207 if $h_msg && $test `./findhdr sys/msg.h`; then
9208 echo "You have the full msg*(2) library." >&4
9211 echo "You don't have the full msg*(2) library." >&4
9217 : see if msync exists
9221 : see if munmap exists
9225 : see if nice exists
9229 : see if POSIX threads are available
9230 set pthread.h i_pthread
9236 : how to create joinable pthreads
9237 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9239 echo "Checking what constant to use for creating joinable pthreads..." >&4
9240 $cat >try.c <<'EOCP'
9241 #include <pthread.h>
9243 int detachstate = JOINABLE;
9246 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9247 if eval $compile; then
9248 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9249 val="$undef" # Yes, undef.
9250 set d_old_pthread_create_joinable
9253 set old_pthread_create_joinable
9256 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9257 if eval $compile; then
9258 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9260 set d_old_pthread_create_joinable
9262 val=PTHREAD_CREATE_UNDETACHED
9263 set old_pthread_create_joinable
9266 set try -DJOINABLE=__UNDETACHED
9267 if eval $compile; then
9268 echo "You seem to use __UNDETACHED." >&4
9270 set d_old_pthread_create_joinable
9273 set old_pthread_create_joinable
9276 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9278 set d_old_pthread_create_joinable
9281 set old_pthread_create_joinable
9288 d_old_pthread_create_joinable="$undef"
9289 old_pthread_create_joinable=""
9292 : see if pause exists
9296 : see if pipe exists
9300 : see if poll exists
9305 : see whether the various POSIXish _yields exist
9307 #include <pthread.h>
9313 #ifdef PTHREAD_YIELD
9316 #ifdef PTHREAD_YIELD_NULL
9317 pthread_yield(NULL);
9323 : see if sched_yield exists
9324 set try -DSCHED_YIELD
9325 if eval $compile; then
9327 sched_yield='sched_yield()'
9331 case "$usethreads" in
9334 $define) echo 'sched_yield() found.' >&4 ;;
9335 *) echo 'sched_yield() NOT found.' >&4 ;;
9341 : see if pthread_yield exists
9342 set try -DPTHREAD_YIELD
9343 if eval $compile; then
9345 case "$sched_yield" in
9346 '') sched_yield='pthread_yield()' ;;
9349 set try -DPTHREAD_YIELD_NULL
9350 if eval $compile; then
9352 case "$sched_yield" in
9353 '') sched_yield='pthread_yield(NULL)' ;;
9359 case "$usethreads" in
9362 $define) echo 'pthread_yield() found.' >&4 ;;
9363 *) echo 'pthread_yield() NOT found.' >&4 ;;
9370 case "$sched_yield" in
9371 '') sched_yield=undef ;;
9376 : see if this is a pwd.h system
9382 xxx=`./findhdr pwd.h`
9383 $cppstdin $cppflags $cppminus < $xxx >$$.h
9385 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9393 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9401 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9409 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9417 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9425 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9433 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9441 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9453 set d_pwquota; eval $setvar
9454 set d_pwage; eval $setvar
9455 set d_pwchange; eval $setvar
9456 set d_pwclass; eval $setvar
9457 set d_pwexpire; eval $setvar
9458 set d_pwcomment; eval $setvar
9459 set d_pwgecos; eval $setvar
9460 set d_pwpasswd; eval $setvar
9464 : see if readdir and friends exist
9465 set readdir d_readdir
9467 set seekdir d_seekdir
9469 set telldir d_telldir
9471 set rewinddir d_rewinddir
9474 : see if readlink exists
9475 set readlink d_readlink
9478 : see if readv exists
9482 : see if rename exists
9486 : see if rmdir exists
9490 : see if memory.h is available.
9495 : See if it conflicts with string.h
9501 $cppstdin $cppflags $cppminus < $strings > mem.h
9502 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9504 echo "We won't be including <memory.h>."
9514 : can bcopy handle overlapping blocks?
9519 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9526 $cat >>try.c <<'EOCP'
9529 # include <memory.h>
9532 # include <stdlib.h>
9535 # include <string.h>
9537 # include <strings.h>
9540 # include <unistd.h> /* Needed for NetBSD */
9544 char buf[128], abc[128];
9550 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9552 for (align = 7; align >= 0; align--) {
9553 for (len = 36; len; len--) {
9556 for (off = 1; off <= len; off++) {
9557 bcopy(b, b+off, len);
9558 bcopy(b+off, b, len);
9559 if (bcmp(b, abc, len))
9568 if eval $compile_ok; then
9569 if ./try 2>/dev/null; then
9573 echo "It can't, sorry."
9574 case "$d_memmove" in
9575 "$define") echo "But that's Ok since you have memmove()." ;;
9579 echo "(I can't compile the test program, so we'll assume not...)"
9580 case "$d_memmove" in
9581 "$define") echo "But that's Ok since you have memmove()." ;;
9586 $rm -f try.* try core
9590 : can memcpy handle overlapping blocks?
9595 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9602 $cat >>try.c <<'EOCP'
9605 # include <memory.h>
9608 # include <stdlib.h>
9611 # include <string.h>
9613 # include <strings.h>
9616 # include <unistd.h> /* Needed for NetBSD */
9620 char buf[128], abc[128];
9626 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9627 try to store the string in read-only memory. */
9628 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9630 for (align = 7; align >= 0; align--) {
9631 for (len = 36; len; len--) {
9633 memcpy(b, abc, len);
9634 for (off = 1; off <= len; off++) {
9635 memcpy(b+off, b, len);
9636 memcpy(b, b+off, len);
9637 if (memcmp(b, abc, len))
9646 if eval $compile_ok; then
9647 if ./try 2>/dev/null; then
9651 echo "It can't, sorry."
9652 case "$d_memmove" in
9653 "$define") echo "But that's Ok since you have memmove()." ;;
9657 echo "(I can't compile the test program, so we'll assume not...)"
9658 case "$d_memmove" in
9659 "$define") echo "But that's Ok since you have memmove()." ;;
9664 $rm -f try.* try core
9668 : can memcmp be trusted to compare relative magnitude?
9673 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9680 $cat >>try.c <<'EOCP'
9683 # include <memory.h>
9686 # include <stdlib.h>
9689 # include <string.h>
9691 # include <strings.h>
9694 # include <unistd.h> /* Needed for NetBSD */
9700 if ((a < b) && memcmp(&a, &b, 1) < 0)
9706 if eval $compile_ok; then
9707 if ./try 2>/dev/null; then
9711 echo "No, it can't (it uses signed chars)."
9714 echo "(I can't compile the test program, so we'll assume not...)"
9718 $rm -f try.* try core
9722 : see if select exists
9726 : see if semctl exists
9730 : see if semget exists
9734 : see if semop exists
9738 : see how much of the 'sem*(2)' library is present.
9741 case "$d_semctl$d_semget$d_semop" in
9742 *"$undef"*) h_sem=false;;
9746 case "`ipcs 2>&1`" in
9747 "SVID messages"*"not configured"*)
9748 echo "Your $osname does not have the sem*(2) configured." >&4
9761 : we could also check for sys/ipc.h ...
9762 if $h_sem && $test `./findhdr sys/sem.h`; then
9763 echo "You have the full sem*(2) library." >&4
9766 echo "You don't have the full sem*(2) library." >&4
9772 : see whether sys/sem.h defines union semun
9774 $cat > try.c <<'END'
9775 #include <sys/types.h>
9776 #include <sys/ipc.h>
9777 #include <sys/sem.h>
9778 int main () { union semun semun; semun.buf = 0; }
9781 if eval $compile; then
9782 echo "You have union semun in <sys/sem.h>." >&4
9785 echo "You do not have union semun in <sys/sem.h>." >&4
9788 $rm -f try try.c try.h
9792 : see how to do semctl IPC_STAT
9795 : see whether semctl IPC_STAT can use union semun
9800 # define S_IRUSR S_IREAD
9801 # define S_IWUSR S_IWRITE
9802 # define S_IXUSR S_IEXEC
9804 # define S_IRUSR 0400
9805 # define S_IWUSR 0200
9806 # define S_IXUSR 0100
9808 # define S_IRGRP (S_IRUSR>>3)
9809 # define S_IWGRP (S_IWUSR>>3)
9810 # define S_IXGRP (S_IXUSR>>3)
9811 # define S_IROTH (S_IRUSR>>6)
9812 # define S_IWOTH (S_IWUSR>>6)
9813 # define S_IXOTH (S_IXUSR>>6)
9816 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9817 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9818 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9823 #include <sys/types.h>
9824 #include <sys/ipc.h>
9825 #include <sys/sem.h>
9826 #include <sys/stat.h>
9833 #$d_union_semun HAS_UNION_SEMUN
9836 #ifndef HAS_UNION_SEMUN
9839 struct semid_ds *buf;
9840 unsigned short *array;
9846 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9847 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9849 struct semid_ds argbuf;
9852 st = semctl(sem, 0, IPC_STAT, arg);
9856 # endif /* IPC_STAT */
9857 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9859 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9860 # endif /* IPC_RMID */
9861 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9863 #endif /* IPC_PRIVATE && ... */
9864 printf("semget failed: errno = %d\n", errno);
9870 if eval $compile; then
9873 semun) val="$define" ;;
9879 case "$d_semctl_semun" in
9881 echo "You can use union semun for semctl IPC_STAT." >&4
9884 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9889 : see whether semctl IPC_STAT can use struct semid_ds pointer
9890 $cat > try.c <<'END'
9891 #include <sys/types.h>
9892 #include <sys/ipc.h>
9893 #include <sys/sem.h>
9894 #include <sys/stat.h>
9902 struct semid_ds arg;
9905 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9906 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9909 st = semctl(sem, 0, IPC_STAT, &arg);
9911 printf("semid_ds\n");
9913 # endif /* IPC_STAT */
9914 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9916 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9917 # endif /* IPC_RMID */
9918 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9920 #endif /* IPC_PRIVATE && ... */
9921 printf("semget failed: errno = %d\n", errno);
9928 if eval $compile; then
9931 semid_ds) val="$define" ;;
9935 set d_semctl_semid_ds
9937 case "$d_semctl_semid_ds" in
9939 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9941 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9948 # We do not have the full sem*(2) library, so assume we can not
9954 set d_semctl_semid_ds
9959 : see if setegid exists
9960 set setegid d_setegid
9963 : see if seteuid exists
9964 set seteuid d_seteuid
9967 : see if setgrent exists
9968 set setgrent d_setgrent
9971 : see if sethostent exists
9972 set sethostent d_sethent
9975 : see if setlinebuf exists
9976 set setlinebuf d_setlinebuf
9979 : see if setlocale exists
9980 set setlocale d_setlocale
9983 : see if setnetent exists
9984 set setnetent d_setnent
9987 : see if setprotoent exists
9988 set setprotoent d_setpent
9991 : see if setpgid exists
9992 set setpgid d_setpgid
9995 : see if setpgrp2 exists
9996 set setpgrp2 d_setpgrp2
9999 : see if setpriority exists
10000 set setpriority d_setprior
10003 : see if setpwent exists
10004 set setpwent d_setpwent
10007 : see if setregid exists
10008 set setregid d_setregid
10010 set setresgid d_setresgid
10013 : see if setreuid exists
10014 set setreuid d_setreuid
10016 set setresuid d_setresuid
10019 : see if setrgid exists
10020 set setrgid d_setrgid
10023 : see if setruid exists
10024 set setruid d_setruid
10027 : see if setservent exists
10028 set setservent d_setsent
10031 : see if setsid exists
10032 set setsid d_setsid
10035 : see if setspent exists
10036 set setspent d_setspent
10039 : see if setvbuf exists
10040 set setvbuf d_setvbuf
10043 : see if sfio.h is available
10048 : see if sfio library is available
10059 : Ok, but do we want to use it.
10063 true|$define|[yY]*) dflt='y';;
10066 echo "$package can use the sfio library, but it is experimental."
10067 rp="You seem to have sfio available, do you want to try using it?"
10071 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10073 : Remove sfio from list of libraries to use
10074 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10077 echo "libs = $libs" >&4
10081 *) case "$usesfio" in
10082 true|$define|[yY]*)
10083 echo "Sorry, cannot find sfio on this machine" >&4
10084 echo "Ignoring your setting of usesfio=$usesfio" >&4
10092 $define) usesfio='true';;
10093 *) usesfio='false';;
10096 : see if shmctl exists
10097 set shmctl d_shmctl
10100 : see if shmget exists
10101 set shmget d_shmget
10104 : see if shmat exists
10107 : see what shmat returns
10110 $cat >shmat.c <<'END'
10111 #include <sys/shm.h>
10114 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10119 echo "and it returns ($shmattype)." >&4
10120 : see if a prototype for shmat is available
10121 xxx=`./findhdr sys/shm.h`
10122 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10123 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10134 set d_shmatprototype
10137 : see if shmdt exists
10141 : see how much of the 'shm*(2)' library is present.
10144 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10145 *"$undef"*) h_shm=false;;
10149 case "`ipcs 2>&1`" in
10150 "SVID shared memory"*"not configured"*)
10151 echo "Your $osname does not have the shm*(2) configured." >&4
10154 set shmctl d_shmctl
10156 set shmget d_shmget
10166 : we could also check for sys/ipc.h ...
10167 if $h_shm && $test `./findhdr sys/shm.h`; then
10168 echo "You have the full shm*(2) library." >&4
10171 echo "You don't have the full shm*(2) library." >&4
10178 : see if we have sigaction
10179 if set sigaction val -f d_sigaction; eval $csym; $val; then
10180 echo 'sigaction() found.' >&4
10181 $cat > try.c <<'EOP'
10183 #include <sys/types.h>
10184 #include <signal.h>
10187 struct sigaction act, oact;
10189 oact.sa_handler = 0;
10193 if eval $compile_ok; then
10196 echo "But you don't seem to have a useable struct sigaction." >&4
10200 echo 'sigaction NOT found.' >&4
10203 set d_sigaction; eval $setvar
10204 $rm -f try try$_o try.c
10206 : see if sigsetjmp exists
10208 case "$d_sigsetjmp" in
10210 $cat >try.c <<'EOP'
10211 #include <setjmp.h>
10216 if (sigsetjmp(env,1))
10219 siglongjmp(env, 1);
10224 if eval $compile; then
10225 if ./try >/dev/null 2>&1; then
10226 echo "POSIX sigsetjmp found." >&4
10230 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10236 echo "sigsetjmp not found." >&4
10240 *) val="$d_sigsetjmp"
10241 case "$d_sigsetjmp" in
10242 $define) echo "POSIX sigsetjmp found." >&4;;
10243 $undef) echo "sigsetjmp not found." >&4;;
10251 : see if sys/stat.h is available
10252 set sys/stat.h i_sysstat
10255 : see if stat knows about block sizes
10257 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10260 : see if _ptr and _cnt from stdio act std
10262 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10263 echo "(Looks like you have stdio.h from Linux.)"
10264 case "$stdio_ptr" in
10265 '') stdio_ptr='((fp)->_IO_read_ptr)'
10268 *) ptr_lval=$d_stdio_ptr_lval;;
10270 case "$stdio_cnt" in
10271 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10274 *) cnt_lval=$d_stdio_cnt_lval;;
10276 case "$stdio_base" in
10277 '') stdio_base='((fp)->_IO_read_base)';;
10279 case "$stdio_bufsiz" in
10280 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10283 case "$stdio_ptr" in
10284 '') stdio_ptr='((fp)->_ptr)'
10287 *) ptr_lval=$d_stdio_ptr_lval;;
10289 case "$stdio_cnt" in
10290 '') stdio_cnt='((fp)->_cnt)'
10293 *) cnt_lval=$d_stdio_cnt_lval;;
10295 case "$stdio_base" in
10296 '') stdio_base='((fp)->_base)';;
10298 case "$stdio_bufsiz" in
10299 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10302 : test whether _ptr and _cnt really work
10303 echo "Checking how std your stdio is..." >&4
10306 #define FILE_ptr(fp) $stdio_ptr
10307 #define FILE_cnt(fp) $stdio_cnt
10309 FILE *fp = fopen("try.c", "r");
10312 18 <= FILE_cnt(fp) &&
10313 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10321 if eval $compile; then
10323 echo "Your stdio acts pretty std."
10326 echo "Your stdio isn't very std."
10329 echo "Your stdio doesn't appear very std."
10335 : Can _ptr be used as an lvalue?
10336 case "$d_stdstdio$ptr_lval" in
10337 $define$define) val=$define ;;
10340 set d_stdio_ptr_lval
10343 : Can _cnt be used as an lvalue?
10344 case "$d_stdstdio$cnt_lval" in
10345 $define$define) val=$define ;;
10348 set d_stdio_cnt_lval
10351 : see if _base is also standard
10353 case "$d_stdstdio" in
10357 #define FILE_base(fp) $stdio_base
10358 #define FILE_bufsiz(fp) $stdio_bufsiz
10360 FILE *fp = fopen("try.c", "r");
10363 19 <= FILE_bufsiz(fp) &&
10364 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10371 if eval $compile; then
10373 echo "And its _base field acts std."
10376 echo "But its _base field isn't std."
10379 echo "However, it seems to be lacking the _base field."
10388 Checking how to access stdio streams by file descriptor number...
10390 case "$stdio_stream_array" in
10391 '') $cat >try.c <<EOCP
10394 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10398 for s in _iob __iob __sF
10400 set try -DSTDIO_STREAM_ARRAY=$s
10401 if eval $compile; then
10402 case "`./try$exe_ext`" in
10403 yes) stdio_stream_array=$s; break ;;
10407 $rm -f try.* try$exe_ext
10409 case "$stdio_stream_array" in
10411 I can't figure out how to access stdio streams by file descriptor number.
10413 d_stdio_stream_array="$undef"
10416 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10418 d_stdio_stream_array="$define"
10422 : see if strcoll exists
10423 set strcoll d_strcoll
10426 : check for structure copying
10428 echo "Checking to see if your C compiler can copy structs..." >&4
10429 $cat >try.c <<'EOCP'
10439 if $cc -c try.c >/dev/null 2>&1 ; then
10441 echo "Yup, it can."
10444 echo "Nope, it can't."
10450 : see if strerror and/or sys_errlist[] exist
10452 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10453 if set strerror val -f d_strerror; eval $csym; $val; then
10454 echo 'strerror() found.' >&4
10455 d_strerror="$define"
10456 d_strerrm='strerror(e)'
10457 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10458 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10459 d_syserrlst="$define"
10461 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10462 d_syserrlst="$undef"
10464 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10465 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10466 echo 'strerror() found in string header.' >&4
10467 d_strerror="$define"
10468 d_strerrm='strerror(e)'
10469 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10470 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10471 d_syserrlst="$define"
10473 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10474 d_syserrlst="$undef"
10476 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10477 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10478 d_strerror="$undef"
10479 d_syserrlst="$define"
10480 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10482 echo 'strerror() and sys_errlist[] NOT found.' >&4
10483 d_strerror="$undef"
10484 d_syserrlst="$undef"
10485 d_strerrm='"unknown"'
10489 : see if strtod exists
10490 set strtod d_strtod
10493 : see if strtol exists
10494 set strtol d_strtol
10497 : see if strtoul exists
10498 set strtoul d_strtoul
10501 : see if strtoull exists
10502 set strtoull d_strtoull
10505 : see if strxfrm exists
10506 set strxfrm d_strxfrm
10509 : see if symlink exists
10510 set symlink d_symlink
10513 : see if syscall exists
10514 set syscall d_syscall
10517 : see if sysconf exists
10518 set sysconf d_sysconf
10521 : see if system exists
10522 set system d_system
10525 : see if tcgetpgrp exists
10526 set tcgetpgrp d_tcgetpgrp
10529 : see if tcsetpgrp exists
10530 set tcsetpgrp d_tcsetpgrp
10533 : see if sys/types.h has to be included
10534 set sys/types.h i_systypes
10537 : see if prototype for telldir is available
10539 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10542 : define an is-a-typedef? function
10543 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10545 "") inclist="sys/types.h";;
10547 eval "varval=\$$var";
10551 for inc in $inclist; do
10552 echo "#include <$inc>" >>temp.c;
10554 echo "#ifdef $type" >> temp.c;
10555 echo "printf(\"We have $type\");" >> temp.c;
10556 echo "#endif" >> temp.c;
10557 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10558 if $contains $type temp.E >/dev/null 2>&1; then
10559 eval "$var=\$type";
10564 *) eval "$var=\$varval";;
10567 : define an is-a-typedef? function that prompts if the type is not available.
10568 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10570 "") inclist="sys/types.h";;
10572 eval "varval=\$$var";
10576 for inc in $inclist; do
10577 echo "#include <$inc>" >>temp.c;
10579 echo "#ifdef $type" >> temp.c;
10580 echo "printf(\"We have $type\");" >> temp.c;
10581 echo "#endif" >> temp.c;
10582 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10584 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10585 if $contains $type temp.E >/dev/null 2>&1; then
10586 echo "$type found." >&4;
10587 eval "$var=\$type";
10589 echo "$type NOT found." >&4;
10595 *) eval "$var=\$varval";;
10598 : see if this is a sys/times.h system
10599 set sys/times.h i_systimes
10602 : see if times exists
10604 if set times val -f d_times; eval $csym; $val; then
10605 echo 'times() found.' >&4
10608 case "$i_systimes" in
10609 "$define") inc='sys/times.h';;
10611 rp="What is the type returned by times() on this system?"
10612 set clock_t clocktype long stdio.h sys/types.h $inc
10615 echo 'times() NOT found, hope that will do.' >&4
10620 : see if truncate exists
10621 set truncate d_truncate
10624 : see if tzname[] exists
10626 if set tzname val -a d_tzname; eval $csym; $val; then
10628 echo 'tzname[] found.' >&4
10631 echo 'tzname[] NOT found.' >&4
10636 : see if umask exists
10640 : backward compatibility for d_hvfork
10641 if test X$d_hvfork != X; then
10642 d_vfork="$d_hvfork"
10645 : see if there is a vfork
10650 : Ok, but do we want to use it. vfork is reportedly unreliable in
10651 : perl on Solaris 2.x, and probably elsewhere.
10655 case "$usevfork" in
10661 Perl can only use a vfork() that doesn't suffer from strict
10662 restrictions on calling functions or modifying global data in
10663 the child. For example, glibc-2.1 contains such a vfork()
10664 that is unsuitable. If your system provides a proper fork()
10665 call, chances are that you do NOT want perl to use vfork().
10668 rp="Do you still want to use vfork()?"
10673 echo "Ok, we won't use vfork()."
10682 $define) usevfork='true';;
10683 *) usevfork='false';;
10686 : see if this is an sysdir system
10687 set sys/dir.h i_sysdir
10690 : see if this is an sysndir system
10691 set sys/ndir.h i_sysndir
10694 : see if closedir exists
10695 set closedir d_closedir
10698 case "$d_closedir" in
10701 echo "Checking whether closedir() returns a status..." >&4
10702 cat > closedir.c <<EOM
10703 #$i_dirent I_DIRENT /**/
10704 #$i_sysdir I_SYS_DIR /**/
10705 #$i_sysndir I_SYS_NDIR /**/
10706 #$i_systypes I_SYS_TYPES /**/
10708 #if defined(I_SYS_TYPES)
10709 #include <sys/types.h>
10711 #if defined(I_DIRENT)
10712 #include <dirent.h>
10713 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10714 #include <sys/dir.h>
10718 #include <sys/ndir.h>
10722 #include <ndir.h> /* may be wrong in the future */
10724 #include <sys/dir.h>
10729 int main() { return closedir(opendir(".")); }
10732 if eval $compile_ok; then
10733 if ./closedir > /dev/null 2>&1 ; then
10734 echo "Yes, it does."
10737 echo "No, it doesn't."
10741 echo "(I can't seem to compile the test program--assuming it doesn't)"
10749 set d_void_closedir
10752 : check for volatile keyword
10754 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10755 $cat >try.c <<'EOCP'
10758 typedef struct _goo_struct goo_struct;
10759 goo_struct * volatile goo = ((goo_struct *)0);
10760 struct _goo_struct {
10765 typedef unsigned short foo_t;
10766 char *volatile foo;
10768 volatile foo_t blech;
10772 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10774 echo "Yup, it does."
10777 echo "Nope, it doesn't."
10783 : see if there is a wait4
10787 : see if waitpid exists
10788 set waitpid d_waitpid
10791 : see if wcstombs exists
10792 set wcstombs d_wcstombs
10795 : see if wctomb exists
10796 set wctomb d_wctomb
10799 : see if writev exists
10800 set writev d_writev
10803 : preserve RCS keywords in files with variable substitution, grrr
10808 Revision='$Revision'
10810 case "$crosscompile" in
10811 ''|[nN]*) crosscompile="$undef" ;;
10815 next|rhapsody) multiarch="$define" ;;
10817 case "$multiarch" in
10818 ''|[nN]*) multiarch="$undef" ;;
10821 : check for alignment requirements
10823 case "$crosscompile$multiarch" in
10826 You seem to be either cross-compiling or doing a multiarchitecture build,
10827 skipping the memory alignment check.
10830 case "$alignbytes" in
10831 '') alignbytes=8 ;;
10835 case "$alignbytes" in
10836 '') echo "Checking alignment constraints..." >&4
10837 $cat >try.c <<'EOCP'
10844 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10848 if eval $compile_ok; then
10852 echo "(I can't seem to compile the test program...)"
10855 *) dflt="$alignbytes"
10858 rp="Doubles must be aligned on a how-many-byte boundary?"
10866 : check for ordering of bytes in a long
10868 case "$crosscompile$multiarch" in
10871 You seem to be either cross-compiling or doing a multiarchitecture build,
10872 skipping the byteorder check.
10878 case "$byteorder" in
10881 In the following, larger digits indicate more significance. A big-endian
10882 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10883 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10884 machines may have weird orders like 3412. A Cray will report 87654321,
10885 an Alpha will report 12345678. If the test program works the default is
10887 I'm now running the test program...
10889 $cat >try.c <<'EOCP'
10896 char c[sizeof(long)];
10899 if (sizeof(long) > 4)
10900 u.l = (0x08070605L << 32) | 0x04030201L;
10903 for (i = 0; i < sizeof(long); i++)
10904 printf("%c", u.c[i]+'0');
10911 if eval $compile && ./try > /dev/null; then
10914 [1-4][1-4][1-4][1-4]|12345678|87654321)
10915 echo "(The test program ran ok.)"
10916 echo "byteorder=$dflt"
10919 ????|????????) echo "(The test program ran ok.)" ;;
10920 *) echo "(The test program didn't run right for some reason.)" ;;
10925 (I can't seem to compile the test program. Guessing big-endian...)
10928 case "$xxx_prompt" in
10930 rp="What is the order of bytes in a long?"
10944 : how do we catenate cpp tokens here?
10946 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10947 $cat >cpp_stuff.c <<'EOCP'
10948 #define RCAT(a,b)a/**/b
10949 #define ACAT(a,b)a ## b
10953 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10954 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10955 echo "Oh! Smells like ANSI's been here." >&4
10956 echo "We can catify or stringify, separately or together!"
10958 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10959 echo "Ah, yes! The good old days!" >&4
10960 echo "However, in the good old days we don't know how to stringify and"
10961 echo "catify at the same time."
10965 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10966 to have to edit the values of CAT[2-5] in config.h...
10968 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10972 : see if this is a db.h system
10978 : Check db version.
10980 echo "Checking Berkeley DB version ..." >&4
10986 #include <sys/types.h>
10991 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10992 int Major, Minor, Patch ;
10993 unsigned long Version ;
10994 (void)db_version(&Major, &Minor, &Patch) ;
10995 printf("You have Berkeley DB Version 2 or greater\n");
10997 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10998 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10999 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11000 Major, Minor, Patch) ;
11002 /* check that db.h & libdb are compatible */
11003 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11004 printf("db.h and libdb are incompatible\n") ;
11008 printf("db.h and libdb are compatible\n") ;
11010 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11011 + DB_VERSION_PATCH ;
11013 /* needs to be >= 2.3.4 */
11014 if (Version < 2003004) {
11015 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11016 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11022 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11023 printf("You have Berkeley DB Version 1\n");
11024 exit(0); /* DB version < 2: the coast is clear. */
11026 exit(1); /* <db.h> not Berkeley DB? */
11032 if eval $compile && ./try; then
11033 echo 'Looks OK.' >&4
11035 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11039 : Remove db from list of libraries to use
11040 echo "Removing unusable -ldb from library list" >&4
11041 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11044 echo "libs = $libs" >&4
11054 : Check the return type needed for hash
11056 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11062 #include <sys/types.h>
11065 #ifndef DB_VERSION_MAJOR
11066 u_int32_t hash_cb (ptr, size)
11074 info.hash = hash_cb;
11078 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11079 if $contains warning try.out >>/dev/null 2>&1 ; then
11082 db_hashtype='u_int32_t'
11085 : XXX Maybe we should just give up here.
11086 db_hashtype=u_int32_t
11088 echo "Help: I can't seem to compile the db test program." >&4
11089 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11092 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11094 *) db_hashtype=u_int32_t
11099 : Check the return type needed for prefix
11101 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11107 #include <sys/types.h>
11110 #ifndef DB_VERSION_MAJOR
11111 size_t prefix_cb (key1, key2)
11119 info.prefix = prefix_cb;
11123 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11124 if $contains warning try.out >>/dev/null 2>&1 ; then
11125 db_prefixtype='int'
11127 db_prefixtype='size_t'
11130 db_prefixtype='size_t'
11131 : XXX Maybe we should just give up here.
11133 echo "Help: I can't seem to compile the db test program." >&4
11134 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11137 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11139 *) db_prefixtype='size_t'
11143 : check for void type
11145 echo "Checking to see how well your C compiler groks the void type..." >&4
11146 case "$voidflags" in
11148 $cat >try.c <<'EOCP'
11154 extern void moo(); /* function returning void */
11155 void (*goo)(); /* ptr to func returning void */
11157 void *hue; /* generic ptr */
11170 int main() { sub(); }
11172 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11173 voidflags=$defvoidused
11174 echo "Good. It appears to support void to the level $package wants.">&4
11175 if $contains warning .out >/dev/null 2>&1; then
11176 echo "However, you might get some warnings that look like this:"
11180 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11181 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11182 echo "It supports 1..."
11183 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11184 echo "It also supports 2..."
11185 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11187 echo "And it supports 4 but not 8 definitely."
11189 echo "It doesn't support 4..."
11190 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11192 echo "But it supports 8."
11195 echo "Neither does it support 8."
11199 echo "It does not support 2..."
11200 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11202 echo "But it supports 4 and 8."
11204 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11206 echo "And it supports 4 but has not heard about 8."
11208 echo "However it supports 8 but not 4."
11213 echo "There is no support at all for void."
11218 case "$voidflags" in
11220 *) $cat >&4 <<'EOM'
11221 Support flag bits are:
11222 1: basic void declarations.
11223 2: arrays of pointers to functions returning void.
11224 4: operations between pointers to and addresses of void functions.
11225 8: generic void pointers.
11228 rp="Your void support flags add up to what?"
11236 : How can we generate normalized random numbers ?
11238 echo "Looking for a random number function..." >&4
11239 case "$randfunc" in
11241 if set drand48 val -f; eval $csym; $val; then
11243 echo "Good, found drand48()." >&4
11244 elif set random val -f; eval $csym; $val; then
11246 echo "OK, found random()." >&4
11249 echo "Yick, looks like I have to use rand()." >&4
11260 *-Dmy_rand=*|*-Dmy_srand=*)
11261 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11262 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11263 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11264 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11268 while $test "$cont"; do
11269 rp="Use which function to generate random numbers?"
11271 if $test "$ans" = "$dflt"; then
11277 if set $ans val -f; eval $csym; $val; then
11281 rp="I cannot find function $ans. Use that name anyway?"
11290 case "$randfunc" in
11292 drand01="drand48()"
11298 case "$randbits" in
11300 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11302 #$i_unistd I_UNISTD
11303 #$i_stdlib I_STDLIB
11306 # include <unistd.h>
11309 # include <stdlib.h>
11314 register unsigned long tmp;
11315 register unsigned long max = 0L;
11317 for (i = 1000; i; i--) {
11318 tmp = (unsigned long) $randfunc();
11319 if (tmp > max) max = tmp;
11321 for (i = 0; max; i++)
11327 if eval $compile_ok; then
11331 echo "(I can't seem to compile the test program...)"
11338 rp="How many bits does your $randfunc() function produce?"
11342 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11343 seedfunc="s$randfunc"
11344 randseedtype=unsigned
11348 rp="How many bits does your $randfunc() function produce?"
11351 seedfunc="s$randfunc"
11352 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11353 if set $seedfunc val -f; eval $csym; $val; then
11354 echo "(Using $seedfunc() to seed random generator)"
11356 echo "(Warning: no $seedfunc() to seed random generator)"
11359 randseedtype=unsigned
11367 echo "Determining whether or not we are on an EBCDIC system..." >&4
11368 $cat >tebcdic.c <<'EOM'
11371 if ('M'==0xd4) return 0;
11378 if eval $compile_ok; then
11380 echo "You have EBCDIC." >&4
11383 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11386 echo "I'm unable to compile the test program." >&4
11387 echo "I'll assume ASCII or some ISO Latin." >&4
11389 $rm -f tebcdic.c tebcdic
11395 Checking how to flush all pending stdio output...
11397 # I only know how to find the first 32 possibly open files on SunOS.
11398 # See also hints/sunos_4_1.sh and util.c --AD
11400 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11402 $cat >>try.c <<EOCP
11404 #$i_unistd I_UNISTD
11406 # include <unistd.h>
11408 #$d_sysconf HAS_SYSCONF
11409 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11410 #ifdef HAS_STDIO_STREAM_ARRAY
11411 # define STDIO_STREAM_ARRAY $stdio_stream_array
11414 FILE* p = fopen("try.out", "w");
11418 # ifdef TRY_FPRINTF
11422 #ifdef TRY_FFLUSH_NULL
11425 #ifdef TRY_FFLUSH_ALL
11427 long open_max = -1;
11428 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11429 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11431 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11432 open_max = sysconf(_SC_OPEN_MAX);
11435 open_max = FOPEN_MAX;
11438 open_max = OPEN_MAX;
11447 # ifdef HAS_STDIO_STREAM_ARRAY
11448 if (open_max > 0) {
11450 for (i = 0; i < open_max; i++)
11451 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11452 STDIO_STREAM_ARRAY[i]._file < open_max &&
11453 STDIO_STREAM_ARRAY[i]._flag)
11454 fflush(&STDIO_STREAM_ARRAY[i]);
11462 : first we have to find out how _not_ to flush
11463 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11465 set try -DTRY_FPUTC
11466 if eval $compile; then
11468 ./try$exe_ext 2>/dev/null
11469 if $test ! -s try.out -a "X$?" = X42; then
11475 set try -DTRY_FPRINTF
11477 if eval $compile; then
11479 ./try$exe_ext 2>/dev/null
11480 if $test ! -s try.out -a "X$?" = X42; then
11481 output=-DTRY_FPRINTF
11487 : check for fflush NULL behaviour
11488 case "$fflushNULL" in
11489 '') set try -DTRY_FFLUSH_NULL $output
11490 if eval $compile; then
11492 ./try$exe_ext 2>/dev/null
11494 if $test -s try.out -a "X$code" = X42; then
11495 fflushNULL="`$cat try.out`"
11497 if $test "X$code" != X42; then
11499 (If this test failed, don't worry, we'll try another method shortly.)
11504 $rm -f core try.core core.try.*
11505 case "$fflushNULL" in
11507 Your fflush(NULL) works okay.
11509 fflushNULL="$define"
11512 Your fflush(NULL) isn't working (contrary to ANSI C).
11514 fflushNULL="$undef"
11517 Cannot figure out whether your fflush(NULL) works or not.
11518 I'm assuming it doesn't (contrary to ANSI C).
11520 fflushNULL="$undef"
11524 $define|true|[yY]*)
11525 fflushNULL="$define"
11528 fflushNULL="$undef"
11531 : check explicit looping only if NULL did not work
11532 case "$fflushNULL" in
11534 : check for fflush all behaviour
11535 case "$fflushall" in
11536 '') set try -DTRY_FFLUSH_ALL $output
11537 if eval $compile; then
11539 (Now testing the other method--but note that also this may fail.)
11542 ./try$exe_ext 2>/dev/null
11543 if $test -s try.out -a "X$?" = X42; then
11544 fflushall="`$cat try.out`"
11547 $rm -f core try.core core.try.*
11548 case "$fflushall" in
11550 Whew. Flushing explicitly all the stdio streams works.
11552 fflushall="$define"
11555 Sigh. Flushing explicitly all the stdio streams doesn't work.
11560 Cannot figure out whether flushing stdio streams explicitly works or not.
11561 I'm assuming it doesn't.
11567 "$define"|true|[yY]*)
11568 fflushall="$define"
11575 *) fflushall="$undef"
11578 case "$fflushNULL$fflushall" in
11581 I cannot figure out how to flush pending stdio output.
11585 $rm -f try.* try$exe_ext
11587 : see what type file positions are declared as in the library
11588 rp="What is the type for file position used by fsetpos()?"
11589 set fpos_t fpostype long stdio.h sys/types.h
11592 : Store the full pathname to the ar program for use in the C program
11593 : Respect a hint or command line value for full_ar.
11598 : Store the full pathname to the sed program for use in the C program
11601 : see what type gids are declared as in the kernel
11603 echo "Looking for the type for group ids returned by getgid()."
11604 set gid_t gidtype xxx stdio.h sys/types.h
11608 xxx=`./findhdr sys/user.h`
11609 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11611 unsigned) dflt="$1 $2" ;;
11615 *) dflt="$gidtype";;
11618 gid_t) echo "gid_t found." ;;
11619 *) rp="What is the type for group ids returned by getgid()?"
11625 : see if getgroups exists
11626 set getgroups d_getgrps
11629 : see if setgroups exists
11630 set setgroups d_setgrps
11634 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11636 case "$d_getgrps$d_setgrps" in
11638 case "$groupstype" in
11639 '') dflt="$gidtype" ;;
11640 *) dflt="$groupstype" ;;
11643 What type of pointer is the second argument to getgroups() and setgroups()?
11644 Usually this is the same as group ids, $gidtype, but not always.
11647 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11651 *) groupstype="$gidtype";;
11654 : see what type lseek is declared as in the kernel
11655 rp="What is the type used for lseek's offset on this system?"
11656 set off_t lseektype long stdio.h sys/types.h
11660 $echo $n "Checking to see how big your file offsets are...$c" >&4
11662 #include <sys/types.h>
11666 printf("%d\n", sizeof($lseektype));
11670 if eval $compile_ok; then
11672 $echo " $lseeksize bytes." >&4
11676 echo "(I can't seem to compile the test program. Guessing...)"
11677 rp="What is the size of your file offsets (in bytes)?"
11684 echo "Checking if your $make program sets \$(MAKE)..." >&4
11685 case "$make_set_make" in
11687 $sed 's/^X //' > testmake.mak << 'EOF'
11689 X @echo 'maketemp="$(MAKE)"'
11691 case "`$make -f testmake.mak 2>/dev/null`" in
11692 *maketemp=*) make_set_make='#' ;;
11693 *) make_set_make="MAKE=$make" ;;
11695 $rm -f testmake.mak
11698 case "$make_set_make" in
11699 '#') echo "Yup, it does.";;
11700 *) echo "Nope, it doesn't.";;
11703 : see what type is used for mode_t
11704 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11705 set mode_t modetype int stdio.h sys/types.h
11708 : define a fucntion to check prototypes
11709 $cat > protochk <<EOSH
11712 optimize="$optimize"
11714 prototype="$prototype"
11719 $cat >> protochk <<'EOSH'
11724 while test $# -ge 2; do
11726 $define) echo "#include <$2>" >> try.c ;;
11727 literal) echo "$2" >> try.c ;;
11731 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11732 cat >> try.c <<'EOCP'
11733 #ifdef CAN_PROTOTYPE
11734 #define _(args) args
11739 echo "$foo" >> try.c
11740 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11741 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11747 $eunicefix protochk
11749 : see what type is used for size_t
11750 rp="What is the type used for the length parameter for string functions?"
11751 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11754 : check for type of arguments to gethostbyaddr.
11755 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11756 case "$d_gethbyaddr" in
11760 Checking to see what type of arguments are accepted by gethostbyaddr().
11762 hdrs="$define sys/types.h
11763 $d_socket sys/socket.h
11764 $i_niin netinet/in.h
11766 $i_unistd unistd.h"
11767 : The first arg can 'char *' or 'void *'
11768 : The second arg is some of integral type
11769 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11770 for yyy in size_t long int; do
11771 case "$netdb_host_type" in
11772 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11773 if ./protochk "$try" $hdrs; then
11774 echo "Your system accepts $xxx for the first arg."
11775 echo "...and $yyy for the second arg."
11776 netdb_host_type="$xxx"
11777 netdb_hlen_type="$yyy"
11783 : In case none of those worked, prompt the user.
11784 case "$netdb_host_type" in
11785 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11788 netdb_host_type=$ans
11789 rp='What is the type for the 2nd argument to gethostbyaddr?'
11792 netdb_hlen_type=$ans
11796 *) : no gethostbyaddr, so pick harmless defaults
11797 netdb_host_type='char *'
11798 netdb_hlen_type="$sizetype"
11801 # Remove the "const" if needed. -- but then we'll have a
11803 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11806 : check for type of argument to gethostbyname.
11807 if test "X$netdb_name_type" = X ; then
11808 case "$d_gethbyname" in
11812 Checking to see what type of argument is accepted by gethostbyname().
11814 hdrs="$define sys/types.h
11815 $d_socket sys/socket.h
11816 $i_niin netinet/in.h
11818 $i_unistd unistd.h"
11819 for xxx in "const char *" "char *"; do
11820 case "$netdb_name_type" in
11821 '') try="extern struct hostent *gethostbyname($xxx);"
11822 if ./protochk "$try" $hdrs; then
11823 echo "Your system accepts $xxx."
11824 netdb_name_type="$xxx"
11829 : In case none of those worked, prompt the user.
11830 case "$netdb_name_type" in
11831 '') rp='What is the type for the 1st argument to gethostbyname?'
11834 netdb_name_type=$ans
11838 *) : no gethostbyname, so pick harmless default
11839 netdb_name_type='char *'
11844 : check for type of 1st argument to getnetbyaddr.
11845 if test "X$netdb_net_type" = X ; then
11846 case "$d_getnbyaddr" in
11850 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11852 hdrs="$define sys/types.h
11853 $d_socket sys/socket.h
11854 $i_niin netinet/in.h
11856 $i_unistd unistd.h"
11857 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11858 case "$netdb_net_type" in
11859 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11860 if ./protochk "$try" $hdrs; then
11861 echo "Your system accepts $xxx."
11862 netdb_net_type="$xxx"
11867 : In case none of those worked, prompt the user.
11868 case "$netdb_net_type" in
11869 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11872 netdb_net_type=$ans
11876 *) : no getnetbyaddr, so pick harmless default
11877 netdb_net_type='long'
11881 : locate the preferred pager for this system
11895 '') dflt=/usr/ucb/more;;
11902 rp='What pager is used on your system?'
11906 : see what type pids are declared as in the kernel
11907 rp="What is the type of process ids on this system?"
11908 set pid_t pidtype int stdio.h sys/types.h
11911 : check for length of pointer
11915 $echo $n "Checking to see how big your pointers are...$c" >&4
11916 if test "$voidflags" -gt 7; then
11917 echo '#define VOID_PTR char *' > try.c
11919 echo '#define VOID_PTR void *' > try.c
11921 $cat >>try.c <<'EOCP'
11925 printf("%d\n", sizeof(VOID_PTR));
11930 if eval $compile_ok; then
11932 $echo " $ptrsize bytes." >&4
11935 echo "(I can't seem to compile the test program. Guessing...)" >&4
11936 rp="What is the size of a pointer (in bytes)?"
11944 : see if ar generates random libraries by itself
11946 echo "Checking how to generate random libraries on your machine..." >&4
11947 echo 'int bar1() { return bar2(); }' > bar1.c
11948 echo 'int bar2() { return 2; }' > bar2.c
11949 $cat > foo.c <<'EOP'
11950 int main() { printf("%d\n", bar1()); exit(0); }
11952 $cc $ccflags -c bar1.c >/dev/null 2>&1
11953 $cc $ccflags -c bar2.c >/dev/null 2>&1
11954 $cc $ccflags -c foo.c >/dev/null 2>&1
11955 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11956 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11957 ./foobar >/dev/null 2>&1; then
11958 echo "$ar appears to generate random libraries itself."
11961 elif $ar ts bar$_a >/dev/null 2>&1 &&
11962 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11963 ./foobar >/dev/null 2>&1; then
11964 echo "a table of contents needs to be added with '$ar ts'."
11971 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11972 $test -f $ranlib || ranlib=''
11975 if $test -n "$ranlib"; then
11976 echo "your system has '$ranlib'; we'll use that."
11979 echo "your system doesn't seem to support random libraries"
11980 echo "so we'll use lorder and tsort to order the libraries."
11987 : check for type of arguments to select.
11988 case "$selecttype" in
11989 '') case "$d_select" in
11992 Checking to see what type of arguments are accepted by select().
11994 hdrs="$define sys/types.h
11995 $i_systime sys/time.h
11996 $i_sysselct sys/select.h
11997 $d_socket sys/socket.h"
11998 : The first arg can be int, unsigned, or size_t
11999 : The last arg may or may not be 'const'
12001 : void pointer has been seen but using that
12002 : breaks the selectminbits test
12003 for xxx in 'fd_set *' 'int *'; do
12004 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12005 for tmo in 'struct timeval *' 'const struct timeval *'; do
12007 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12008 if ./protochk "$try" $hdrs; then
12009 echo "Your system accepts $xxx."
12018 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12019 case "$d_fd_set" in
12020 $define) dflt="fd_set *" ;;
12029 *) : no select, so pick a harmless default
12036 : check for the select 'width'
12037 case "$selectminbits" in
12038 '') case "$d_select" in
12042 Checking to see on how many bits at a time your select() operates...
12045 #include <sys/types.h>
12047 #$i_systime I_SYS_TIME
12048 #$i_systimek I_SYS_TIME_KERNEL
12053 # ifdef I_SYS_TIME_KERNEL
12056 # include <sys/time.h>
12057 # ifdef I_SYS_TIME_KERNEL
12061 #$i_sysselct I_SYS_SELECT
12062 #ifdef I_SYS_SELECT
12063 #include <sys/select.h>
12065 #$d_socket HAS_SOCKET
12067 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12071 #define S sizeof(*(b))
12073 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12074 #define NBITS (NBYTES * 8)
12083 fp = fopen("try.c", "r");
12089 b = ($selecttype)s;
12090 for (i = 0; i < NBITS; i++)
12094 select(fd + 1, b, 0, 0, &t);
12095 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12096 printf("%d\n", i + 1);
12101 if eval $compile_ok; then
12102 selectminbits=`./try`
12103 case "$selectminbits" in
12105 Cannot figure out on how many bits at a time your select() operates.
12106 I'll play safe and guess it is 32 bits.
12112 *) bits="$selectminbits bits" ;;
12114 echo "Your select() operates on $bits at a time." >&4
12116 rp='What is the minimum number of bits your select() operates on?'
12117 case "$byteorder" in
12118 1234|12345678) dflt=32 ;;
12123 selectminbits="$val"
12127 *) : no select, so pick a harmless default
12134 : Trace out the files included by signal.h, then look for SIGxxx names.
12135 : Remove SIGARRAYSIZE used by HPUX.
12136 : Remove SIGSTKSIZE used by Linux.
12137 : Remove SIGSTKSZ used by Posix.
12138 : Remove SIGTYP void lines used by OS2.
12139 xxx=`echo '#include <signal.h>' |
12140 $cppstdin $cppminus $cppflags 2>/dev/null |
12141 $grep '^[ ]*#.*include' |
12142 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12143 : Check this list of files to be sure we have parsed the cpp output ok.
12144 : This will also avoid potentially non-existent files, such
12147 for xx in $xxx /dev/null ; do
12148 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12150 : If we have found no files, at least try signal.h
12151 case "$xxxfiles" in
12152 '') xxxfiles=`./findhdr signal.h` ;;
12155 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12156 print substr($2, 4, 20)
12158 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12159 print substr($3, 4, 20)
12161 : Append some common names just in case the awk scan failed.
12162 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12163 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12164 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12165 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12166 : generate a few handy files for later
12167 $cat > signal.c <<'EOCP'
12168 #include <sys/types.h>
12169 #include <signal.h>
12173 /* Strange style to avoid deeply-nested #if/#else/#endif */
12176 # define NSIG (_NSIG)
12182 # define NSIG (SIGMAX+1)
12188 # define NSIG (SIG_MAX+1)
12194 # define NSIG (MAXSIG+1)
12200 # define NSIG (MAX_SIG+1)
12205 # ifdef SIGARRAYSIZE
12206 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12212 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12216 /* Default to some arbitrary number that's big enough to get most
12217 of the common signals.
12223 printf("NSIG %d\n", NSIG);
12229 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12231 printf "#ifdef SIG"; printf $1; printf "\n"
12232 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12233 printf $1; printf ");\n"
12237 printf "#endif /* JUST_NSIG */\n";
12241 $cat >signal.awk <<'EOP'
12242 BEGIN { ndups = 0 }
12243 $1 ~ /^NSIG$/ { nsig = $2 }
12244 ($1 !~ /^NSIG$/) && (NF == 2) {
12245 if ($2 > maxsig) { maxsig = $2 }
12246 if (sig_name[$2]) {
12247 dup_name[ndups] = $1
12248 dup_num[ndups] = $2
12260 printf("NSIG %d\n", nsig);
12261 for (n = 1; n < nsig; n++) {
12263 printf("%s %d\n", sig_name[n], sig_num[n])
12266 printf("NUM%d %d\n", n, n)
12269 for (n = 0; n < ndups; n++) {
12270 printf("%s %d\n", dup_name[n], dup_num[n])
12274 $cat >signal_cmd <<EOS
12276 if $test -s signal.lst; then
12277 echo "Using your existing signal.lst file"
12282 $cat >>signal_cmd <<'EOS'
12285 if eval $compile_ok; then
12286 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12288 echo "(I can't seem be able to compile the whole test program)" >&4
12289 echo "(I'll try it in little pieces.)" >&4
12290 set signal -DJUST_NSIG
12291 if eval $compile_ok; then
12292 ./signal$_exe > signal.nsg
12295 echo "I can't seem to figure out how many signals you have." >&4
12296 echo "Guessing 50." >&4
12297 echo 'NSIG 50' > signal.nsg
12299 : Now look at all the signal names, one at a time.
12300 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12301 $cat > signal.c <<EOCP
12302 #include <sys/types.h>
12303 #include <signal.h>
12306 printf("$xx %d\n", SIG${xx});
12311 if eval $compile; then
12312 echo "SIG${xx} found."
12313 ./signal$_exe >> signal.ls1
12315 echo "SIG${xx} NOT found."
12318 if $test -s signal.ls1; then
12319 $cat signal.nsg signal.ls1 |
12320 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12324 if $test -s signal.lst; then
12327 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12328 echo 'kill -l' >signal
12329 set X `csh -f <signal`
12333 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12335 echo $@ | $tr ' ' $trnl | \
12336 $awk '{ printf "%s %d\n", $1, ++s; }
12337 END { printf "NSIG %d\n", ++s }' >signal.lst
12339 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12341 chmod a+x signal_cmd
12342 $eunicefix signal_cmd
12344 : generate list of signal names
12346 case "$sig_name_init" in
12348 *) case "$sig_num_init" in
12349 ''|*,*) doinit=yes ;;
12354 echo "Generating a list of signal names and numbers..." >&4
12356 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12357 sig_name=`$awk 'BEGIN { printf "ZERO " }
12358 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12359 sig_num=`$awk 'BEGIN { printf "0 " }
12360 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12361 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12362 !/^NSIG/ { printf "\"%s\", ", $1 }
12363 END { printf "0\n" }' signal.lst`
12364 sig_num_init=`$awk 'BEGIN { printf "0, " }
12365 !/^NSIG/ { printf "%d, ", $2}
12366 END { printf "0\n"}' signal.lst`
12369 echo "The following $sig_count signals are available:"
12371 echo $sig_name | $awk \
12372 'BEGIN { linelen = 0 }
12374 for (i = 1; i <= NF; i++) {
12375 name = "SIG" $i " "
12376 linelen = linelen + length(name)
12377 if (linelen > 70) {
12379 linelen = length(name)
12385 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12387 : see what type is used for signed size_t
12388 set ssize_t ssizetype int stdio.h sys/types.h
12391 $cat > ssize.c <<EOM
12393 #include <sys/types.h>
12394 #define Size_t $sizetype
12395 #define SSize_t $dflt
12398 if (sizeof(Size_t) == sizeof(SSize_t))
12400 else if (sizeof(Size_t) == sizeof(int))
12409 if eval $compile_ok && ./ssize > /dev/null; then
12410 ssizetype=`./ssize`
12411 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12414 Help! I can't compile and run the ssize_t test program: please enlighten me!
12415 (This is probably a misconfiguration in your system or libraries, and
12416 you really ought to fix it. Still, I'll try anyway.)
12418 I need a type that is the same size as $sizetype, but is guaranteed to
12419 be signed. Common values are ssize_t, int and long.
12422 rp="What signed type is the same size as $sizetype?"
12426 $rm -f ssize ssize.*
12428 : see what type of char stdio uses.
12430 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12431 echo "Your stdio uses unsigned chars." >&4
12432 stdchar="unsigned char"
12434 echo "Your stdio uses signed chars." >&4
12438 : see if time exists
12440 if test "X$d_time" = X -o X"$timetype" = X; then
12441 if set time val -f d_time; eval $csym; $val; then
12442 echo 'time() found.' >&4
12444 rp="What is the type returned by time() on this system?"
12445 set time_t timetype long stdio.h sys/types.h
12448 echo 'time() not found, hope that will do.' >&4
12456 : see what type uids are declared as in the kernel
12458 echo "Looking for the type for user ids returned by getuid()."
12459 set uid_t uidtype xxx stdio.h sys/types.h
12463 xxx=`./findhdr sys/user.h`
12464 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12466 unsigned) dflt="$1 $2" ;;
12470 *) dflt="$uidtype";;
12473 uid_t) echo "uid_t found." ;;
12474 *) rp="What is the type for user ids returned by getuid()?"
12480 : see if dbm.h is available
12481 : see if dbmclose exists
12482 set dbmclose d_dbmclose
12485 case "$d_dbmclose" in
12495 *) set rpcsvc/dbm.h i_rpcsvcdbm
12500 *) echo "We won't be including <dbm.h>"
12510 : see if this is a sys/file.h system
12515 : do we need to include sys/file.h ?
12519 if $h_sysfile; then
12521 echo "We'll be including <sys/file.h>." >&4
12524 echo "We won't be including <sys/file.h>." >&4
12534 : see if fcntl.h is there
12539 : see if we can include fcntl.h
12545 echo "We'll be including <fcntl.h>." >&4
12548 if $h_sysfile; then
12549 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12551 echo "We won't be including <fcntl.h>." >&4
12563 : see if locale.h is available
12564 set locale.h i_locale
12567 : see if mach cthreads are available
12568 if test "X$usethreads" = "X$define"; then
12569 set mach/cthreads.h i_machcthr
12572 i_machcthr="$undef"
12577 : see if this is a math.h system
12581 : see if this is a mntent.h system
12582 set mntent.h i_mntent
12585 : see if ndbm.h is available
12590 : see if dbm_open exists
12591 set dbm_open d_dbm_open
12593 case "$d_dbm_open" in
12596 echo "We won't be including <ndbm.h>"
12605 : see if net/errno.h is available
12607 set net/errno.h val
12610 : Unfortunately, it causes problems on some systems. Arrgh.
12613 cat > try.c <<'EOM'
12616 #include <net/errno.h>
12622 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12623 echo "We'll be including <net/errno.h>." >&4
12625 echo "We won't be including <net/errno.h>." >&4
12634 : see if netinet/tcp.h is available
12635 set netinet/tcp.h i_netinettcp
12638 : see if this is a poll.h system
12642 : get C preprocessor symbols handy
12644 $echo $n "Hmm... $c"
12645 echo $al | $tr ' ' $trnl >Cppsym.know
12646 $cat <<EOSS >Cppsym
12654 case "\$list\$#" in
12657 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12659 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12662 unknown="\$unknown \$sym"
12672 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12674 exit 0; _ _ _ _\1\\ \1\\
12677 echo "exit 1; _ _ _" >>Cppsym\$\$
12678 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12680 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12686 $rm -f Cppsym\$\$ Cppsym2\$\$
12691 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12693 : now check the C compiler for additional symbols
12694 postprocess_cc_v=''
12696 aix) postprocess_cc_v="|$tr , ' '" ;;
12703 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12706 -D*) echo "\$i" | $sed 's/^-D//';;
12707 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12712 postprocess_cc_v=''
12715 ./ccsym > ccsym1.raw
12716 if $test -s ccsym1.raw; then
12717 $sort ccsym1.raw | $uniq >ccsym.raw
12719 mv ccsym1.raw ccsym.raw
12722 $awk '/\=/ { print $0; next }
12723 { print $0"=1" }' ccsym.raw >ccsym.list
12724 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12725 $comm -13 ccsym.true ccsym.list >ccsym.own
12726 $comm -12 ccsym.true ccsym.list >ccsym.com
12727 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12729 if $test -z ccsym.raw; then
12730 echo "Your C compiler doesn't seem to define any symbols!" >&4
12732 echo "However, your C preprocessor defines the following symbols:"
12735 cppsymbols=`$cat Cppsym.true`
12736 cppsymbols=`echo $cppsymbols`
12737 cppccsymbols="$cppsymbols"
12739 if $test -s ccsym.com; then
12740 echo "Your C compiler and pre-processor define these symbols:"
12741 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12744 cppccsymbols=`$cat ccsym.com`
12745 cppccsymbols=`echo $cppccsymbols`
12746 $test "$silent" || sleep 1
12748 if $test -s ccsym.cpp; then
12749 $test "$also" && echo " "
12750 echo "Your C pre-processor ${also}defines the following symbols:"
12751 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12753 cppsymbols=`$cat ccsym.cpp`
12754 cppsymbols=`echo $cppsymbols`
12755 $test "$silent" || sleep 1
12757 if $test -s ccsym.own; then
12758 $test "$also" && echo " "
12759 echo "Your C compiler ${also}defines the following cpp symbols:"
12760 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12761 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12762 ccsymbols=`$cat ccsym.own`
12763 ccsymbols=`echo $ccsymbols`
12764 $test "$silent" || sleep 1
12769 : see if this is a termio system
12773 if $test `./findhdr termios.h`; then
12774 set tcsetattr i_termios
12780 "$define") echo "You have POSIX termios.h... good!" >&4;;
12781 *) if ./Cppsym pyr; then
12782 case "`/bin/universe`" in
12783 ucb) if $test `./findhdr sgtty.h`; then
12785 echo "<sgtty.h> found." >&4
12787 echo "System is pyramid with BSD universe."
12788 echo "<sgtty.h> not found--you could have problems." >&4
12790 *) if $test `./findhdr termio.h`; then
12792 echo "<termio.h> found." >&4
12794 echo "System is pyramid with USG universe."
12795 echo "<termio.h> not found--you could have problems." >&4
12799 if $test `./findhdr termio.h`; then
12800 echo "<termio.h> found." >&4
12802 elif $test `./findhdr sgtty.h`; then
12803 echo "<sgtty.h> found." >&4
12806 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12809 if $test `./findhdr sgtty.h`; then
12810 echo "<sgtty.h> found." >&4
12812 elif $test `./findhdr termio.h`; then
12813 echo "<termio.h> found." >&4
12816 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12820 set i_termio; eval $setvar
12821 val=$val2; set i_sgtty; eval $setvar
12822 val=$val3; set i_termios; eval $setvar
12824 : see if this is a shadow.h system
12825 set shadow.h i_shadow
12828 : see if this is a socks.h system
12829 set socks.h i_socks
12832 : see if stdarg is available
12834 if $test `./findhdr stdarg.h`; then
12835 echo "<stdarg.h> found." >&4
12838 echo "<stdarg.h> NOT found." >&4
12842 : see if varags is available
12844 if $test `./findhdr varargs.h`; then
12845 echo "<varargs.h> found." >&4
12847 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12850 : set up the varargs testing programs
12851 $cat > varargs.c <<EOP
12853 #include <stdarg.h>
12856 #include <varargs.h>
12860 int f(char *p, ...)
12874 p = va_arg(ap, char *);
12879 $cat > varargs <<EOP
12881 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12890 : now check which varargs header should be included
12895 if `./varargs I_STDARG`; then
12897 elif `./varargs I_VARARGS`; then
12902 if `./varargs I_VARARGS`; then
12909 echo "I could not find the definition for va_dcl... You have problems..." >&4
12910 val="$undef"; set i_stdarg; eval $setvar
12911 val="$undef"; set i_varargs; eval $setvar
12916 case "$i_varhdr" in
12918 val="$define"; set i_stdarg; eval $setvar
12919 val="$undef"; set i_varargs; eval $setvar
12922 val="$undef"; set i_stdarg; eval $setvar
12923 val="$define"; set i_varargs; eval $setvar
12926 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12930 : see if stddef is available
12931 set stddef.h i_stddef
12934 : see if sys/access.h is available
12935 set sys/access.h i_sysaccess
12938 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12939 set sys/filio.h i_sysfilio
12942 if $test `./findhdr sys/ioctl.h`; then
12944 echo '<sys/ioctl.h> found.' >&4
12947 if $test $i_sysfilio = "$define"; then
12948 echo '<sys/ioctl.h> NOT found.' >&4
12950 $test $i_sgtty = "$define" && xxx="sgtty.h"
12951 $test $i_termio = "$define" && xxx="termio.h"
12952 $test $i_termios = "$define" && xxx="termios.h"
12953 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12959 : see if sys/resource.h has to be included
12960 set sys/resource.h i_sysresrc
12963 : see if sys/security.h is available
12964 set sys/security.h i_syssecrt
12967 : see if this is a sys/statvfs.h system
12968 set sys/statvfs.h i_sysstatvfs
12971 : see if this is a sys/un.h system
12972 set sys/un.h i_sysun
12975 : see if this is a syswait system
12976 set sys/wait.h i_syswait
12979 : see if this is an utime system
12980 set utime.h i_utime
12983 : see if this is a values.h system
12984 set values.h i_values
12987 : see if this is a vfork system
12990 set vfork.h i_vfork
12998 : see if gdbm.h is available
13003 : see if gdbm_open exists
13004 set gdbm_open d_gdbm_open
13006 case "$d_gdbm_open" in
13009 echo "We won't be including <gdbm.h>"
13019 echo "Looking for extensions..." >&4
13020 : If we are using the old config.sh, known_extensions may contain
13021 : old or inaccurate or duplicate values.
13022 known_extensions=''
13023 nonxs_extensions=''
13024 : We do not use find because it might not be available.
13025 : We do not just use MANIFEST because the user may have dropped
13026 : some additional extensions into the source tree and expect them
13029 : Function to recursively find available extensions, ignoring DynaLoader
13030 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13034 DynaLoader|dynaload) ;;
13036 if $test -f $xxx/$xxx.xs; then
13037 known_extensions="$known_extensions $1$xxx";
13038 elif $test -f $xxx/Makefile.PL; then
13039 nonxs_extensions="$nonxs_extensions $1$xxx";
13041 if $test -d $xxx -a $# -lt 10; then
13044 eval $find_extensions;
13056 eval $find_extensions
13057 set X $nonxs_extensions
13059 nonxs_extensions="$*"
13060 set X $known_extensions
13062 known_extensions="$*"
13065 : Now see which are supported on this system.
13067 for xxx in $known_extensions ; do
13071 $define) avail_ext="$avail_ext $xxx" ;;
13074 GDBM_File|gdbm_fil)
13076 $define) avail_ext="$avail_ext $xxx" ;;
13079 NDBM_File|ndbm_fil)
13081 $define) avail_ext="$avail_ext $xxx" ;;
13084 ODBM_File|odbm_fil)
13085 case "${i_dbm}${i_rpcsvcdbm}" in
13086 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13090 case "$useposix" in
13091 true|define|y) avail_ext="$avail_ext $xxx" ;;
13095 case "$useopcode" in
13096 true|define|y) avail_ext="$avail_ext $xxx" ;;
13100 case "$d_socket" in
13101 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13105 case "$usethreads" in
13106 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13110 : XXX Do we need a useipcsysv variable here
13111 case "${d_msg}${d_sem}${d_shm}" in
13112 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13115 *) avail_ext="$avail_ext $xxx"
13124 : Now see which nonxs extensions are supported on this system.
13125 : For now assume all are.
13127 for xxx in $nonxs_extensions ; do
13129 *) nonxs_ext="$nonxs_ext $xxx"
13141 A number of extensions are supplied with $package. You may choose to
13142 compile these extensions for dynamic loading (the default), compile
13143 them into the $package executable (static loading), or not include
13144 them at all. Answer "none" to include no extensions.
13145 Note that DynaLoader is always built and need not be mentioned here.
13148 case "$dynamic_ext" in
13149 '') dflt="$avail_ext" ;;
13150 *) dflt="$dynamic_ext"
13151 # Perhaps we are reusing an old out-of-date config.sh.
13154 if test X"$dynamic_ext" != X"$avail_ext"; then
13156 NOTICE: Your previous config.sh list may be incorrect.
13157 The extensions now available to you are
13159 but the default list from your previous config.sh is
13171 rp="What extensions do you wish to load dynamically?"
13174 none) dynamic_ext=' ' ;;
13175 *) dynamic_ext="$ans" ;;
13178 case "$static_ext" in
13180 : Exclude those already listed in dynamic linking
13182 for xxx in $avail_ext; do
13183 case " $dynamic_ext " in
13185 *) dflt="$dflt $xxx" ;;
13192 *) dflt="$static_ext"
13199 rp="What extensions do you wish to load statically?"
13202 none) static_ext=' ' ;;
13203 *) static_ext="$ans" ;;
13208 A number of extensions are supplied with $package. Answer "none"
13209 to include no extensions.
13210 Note that DynaLoader is always built and need not be mentioned here.
13213 case "$static_ext" in
13214 '') dflt="$avail_ext" ;;
13215 *) dflt="$static_ext"
13216 # Perhaps we are reusing an old out-of-date config.sh.
13219 if test X"$static_ext" != X"$avail_ext"; then
13221 NOTICE: Your previous config.sh list may be incorrect.
13222 The extensions now available to you are
13224 but the default list from your previous config.sh is
13233 : Exclude those that are not xs extensions
13237 rp="What extensions do you wish to include?"
13240 none) static_ext=' ' ;;
13241 *) static_ext="$ans" ;;
13246 set X $dynamic_ext $static_ext $nonxs_ext
13250 : Remove build directory name from cppstdin so it can be used from
13251 : either the present location or the final installed location.
13253 : Get out of the UU directory to get correct path name.
13255 case "$cppstdin" in
13257 echo "Stripping down cppstdin path name"
13263 : end of configuration questions
13265 echo "End of configuration questions."
13268 : back to where it started
13269 if test -d ../UU; then
13273 : configuration may be patched via a 'config.over' file
13274 if $test -f config.over; then
13277 rp='I see a config.over file. Do you wish to load it?'
13280 n*) echo "OK, I'll ignore it.";;
13282 echo "Configuration override changes have been loaded."
13287 : in case they want portability, strip down executable paths
13288 case "$d_portable" in
13291 echo "Stripping down executable paths..." >&4
13292 for file in $loclist $trylist; do
13294 eval $file=`basename $temp`
13299 : create config.sh file
13301 echo "Creating config.sh..." >&4
13302 $spitshell <<EOT >config.sh
13305 # This file was produced by running the Configure script. It holds all the
13306 # definitions figured out by Configure. Should you modify one of these values,
13307 # do not forget to propagate your changes by running "Configure -der". You may
13308 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13311 # Package name : $package
13312 # Source directory : $src
13313 # Configuration time: $cf_time
13314 # Configured by : $cf_by
13315 # Target system : $myuname
13325 Revision='$Revision'
13332 alignbytes='$alignbytes'
13333 ansi2knr='$ansi2knr'
13334 aphostname='$aphostname'
13335 apiversion='$apiversion'
13338 archlibexp='$archlibexp'
13339 archname64='$archname64'
13340 archname='$archname'
13341 archobjs='$archobjs'
13346 bincompat5005='$bincompat5005'
13350 byteorder='$byteorder'
13352 castflags='$castflags'
13355 cccdlflags='$cccdlflags'
13356 ccdlflags='$ccdlflags'
13358 ccsymbols='$ccsymbols'
13360 cf_email='$cf_email'
13365 clocktype='$clocktype'
13367 compress='$compress'
13368 contains='$contains'
13372 cpp_stuff='$cpp_stuff'
13373 cppccsymbols='$cppccsymbols'
13374 cppflags='$cppflags'
13376 cppminus='$cppminus'
13378 cppstdin='$cppstdin'
13379 cppsymbols='$cppsymbols'
13380 crosscompile='$crosscompile'
13381 cryptlib='$cryptlib'
13383 d_Gconvert='$d_Gconvert'
13384 d_PRIEldbl='$d_PRIEldbl'
13385 d_PRIFldbl='$d_PRIFldbl'
13386 d_PRIGldbl='$d_PRIGldbl'
13387 d_PRIX64='$d_PRIX64'
13388 d_PRId64='$d_PRId64'
13389 d_PRIeldbl='$d_PRIeldbl'
13390 d_PRIfldbl='$d_PRIfldbl'
13391 d_PRIgldbl='$d_PRIgldbl'
13392 d_PRIi64='$d_PRIi64'
13393 d_PRIo64='$d_PRIo64'
13394 d_PRIu64='$d_PRIu64'
13395 d_PRIx64='$d_PRIx64'
13396 d_access='$d_access'
13397 d_accessx='$d_accessx'
13399 d_archlib='$d_archlib'
13402 d_attribut='$d_attribut'
13405 d_bincompat5005='$d_bincompat5005'
13407 d_bsdgetpgrp='$d_bsdgetpgrp'
13408 d_bsdsetpgrp='$d_bsdsetpgrp'
13410 d_casti32='$d_casti32'
13411 d_castneg='$d_castneg'
13412 d_charvspr='$d_charvspr'
13414 d_chroot='$d_chroot'
13415 d_chsize='$d_chsize'
13416 d_closedir='$d_closedir'
13417 d_cmsghdr_s='$d_cmsghdr_s'
13421 d_cuserid='$d_cuserid'
13422 d_dbl_dig='$d_dbl_dig'
13423 d_difftime='$d_difftime'
13424 d_dirnamlen='$d_dirnamlen'
13425 d_dlerror='$d_dlerror'
13426 d_dlopen='$d_dlopen'
13427 d_dlsymun='$d_dlsymun'
13428 d_dosuid='$d_dosuid'
13429 d_drand48proto='$d_drand48proto'
13431 d_eaccess='$d_eaccess'
13432 d_endgrent='$d_endgrent'
13433 d_endhent='$d_endhent'
13434 d_endnent='$d_endnent'
13435 d_endpent='$d_endpent'
13436 d_endpwent='$d_endpwent'
13437 d_endsent='$d_endsent'
13438 d_endspent='$d_endspent'
13439 d_eofnblk='$d_eofnblk'
13440 d_eunice='$d_eunice'
13441 d_fchmod='$d_fchmod'
13442 d_fchown='$d_fchown'
13444 d_fd_macros='$d_fd_macros'
13445 d_fd_set='$d_fd_set'
13446 d_fds_bits='$d_fds_bits'
13447 d_fgetpos='$d_fgetpos'
13448 d_flexfnam='$d_flexfnam'
13451 d_fpathconf='$d_fpathconf'
13452 d_fpos64_t='$d_fpos64_t'
13453 d_fseeko='$d_fseeko'
13454 d_fsetpos='$d_fsetpos'
13455 d_fstatfs='$d_fstatfs'
13456 d_fstatvfs='$d_fstatvfs'
13457 d_ftello='$d_ftello'
13459 d_getgrent='$d_getgrent'
13460 d_getgrps='$d_getgrps'
13461 d_gethbyaddr='$d_gethbyaddr'
13462 d_gethbyname='$d_gethbyname'
13463 d_gethent='$d_gethent'
13464 d_gethname='$d_gethname'
13465 d_gethostprotos='$d_gethostprotos'
13466 d_getlogin='$d_getlogin'
13467 d_getmntent='$d_getmntent'
13468 d_getnbyaddr='$d_getnbyaddr'
13469 d_getnbyname='$d_getnbyname'
13470 d_getnent='$d_getnent'
13471 d_getnetprotos='$d_getnetprotos'
13472 d_getpbyname='$d_getpbyname'
13473 d_getpbynumber='$d_getpbynumber'
13474 d_getpent='$d_getpent'
13475 d_getpgid='$d_getpgid'
13476 d_getpgrp2='$d_getpgrp2'
13477 d_getpgrp='$d_getpgrp'
13478 d_getppid='$d_getppid'
13479 d_getprior='$d_getprior'
13480 d_getprotoprotos='$d_getprotoprotos'
13481 d_getpwent='$d_getpwent'
13482 d_getsbyname='$d_getsbyname'
13483 d_getsbyport='$d_getsbyport'
13484 d_getsent='$d_getsent'
13485 d_getservprotos='$d_getservprotos'
13486 d_getspent='$d_getspent'
13487 d_getspnam='$d_getspnam'
13488 d_gettimeod='$d_gettimeod'
13489 d_gnulibc='$d_gnulibc'
13490 d_grpasswd='$d_grpasswd'
13491 d_hasmntopt='$d_hasmntopt'
13494 d_inetaton='$d_inetaton'
13495 d_int64t='$d_int64t'
13496 d_iovec_s='$d_iovec_s'
13497 d_isascii='$d_isascii'
13498 d_killpg='$d_killpg'
13499 d_lchown='$d_lchown'
13500 d_ldbl_dig='$d_ldbl_dig'
13502 d_llseek='$d_llseek'
13503 d_locconv='$d_locconv'
13505 d_longdbl='$d_longdbl'
13506 d_longlong='$d_longlong'
13508 d_madvise='$d_madvise'
13510 d_mbstowcs='$d_mbstowcs'
13511 d_mbtowc='$d_mbtowc'
13512 d_memchr='$d_memchr'
13513 d_memcmp='$d_memcmp'
13514 d_memcpy='$d_memcpy'
13515 d_memmove='$d_memmove'
13516 d_memset='$d_memset'
13518 d_mkfifo='$d_mkfifo'
13519 d_mktime='$d_mktime'
13521 d_mprotect='$d_mprotect'
13523 d_msg_ctrunc='$d_msg_ctrunc'
13524 d_msg_dontroute='$d_msg_dontroute'
13525 d_msg_oob='$d_msg_oob'
13526 d_msg_peek='$d_msg_peek'
13527 d_msg_proxy='$d_msg_proxy'
13528 d_msgctl='$d_msgctl'
13529 d_msgget='$d_msgget'
13530 d_msghdr_s='$d_msghdr_s'
13531 d_msgrcv='$d_msgrcv'
13532 d_msgsnd='$d_msgsnd'
13534 d_munmap='$d_munmap'
13535 d_mymalloc='$d_mymalloc'
13537 d_off64_t='$d_off64_t'
13538 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13539 d_oldpthreads='$d_oldpthreads'
13540 d_oldsock='$d_oldsock'
13542 d_pathconf='$d_pathconf'
13544 d_phostname='$d_phostname'
13547 d_portable='$d_portable'
13548 d_pthread_yield='$d_pthread_yield'
13550 d_pwchange='$d_pwchange'
13551 d_pwclass='$d_pwclass'
13552 d_pwcomment='$d_pwcomment'
13553 d_pwexpire='$d_pwexpire'
13554 d_pwgecos='$d_pwgecos'
13555 d_pwpasswd='$d_pwpasswd'
13556 d_pwquota='$d_pwquota'
13557 d_readdir='$d_readdir'
13558 d_readlink='$d_readlink'
13560 d_recvmsg='$d_recvmsg'
13561 d_rename='$d_rename'
13562 d_rewinddir='$d_rewinddir'
13564 d_safebcpy='$d_safebcpy'
13565 d_safemcpy='$d_safemcpy'
13566 d_sanemcmp='$d_sanemcmp'
13567 d_sched_yield='$d_sched_yield'
13568 d_scm_rights='$d_scm_rights'
13569 d_seekdir='$d_seekdir'
13570 d_select='$d_select'
13572 d_semctl='$d_semctl'
13573 d_semctl_semid_ds='$d_semctl_semid_ds'
13574 d_semctl_semun='$d_semctl_semun'
13575 d_semget='$d_semget'
13577 d_sendmsg='$d_sendmsg'
13578 d_setegid='$d_setegid'
13579 d_seteuid='$d_seteuid'
13580 d_setgrent='$d_setgrent'
13581 d_setgrps='$d_setgrps'
13582 d_sethent='$d_sethent'
13583 d_setlinebuf='$d_setlinebuf'
13584 d_setlocale='$d_setlocale'
13585 d_setnent='$d_setnent'
13586 d_setpent='$d_setpent'
13587 d_setpgid='$d_setpgid'
13588 d_setpgrp2='$d_setpgrp2'
13589 d_setpgrp='$d_setpgrp'
13590 d_setprior='$d_setprior'
13591 d_setpwent='$d_setpwent'
13592 d_setregid='$d_setregid'
13593 d_setresgid='$d_setresgid'
13594 d_setresuid='$d_setresuid'
13595 d_setreuid='$d_setreuid'
13596 d_setrgid='$d_setrgid'
13597 d_setruid='$d_setruid'
13598 d_setsent='$d_setsent'
13599 d_setsid='$d_setsid'
13600 d_setspent='$d_setspent'
13601 d_setvbuf='$d_setvbuf'
13605 d_shmatprototype='$d_shmatprototype'
13606 d_shmctl='$d_shmctl'
13608 d_shmget='$d_shmget'
13609 d_sigaction='$d_sigaction'
13610 d_sigsetjmp='$d_sigsetjmp'
13611 d_socket='$d_socket'
13612 d_sockpair='$d_sockpair'
13613 d_statblks='$d_statblks'
13614 d_statfs='$d_statfs'
13615 d_statfsflags='$d_statfsflags'
13616 d_statvfs='$d_statvfs'
13617 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13618 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13619 d_stdio_stream_array='$d_stdio_stream_array'
13620 d_stdiobase='$d_stdiobase'
13621 d_stdstdio='$d_stdstdio'
13622 d_strchr='$d_strchr'
13623 d_strcoll='$d_strcoll'
13624 d_strctcpy='$d_strctcpy'
13625 d_strerrm='$d_strerrm'
13626 d_strerror='$d_strerror'
13627 d_strtod='$d_strtod'
13628 d_strtol='$d_strtol'
13629 d_strtoul='$d_strtoul'
13630 d_strtoull='$d_strtoull'
13631 d_strxfrm='$d_strxfrm'
13632 d_suidsafe='$d_suidsafe'
13633 d_symlink='$d_symlink'
13634 d_syscall='$d_syscall'
13635 d_sysconf='$d_sysconf'
13636 d_sysernlst='$d_sysernlst'
13637 d_syserrlst='$d_syserrlst'
13638 d_system='$d_system'
13639 d_tcgetpgrp='$d_tcgetpgrp'
13640 d_tcsetpgrp='$d_tcsetpgrp'
13641 d_telldir='$d_telldir'
13642 d_telldirproto='$d_telldirproto'
13645 d_truncate='$d_truncate'
13646 d_tzname='$d_tzname'
13649 d_union_semun='$d_union_semun'
13650 d_vendorlib='$d_vendorlib'
13652 d_void_closedir='$d_void_closedir'
13653 d_voidsig='$d_voidsig'
13654 d_voidtty='$d_voidtty'
13655 d_volatile='$d_volatile'
13656 d_vprintf='$d_vprintf'
13658 d_waitpid='$d_waitpid'
13659 d_wcstombs='$d_wcstombs'
13660 d_wctomb='$d_wctomb'
13661 d_writev='$d_writev'
13664 db_hashtype='$db_hashtype'
13665 db_prefixtype='$db_prefixtype'
13666 defvoidused='$defvoidused'
13667 direntrytype='$direntrytype'
13670 doublesize='$doublesize'
13672 dynamic_ext='$dynamic_ext'
13678 eunicefix='$eunicefix'
13681 extensions='$extensions'
13682 fflushNULL='$fflushNULL'
13683 fflushall='$fflushall'
13685 firstmakefile='$firstmakefile'
13687 fpostype='$fpostype'
13688 freetype='$freetype'
13690 full_csh='$full_csh'
13691 full_sed='$full_sed'
13692 gccversion='$gccversion'
13696 groupcat='$groupcat'
13697 groupstype='$groupstype'
13700 h_sysfile='$h_sysfile'
13704 i_arpainet='$i_arpainet'
13705 i_bsdioctl='$i_bsdioctl'
13708 i_dirent='$i_dirent'
13715 i_inttypes='$i_inttypes'
13716 i_limits='$i_limits'
13717 i_locale='$i_locale'
13718 i_machcthr='$i_machcthr'
13719 i_malloc='$i_malloc'
13721 i_memory='$i_memory'
13722 i_mntent='$i_mntent'
13725 i_neterrno='$i_neterrno'
13726 i_netinettcp='$i_netinettcp'
13729 i_pthread='$i_pthread'
13731 i_rpcsvcdbm='$i_rpcsvcdbm'
13734 i_shadow='$i_shadow'
13736 i_stdarg='$i_stdarg'
13737 i_stddef='$i_stddef'
13738 i_stdlib='$i_stdlib'
13739 i_string='$i_string'
13740 i_sysaccess='$i_sysaccess'
13741 i_sysdir='$i_sysdir'
13742 i_sysfile='$i_sysfile'
13743 i_sysfilio='$i_sysfilio'
13745 i_sysioctl='$i_sysioctl'
13746 i_sysmman='$i_sysmman'
13747 i_sysmount='$i_sysmount'
13748 i_sysndir='$i_sysndir'
13749 i_sysparam='$i_sysparam'
13750 i_sysresrc='$i_sysresrc'
13751 i_syssecrt='$i_syssecrt'
13752 i_sysselct='$i_sysselct'
13753 i_syssockio='$i_syssockio'
13754 i_sysstat='$i_sysstat'
13755 i_sysstatvfs='$i_sysstatvfs'
13756 i_systime='$i_systime'
13757 i_systimek='$i_systimek'
13758 i_systimes='$i_systimes'
13759 i_systypes='$i_systypes'
13760 i_sysuio='$i_sysuio'
13762 i_syswait='$i_syswait'
13763 i_termio='$i_termio'
13764 i_termios='$i_termios'
13766 i_unistd='$i_unistd'
13768 i_values='$i_values'
13769 i_varargs='$i_varargs'
13770 i_varhdr='$i_varhdr'
13772 ignore_versioned_solibs='$ignore_versioned_solibs'
13775 installarchlib='$installarchlib'
13776 installbin='$installbin'
13777 installman1dir='$installman1dir'
13778 installman3dir='$installman3dir'
13779 installprefix='$installprefix'
13780 installprefixexp='$installprefixexp'
13781 installprivlib='$installprivlib'
13782 installscript='$installscript'
13783 installsitearch='$installsitearch'
13784 installsitelib='$installsitelib'
13785 installstyle='$installstyle'
13786 installusrbinperl='$installusrbinperl'
13787 installvendorlib='$installvendorlib'
13789 known_extensions='$known_extensions'
13793 lddlflags='$lddlflags'
13795 ldlibpthname='$ldlibpthname'
13802 libswanted='$libswanted'
13808 locincpth='$locincpth'
13809 loclibpth='$loclibpth'
13810 longdblsize='$longdblsize'
13811 longlongsize='$longlongsize'
13812 longsize='$longsize'
13816 lseeksize='$lseeksize'
13817 lseektype='$lseektype'
13821 make_set_make='$make_set_make'
13822 mallocobj='$mallocobj'
13823 mallocsrc='$mallocsrc'
13824 malloctype='$malloctype'
13826 man1direxp='$man1direxp'
13829 man3direxp='$man3direxp'
13833 mips_type='$mips_type'
13835 mmaptype='$mmaptype'
13837 modetype='$modetype'
13839 multiarch='$multiarch'
13841 myarchname='$myarchname'
13842 mydomain='$mydomain'
13843 myhostname='$myhostname'
13846 netdb_hlen_type='$netdb_hlen_type'
13847 netdb_host_type='$netdb_host_type'
13848 netdb_name_type='$netdb_name_type'
13849 netdb_net_type='$netdb_net_type'
13852 nm_so_opt='$nm_so_opt'
13853 nonxs_ext='$nonxs_ext'
13855 o_nonblock='$o_nonblock'
13857 old_pthread_create_joinable='$old_pthread_create_joinable'
13858 optimize='$optimize'
13859 orderlib='$orderlib'
13865 patchlevel='$patchlevel'
13866 path_sep='$path_sep'
13868 perladmin='$perladmin'
13869 perlpath='$perlpath'
13871 phostname='$phostname'
13877 prefixexp='$prefixexp'
13879 privlibexp='$privlibexp'
13880 prototype='$prototype'
13882 randbits='$randbits'
13883 randfunc='$randfunc'
13884 randseedtype='$randseedtype'
13886 rd_nodata='$rd_nodata'
13890 sPRIEldbl='$sPRIEldbl'
13891 sPRIFldbl='$sPRIFldbl'
13892 sPRIGldbl='$sPRIGldbl'
13895 sPRIeldbl='$sPRIeldbl'
13896 sPRIfldbl='$sPRIfldbl'
13897 sPRIgldbl='$sPRIgldbl'
13902 sched_yield='$sched_yield'
13903 scriptdir='$scriptdir'
13904 scriptdirexp='$scriptdirexp'
13906 seedfunc='$seedfunc'
13907 selectminbits='$selectminbits'
13908 selecttype='$selecttype'
13909 sendmail='$sendmail'
13912 sharpbang='$sharpbang'
13913 shmattype='$shmattype'
13914 shortsize='$shortsize'
13917 sig_count='$sig_count'
13918 sig_name='$sig_name'
13919 sig_name_init='$sig_name_init'
13921 sig_num_init='$sig_num_init'
13922 signal_t='$signal_t'
13923 sitearch='$sitearch'
13924 sitearchexp='$sitearchexp'
13926 sitelibexp='$sitelibexp'
13927 siteprefix='$siteprefix'
13928 siteprefixexp='$siteprefixexp'
13929 sizetype='$sizetype'
13934 sockethdr='$sockethdr'
13935 socketlib='$socketlib'
13937 spackage='$spackage'
13938 spitshell='$spitshell'
13941 ssizetype='$ssizetype'
13942 startperl='$startperl'
13944 static_ext='$static_ext'
13946 stdio_base='$stdio_base'
13947 stdio_bufsiz='$stdio_bufsiz'
13948 stdio_cnt='$stdio_cnt'
13949 stdio_filbuf='$stdio_filbuf'
13950 stdio_ptr='$stdio_ptr'
13951 stdio_stream_array='$stdio_stream_array'
13954 subversion='$subversion'
13961 timeincl='$timeincl'
13962 timetype='$timetype'
13970 use64bits='$use64bits'
13972 uselongdouble='$uselongdouble'
13973 usemultiplicity='$usemultiplicity'
13974 usemymalloc='$usemymalloc'
13976 useopcode='$useopcode'
13977 useperlio='$useperlio'
13978 useposix='$useposix'
13980 useshrplib='$useshrplib'
13981 usesocks='$usesocks'
13982 usethreads='$usethreads'
13983 usevendorprefix='$usevendorprefix'
13984 usevfork='$usevfork'
13987 vendorlib='$vendorlib'
13988 vendorlibexp='$vendorlibexp'
13989 vendorprefix='$vendorprefix'
13990 vendorprefixexp='$vendorprefixexp'
13993 voidflags='$voidflags'
13999 : Add in command line options if available
14000 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14002 : add special variables
14003 $test -f $src/patchlevel.h && \
14004 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14005 echo "CONFIGDOTSH=true" >>config.sh
14007 : propagate old symbols
14008 if $test -f UU/config.sh; then
14009 <UU/config.sh sort | uniq >UU/oldconfig.sh
14010 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14011 sort | uniq -u >UU/oldsyms
14012 set X `cat UU/oldsyms`
14018 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14020 echo "# Variables propagated from previous config.sh file." >>config.sh
14021 for sym in `cat UU/oldsyms`; do
14022 echo " Propagating $hint variable "'$'"$sym..."
14023 eval 'tmp="$'"${sym}"'"'
14025 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14031 : Finish up by extracting the .SH files
14045 If you'd like to make any changes to the config.sh file before I begin
14046 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14049 rp="Press return or use a shell escape to edit config.sh:"
14054 *) : in case they cannot read
14055 sh 1>&4 -c "$ans";;
14060 : if this fails, just run all the .SH files by hand
14067 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14074 Now you need to generate make dependencies by running "$make depend".
14075 You might prefer to run it in background: "$make depend > makedepend.out &"
14076 It can take a while, so you might not want to run it right now.
14081 rp="Run $make depend now?"
14085 $make depend && echo "Now you must run a $make."
14088 echo "You must run '$make depend' then '$make'."
14091 elif test -f [Mm]akefile; then
14093 echo "Now you must run a $make."
14098 if $test -f Policy.sh; then
14101 If you compile $package on a different machine or from a different object
14102 directory, copy the Policy.sh file from this object directory to the
14103 new one before you run Configure -- this will help you with most of
14104 the policy defaults.
14108 if $test -f config.msg; then
14109 echo "Hmm. I also noted the following information while running:"
14111 $cat config.msg >&4
14114 $rm -f kit*isdone ark*isdone