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 Wed Oct 27 20:27:00 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
444 d_old_pthread_create_joinable=''
445 old_pthread_create_joinable=''
698 ignore_versioned_solibs=''
822 d_stdio_stream_array=''
823 stdio_stream_array=''
865 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
868 : We must find out about Eunice early
870 if test -f /etc/unixtovms; then
871 eunicefix=/etc/unixtovms
873 if test -f /etc/unixtovms.exe; then
874 eunicefix=/etc/unixtovms.exe
878 : Possible local include directories to search.
879 : Set locincpth to "" in a hint file to defeat local include searches.
880 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
881 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
883 : no include file wanted by default
886 : list of known cpp symbols, sorted alphabetically
887 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
888 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
889 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
890 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
891 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
892 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
893 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
894 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
895 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
896 al="$al VMS Xenix286"
897 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
898 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
899 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
900 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
901 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
902 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
903 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
904 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
905 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
906 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
907 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
908 al="$al __SVR4_2__ __UMAXV__"
909 al="$al ____386BSD____ __alpha __alpha__ __amiga"
910 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
911 al="$al __host_mips__"
912 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
913 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
914 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
915 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
916 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
917 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
918 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
919 al="$al __mc88100 __mc88100__ __mips __mips__"
920 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
921 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
922 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
923 al="$al _host_mips _mips _unix"
924 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
925 al="$al apollo ardent att386 att3b"
926 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
927 al="$al cadmus clipper concurrent convex cray ctix"
928 al="$al dmert encore gcos gcx gimpel gould"
929 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
930 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
931 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
932 al="$al i186 i286 i386 i486 i8086"
933 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
934 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
935 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
936 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
937 al="$al mc88000 mc88100 merlin mert mips mvs n16"
938 al="$al ncl_el ncl_mr"
939 al="$al news1500 news1700 news1800 news1900 news3700"
940 al="$al news700 news800 news900 ns16000 ns32000"
941 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
942 al="$al parisc pc532 pdp11 plexus posix pyr"
943 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
944 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
945 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
946 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
947 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
948 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
951 : Trailing extension. Override this in a hint file, if needed.
953 : Extra object files, if any, needed on this platform.
956 : change the next line if compiling for Xenix/286 on Xenix/386
957 xlibpth='/usr/lib/386 /lib/386'
959 : Possible local library directories to search.
960 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
961 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
963 : general looking path for locating libraries
964 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
965 glibpth="$glibpth /lib /usr/lib $xlibpth"
966 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
967 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
969 : Private path used by Configure to find libraries. Its value
970 : is prepended to libpth. This variable takes care of special
971 : machines, like the mips. Usually, it should be empty.
974 : default library list
976 : some systems want to use only the non-versioned libso:s
977 ignore_versioned_solibs=''
978 : full support for void wanted by default
981 : set useposix=false in your hint file to disable the POSIX extension.
983 : set useopcode=false in your hint file to disable the Opcode extension.
985 : set usemultiplicity on the Configure command line to enable multiplicity.
986 : set usesocks on the Configure command line to enable socks.
987 : set usethreads on the Configure command line to enable threads.
988 : List of libraries we want.
989 : If anyone needs -lnet, put it in a hint file.
990 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
991 libswanted="$libswanted dld ld sun m c cposix posix"
992 libswanted="$libswanted ndir dir crypt sec"
993 libswanted="$libswanted ucb bsd BSD PW x"
994 : We probably want to search /usr/shlib before most other libraries.
995 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
996 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
997 glibpth="/usr/shlib $glibpth"
998 : Do not use vfork unless overridden by a hint file.
1001 : Find the basic shell for Bourne shell scripts
1005 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1008 if test -f "$xxx"; then
1011 : Build up a list and do a single loop so we can 'break' out.
1012 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1013 for xxx in sh bash ksh pdksh ash; do
1015 try="$try ${p}/${xxx}"
1019 if test -f "$xxx"; then
1022 elif test -f "$xxx.exe"; then
1033 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1035 Usually it's in /bin/sh. How did you even get this far?
1036 Please contact me (Perl Maintainers) at perlbug@perl.com and
1037 we'll try to straighten this all out.
1043 : see if sh knows # comments
1044 if `$sh -c '#' >/dev/null 2>&1`; then
1048 test -f $xcat || xcat=/usr/bin/cat
1053 if test -s today; then
1056 echo "#! $xcat" > try
1060 if test -s today; then
1068 echo "Your $sh doesn't grok # comments--I will strip them later on."
1071 echo "exec grep -v '^[ ]*#'" >spitshell
1073 $eunicefix spitshell
1074 spitshell=`pwd`/spitshell
1076 echo "I presume that if # doesn't work, #! won't work either!"
1081 : figure out how to guarantee sh startup
1083 '') startsh=${sharpbang}${sh} ;;
1095 : echo "Yup, it does."
1097 echo "Hmm... '$startsh' does not guarantee sh startup..."
1098 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1103 : Save command line options in file UU/cmdline.opt for later use in
1104 : generating config.sh.
1105 cat > cmdline.opt <<EOSH
1106 # Configure command line arguments.
1113 cat >>cmdline.opt <<EOSH
1114 config_arg$argn='$arg'
1116 argn=`expr $argn + 1`
1119 : produce awk script to parse command line options
1120 cat >options.awk <<'EOF'
1122 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1124 len = length(optstr);
1125 for (i = 1; i <= len; i++) {
1126 c = substr(optstr, i, 1);
1127 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1138 if (substr(str, 1, 1) != "-") {
1139 printf("'%s'\n", str);
1143 for (i = 2; i <= len; i++) {
1144 c = substr(str, i, 1);
1146 printf("-%s\n", substr(str, i));
1152 printf("'%s'\n", substr(str, i + 1));
1165 : process the command line options
1166 set X `for arg in "$@"; do echo "X$arg"; done |
1167 sed -e s/X// | awk -f options.awk`
1172 : set up default values
1182 rm -f optdef.sh posthint.sh
1183 cat >optdef.sh <<EOS
1189 while test $# -gt 0; do
1191 -d) shift; fastread=yes;;
1192 -e) shift; alldone=cont;;
1196 if test -r "$1"; then
1199 echo "$me: cannot read config file $1." >&2
1204 -h) shift; error=true;;
1205 -r) shift; reuseval=true;;
1206 -s) shift; silent=true; realsilent=true;;
1207 -E) shift; alldone=exit;;
1208 -K) shift; knowitall=true;;
1209 -O) shift; override=true;;
1210 -S) shift; silent=true; extractsh=true;;
1215 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1216 echo "$me: ignoring -D $1" >&2
1219 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1220 *) echo "$1='define'" >> optdef.sh;;
1227 *=) echo "$1" >> optdef.sh;;
1229 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1230 echo "$me: ignoring -U $1" >&2
1232 *) echo "$1='undef'" >> optdef.sh;;
1243 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1247 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1248 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1254 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1255 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1256 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1257 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1258 *) xxx=`echo $yyy|sed 's!:.*!!'`
1259 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1265 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1267 echo "$yyy=''" >> posthint.sh ;;
1272 echo "$yyy='$zzz'" >> posthint.sh ;;
1274 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1276 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1281 echo "$yyy=$zzz" >> posthint.sh ;;
1282 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1285 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1288 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1296 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1297 [-U symbol] [-U symbol=] [-A command:symbol...]
1298 -d : use defaults for all answers.
1299 -e : go on without questioning past the production of config.sh.
1300 -f : specify an alternate default configuration file.
1301 -h : print this help message and exit (with an error status).
1302 -r : reuse C symbols value if possible (skips costly nm extraction).
1303 -s : silent mode, only echoes questions and essential information.
1304 -D : define symbol to have some value:
1305 -D symbol symbol gets the value 'define'
1306 -D symbol=value symbol gets the value 'value'
1307 -E : stop at the end of questions, after having produced config.sh.
1308 -K : do not use unless you know what you are doing.
1309 -O : let -D and -U override definitions from loaded configuration file.
1310 -S : perform variable substitutions on all .SH files (can mix with -f)
1311 -U : undefine symbol:
1312 -U symbol symbol gets the value 'undef'
1313 -U symbol= symbol gets completely empty
1314 -A : manipulate symbol after the platform specific hints have been applied:
1315 -A symbol=value append " "value to symbol
1316 -A append:symbol=value append value to symbol
1317 -A define:symbol=value define symbol to have value
1318 -A clear:symbol define symbol to be ''
1319 -A define:symbol define symbol to be 'define'
1320 -A eval:symbol=value define symbol to be eval of value
1321 -A prepend:symbol=value prepend value to symbol
1322 -A undef:symbol define symbol to be 'undef'
1323 -A undef:symbol= define symbol to be ''
1324 -V : print version number and exit (with a zero status).
1331 case "$fastread$alldone" in
1334 if test ! -t 0; then
1335 echo "Say 'sh Configure', not 'sh <Configure'"
1343 true) exec 1>/dev/null;;
1346 : run the defines and the undefines, if any, but leave the file out there...
1349 : create the posthint manipulation script and leave the file out there...
1354 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1355 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1356 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1357 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1358 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1361 : Some greps do not return status, grrr.
1362 echo "grimblepritz" >grimble
1363 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1365 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1371 : the following should work in any shell
1375 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1376 cat >contains <<'EOSS'
1377 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1382 : Find the path to the source tree
1385 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1388 *) src=`cd ../$src && pwd` ;;
1401 if test -f $rsrc/Configure && \
1402 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1404 : found it, so we are ok.
1407 for src in . .. ../.. ../../.. ../../../..; do
1408 if test -f ../$src/Configure && \
1409 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1420 Sorry, I can't seem to locate the source dir for $package. Please start
1421 Configure with an explicit path -- i.e. /some/path/Configure.
1429 echo "Sources for $package found in \"$src\"." >&4
1433 : script used to extract .SH files with variable substitutions
1434 cat >extract <<'EOS'
1436 echo "Doing variable substitutions on .SH files..."
1437 if test -f $src/MANIFEST; then
1438 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1440 echo "(Looking for .SH files under the source directory.)"
1441 set x `(cd $src; find . -name "*.SH" -print)`
1445 0) set x `(cd $src; echo *.SH)`; shift;;
1447 if test ! -f $src/$1; then
1453 while test $name; do
1454 if test ! -d "$name"; then
1455 create="$name $create";
1456 name=`echo $name | sed -e "s|^[^/]*$||"`;
1457 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1462 for file in $create; do
1471 dir=`expr X$file : 'X\(.*\)/'`
1472 file=`expr X$file : 'X.*/\(.*\)'`
1473 (cd $dir && . ./$file)
1483 dir=`expr X$file : 'X\(.*\)/'`
1484 file=`expr X$file : 'X.*/\(.*\)'`
1485 (set x $dir; shift; eval $mkdir_p)
1495 if test -f $src/config_h.SH; then
1496 if test ! -f config.h; then
1497 : oops, they left it out of MANIFEST, probably, so do it anyway.
1503 : extract files and exit if asked to do so
1504 case "$extractsh" in
1506 case "$realsilent" in
1510 case "$config_sh" in
1511 '') config_sh='config.sh';;
1514 echo "Fetching answers from $config_sh..."
1517 test "$override" && . ./optdef.sh
1526 : Eunice requires " " instead of "", can you believe it
1529 echo "Beginning of configuration questions for $package."
1531 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1533 : first determine how to suppress newline on echo command
1535 echo "Checking echo to see how to suppress newlines..."
1536 (echo "hi there\c" ; echo " ") >.echotmp
1537 if $contains c .echotmp >/dev/null 2>&1 ; then
1548 echo $n "The star should be here-->$c"
1552 : Now test for existence of everything in MANIFEST
1554 if test -f $rsrc/MANIFEST; then
1555 echo "First let's make sure your kit is complete. Checking..." >&4
1556 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1559 for filelist in x??; do
1560 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1562 if test -s missing; then
1566 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1568 You have the option of continuing the configuration process, despite the
1569 distinct possibility that your kit is damaged, by typing 'y'es. If you
1570 do, don't blame me if something goes wrong. I advise you to type 'n'o
1571 and contact the author (perlbug@perl.com).
1574 echo $n "Continue? [n] $c" >&4
1578 echo "Continuing..." >&4
1582 echo "ABORTING..." >&4
1587 echo "Looks good..."
1590 echo "There is no MANIFEST file. I hope your kit is complete !"
1595 : Find the appropriate value for a newline for tr
1596 if test -n "$DJGPP"; then
1599 if test X"$trnl" = X; then
1600 case "`echo foo|tr '\n' x 2>/dev/null`" in
1604 if test X"$trnl" = X; then
1605 case "`echo foo|tr '\012' x 2>/dev/null`" in
1606 foox) trnl='\012' ;;
1609 if test X"$trnl" = X; then
1612 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1618 : compute the number of columns on the terminal for proper question formatting
1623 : set up the echo used in my read
1624 myecho="case \"\$xxxm\" in
1625 '') echo $n \"\$rp $c\" >&4;;
1627 '') echo $n \"[\$xxxm] $c\";;
1629 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1631 echo $n \"[\$xxxm] $c\" >&4
1633 echo $n \"\$rp [\$xxxm] $c\" >&4
1639 : now set up to do reads with possible shell escape and default assignment
1645 case "\$fastread" in
1646 yes) case "\$dflt" in
1649 case "\$silent-\$rp" in
1654 *) case "\$silent" in
1655 true) case "\$rp" in
1660 while expr "X\$ans" : "X!" >/dev/null; do
1664 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1672 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1681 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1686 echo "(OK, I'll run with -d after this question.)" >&4
1689 echo "*** Sorry, \$1 not supported yet." >&4
1699 echo "*** Substitution done -- please confirm."
1701 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1706 echo "*** Error -- try again."
1713 case "\$ans\$xxxm\$nostick" in
1725 : create .config dir to save info across Configure sessions
1726 test -d ../.config || mkdir ../.config
1727 cat >../.config/README <<EOF
1728 This directory created by Configure to save information that should
1729 persist across sessions for $package.
1731 You may safely delete it if you wish.
1734 : general instructions
1737 user=`(logname) 2>/dev/null`
1739 '') user=`whoami 2>&1`;;
1741 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1744 rp='Would you like to see the instructions?'
1755 This installation shell script will examine your system and ask you questions
1756 to determine how the perl5 package should be installed. If you get
1757 stuck on a question, you may use a ! shell escape to start a subshell or
1758 execute a command. Many of the questions will have default answers in square
1759 brackets; typing carriage return will give you the default.
1761 On some of the questions which ask for file or directory names you are allowed
1762 to use the ~name construct to specify the login directory belonging to "name",
1763 even if you don't have a shell which knows about that. Questions where this is
1764 allowed will be marked "(~name ok)".
1768 dflt='Type carriage return to continue'
1772 The prompter used in this script allows you to use shell variables and
1773 backticks in your answers. You may use $1, $2, etc... to refer to the words
1774 in the default answer, as if the default line was a set of arguments given to a
1775 script shell. This means you may also use $* to repeat the whole default line,
1776 so you do not have to re-type everything to add something to the default.
1778 Everytime there is a substitution, you will have to confirm. If there is an
1779 error (e.g. an unmatched backtick), the default answer will remain unchanged
1780 and you will be prompted again.
1782 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1783 the questions and use the computed defaults (or the previous answers if there
1784 was already a config.sh file). Type 'Configure -h' for a list of options.
1785 You may also start interactively and then answer '& -d' at any prompt to turn
1786 on the non-interactive behaviour for the remainder of the execution.
1792 Much effort has been expended to ensure that this shell script will run on any
1793 Unix system. If despite that it blows up on yours, your best bet is to edit
1794 Configure and run it again. If you can't run Configure for some reason,
1795 you'll have to generate a config.sh file by hand. Whatever problems you
1796 have, let me (perlbug@perl.com) know how I blew it.
1798 This installation script affects things in two ways:
1800 1) it may do direct variable substitutions on some of the files included
1802 2) it builds a config.h file for inclusion in C programs. You may edit
1803 any of these files as the need arises after running this script.
1805 If you make a mistake on a question, there is no easy way to back up to it
1806 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1807 files. Configure will offer to let you do this before it runs the SH files.
1810 dflt='Type carriage return to continue'
1812 case "$firsttime" in
1813 true) echo $user >>../.config/instruct;;
1817 : find out where common programs are
1819 echo "Locating common programs..." >&4
1832 if test -d \$dir/\$thing; then
1838 for thisthing in \$dir/\$thing; do
1839 : just loop through to pick last item
1841 if test -f \$thisthing; then
1844 elif test -f \$dir/\$thing.exe; then
1845 if test -n "$DJGPP"; then
1846 echo \$dir/\$thing.exe
1848 : on Eunice apparently
1898 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1899 pth="$pth /lib /usr/lib"
1900 for file in $loclist; do
1904 if test -f "$xxx"; then
1907 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1908 xxx=`./loc $file $file $pth`
1911 '') xxx=`./loc $file $file $pth`;;
1912 *) xxx=`./loc $xxx $xxx $pth`;;
1918 echo $file is in $xxx.
1921 echo $file is in $xxx.
1924 echo "I don't know where '$file' is, and my life depends on it." >&4
1925 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1931 echo "Don't worry if any of the following aren't found..."
1933 for file in $trylist; do
1937 if test -f "$xxx"; then
1940 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1941 xxx=`./loc $file $file $pth`
1944 '') xxx=`./loc $file $file $pth`;;
1945 *) xxx=`./loc $xxx $xxx $pth`;;
1951 echo $file is in $xxx.
1954 echo $file is in $xxx.
1957 echo "I don't see $file out there, $say."
1964 echo "Substituting grep for egrep."
1970 echo "Substituting cp for ln."
1976 echo "Hopefully test is built into your sh."
1979 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1980 echo "Using the test built into your sh."
1988 echo "Hopefully echo is built into your sh."
1993 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1994 $echo $n "hi there$c" >foo1
1995 echo $n "hi there$c" >foo2
1996 if cmp foo1 foo2 >/dev/null 2>&1; then
1997 echo "They are compatible. In fact, they may be identical."
2004 They are not compatible! You are probably running ksh on a non-USG system.
2005 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2006 have echo built in and we may have to run some Bourne shell scripts. That
2007 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2010 $echo $n "The star should be here-->$c"
2017 : determine whether symbolic links are supported
2020 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2021 echo "Symbolic links are supported." >&4
2024 echo "Symbolic links are NOT supported." >&4
2029 : see whether [:lower:] and [:upper:] are supported character classes
2031 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2033 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2037 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2038 # (0xc9 and 0xd1), therefore that is a nice testing point.
2039 if test "X$up" = X -o "X$low" = X; then
2040 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2046 if test "X$up" = X -o "X$low" = X; then
2047 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2053 if test "X$up" = X -o "X$low" = X; then
2054 case "`echo IJ | od -x 2>/dev/null`" in
2056 echo "Hey, this might be EBCDIC." >&4
2057 if test "X$up" = X -o "X$low" = X; then
2058 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2059 ij) up='[A-IJ-RS-Z]'
2064 if test "X$up" = X -o "X$low" = X; then
2065 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2075 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2077 echo "Using $up and $low to convert case." >&4
2080 echo "I don't know how to translate letters from upper to lower case." >&4
2081 echo "Your tr is not acting any way I know of." >&4
2085 : set up the translation script tr, must be called with ./tr of course
2089 '[A-Z][a-z]') exec $tr '$up' '$low';;
2090 '[a-z][A-Z]') exec $tr '$low' '$up';;
2097 : Try to determine whether config.sh was made on this system
2098 case "$config_sh" in
2100 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2101 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2102 # because the A-Z/a-z are not consecutive.
2103 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2104 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2105 newmyuname="$myuname"
2107 case "$knowitall" in
2109 if test -f ../config.sh; then
2110 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2111 eval "`grep myuname= ../config.sh`"
2113 if test "X$myuname" = "X$newmyuname"; then
2121 : Get old answers from old config file if Configure was run on the
2122 : same system, otherwise use the hints.
2125 if test -f config.sh; then
2127 rp="I see a config.sh file. Shall I use it to set the defaults?"
2130 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2131 *) echo "Fetching default answers from your old config.sh file..." >&4
2139 : Older versions did not always set $sh. Catch re-use of such
2148 if test ! -f config.sh; then
2151 First time through, eh? I have some defaults handy for some systems
2152 that need some extra help getting the Configure answers right:
2155 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2157 : Half the following guesses are probably wrong... If you have better
2158 : tests or hints, please send them to perlbug@perl.com
2159 : The metaconfig authors would also appreciate a copy...
2160 $test -f /irix && osname=irix
2161 $test -f /xenix && osname=sco_xenix
2162 $test -f /dynix && osname=dynix
2163 $test -f /dnix && osname=dnix
2164 $test -f /lynx.os && osname=lynxos
2165 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2166 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2167 $test -f /bin/mips && /bin/mips && osname=mips
2168 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2169 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2170 $test -d /usr/apollo/bin && osname=apollo
2171 $test -f /etc/saf/_sactab && osname=svr4
2172 $test -d /usr/include/minix && osname=minix
2173 if $test -d /MachTen -o -d /MachTen_Folder; then
2175 if $test -x /sbin/version; then
2176 osvers=`/sbin/version | $awk '{print $2}' |
2177 $sed -e 's/[A-Za-z]$//'`
2178 elif $test -x /usr/etc/version; then
2179 osvers=`/usr/etc/version | $awk '{print $2}' |
2180 $sed -e 's/[A-Za-z]$//'`
2185 $test -f /sys/posix.dll &&
2186 $test -f /usr/bin/what &&
2187 set X `/usr/bin/what /sys/posix.dll` &&
2188 $test "$3" = UWIN &&
2191 if $test -f $uname; then
2199 umips) osname=umips ;;
2202 [23]100) osname=mips ;;
2203 next*) osname=next ;;
2205 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2206 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2209 elif $test -f /etc/kconfig; then
2211 if test "$lns" = "$ln -s"; then
2213 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2215 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2222 if test -n "$DJGPP"; then
2231 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2233 'not found') osvers="$4"."$3" ;;
2234 '<3240'|'<>3240') osvers=3.2.0 ;;
2235 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2236 '=3250'|'>3250') osvers=3.2.5 ;;
2240 *dc.osx) osname=dcosx
2246 domainos) osname=apollo
2252 dynixptx*) osname=dynixptx
2253 osvers=`echo "$4"|sed 's/^v//'`
2255 freebsd) osname=freebsd
2257 genix) osname=genix ;;
2259 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2275 netbsd*) osname=netbsd
2278 news-os) osvers="$3"
2280 4*) osname=newsos4 ;;
2284 bsd386) osname=bsd386
2287 POSIX-BC | posix-bc ) osname=posix-bc
2290 powerux | power_ux | powermax_os | powermaxos | \
2291 powerunix | power_unix) osname=powerux
2294 next*) osname=next ;;
2295 solaris) osname=solaris
2297 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2304 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2308 titanos) osname=titanos
2317 ultrix) osname=ultrix
2320 osf1|mls+) case "$5" in
2323 osvers=`echo "$3" | sed 's/^[xvt]//'`
2325 hp*) osname=hp_osf1 ;;
2326 mips) osname=mips_osf1 ;;
2329 unixware) osname=svr5
2338 $2) case "$osname" in
2342 : svr4.x or possibly later
2352 if test -f /stand/boot ; then
2353 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2354 if test -n "$INITPROG" -a -f "$INITPROG"; then
2355 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2356 if test -n "$isesix"; then
2364 *) if test -f /etc/systemid; then
2366 set `echo $3 | $sed 's/\./ /g'` $4
2367 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2369 elif $test -f $src/hints/sco_$1_$2.sh; then
2371 elif $test -f $src/hints/sco_$1.sh; then
2376 '') : Still unknown. Probably a generic Sys V.
2385 *) case "$osname" in
2386 '') : Still unknown. Probably a generic BSD.
2394 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2395 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2396 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2399 $rm -f UU/kernel.what
2400 elif test -d c:/.; then
2407 : Now look for a hint file osname_osvers, unless one has been
2408 : specified already.
2411 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2412 : Also try without trailing minor version numbers.
2413 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2414 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2415 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2416 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2419 *) case "$osvers" in
2422 *) if $test -f $src/hints/$file.sh ; then
2424 elif $test -f $src/hints/$xfile.sh ; then
2426 elif $test -f $src/hints/$xxfile.sh ; then
2428 elif $test -f $src/hints/$xxxfile.sh ; then
2430 elif $test -f $src/hints/$xxxxfile.sh ; then
2432 elif $test -f "$src/hints/${osname}.sh" ; then
2441 if $test -f Policy.sh ; then
2444 none) dflt="Policy" ;;
2445 *) dflt="Policy $dflt" ;;
2450 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2454 if $test -f Policy.sh ; then
2457 There's also a Policy hint file available, which should make the
2458 site-specific (policy) questions easier to answer.
2465 You may give one or more space-separated answers, or "none" if appropriate.
2466 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2467 is a good thing. DO NOT give a wrong version or a wrong OS.
2471 rp="Which of these apply, if any?"
2474 for file in $tans; do
2475 if $test X$file = XPolicy -a -f Policy.sh; then
2477 $cat Policy.sh >> UU/config.sh
2478 elif $test -f $src/hints/$file.sh; then
2479 . $src/hints/$file.sh
2480 $cat $src/hints/$file.sh >> UU/config.sh
2481 elif $test X$tans = X -o X$tans = Xnone ; then
2484 : Give one chance to correct a possible typo.
2485 echo "$file.sh does not exist"
2487 rp="hint to use instead?"
2489 for file in $ans; do
2490 if $test -f "$src/hints/$file.sh"; then
2491 . $src/hints/$file.sh
2492 $cat $src/hints/$file.sh >> UU/config.sh
2493 elif $test X$ans = X -o X$ans = Xnone ; then
2496 echo "$file.sh does not exist -- ignored."
2503 : Remember our hint file for later.
2504 if $test -f "$src/hints/$file.sh" ; then
2514 echo "Fetching default answers from $config_sh..." >&4
2518 cp $config_sh config.sh 2>/dev/null
2528 test "$override" && . ./optdef.sh
2529 myuname="$newmyuname"
2531 : Restore computed paths
2532 for file in $loclist $trylist; do
2533 eval $file="\$_$file"
2538 Configure uses the operating system name and version to set some defaults.
2539 The default value is probably right if the name rings a bell. Otherwise,
2540 since spelling matters for me, either accept the default or answer "none"
2547 ''|' '|none) dflt=none ;;
2548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2551 *) dflt="$osname" ;;
2553 rp="Operating system name?"
2557 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2563 ''|' '|none) dflt=none ;;
2564 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2565 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2567 ''|' ') dflt=none ;;
2572 *) dflt="$osvers" ;;
2574 rp="Operating system version?"
2584 : who configured the system
2585 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2586 cf_by=`(logname) 2>/dev/null`
2589 cf_by=`(whoami) 2>/dev/null`
2591 "") cf_by=unknown ;;
2595 : set up the script used to warn in case of inconsistency
2602 echo "*** WHOA THERE!!! ***" >&4
2603 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2604 rp=" Keep the $hint value?"
2607 y) td=$was; tu=$was;;
2611 : function used to set $1 to $val
2612 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2614 $define$undef) . ./whoa; eval "$var=\$td";;
2615 $undef$define) . ./whoa; eval "$var=\$tu";;
2616 *) eval "$var=$val";;
2621 Perl can be built to take advantage of threads, on some systems.
2622 To do so, Configure must be run with -Dusethreads.
2624 Note that threading is a highly experimental feature, and
2625 some known race conditions still remain. If you choose to try
2626 it, be very sure to not actually deploy it for production
2627 purposes. README.threads has more details, and is required
2628 reading if you enable threads.
2630 case "$usethreads" in
2631 $define|true|[yY]*) dflt='y';;
2634 rp='Build a threading Perl?'
2637 y|Y) val="$define" ;;
2643 case "$d_oldpthreads" in
2644 '') : Configure tests would be welcome here. For now, assume undef.
2646 *) val="$d_oldpthreads" ;;
2652 case "$usethreads" in
2653 "$define"|true|[yY]*)
2654 : Look for a hint-file generated 'call-back-unit'. If the
2655 : user has specified that a threading perl is to be built,
2656 : we may need to set or change some other defaults.
2657 if $test -f usethreads.cbu; then
2658 echo "Your platform has some specific hints for threaded builds, using them..."
2662 (Your platform doesn't have any specific hints for threaded builds.
2663 Assuming POSIX threads, then.)
2671 Perl can be built so that multiple Perl interpreters can coexist
2672 within the same Perl executable. To do so, Configure must be run with
2675 Normally you do not need this and you should answer no.
2678 case "$usemultiplicity" in
2679 $define|true|[yY]*) dflt='y';;
2682 rp='Build Perl for multiplicity?'
2685 y|Y) val="$define" ;;
2691 : determine where manual pages are on this system
2695 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2696 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2697 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2698 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2699 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2700 sysman=`./loc . /usr/man/man1 $syspath`
2703 if $test -d "$sysman"; then
2704 echo "System manual is in $sysman." >&4
2706 echo "Could not find manual pages in source form." >&4
2709 : see what memory models we can support
2712 $cat >pdp11.c <<'EOP'
2721 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2722 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2723 dflt='unsplit split'
2725 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2728 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2733 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2736 if $test -d /lib/large || $test -d /usr/lib/large; then
2739 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2748 Some systems have different model sizes. On most systems they are called
2749 small, medium, large, and huge. On the PDP11 they are called unsplit and
2750 split. If your system doesn't support different memory models, say "none".
2751 If you wish to force everything to one memory model, say "none" here and
2752 put the appropriate flags later when it asks you for other cc and ld flags.
2753 Venix systems may wish to put "none" and let the compiler figure things out.
2754 (In the following question multiple model names should be space separated.)
2756 The default for most systems is "none".
2759 rp="Which memory models are supported?"
2774 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2775 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2782 rp="What flag indicates separate I and D space?"
2790 *large*|*small*|*medium*|*huge*)
2797 rp="What flag indicates large model?"
2807 *huge*) case "$huge" in
2811 rp="What flag indicates huge model?"
2821 *medium*) case "$medium" in
2825 rp="What flag indicates medium model?"
2832 *) medium="$large";;
2835 *small*) case "$small" in
2839 rp="What flag indicates small model?"
2850 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2853 $rm -f pdp11.* pdp11
2855 : make some quick guesses about what we are up against
2857 $echo $n "Hmm... $c"
2867 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2868 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2870 echo "Looks kind of like an OSF/1 system, but we'll see..."
2872 elif test `echo abc | tr a-z A-Z` = Abc ; then
2873 xxx=`./loc addbib blurfl $pth`
2874 if $test -f $xxx; then
2875 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2879 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2880 echo "Looks kind of like an extended USG system, but we'll see..."
2882 echo "Looks kind of like a USG system, but we'll see..."
2886 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2887 echo "Looks kind of like a BSD system, but we'll see..."
2891 echo "Looks kind of like a Version 7 system, but we'll see..."
2894 case "$eunicefix" in
2897 There is, however, a strange, musty smell in the air that reminds me of
2898 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2902 : it so happens the Eunice I know will not run shell scripts in Unix format
2906 echo "Congratulations. You aren't running Eunice."
2910 : Detect OS2. The p_ variable is set above in the Head.U unit.
2915 I have the feeling something is not exactly right, however...don't tell me...
2916 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2921 if test -f /xenix; then
2922 echo "Actually, this looks more like a XENIX system..."
2927 echo "It's not Xenix..."
2932 if test -f /venix; then
2933 echo "Actually, this looks more like a VENIX system..."
2940 echo "Nor is it Venix..."
2943 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2944 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2947 : see if we need a special compiler
2955 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2956 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2970 On some older systems the default C compiler will not resolve multiple global
2971 references that happen to have the same name. On some such systems the "Mcc"
2972 command may be used to force these to be resolved. On other systems a "cc -M"
2973 command is required. (Note that the -M flag on other systems indicates a
2974 memory model to use!) If you have the Gnu C compiler, you might wish to use
2980 rp="Use which C compiler?"
2988 rp="Use which C compiler?"
2992 : Look for a hint-file generated 'call-back-unit'. Now that the
2993 : user has specified the compiler, we may need to set or change some
2995 if $test -f cc.cbu; then
2999 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3000 $cat >gccvers.c <<EOM
3005 printf("%s\n", __VERSION__);
3007 printf("%s\n", "1");
3013 if $cc -o gccvers gccvers.c; then
3014 gccversion=`./gccvers`
3015 case "$gccversion" in
3016 '') echo "You are not using GNU cc." ;;
3017 *) echo "You are using GNU cc $gccversion." ;;
3021 echo "*** WHOA THERE!!! ***" >&4
3022 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3023 case "$knowitall" in
3025 echo " You'd better start hunting for one and let me know about it." >&4
3031 case "$gccversion" in
3032 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3036 case "$usemorebits" in
3037 "$define"|true|[yY]*)
3039 uselongdouble="$define"
3040 usemorebits="$define"
3042 *) usemorebits="$undef"
3049 Perl can be built to understand large files (files larger than 2 gigabytes)
3050 on some systems. To do so, Configure must be run with -Duselargefiles.
3052 If this doesn't make any sense to you, just accept the default.
3054 case "$uselargefiles" in
3055 "$define"|true|[yY]*) dflt='y' ;;
3058 rp='Try to understand large files?'
3061 y|Y) val="$define" ;;
3066 case "$uselargefiles" in
3067 "$define") use64bits="$define" ;;
3072 Perl can be built to take advantage of explicit 64-bit interfaces,
3073 on some systems. To do so, Configure must be run with -Duse64bits.
3075 If this doesn't make any sense to you, just accept the default.
3077 case "$use64bits" in
3078 $define|true|[yY]*) dflt='y';;
3081 rp='Try to use explicit 64-bit interfaces, if available?'
3094 case "$archname64" in
3095 '') archname64='' ;; # not a typo
3098 case "$use64bits" in
3099 "$define"|true|[yY]*)
3100 : Look for a hint-file generated 'call-back-unit'. If the
3101 : user has specified that a 64 bit perl is to be built,
3102 : we may need to set or change some other defaults.
3103 if $test -f use64bits.cbu; then
3104 echo "Your platform has some specific hints for 64-bit builds, using them..."
3108 (Your platform doesn't have any specific hints for 64-bit builds.
3109 This is probably okay, especially if your system is a true 64-bit system.)
3111 case "$gccversion" in
3114 But since you seem to be using gcc,
3115 I will now add -DUSE_LONG_LONG to the compilation flags.
3117 ccflags="$ccflags -DUSE_LONG_LONG"
3124 : determine the architecture name
3126 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3127 tarch=`arch`"-$osname"
3128 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3129 if uname -m > tmparch 2>&1 ; then
3130 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3131 -e 's/$/'"-$osname/" tmparch`
3139 case "$myarchname" in
3142 echo "(Your architecture name used to be $myarchname.)"
3149 *) dflt="$archname";;
3151 rp='What is your architecture name'
3154 case "$usethreads" in
3156 echo "Threads selected." >&4
3158 *-thread*) echo "...and architecture name already has -thread." >&4
3160 *) archname="$archname-thread"
3161 echo "...setting architecture name to $archname." >&4
3166 case "$usemultiplicity" in
3168 echo "Multiplicity selected." >&4
3170 *-multi*) echo "...and architecture name already has -multi." >&4
3172 *) archname="$archname-multi"
3173 echo "...setting architecture name to $archname." >&4
3178 case "$use64bits" in
3180 echo "Explicit 64-bitness selected." >&4
3181 case "$archname64" in
3186 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3188 *) archname="$archname-$archname64"
3189 echo "...setting architecture name to $archname." >&4
3196 : decide how portable to be. Allow command line overrides.
3197 case "$d_portable" in
3199 *) d_portable="$define" ;;
3202 : set up shell script to do ~ expansion
3208 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3211 if $test -f /bin/csh; then
3212 /bin/csh -f -c "glob \$1"
3217 name=\`$expr x\$1 : '..\([^/]*\)'\`
3218 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3219 if $test ! -d "\$dir"; then
3221 echo "\$me: can't locate home directory for: \$name" >&2
3226 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3242 : now set up to get a file name
3246 cat <<'EOSC' >>getfile
3262 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3263 fn=`echo $fn | sed 's/(.*)//'`
3269 loc_file=`expr $fn : '.*:\(.*\)'`
3270 fn=`expr $fn : '\(.*\):.*'`
3278 */*) fullpath=true;;
3287 *e*) exp_file=true;;
3290 *p*) nopath_ok=true;;
3295 *d*) type='Directory';;
3296 *l*) type='Locate';;
3301 Locate) what='File';;
3306 case "$d_portable" in
3314 while test "$type"; do
3319 true) rp="$rp (~name ok)";;
3322 if test -f UU/getfile.ok && \
3323 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3342 value=`UU/filexp $ans`
3345 if test "$ans" != "$value"; then
3346 echo "(That expands to $value on this system.)"
3360 /*) value="$ansexp" ;;
3365 echo "I shall only accept a full path name, as in /bin/ls." >&4
3366 echo "Use a ! shell escape if you wish to check pathnames." >&4
3369 echo "Please give a full path name, starting with slash." >&4
3372 echo "Note that using ~name is ok provided it expands well." >&4
3385 for fp in $gfpth; do
3386 if test "X$fp" = X.; then
3391 if test -f "$pf"; then
3393 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3395 echo "($value is not a plain file, but that's ok.)"
3398 if test X"$type" = X; then
3405 for fp in $gfpth; do
3406 if test "X$fp" = X.; then
3411 if test -d "$pf"; then
3419 if test -d "$ansexp"; then
3420 echo "(Looking for $loc_file in directory $value.)"
3421 value="$value/$loc_file"
3422 ansexp="$ansexp/$loc_file"
3424 if test -f "$ansexp"; then
3427 case "$nopath_ok" in
3428 true) case "$value" in
3430 *) echo "Assuming $value will be in people's path."
3446 if test "$fastread" = yes; then
3451 rp="$what $value doesn't exist. Use that name anyway?"
3470 test "X$gfpthkeep" != Xy && gfpth=""
3473 : determine root of directory hierarchy where package will be installed.
3476 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3484 By default, $package will be installed in $dflt/bin, manual pages
3485 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3486 installation directories. Typically this is something like /usr/local.
3487 If you wish to have binaries under /usr/bin but other parts of the
3488 installation under /usr/local, that's ok: you will be prompted
3489 separately for each of the installation directories, the prefix being
3490 only used to set the defaults.
3494 rp='Installation prefix to use?'
3502 *) oldprefix="$prefix";;
3512 $define|true) afs=true ;;
3513 $undef|false) afs=false ;;
3514 *) if test -d /afs; then
3522 echo "AFS may be running... I'll be extra cautious then..." >&4
3524 echo "AFS does not seem to be running..." >&4
3527 : determine installation prefix for where package is to be installed.
3531 Since you are running AFS, I need to distinguish the directory in which
3532 files will reside from the directory in which they are installed (and from
3533 which they are presumably copied to the former directory by occult means).
3536 case "$installprefix" in
3537 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3538 *) dflt="$installprefix";;
3543 In some special cases, particularly when building $package for distribution,
3544 it is convenient to distinguish between the directory in which files should
3545 be installed from the directory ($prefix) in which they
3546 will eventually reside. For most users, these two directories are the same.
3549 case "$installprefix" in
3551 *) dflt=$installprefix;;
3555 rp='What installation prefix should I use for installing files?'
3557 installprefix="$ans"
3558 installprefixexp="$ansexp"
3560 : set the prefixit variable, to compute a suitable default value
3561 prefixit='case "$3" in
3563 case "$oldprefix" in
3564 "") eval "$1=\"\$$2\"";;
3571 ""|" ") eval "$1=\"\$$2\"";;
3577 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3579 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3580 /*-$oldprefix/*|\~*-$oldprefix/*)
3581 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3582 *) eval "$1=\"\$$2\"";;
3586 : set the base revision
3589 : get the patchlevel
3591 echo "Getting the current patchlevel..." >&4
3592 if $test -r $rsrc/patchlevel.h;then
3593 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3594 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3595 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3601 $echo $n "(You have $package" $c
3604 *) $echo $n " $baserev" $c ;;
3606 $echo $n " patchlevel $patchlevel" $c
3607 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3610 if test 0 -eq "$subversion"; then
3611 version=`LC_ALL=C; export LC_ALL; \
3612 echo $baserev $patchlevel | \
3613 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3615 version=`LC_ALL=C; export LC_ALL; \
3616 echo $baserev $patchlevel $subversion | \
3617 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3620 : determine installation style
3621 : For now, try to deduce it from prefix unless it is already set.
3622 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3623 case "$installstyle" in
3624 '') case "$prefix" in
3625 *perl*) dflt='lib';;
3626 *) dflt='lib/perl5' ;;
3629 *) dflt='lib/perl5' ;;
3631 : Probably not worth prompting for this since we prompt for all
3632 : the directories individually, and the prompt would be too long and
3636 : determine where private library files go
3637 : Usual default is /usr/local/lib/perl5/$version.
3638 : Also allow things like /opt/perl/lib/$version, since
3639 : /opt/perl/lib/perl5... would be redundant.
3640 : The default "style" setting is made in installstyle.U
3641 case "$installstyle" in
3642 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3643 *) set dflt privlib lib/$version ;;
3648 There are some auxiliary files for $package that need to be put into a
3649 private library directory that is accessible by everyone.
3653 rp='Pathname where the private library files will reside?'
3656 privlibexp="$ansexp"
3657 : Change installation prefix, if necessary.
3658 if $test X"$prefix" != X"$installprefix"; then
3659 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3661 installprivlib="$privlibexp"
3664 : set the prefixup variable, to restore leading tilda escape
3665 prefixup='case "$prefixexp" in
3667 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3670 : determine where public architecture dependent libraries go
3673 : privlib default is /usr/local/lib/$package/$version
3674 : archlib default is /usr/local/lib/$package/$version/$archname
3675 : privlib may have an optional trailing /share.
3676 tdflt=`echo $privlib | $sed 's,/share$,,'`
3677 tdflt=$tdflt/$archname
3686 $spackage contains architecture-dependent library files. If you are
3687 sharing libraries in a heterogeneous environment, you might store
3688 these files in a separate location. Otherwise, you can just include
3689 them with the rest of the public library files.
3693 rp='Where do you want to put the public architecture-dependent libraries?'
3696 archlibexp="$ansexp"
3697 if $test X"$archlib" = X"$privlib"; then
3702 : Change installation prefix, if necessary.
3703 if $test X"$prefix" != X"$installprefix"; then
3704 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3706 installarchlib="$archlibexp"
3710 : Binary compatibility with 5.005 is not possible for builds
3711 : with advanced features
3712 case "$usethreads$usemultiplicity" in
3714 bincompat5005="$undef"
3715 d_bincompat5005="$undef"
3719 Perl 5.006 can be compiled for binary compatibility with 5.005.
3720 If you decide to do so, you will be able to continue using most
3721 of the extensions that were compiled for Perl 5.005.
3724 case "$bincompat5005$d_bincompat5005" in
3725 *"$undef"*) dflt=n ;;
3728 rp='Binary compatibility with Perl 5.005?'
3731 y*) val="$define" ;;
3736 case "$d_bincompat5005" in
3738 bincompat5005="$define"
3740 *) bincompat5005="$undef"
3741 d_bincompat5005="$undef"
3748 : see if setuid scripts can be secure
3751 Some kernels have a bug that prevents setuid #! scripts from being
3752 secure. Some sites have disabled setuid #! scripts because of this.
3754 First let's decide if your kernel supports secure setuid #! scripts.
3755 (If setuid #! scripts would be secure but have been disabled anyway,
3756 don't say that they are secure if asked.)
3761 if $test -d /dev/fd; then
3762 echo "#!$ls" >reflect
3763 chmod +x,u+s reflect
3764 ./reflect >flect 2>&1
3765 if $contains "/dev/fd" flect >/dev/null; then
3766 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3770 If you are not sure if they are secure, I can check but I'll need a
3771 username and password different from the one you are using right now.
3772 If you don't have such a username or don't want me to test, simply
3776 rp='Other username to test security of setuid scripts with?'
3781 case "$d_suidsafe" in
3782 '') echo "I'll assume setuid scripts are *not* secure." >&4
3785 echo "Well, the $hint value is *not* secure." >&4
3787 *) echo "Well, the $hint value *is* secure." >&4
3792 $rm -f reflect flect
3793 echo "#!$ls" >reflect
3794 chmod +x,u+s reflect
3797 echo '"su" will (probably) prompt you for '"$ans's password."
3798 su $ans -c './reflect >flect'
3799 if $contains "/dev/fd" flect >/dev/null; then
3800 echo "Okay, it looks like setuid scripts are secure." >&4
3803 echo "I don't think setuid scripts are secure." >&4
3808 rp='Does your kernel have *secure* setuid scripts?'
3811 [yY]*) val="$define";;
3816 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3817 echo "(That's for file descriptors, not floppy disks.)"
3823 $rm -f reflect flect
3825 : now see if they want to do setuid emulation
3828 case "$d_suidsafe" in
3831 echo "No need to emulate SUID scripts since they are secure here." >& 4
3835 Some systems have disabled setuid scripts, especially systems where
3836 setuid scripts cannot be secure. On systems where setuid scripts have
3837 been disabled, the setuid/setgid bits on scripts are currently
3838 useless. It is possible for $package to detect those bits and emulate
3839 setuid/setgid in a secure fashion. This emulation will only work if
3840 setuid scripts have been disabled in your kernel.
3844 "$define") dflt=y ;;
3847 rp="Do you want to do setuid/setgid emulation?"
3850 [yY]*) val="$define";;
3858 : What should the include directory be ?
3860 $echo $n "Hmm... $c"
3864 if $test -f /bin/mips && /bin/mips; then
3865 echo "Looks like a MIPS system..."
3866 $cat >usr.c <<'EOCP'
3867 #ifdef SYSTYPE_BSD43
3871 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3872 dflt='/bsd43/usr/include'
3876 mips_type='System V'
3878 $rm -f usr.c usr.out
3879 echo "and you're compiling with the $mips_type compiler and libraries."
3883 echo "Doesn't look like a MIPS system."
3893 case "$xxx_prompt" in
3896 rp='Where are the include files you want to use?'
3904 : see how we invoke the C preprocessor
3906 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3907 cat <<'EOT' >testcpp.c
3913 if test ! -f cppstdin; then
3914 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3915 # AIX cc -E doesn't show the absolute headerfile
3916 # locations but we'll cheat by using the -M flag.
3917 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
3919 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3922 echo "Keeping your $hint cppstdin wrapper."
3925 wrapper=`pwd`/cppstdin
3929 if $test "X$cppstdin" != "X" && \
3930 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3931 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3933 echo "You used to use $cppstdin $cppminus so we'll use that again."
3935 '') echo "But let's see if we can live without a wrapper..." ;;
3937 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3938 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3940 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3943 echo "(However, $cpprun $cpplast does not work, let's see...)"
3951 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3958 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3959 $cc -E <testcpp.c >testcpp.out 2>&1; \
3960 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3961 echo "Yup, it does."
3964 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3965 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3966 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3967 echo "Yup, it does."
3970 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3971 $cc -P <testcpp.c >testcpp.out 2>&1; \
3972 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3973 echo "Yipee, that works!"
3976 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3977 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3978 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3979 echo "At long last!"
3982 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3983 $cpp <testcpp.c >testcpp.out 2>&1; \
3984 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3988 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3989 $cpp - <testcpp.c >testcpp.out 2>&1; \
3990 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3991 echo "Hooray, it works! I was beginning to wonder."
3994 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3995 $wrapper <testcpp.c >testcpp.out 2>&1; \
3996 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4002 rp="No dice. I can't find a C preprocessor. Name one:"
4006 $x_cpp <testcpp.c >testcpp.out 2>&1
4007 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4008 echo "OK, that will do." >&4
4010 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4025 echo "Perhaps can we force $cc -E using a wrapper..."
4026 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4027 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4033 echo "Nope, we'll have to live without it..."
4047 "$wrapper"|'cppstdin') ;;
4048 *) $rm -f $wrapper;;
4050 $rm -f testcpp.c testcpp.out
4052 : Set private lib path
4055 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4060 '') dlist="$loclibpth $plibpth $glibpth";;
4061 *) dlist="$libpth";;
4064 : Now check and see which directories actually exist, avoiding duplicates
4068 if $test -d $xxx; then
4071 *) libpth="$libpth $xxx";;
4077 Some systems have incompatible or broken versions of libraries. Among
4078 the directories listed in the question below, please remove any you
4079 know not to be holding relevant libraries, and add any that are needed.
4080 Say "none" for none.
4091 rp="Directories to use for library searches?"
4098 : compute shared library extension
4101 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4111 On some systems, shared libraries may be available. Answer 'none' if
4112 you want to suppress searching of shared libraries for the remaining
4113 of this configuration.
4116 rp='What is the file extension used for shared libraries?'
4120 : Define several unixisms.
4121 : Hints files or command line option can be used to override them.
4122 : The convoluted testing is in case hints files set either the old
4125 '') case "$exe_ext" in
4127 *) _exe="$exe_ext" ;;
4132 '') case "$lib_ext" in
4139 '') case "$obj_ext" in
4146 '') case "$path_sep" in
4157 : Which makefile gets called first. This is used by make depend.
4158 case "$firstmakefile" in
4159 '') firstmakefile='makefile';;
4164 Perl can be built to use the SOCKS proxy protocol library. To do so,
4165 Configure must be run with -Dusesocks.
4167 Normally you do not need this and you should answer no.
4171 $define|true|[yY]*) dflt='y';;
4174 rp='Build Perl for SOCKS?'
4177 y|Y) val="$define" ;;
4183 : Looking for optional libraries
4185 echo "Checking for optional libraries..." >&4
4190 case "$libswanted" in
4191 '') libswanted='c_s';;
4195 libswanted="$libswanted socks5 socks5_sh"
4198 for thislib in $libswanted; do
4200 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4201 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4202 echo "Found -l$thislib (shared)."
4205 *) dflt="$dflt -l$thislib";;
4207 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4208 echo "Found -l$thislib (shared)."
4211 *) dflt="$dflt -l$thislib";;
4213 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4214 echo "Found -l$thislib."
4217 *) dflt="$dflt -l$thislib";;
4219 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4220 echo "Found -l$thislib."
4223 *) dflt="$dflt -l$thislib";;
4225 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4226 echo "Found -l${thislib}_s."
4229 *) dflt="$dflt -l${thislib}_s";;
4231 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4232 echo "Found -l$thislib."
4235 *) dflt="$dflt -l$thislib";;
4238 echo "No -l$thislib."
4249 ' '|'') dflt='none';;
4254 In order to compile $package on your machine, a number of libraries
4255 are usually needed. Include any other special libraries here as well.
4256 Say "none" for none. The default list is almost always right.
4260 rp="What libraries to use?"
4267 : determine optimization, if desired, or use for debug flag also
4269 ' '|$undef) dflt='none';;
4271 *) dflt="$optimize";;
4275 By default, $package compiles with the -O flag to use the optimizer.
4276 Alternately, you might want to use the symbolic debugger, which uses
4277 the -g flag (on traditional Unix systems). Either flag can be
4278 specified here. To use neither flag, specify the word "none".
4281 rp="What optimizer/debugger flag should be used?"
4285 'none') optimize=" ";;
4289 : We will not override a previous value, but we might want to
4290 : augment a hint file
4292 default|recommended)
4293 case "$gccversion" in
4294 1*) dflt='-fpcc-struct-return' ;;
4297 *-g*) dflt="$dflt -DDEBUGGING";;
4299 case "$gccversion" in
4300 2*) if test -d /etc/conf/kconfig.d &&
4301 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4307 case "$gccversion" in
4311 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4312 echo 'int main(void) { return 0; }' > gcctest.c
4313 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4314 echo "Yes, it does." 2>&1
4317 echo "Leaving current flags $ccflags alone." 2>&1
4319 *) dflt="$dflt -fno-strict-aliasing" ;;
4322 echo "Nope, it doesn't, but that's ok." 2>&1
4329 case "$mips_type" in
4330 *BSD*|'') inclwanted="$locincpth $usrinc";;
4331 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4333 for thisincl in $inclwanted; do
4334 if $test -d $thisincl; then
4335 if $test x$thisincl != x$usrinc; then
4338 *) dflt="$dflt -I$thisincl";;
4344 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4346 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4354 *) dflt="$dflt -D$2";;
4358 set signal.h LANGUAGE_C; eval $inctest
4362 ccflags="$ccflags -DSOCKS"
4367 default|recommended) dflt="$ccflags $dflt" ;;
4368 *) dflt="$ccflags";;
4376 Your C compiler may want other flags. For this question you should include
4377 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4378 but you should NOT include libraries or ld flags like -lwhatever. If you
4379 want $package to honor its debug switch, you should include -DDEBUGGING here.
4380 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4382 To use no flags, specify the word "none".
4388 rp="Any additional cc flags?"
4395 : the following weeds options from ccflags that are of no interest to cpp
4397 case "$gccversion" in
4398 1*) cppflags="$cppflags -D__GNUC__"
4400 case "$mips_type" in
4402 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4408 echo "Let me guess what the preprocessor flags are..." >&4
4422 *) ftry="$previous $flag";;
4424 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4425 >cpp1.out 2>/dev/null && \
4426 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4427 >cpp2.out 2>/dev/null && \
4428 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4429 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4431 cppflags="$cppflags $ftry"
4441 *-*) echo "They appear to be: $cppflags";;
4443 $rm -f cpp.c cpp?.out
4447 : flags used in final linking phase
4449 '') if ./venix; then
4455 *-posix*) dflt="$dflt -posix" ;;
4458 *) dflt="$ldflags";;
4461 : Try to guess additional flags to pick up local libraries.
4462 for thislibdir in $libpth; do
4463 case " $loclibpth " in
4466 *"-L$thislibdir "*) ;;
4467 *) dflt="$dflt -L$thislibdir" ;;
4479 Your C linker may need flags. For this question you should
4480 include -L/whatever and any other flags used by the C linker, but you
4481 should NOT include libraries like -lwhatever.
4483 Make sure you include the appropriate -L/path flags if your C linker
4484 does not normally search all of the directories you specified above,
4487 To use no flags, specify the word "none".
4491 rp="Any additional ld flags (NOT including libraries)?"
4497 rmlist="$rmlist pdp11"
4501 echo "Checking your choice of C compiler and flags for coherency..." >&4
4502 $cat > try.c <<'EOF'
4504 int main() { printf("Ok\n"); exit(0); }
4506 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4508 $cat >try.msg <<'EOM'
4509 I've tried to compile and run the following simple program:
4512 $cat try.c >> try.msg
4514 $cat >> try.msg <<EOM
4521 and I got the following output:
4525 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4526 if sh -c './try' >>try.msg 2>&1; then
4530 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4533 cat >> try.msg <<'EOQS'
4534 If $libs contains -lsfio, and sfio is mis-configured, then it
4535 sometimes (apparently) runs and exits with a 0 status, but with no
4536 output! It may have to do with sfio's use of _exit vs. exit.
4539 rp="You have a big problem. Shall I abort Configure"
4546 echo "The program compiled OK, but exited with status $?." >>try.msg
4547 rp="You have a problem. Shall I abort Configure"
4551 echo "I can't compile the test program." >>try.msg
4552 rp="You have a BIG problem. Shall I abort Configure"
4558 case "$knowitall" in
4560 echo "(The supplied flags or libraries might be incorrect.)"
4568 *) echo "Ok. Stopping Configure." >&4
4573 n) echo "OK, that should do.";;
4575 $rm -f try try.* core
4577 : determine filename position in cpp output
4579 echo "Computing filename position in cpp output for #include directives..." >&4
4580 echo '#include <stdio.h>' > foo.c
4583 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4584 $grep '^[ ]*#.*stdio\.h' | \
4585 while read cline; do
4588 while $test \$# -gt 0; do
4589 if $test -r \`echo \$1 | $tr -d '"'\`; then
4594 pos=\`expr \$pos + 1\`
4606 *) pos="${fieldn}th";;
4608 echo "Your cpp writes the filename in the $pos field of the line."
4610 : locate header file
4615 for usrincdir in $usrinc
4617 if test -f \$usrincdir/\$wanted; then
4618 echo "\$usrincdir/\$wanted"
4622 awkprg='{ print \$$fieldn }'
4623 echo "#include <\$wanted>" > foo\$\$.c
4624 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4625 $grep "^[ ]*#.*\$wanted" | \
4626 while read cline; do
4627 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4629 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4630 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4635 # status = 0: grep returned 0 lines, case statement not executed
4636 # status = 1: headerfile found
4637 # status = 2: while loop executed, no headerfile found
4641 if test \$status -eq 1; then
4648 : define an alternate in-header-list? function
4649 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4650 cont=true; xxf="echo \"<\$1> found.\" >&4";
4651 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4652 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4654 case $# in 4) instead=instead;; *) instead="at last";; esac;
4655 while $test "$cont"; do
4657 var=$2; eval "was=\$$2";
4658 if $test "$xxx" && $test -r "$xxx";
4660 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4663 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4664 set $yyy; shift; shift; yyy=$@;
4665 case $# in 0) cont="";;
4666 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4667 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4668 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4669 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4673 do set $yyy; var=$2; eval "was=\$$2";
4674 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4675 set $yyy; shift; shift; yyy=$@;
4678 : see if this is a malloc.h system
4679 set malloc.h i_malloc
4682 : see if stdlib is available
4683 set stdlib.h i_stdlib
4686 : determine which malloc to compile in
4688 case "$usemymalloc" in
4689 ''|[yY]*|true|$define) dflt='y' ;;
4692 rp="Do you wish to attempt to use the malloc that comes with $package?"
4698 mallocsrc='malloc.c'
4699 mallocobj="malloc$_o"
4700 d_mymalloc="$define"
4703 : Remove malloc from list of libraries to use
4704 echo "Removing unneeded -lmalloc from library list" >&4
4705 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4708 echo "libs = $libs" >&4
4720 : compute the return types of malloc and free
4722 $cat >malloc.c <<END
4726 #include <sys/types.h>
4740 case "$malloctype" in
4742 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4749 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4753 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4760 echo "Your system uses $freetype free(), it would seem." >&4
4764 The installation process will also create a directory for
4765 vendor-supplied add-ons. Vendors who supply perl with their system
4766 may find it convenient to place all vendor-supplied files in this
4767 directory rather than in the main distribution directory. This will
4768 ease upgrades between binary-compatible maintenance versions of perl.
4770 Of course you may also use these directories in whatever way you see
4771 fit. For example, you might use them to access modules shared over a
4772 company-wide network.
4774 The default answer should be fine for most people.
4775 This causes further questions about vendor add-ons to be skipped
4776 and no vendor-specific directories will be configured for perl.
4779 rp='Do you want to configure vendor-specific add-on directories?'
4780 case "$usevendorprefix" in
4781 define|true|[yY]*) dflt=y ;;
4787 rp='Installation prefix to use for vendor-supplied add-ons?'
4788 case "$vendorprefix" in
4790 *) dflt=$vendorprefix ;;
4794 case "$vendorprefix" in
4798 *) oldvendorprefix="$prefix";;
4802 usevendorprefix="$define"
4804 vendorprefixexp="$ansexp"
4806 *) usevendorprefix="$undef"
4812 case "$vendorprefix" in
4813 '') d_vendorlib="$undef"
4817 *) d_vendorlib="$define"
4818 : determine where vendor-supplied modules go.
4819 : Usual default is /usr/local/lib/perl5/vendor_perl
4820 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4821 case "$installstyle" in
4822 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4823 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4826 rp='Pathname for the vendor-supplied library files?'
4829 vendorlibexp="$ansexp"
4830 : Change installation prefix, if necessary.
4831 if $test X"$prefix" != X"$installprefix"; then
4832 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4834 installvendorlib="$vendorlibexp"
4839 : Cruising for prototypes
4841 echo "Checking out function prototypes..." >&4
4842 $cat >prototype.c <<'EOCP'
4843 int main(int argc, char *argv[]) {
4846 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4847 echo "Your C compiler appears to support function prototypes."
4850 echo "Your C compiler doesn't seem to understand function prototypes."
4857 case "$prototype" in
4859 *) ansi2knr='ansi2knr'
4864 This version of $package can only be compiled by a compiler that
4865 understands function prototypes. Unfortunately, your C compiler
4867 doesn't seem to understand them. Sorry about that.
4869 If GNU cc is available for your system, perhaps you could try that instead.
4871 Eventually, we hope to support building Perl with pre-ANSI compilers.
4872 If you would like to help in that effort, please contact <perlbug@perl.org>.
4874 Aborting Configure now.
4880 : determine where public executables go
4885 rp='Pathname where the public executables will reside?'
4887 if $test "X$ansexp" != "X$binexp"; then
4892 : Change installation prefix, if necessary.
4893 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4894 if $test X"$prefix" != X"$installprefix"; then
4895 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4897 installbin="$binexp"
4900 : determine whether to install perl also as /usr/bin/perl
4903 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4905 Many scripts expect to perl to be installed as /usr/bin/perl.
4906 I can install the perl you are about to compile also as /usr/bin/perl
4907 (in addition to $installbin/perl).
4909 case "$installusrbinperl" in
4910 "$undef"|[nN]*) dflt='n';;
4913 rp="Do you want to install perl as /usr/bin/perl?"
4916 [yY]*) val="$define";;
4922 set installusrbinperl
4925 : define a shorthand compile call
4929 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4930 : define a shorthand compile call for compilations that should be ok.
4934 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4937 echo "Checking for GNU C Library..." >&4
4938 cat >gnulibc.c <<EOM
4950 if eval $compile_ok && ./gnulibc; then
4952 echo "You are using the GNU C Library"
4955 echo "You are not using the GNU C Library"
4961 : see if nm is to be used to determine whether a symbol is defined or not
4965 case "$d_gnulibc" in
4968 echo "nm probably won't work on the GNU C Library." >&4
4974 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4976 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4977 echo "'nm' won't be sufficient on this sytem." >&4
4983 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4984 if $test $dflt -gt 20; then
4994 true|$define) dflt=y;;
5001 I can use $nm to extract the symbols from your C libraries. This
5002 is a time consuming task which may generate huge output on the disk (up
5003 to 3 megabytes) but that should make the symbols extraction faster. The
5004 alternative is to skip the 'nm' extraction part and to compile a small
5005 test program instead to determine whether each symbol is present. If
5006 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5007 this may be the best solution.
5009 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5012 rp="Shall I use $nm to extract C symbols from the libraries?"
5015 [Nn]*) usenm=false;;
5024 : nm options which may be necessary
5026 '') if $test -f /mach_boot; then
5028 elif $test -d /usr/ccs/lib; then
5029 nm_opt='-p' # Solaris (and SunOS?)
5030 elif $test -f /dgux; then
5032 elif $test -f /lib64/rld; then
5033 nm_opt='-p' # 64-bit Irix
5039 : nm options which may be necessary for shared libraries but illegal
5040 : for archive libraries. Thank you, Linux.
5041 case "$nm_so_opt" in
5042 '') case "$myuname" in
5044 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5045 nm_so_opt='--dynamic'
5054 : get list of predefined functions in a handy place
5059 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5066 *) for thislib in $libs; do
5069 : Handle C library specially below.
5072 thislib=`echo $thislib | $sed -e 's/^-l//'`
5073 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5075 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5077 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5079 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5081 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5083 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5085 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5090 libnames="$libnames $try"
5092 *) libnames="$libnames $thislib" ;;
5101 for xxx in $libpth; do
5102 $test -r $1 || set $xxx/libc.$so
5103 : The messy sed command sorts on library version numbers.
5105 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5106 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5108 s/[0-9][0-9]*/0000&/g
5109 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5112 sort | $sed -e 's/^.* //'`
5115 $test -r $1 || set /usr/ccs/lib/libc.$so
5116 $test -r $1 || set /lib/libsys_s$_a
5122 if $test -r "$1"; then
5123 echo "Your (shared) C library seems to be in $1."
5125 elif $test -r /lib/libc && $test -r /lib/clib; then
5126 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5128 libc='/lib/clib /lib/libc'
5129 if $test -r /lib/syslib; then
5130 echo "(Your math library is in /lib/syslib.)"
5131 libc="$libc /lib/syslib"
5133 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5134 echo "Your C library seems to be in $libc, as you said before."
5135 elif $test -r $incpath/usr/lib/libc$_a; then
5136 libc=$incpath/usr/lib/libc$_a;
5137 echo "Your C library seems to be in $libc. That's fine."
5138 elif $test -r /lib/libc$_a; then
5140 echo "Your C library seems to be in $libc. You're normal."
5142 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5144 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5145 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5146 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5148 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5150 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5153 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5155 if $test -r "$tans"; then
5156 echo "Your C library seems to be in $tans, of all places."
5162 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5166 If the guess above is wrong (which it might be if you're using a strange
5167 compiler, or your machine supports multiple models), you can override it here.
5172 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5174 I can't seem to find your C library. I've looked in the following places:
5177 $sed 's/^/ /' libpath
5180 None of these seems to contain your C library. I need to get its name...
5185 rp='Where is your C library?'
5190 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5191 set X `cat libnames`
5194 case $# in 1) xxx=file; esac
5195 echo "Extracting names from the following $xxx for later perusal:" >&4
5197 $sed 's/^/ /' libnames >&4
5199 $echo $n "This may take a while...$c" >&4
5203 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5204 *) $nm $nm_opt $file 2>/dev/null;;
5209 $grep fprintf libc.tmp > libc.ptf
5210 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5211 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5213 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5223 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5227 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5229 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5231 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5233 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5235 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5237 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5238 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5240 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5242 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5244 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5246 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5248 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5250 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5252 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5254 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5256 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5258 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5260 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5262 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5264 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5266 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5268 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5271 $nm -p $* 2>/dev/null >libc.tmp
5272 $grep fprintf libc.tmp > libc.ptf
5273 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5274 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5280 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5282 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5283 for thisname in $libnames $libc; do
5284 $ar t $thisname >>libc.tmp
5286 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5288 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5289 # Repeat libc to extract forwarders to DLL entries too
5290 for thisname in $libnames $libc; do
5291 $ar tv $thisname >>libc.tmp
5292 # Revision 50 of EMX has bug in $ar.
5293 # it will not extract forwarders to DLL entries
5294 # Use emximp which will extract exactly them.
5295 emximp -o tmp.imp $thisname \
5297 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5298 < tmp.imp >>libc.tmp
5301 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5304 echo "$ar didn't seem to work right." >&4
5305 echo "Maybe this is a Cray...trying bld instead..." >&4
5306 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5308 for thisname in $libnames; do
5310 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5311 $ar t $thisname >>libc.tmp
5315 echo "That didn't work either. Giving up." >&4
5322 if $test -f /lib/syscalls.exp; then
5324 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5325 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5329 $rm -f libnames libpath
5331 : see if dld is available
5335 : is a C symbol defined?
5338 -v) tf=libc.tmp; tc=""; tdc="";;
5339 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5340 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5343 case "$reuseval-$4" in
5345 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5351 if $contains $tlook $tf >/dev/null 2>&1;
5356 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5357 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5365 $define) tval=true;;
5371 : define an is-in-libc? function
5372 inlibc='echo " "; td=$define; tu=$undef;
5373 sym=$1; var=$2; eval "was=\$$2";
5375 case "$reuseval$was" in
5385 echo "$sym() found." >&4;
5386 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5388 echo "$sym() NOT found." >&4;
5389 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5393 $define) echo "$sym() found." >&4;;
5394 *) echo "$sym() NOT found." >&4;;
5398 : see if dlopen exists
5405 : determine which dynamic loading, if any, to compile in
5407 dldir="ext/DynaLoader"
5420 $define) dflt='y' ;;
5423 $define) dflt='y' ;;
5425 : Does a dl_xxx.xs file exist for this operating system
5426 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5429 rp="Do you wish to use dynamic loading?"
5436 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5437 dflt="$dldir/dl_${osname}.xs"
5438 elif $test "$d_dlopen" = "$define" ; then
5439 dflt="$dldir/dl_dlopen.xs"
5440 elif $test "$i_dld" = "$define" ; then
5441 dflt="$dldir/dl_dld.xs"
5446 *) dflt="$dldir/$dlsrc"
5449 echo "The following dynamic loading files are available:"
5450 : Can not go over to $dldir because getfile has path hard-coded in.
5451 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5452 rp="Source file to use for dynamic loading"
5458 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5462 Some systems may require passing special flags to $cc -c to
5463 compile modules that will be used to create a shared library.
5464 To use no flags, say "none".
5467 case "$cccdlflags" in
5468 '') case "$gccversion" in
5469 '') case "$osname" in
5471 next) dflt='none' ;;
5472 irix*) dflt='-KPIC' ;;
5473 svr4*|esix*|solaris) dflt='-KPIC' ;;
5474 sunos) dflt='-pic' ;;
5478 *) case "$osname" in
5479 svr4*|esix*|solaris) dflt='-fPIC' ;;
5484 *) dflt="$cccdlflags" ;;
5486 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5489 none) cccdlflags=' ' ;;
5490 *) cccdlflags="$ans" ;;
5495 Some systems use ld to create libraries that can be dynamically loaded,
5496 while other systems (such as those using ELF) use $cc.
5500 '') $cat >try.c <<'EOM'
5501 /* Test for whether ELF binaries are produced */
5506 int i = open("a.out",O_RDONLY);
5509 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5510 exit(0); /* succeed (yes, it's ELF) */
5515 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5517 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5521 echo "I'll use ld to build dynamic libraries."
5530 rp="What command should be used to create dynamic libraries?"
5536 Some systems may require passing special flags to $ld to create a
5537 library that can be dynamically loaded. If your ld flags include
5538 -L/other/path options to locate libraries outside your loader's normal
5539 search path, you may need to specify those -L options here as well. To
5540 use no flags, say "none".
5543 case "$lddlflags" in
5544 '') case "$osname" in
5545 beos) dflt='-nostart' ;;
5547 linux|irix*) dflt='-shared' ;;
5548 next) dflt='none' ;;
5549 solaris) dflt='-G' ;;
5550 sunos) dflt='-assert nodefinitions' ;;
5551 svr4*|esix*) dflt="-G $ldflags" ;;
5555 *) dflt="$lddlflags" ;;
5558 : Try to guess additional flags to pick up local libraries.
5559 : Be careful not to append to a plain 'none'
5563 for thisflag in $ldflags; do
5568 *) dflt="$dflt $thisflag" ;;
5575 ''|' ') dflt='none' ;;
5578 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5581 none) lddlflags=' ' ;;
5582 *) lddlflags="$ans" ;;
5587 Some systems may require passing special flags to $cc to indicate that
5588 the resulting executable will use dynamic linking. To use no flags,
5592 case "$ccdlflags" in
5593 '') case "$osname" in
5594 hpux) dflt='-Wl,-E' ;;
5595 linux) dflt='-rdynamic' ;;
5596 next) dflt='none' ;;
5597 sunos) dflt='none' ;;
5601 *) dflt="$ccdlflags" ;;
5603 rp="Any special flags to pass to $cc to use dynamic loading?"
5606 none) ccdlflags=' ' ;;
5607 *) ccdlflags="$ans" ;;
5621 # No dynamic loading being used, so don't bother even to prompt.
5624 *) case "$useshrplib" in
5625 '') case "$osname" in
5626 svr4*|dgux|dynixptx|esix|powerux|beos)
5628 also='Building a shared libperl is required for dynamic loading to work on your system.'
5633 also='Building a shared libperl is needed for MAB support.'
5651 The perl executable is normally obtained by linking perlmain.c with
5652 libperl${_a}, any static extensions (usually just DynaLoader), and
5653 any other libraries needed on this system (such as -lm, etc.). Since
5654 your system supports dynamic loading, it is probably possible to build
5655 a shared libperl.$so. If you will have more than one executable linked
5656 to libperl.$so, this will significantly reduce the size of each
5657 executable, but it may have a noticeable affect on performance. The
5658 default is probably sensible for your system.
5662 rp="Build a shared libperl.$so (y/n)"
5666 useshrplib='true' ;;
5667 *) useshrplib='false' ;;
5672 case "$useshrplib" in
5676 # Figure out a good name for libperl.so. Since it gets stored in
5677 # a version-specific architecture-dependent library, the version
5678 # number isn't really that important, except for making cc/ld happy.
5680 # A name such as libperl.so.3.1
5681 majmin="libperl.$so.$patchlevel.$subversion"
5682 # A name such as libperl.so.301
5683 majonly=`echo $patchlevel $subversion |
5684 $awk '{printf "%d%02d", $1, $2}'`
5685 majonly=libperl.$so.$majonly
5686 # I'd prefer to keep the os-specific stuff here to a minimum, and
5687 # rely on figuring it out from the naming of libc.
5688 case "${osname}${osvers}" in
5691 # XXX How handle the --version stuff for MAB?
5693 linux*) # ld won't link with a bare -lperl otherwise.
5696 *) # Try to guess based on whether libc has major.minor.
5698 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5699 *libc.$so.[0-9]*) dflt=$majonly ;;
5700 *) dflt=libperl.$so ;;
5710 I need to select a good name for the shared libperl. If your system uses
5711 library names with major and minor numbers, then you might want something
5712 like $majmin. Alternatively, if your system uses a single version
5713 number for shared libraries, then you might want to use $majonly.
5714 Or, your system might be quite happy with a simple libperl.$so.
5716 Since the shared libperl will get installed into a version-specific
5717 architecture-dependent directory, the version number of the shared perl
5718 library probably isn't important, so the default should be o.k.
5721 rp='What name do you want to give to the shared libperl?'
5724 echo "Ok, I'll use $libperl"
5727 libperl="libperl${_a}"
5731 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5735 WARNING: Use of the shrpdir variable for the installation location of
5736 the shared $libperl is not supported. It was never documented and
5737 will not work in this version. Let me (perlbug@perl.com)
5738 know of any problems this may cause.
5744 But your current setting of $shrpdir is
5745 the default anyway, so it's harmless.
5750 Further, your current attempted setting of $shrpdir
5751 conflicts with the value of $archlibexp/CORE
5752 that installperl will use.
5759 # How will the perl executable find the installed shared $libperl?
5760 # Add $xxx to ccdlflags.
5761 # If we can't figure out a command-line option, use $shrpenv to
5762 # set env LD_RUN_PATH. The main perl makefile uses this.
5763 shrpdir=$archlibexp/CORE
5766 if "$useshrplib"; then
5769 # We'll set it in Makefile.SH...
5775 xxx="-Wl,-R$shrpdir"
5777 linux|irix*|dec_osf)
5778 xxx="-Wl,-rpath,$shrpdir"
5781 # next doesn't like the default...
5784 # beos doesn't like the default, either.
5787 # hpux doesn't like the default, either.
5788 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5791 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5797 # Only add $xxx if it isn't already in ccdlflags.
5798 case " $ccdlflags " in
5800 *) ccdlflags="$ccdlflags $xxx"
5803 Adding $xxx to the flags
5804 passed to $ld so that the perl executable will find the
5805 installed shared $libperl.
5813 # Fix ccdlflags in AIX for building external extensions.
5814 # (For building Perl itself bare -bE:perl.exp is needed,
5815 # Makefile.SH takes care of this.)
5817 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5819 # Respect a hint or command-line value.
5821 '') shrpenv="$tmp_shrpenv" ;;
5823 case "$ldlibpthname" in
5824 '') ldlibpthname=LD_LIBRARY_PATH ;;
5825 none) ldlibpthname='' ;;
5828 : determine where manual pages go
5829 set man1dir man1dir none
5833 $spackage has manual pages available in source form.
5837 echo "However, you don't have nroff, so they're probably useless to you."
5839 '') man1dir="none";;
5842 echo "If you don't want the manual sources installed, answer 'none'."
5847 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5848 lookpath="$lookpath $prefixexp/man/p_man/man1"
5849 lookpath="$lookpath $prefixexp/man/u_man/man1"
5850 lookpath="$lookpath $prefixexp/man/man.1"
5852 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5853 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5863 rp="Where do the main $spackage manual pages (source) go?"
5865 if $test "X$man1direxp" != "X$ansexp"; then
5869 man1direxp="$ansexp"
5875 : Change installation prefix, if necessary.
5876 if $test X"$prefix" != X"$installprefix"; then
5877 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5879 installman1dir="$man1direxp"
5882 : What suffix to use on installed man pages
5889 rp="What suffix should be used for the main $spackage man pages?"
5891 '') case "$man1dir" in
5905 *) dflt="$man1ext";;
5912 : see if we can have long filenames
5914 rmlist="$rmlist /tmp/cf$$"
5915 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5916 first=123456789abcdef
5917 second=/tmp/cf$$/$first
5918 $rm -f $first $second
5919 if (echo hi >$first) 2>/dev/null; then
5920 if $test -f 123456789abcde; then
5921 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5924 if (echo hi >$second) 2>/dev/null; then
5925 if $test -f /tmp/cf$$/123456789abcde; then
5927 That's peculiar... You can have filenames longer than 14 characters, but only
5928 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5929 I shall consider your system cannot support long filenames at all.
5933 echo 'You can have filenames longer than 14 characters.' >&4
5938 How confusing! Some of your filesystems are sane enough to allow filenames
5939 longer than 14 characters but some others like /tmp can't even think about them.
5940 So, for now on, I shall assume your kernel does not allow them at all.
5947 You can't have filenames longer than 14 chars. You can't even think about them!
5953 $rm -rf /tmp/cf$$ 123456789abcde*
5955 : determine where library module manual pages go
5956 set man3dir man3dir none
5960 $spackage has manual pages for many of the library modules.
5966 However, you don't have nroff, so they're probably useless to you.
5969 '') man3dir="none";;
5973 case "$d_flexfnam" in
5976 However, your system can't handle the long file names like File::Basename.3.
5979 '') man3dir="none";;
5983 echo "If you don't want the manual sources installed, answer 'none'."
5984 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5986 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5987 if $test -d "$privlib/man/man3"; then
5990 WARNING: Previous versions of perl installed man3 pages into
5991 $privlib/man/man3. This version will suggest a
5992 new default of $dflt.
5996 rp='Do you wish to preserve the old behavior?(y/n)'
5999 y*) dflt="$privlib/man/man3" ;;
6005 *) dflt="$man3dir" ;;
6009 rp="Where do the $package library man pages (source) go?"
6012 man3direxp="$ansexp"
6018 : Change installation prefix, if necessary.
6019 if $test X"$prefix" != X"$installprefix"; then
6020 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6022 installman3dir="$man3direxp"
6025 : What suffix to use on installed man pages
6031 rp="What suffix should be used for the $package library man pages?"
6033 '') case "$man3dir" in
6047 *) dflt="$man3ext";;
6054 : see if we have to deal with yellow pages, now NIS.
6055 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6056 if $test -f /usr/etc/nibindd; then
6058 echo "I'm fairly confident you're on a NeXT."
6060 rp='Do you get the hosts file via NetInfo?'
6069 y*) hostcat='nidump hosts .';;
6070 *) case "$hostcat" in
6071 nidump*) hostcat='';;
6081 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6089 rp='Are you getting the hosts file via yellow pages?'
6092 y*) hostcat='ypcat hosts';;
6093 *) hostcat='cat /etc/hosts';;
6099 '') hostcat='cat /etc/hosts';;
6102 '') groupcat='cat /etc/group';;
6105 '') passcat='cat /etc/passwd';;
6108 : now get the host name
6110 echo "Figuring out host name..." >&4
6111 case "$myhostname" in
6113 echo 'Maybe "hostname" will work...'
6114 if tans=`sh -c hostname 2>&1` ; then
6122 if $test "$cont"; then
6124 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6125 if tans=`cat /etc/systemid 2>&1` ; then
6127 phostname='cat /etc/systemid'
6128 echo "Whadyaknow. Xenix always was a bit strange..."
6131 elif $test -r /etc/systemid; then
6132 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6135 if $test "$cont"; then
6136 echo 'No, maybe "uuname -l" will work...'
6137 if tans=`sh -c 'uuname -l' 2>&1` ; then
6139 phostname='uuname -l'
6141 echo 'Strange. Maybe "uname -n" will work...'
6142 if tans=`sh -c 'uname -n' 2>&1` ; then
6144 phostname='uname -n'
6146 echo 'Oh well, maybe I can mine it out of whoami.h...'
6147 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6148 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6149 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6151 case "$myhostname" in
6152 '') echo "Does this machine have an identity crisis or something?"
6155 echo "Well, you said $myhostname before..."
6156 phostname='echo $myhostname';;
6162 : you do not want to know about this
6167 if $test "$myhostname" ; then
6169 rp='Your host name appears to be "'$myhostname'".'" Right?"
6177 : bad guess or no guess
6178 while $test "X$myhostname" = X ; do
6180 rp="Please type the (one word) name of your host:"
6185 : translate upper to lower if necessary
6186 case "$myhostname" in
6188 echo "(Normalizing case in your host name)"
6189 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6193 case "$myhostname" in
6195 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6196 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6197 echo "(Trimming domain name from host name--host name is now $myhostname)"
6199 *) case "$mydomain" in
6202 test "X$hostcat" = "Xypcat hosts" &&
6203 ypmatch "$myhostname" hosts 2>/dev/null |\
6204 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6207 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6208 /[ ]$myhostname[ . ]/p" > hosts
6211 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6212 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6213 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6214 hosts | $sort | $uniq | \
6215 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6216 case `$echo X$dflt` in
6217 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6220 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6225 tans=`./loc resolv.conf X /etc /usr/etc`
6226 if $test -f "$tans"; then
6227 echo "(Attempting domain name extraction from $tans)"
6228 dflt=.`$sed -n -e 's/ / /g' \
6229 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6230 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6232 .) dflt=.`$sed -n -e 's/ / /g' \
6233 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6234 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6241 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6242 dflt=.`sh -c domainname 2>/dev/null`
6245 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6250 .) echo "(Lost all hope -- silly guess then)"
6256 *) dflt="$mydomain";;
6260 rp="What is your domain name?"
6270 : translate upper to lower if necessary
6273 echo "(Normalizing case in your domain name)"
6274 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6278 : a little sanity check here
6279 case "$phostname" in
6282 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6283 $myhostname$mydomain|$myhostname) ;;
6285 case "$phostname" in
6287 echo "(That doesn't agree with your whoami.h file, by the way.)"
6290 echo "(That doesn't agree with your $phostname command, by the way.)"
6300 I need to get your e-mail address in Internet format if possible, i.e.
6301 something like user@host.domain. Please answer accurately since I have
6302 no easy means to double check it. The default value provided below
6303 is most probably close to the reality but may not be valid from outside
6304 your organization...
6308 while test "$cont"; do
6310 '') dflt="$cf_by@$myhostname$mydomain";;
6311 *) dflt="$cf_email";;
6313 rp='What is your e-mail address?'
6319 rp='Address does not look like an Internet one. Use it anyway?'
6335 If you or somebody else will be maintaining perl at your site, please
6336 fill in the correct e-mail address here so that they may be contacted
6337 if necessary. Currently, the "perlbug" program included with perl
6338 will send mail to this address in addition to perlbug@perl.com. You may
6339 enter "none" for no administrator.
6342 case "$perladmin" in
6343 '') dflt="$cf_email";;
6344 *) dflt="$perladmin";;
6346 rp='Perl administrator e-mail address'
6350 : figure out how to guarantee perl startup
6351 case "$startperl" in
6353 case "$sharpbang" in
6357 I can use the #! construct to start perl on your system. This will
6358 make startup of perl scripts faster, but may cause problems if you
6359 want to share those scripts and perl is not in a standard place
6360 ($binexp/perl) on all your platforms. The alternative is to force
6361 a shell by starting the script with a single ':' character.
6365 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6368 none) startperl=": # use perl";;
6369 *) startperl="#!$ans"
6370 if $test 30 -lt `echo "$ans" | wc -c`; then
6373 WARNING: Some systems limit the #! command to 32 characters.
6374 If you experience difficulty running Perl scripts with #!, try
6375 installing Perl in a directory with a shorter pathname.
6381 *) startperl=": # use perl"
6386 echo "I'll use $startperl to start perl scripts."
6388 : figure best path for perl in scripts
6391 perlpath="$binexp/perl"
6392 case "$startperl" in
6397 I will use the "eval 'exec'" idiom to start Perl on your system.
6398 I can use the full path of your Perl binary for this purpose, but
6399 doing so may cause problems if you want to share those scripts and
6400 Perl is not always in a standard place ($binexp/perl).
6404 rp="What path shall I use in \"eval 'exec'\"?"
6411 case "$startperl" in
6413 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6416 : determine where public executable scripts go
6417 set scriptdir scriptdir
6419 case "$scriptdir" in
6422 : guess some guesses
6423 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6424 $test -d /usr/share/bin && dflt=/usr/share/bin
6425 $test -d /usr/local/script && dflt=/usr/local/script
6426 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6427 $test -d $prefixexp/script && dflt=$prefixexp/script
6431 *) dflt="$scriptdir"
6436 Some installations have a separate directory just for executable scripts so
6437 that they can mount it across multiple architectures but keep the scripts in
6438 one spot. You might, for example, have a subdirectory of /usr/share for this.
6439 Or you might just lump your scripts in with all your other executables.
6443 rp='Where do you keep publicly executable scripts?'
6445 if $test "X$ansexp" != "X$scriptdirexp"; then
6449 scriptdirexp="$ansexp"
6450 : Change installation prefix, if necessary.
6451 if $test X"$prefix" != X"$installprefix"; then
6452 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6454 installscript="$scriptdirexp"
6459 After $package is installed, you may wish to install various
6460 add-on modules and utilities. Typically, these add-ons will
6461 be installed under $prefix with the rest
6462 of this package. However, you may wish to install such add-ons
6463 elsewhere under a different prefix.
6465 If you do not wish to put everything under a single prefix, that's
6466 ok. You will be prompted for the individual locations; this siteprefix
6467 is only used to suggest the defaults.
6469 The default should be fine for most people.
6473 rp='Installation prefix to use for add-on modules and utilities?'
6474 : XXX Here might be another good place for an installstyle setting.
6475 case "$siteprefix" in
6477 *) dflt=$siteprefix ;;
6481 case "$siteprefix" in
6486 *) oldsiteprefix="$prefix";;
6491 siteprefixexp="$ansexp"
6493 : determine where site specific libraries go.
6494 : Usual default is /usr/local/lib/perl5/site_perl
6495 : The default "style" setting is made in installstyle.U
6496 : XXX No longer works with Prefixit stuff.
6497 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6498 case "$installstyle" in
6499 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6500 *) dflt=$siteprefix/lib/site_$prog ;;
6504 The installation process will create a directory for
6505 site-specific extensions and modules. Most users find it convenient
6506 to place all site-specific files in this directory rather than in the
6507 main distribution directory.
6511 rp='Pathname for the site-specific library files?'
6514 sitelibexp="$ansexp"
6515 : Change installation prefix, if necessary.
6516 if $test X"$prefix" != X"$installprefix"; then
6517 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6519 installsitelib="$sitelibexp"
6522 : determine where site specific architecture-dependent libraries go.
6523 : sitelib default is /usr/local/lib/perl5/site_perl/
6524 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6525 : sitelib may have an optional trailing /share.
6526 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6527 tdflt="$tdflt/$apiversion/$archname"
6528 set sitearch sitearch none
6531 '') dflt="$tdflt" ;;
6532 *) dflt="$sitearch" ;;
6536 The installation process will also create a directory for
6537 architecture-dependent site-specific extensions and modules.
6541 rp='Pathname for the site-specific architecture-dependent library files?'
6544 sitearchexp="$ansexp"
6545 : Change installation prefix, if necessary.
6546 if $test X"$prefix" != X"$installprefix"; then
6547 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6549 installsitearch="$sitearchexp"
6552 : determine where add-on public executables go
6554 '') dflt=$siteprefix/bin ;;
6558 rp='Pathname where the add-on public executables should be installed?'
6561 sitebinexp="$ansexp"
6562 : Change installation prefix, if necessary.
6563 if $test X"$prefix" != X"$installprefix"; then
6564 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6566 installsitebin="$sitebinexp"
6571 Perl can be built to take advantage of long doubles which
6572 (if available) may give more accuracy and range for floating point
6573 numbers. To do so, Configure must be run with -Duselongdouble.
6575 If this doesn't make any sense to you, just accept the default 'n'.
6577 case "$uselongdouble" in
6578 $define|true|[yY]*) dflt='y';;
6581 rp='Try to use long doubles if available?'
6584 y|Y) val="$define" ;;
6590 case "$uselongdouble" in
6591 "$define"|true|[yY]*)
6592 : Look for a hint-file generated 'call-back-unit'. If the
6593 : user has specified that long doubles should be used,
6594 : we may need to set or change some other defaults.
6595 if $test -f uselongdouble.cbu; then
6596 echo "Your platform has some specific hints for long doubles, using them..."
6597 . ./uselongdouble.cbu
6600 (Your platform doesn't have any specific hints for long doubles.)
6608 Previous version of $package used the standard IO mechanisms as defined
6609 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6610 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6611 the default. This abstraction layer can use AT&T's sfio (if you already
6612 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6613 problems with some extension modules. Using PerlIO with stdio is safe,
6614 but it is slower than plain stdio and therefore is not the default.
6616 If this doesn't make any sense to you, just accept the default 'n'.
6618 case "$useperlio" in
6619 $define|true|[yY]*) dflt='y';;
6622 rp='Use the experimental PerlIO abstraction layer?'
6629 echo "Ok, doing things the stdio way"
6636 case "$vendorprefix" in
6637 '') d_vendorbin="$undef"
6641 *) d_vendorbin="$define"
6642 : determine where vendor-supplied executables go.
6643 dflt=$vendorprefix/bin
6645 rp='Pathname for the vendor-supplied executables directory?'
6648 vendorbinexp="$ansexp"
6649 : Change installation prefix, if necessary.
6650 if $test X"$prefix" != X"$installprefix"; then
6651 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6653 installvendorbin="$vendorbinexp"
6658 : Check how to convert floats to strings.
6659 if test "X$d_Gconvert" = X; then
6661 echo "Checking for an efficient way to convert floats to strings."
6664 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6665 char *myname = "gconvert";
6668 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6669 char *myname = "gcvt";
6672 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6673 char *myname = "sprintf";
6679 checkit(expect, got)
6683 if (strcmp(expect, got)) {
6684 printf("%s oddity: Expected %s, got %s\n",
6685 myname, expect, got);
6695 /* This must be 1st test on (which?) platform */
6696 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6697 Gconvert(0.1, 8, 0, buf);
6698 checkit("0.1", buf);
6700 Gconvert(1.0, 8, 0, buf);
6703 Gconvert(0.0, 8, 0, buf);
6706 Gconvert(-1.0, 8, 0, buf);
6709 /* Some Linux gcvt's give 1.e+5 here. */
6710 Gconvert(100000.0, 8, 0, buf);
6711 checkit("100000", buf);
6713 /* Some Linux gcvt's give -1.e+5 here. */
6714 Gconvert(-100000.0, 8, 0, buf);
6715 checkit("-100000", buf);
6720 case "$d_Gconvert" in
6721 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6722 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6723 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6724 *) xxx_list='gconvert gcvt sprintf' ;;
6727 for xxx_convert in $xxx_list; do
6728 echo "Trying $xxx_convert"
6730 set try -DTRY_$xxx_convert
6731 if eval $compile; then
6732 echo "$xxx_convert" found. >&4
6734 echo "I'll use $xxx_convert to convert floats into a string." >&4
6737 echo "...But $xxx_convert didn't work as I expected."
6740 echo "$xxx_convert NOT found." >&4
6744 case "$xxx_convert" in
6745 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6746 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6747 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6751 : see if inttypes.h is available
6752 : we want a real compile instead of Inhdr because some systems
6753 : have an inttypes.h which includes non-existent headers
6756 #include <inttypes.h>
6758 static int32_t foo32 = 0x12345678;
6762 if eval $compile; then
6763 echo "<inttypes.h> found." >&4
6766 echo "<inttypes.h> NOT found." >&4
6774 case "$use64bits" in
6777 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6779 #include <sys/types.h>
6780 #$i_inttypes I_INTTYPES
6782 #include <inttypes.h>
6784 int64_t foo() { int64_t x; x = 7; return x; }
6786 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6788 echo " Yup, it does." >&4
6791 echo " Nope, it doesn't." >&4
6802 : check for lengths of integral types
6806 echo "Checking to see how big your integers are..." >&4
6807 $cat >intsize.c <<'EOCP'
6811 printf("intsize=%d;\n", sizeof(int));
6812 printf("longsize=%d;\n", sizeof(long));
6813 printf("shortsize=%d;\n", sizeof(short));
6818 if eval $compile_ok && ./intsize > /dev/null; then
6820 echo "Your integers are $intsize bytes long."
6821 echo "Your long integers are $longsize bytes long."
6822 echo "Your short integers are $shortsize bytes long."
6826 Help! I can't compile and run the intsize test program: please enlighten me!
6827 (This is probably a misconfiguration in your system or libraries, and
6828 you really ought to fix it. Still, I'll try anyway.)
6832 rp="What is the size of an integer (in bytes)?"
6836 rp="What is the size of a long integer (in bytes)?"
6840 rp="What is the size of a short integer (in bytes)?"
6846 $rm -f intsize intsize.*
6848 : check for long long
6850 $echo $n "Checking to see if your system supports long long...$c" >&4
6851 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6852 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6854 echo " Yup, it does." >&4
6857 echo " Nope, it doesn't." >&4
6863 : check for length of long long
6864 case "${d_longlong}${longlongsize}" in
6867 $echo $n "Checking to see how big your long longs are...$c" >&4
6868 $cat >try.c <<'EOCP'
6872 printf("%d\n", sizeof(long long));
6876 if eval $compile_ok; then
6877 longlongsize=`./try`
6878 $echo " $longlongsize bytes." >&4
6882 echo "(I can't seem to compile the test program. Guessing...)"
6883 rp="What is the size of a long long (in bytes)?"
6887 if $test "X$longsize" = "X$longlongsize"; then
6888 echo "(That isn't any different from an ordinary long.)"
6896 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6898 echo "Checking how to print 64-bit integers..." >&4
6900 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6902 $cat >try.c <<'EOCP'
6903 #include <sys/types.h>
6906 int q = 12345678901;
6911 if eval $compile; then
6915 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6916 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6917 echo "We will use %d."
6923 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6925 $cat >try.c <<'EOCP'
6926 #include <sys/types.h>
6929 long q = 12345678901;
6934 if eval $compile; then
6938 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6939 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6940 echo "We will use %ld."
6946 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6948 $cat >try.c <<'EOCP'
6949 #include <sys/types.h>
6950 #include <inttypes.h>
6953 int64_t q = 12345678901;
6954 printf("%" PRId64 "\n", q);
6958 if eval $compile; then
6962 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6963 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6964 echo "We will use the C9X style."
6970 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6972 $cat >try.c <<'EOCP'
6973 #include <sys/types.h>
6976 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6977 printf("%lld\n", q);
6981 if eval $compile; then
6985 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6986 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6987 echo "We will use the %lld style."
6993 if $test X"$sPRId64" = X -a X"$quad" != X; then
6995 #include <sys/types.h>
6998 $quad q = 12345678901;
7003 if eval $compile; then
7007 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
7008 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
7009 echo "We will use %lld."
7015 if $test X"$sPRId64" = X -a X"$quad" != X; then
7017 #include <sys/types.h>
7020 $quad q = 12345678901;
7025 if eval $compile; then
7029 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7030 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7031 echo "We will use %qd."
7037 if $test X"$sPRId64" = X; then
7038 echo "Cannot figure out how to print 64-bit integers." >&4
7043 fi # intsize -o longsize -o d_int64t -o d_longlong
7046 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7047 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7049 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7050 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7054 : check for length of double
7056 case "$doublesize" in
7058 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7059 $cat >try.c <<'EOCP'
7063 printf("%d\n", sizeof(double));
7067 if eval $compile_ok; then
7069 $echo " $doublesize bytes." >&4
7072 echo "(I can't seem to compile the test program. Guessing...)"
7073 rp="What is the size of a double precision number (in bytes)?"
7081 : check for long doubles
7083 $echo $n "Checking to see if your system supports long double...$c" >&4
7084 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7085 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7087 echo " Yup, it does." >&4
7090 echo " Nope, it doesn't." >&4
7096 : check for length of long double
7097 case "${d_longdbl}${longdblsize}" in
7100 $echo $n "Checking to see how big your long doubles are...$c" >&4
7101 $cat >try.c <<'EOCP'
7105 printf("%d\n", sizeof(long double));
7109 if eval $compile; then
7111 $echo " $longdblsize bytes." >&4
7115 echo "(I can't seem to compile the test program. Guessing...)" >&4
7116 rp="What is the size of a long double (in bytes)?"
7120 if $test "X$doublesize" = "X$longdblsize"; then
7121 echo "(That isn't any different from an ordinary double.)"
7129 if $test X"$d_longdbl" = X"$define"; then
7131 echo "Checking how to print long doubles..." >&4
7133 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7134 $cat >try.c <<'EOCP'
7135 #include <sys/types.h>
7139 printf("%.3f\n", d);
7143 if eval $compile; then
7147 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7148 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7149 echo "We will use %f."
7155 if $test X"$sPRIfldbl" = X; then
7156 $cat >try.c <<'EOCP'
7157 #include <sys/types.h>
7160 long double d = 123.456;
7161 printf("%.3llf\n", d);
7165 if eval $compile; then
7169 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7170 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7171 echo "We will use %llf."
7177 if $test X"$sPRIfldbl" = X; then
7178 $cat >try.c <<'EOCP'
7179 #include <sys/types.h>
7182 long double d = 123.456;
7183 printf("%.3Lf\n", d);
7187 if eval $compile; then
7191 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7192 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7193 echo "We will use %Lf."
7199 if $test X"$sPRIfldbl" = X; then
7200 $cat >try.c <<'EOCP'
7201 #include <sys/types.h>
7204 long double d = 123.456;
7205 printf("%.3lf\n", d);
7209 if eval $compile; then
7213 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7214 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7215 echo "We will use %lf."
7221 if $test X"$sPRIfldbl" = X; then
7222 echo "Cannot figure out how to print long doubles." >&4
7229 case "$sPRIfldbl" in
7230 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7231 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7233 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7234 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7238 : Initialize h_fcntl
7241 : Initialize h_sysfile
7244 : access call always available on UNIX
7248 : locate the flags for 'access()'
7252 $cat >access.c <<'EOCP'
7253 #include <sys/types.h>
7258 #include <sys/file.h>
7267 : check sys/file.h first, no particular reason here
7268 if $test `./findhdr sys/file.h` && \
7269 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7271 echo "<sys/file.h> defines the *_OK access constants." >&4
7272 elif $test `./findhdr fcntl.h` && \
7273 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7275 echo "<fcntl.h> defines the *_OK access constants." >&4
7276 elif $test `./findhdr unistd.h` && \
7277 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7278 echo "<unistd.h> defines the *_OK access constants." >&4
7280 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7286 : see if accessx exists
7287 set accessx d_accessx
7290 : see if alarm exists
7294 : see if atolf exists
7298 : see if atoll exists
7302 : Look for GNU-cc style attribute checking
7304 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7305 $cat >attrib.c <<'EOCP'
7307 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7309 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7310 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7311 echo "Your C compiler doesn't fully support __attribute__."
7314 echo "Your C compiler supports __attribute__."
7318 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7325 : see if bcmp exists
7329 : see if bcopy exists
7333 : see if this is a unistd.h system
7334 set unistd.h i_unistd
7337 : see if getpgrp exists
7338 set getpgrp d_getpgrp
7341 case "$d_getpgrp" in
7344 echo "Checking to see which flavor of getpgrp is in use..."
7347 #include <sys/types.h>
7349 # include <unistd.h>
7353 if (getuid() == 0) {
7354 printf("(I see you are running Configure as super-user...)\n");
7358 if (getpgrp(1) == 0)
7367 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7368 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7370 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7371 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7374 echo "I can't seem to compile and run the test program."
7376 xxx="a USG one, i.e. you use getpgrp()."
7378 # SVR4 systems can appear rather BSD-ish.
7381 xxx="a BSD one, i.e. you use getpgrp(pid)."
7385 xxx="probably a USG one, i.e. you use getpgrp()."
7390 echo "Assuming your getpgrp is $xxx" >&4
7399 : see if setpgrp exists
7400 set setpgrp d_setpgrp
7403 case "$d_setpgrp" in
7406 echo "Checking to see which flavor of setpgrp is in use..."
7409 #include <sys/types.h>
7411 # include <unistd.h>
7415 if (getuid() == 0) {
7416 printf("(I see you are running Configure as super-user...)\n");
7420 if (-1 == setpgrp(1, 1))
7423 if (setpgrp() != -1)
7429 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7430 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7432 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7433 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7436 echo "(I can't seem to compile and run the test program.)"
7438 xxx="a USG one, i.e. you use setpgrp()."
7440 # SVR4 systems can appear rather BSD-ish.
7443 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7447 xxx="probably a USG one, i.e. you use setpgrp()."
7452 echo "Assuming your setpgrp is $xxx" >&4
7460 : see if bzero exists
7464 : see if signal is declared as pointer to function returning int or void
7466 xxx=`./findhdr signal.h`
7467 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7468 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7469 echo "You have int (*signal())() instead of void." >&4
7471 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7472 echo "You have void (*signal())()." >&4
7474 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7475 echo "You have int (*signal())() instead of void." >&4
7477 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7478 echo "You have void (*signal())()." >&4
7481 case "$d_voidsig" in
7483 echo "I can't determine whether signal handler returns void or int..." >&4
7485 rp="What type does your signal handler return?"
7492 echo "As you already told me, signal handler returns void." >&4
7495 *) echo "As you already told me, signal handler returns int." >&4
7502 case "$d_voidsig" in
7503 "$define") signal_t="void";;
7508 : check for ability to cast large floats to 32-bit ints.
7510 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7511 if $test "$intsize" -ge 4; then
7518 #include <sys/types.h>
7520 $signal_t blech(s) int s; { exit(3); }
7527 signal(SIGFPE, blech);
7529 /* Don't let compiler optimize the test away. Store the number
7530 in a writable string for gcc to pass to sscanf under HP/UX.
7532 sprintf(str, "2147483647");
7533 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7537 /* x86 processors will probably give 0x8000 0000, which is a
7538 sign change. We don't want that. We want to mimic SPARC
7539 behavior here, which is to preserve the sign and give
7542 if (i32 != ($xxx) f)
7548 if eval $compile_ok; then
7552 echo "(I can't seem to compile the test program--assuming it can't)"
7560 echo "Nope, it can't."
7567 : check for ability to cast negative floats to unsigned
7569 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7572 #include <sys/types.h>
7574 $signal_t blech(s) int s; { exit(7); }
7575 $signal_t blech_in_list(s) int s; { exit(4); }
7576 unsigned long dummy_long(p) unsigned long p; { return p; }
7577 unsigned int dummy_int(p) unsigned int p; { return p; }
7578 unsigned short dummy_short(p) unsigned short p; { return p; }
7582 unsigned long along;
7584 unsigned short ashort;
7588 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7589 a direct f = -123. assignment. gcc-2.8.0 reportedly
7590 optimized the whole file away
7592 /* Store the number in a writable string for gcc to pass to
7595 sprintf(str, "-123");
7596 sscanf(str, "%lf", &f); /* f = -123.; */
7598 signal(SIGFPE, blech);
7599 along = (unsigned long)f;
7600 aint = (unsigned int)f;
7601 ashort = (unsigned short)f;
7602 if (along != (unsigned long)-123)
7604 if (aint != (unsigned int)-123)
7606 if (ashort != (unsigned short)-123)
7608 sprintf(str, "1073741824.");
7609 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7612 along = (unsigned long)f;
7613 if (along != 0x80000000)
7617 along = (unsigned long)f;
7618 if (along != 0x7fffffff)
7622 along = (unsigned long)f;
7623 if (along != 0x80000001)
7627 signal(SIGFPE, blech_in_list);
7628 sprintf(str, "123.");
7629 sscanf(str, "%lf", &f); /* f = 123.; */
7630 along = dummy_long((unsigned long)f);
7631 aint = dummy_int((unsigned int)f);
7632 ashort = dummy_short((unsigned short)f);
7633 if (along != (unsigned long)123)
7635 if (aint != (unsigned int)123)
7637 if (ashort != (unsigned short)123)
7644 if eval $compile_ok; then
7648 echo "(I can't seem to compile the test program--assuming it can't)"
7651 case "$castflags" in
7656 echo "Nope, it can't."
7663 : see if vprintf exists
7665 if set vprintf val -f d_vprintf; eval $csym; $val; then
7666 echo 'vprintf() found.' >&4
7668 $cat >vprintf.c <<'EOF'
7669 #include <varargs.h>
7671 int main() { xxx("foo"); }
7680 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7684 if eval $compile && ./vprintf; then
7685 echo "Your vsprintf() returns (int)." >&4
7688 echo "Your vsprintf() returns (char*)." >&4
7692 echo 'vprintf() NOT found.' >&4
7702 : see if chown exists
7706 : see if chroot exists
7710 : see if chsize exists
7714 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7715 while $test $# -ge 2; do
7717 $define) echo "#include <$2>";;
7721 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
7723 if eval $compile; then
7732 : see if this is a sys/uio.h system
7733 set sys/uio.h i_sysuio
7736 echo "Checking to see if your system supports struct iovec..." >&4
7737 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7739 case "$d_iovec_s" in
7740 "$define") echo "Yup, it does." >&4
7742 *) echo "Nope, it doesn't." >&4
7748 : see whether socket exists
7750 $echo $n "Hmm... $c" >&4
7751 if set socket val -f d_socket; eval $csym; $val; then
7752 echo "Looks like you have Berkeley networking support." >&4
7754 if set setsockopt val -f; eval $csym; $val; then
7757 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7761 if $contains socklib libc.list >/dev/null 2>&1; then
7762 echo "Looks like you have Berkeley networking support." >&4
7764 : we will have to assume that it supports the 4.2 BSD interface
7767 echo "You don't have Berkeley networking in libc$_a..." >&4
7768 if test "X$d_socket" = "X$define"; then
7769 echo "...but you seem to believe that you have sockets." >&4
7771 for net in net socket
7773 if test -f /usr/lib/lib$net$_a; then
7774 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7775 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7776 if $contains socket libc.list >/dev/null 2>&1; then
7781 echo "...but the Wollongong group seems to have hacked it in." >&4
7782 sockethdr="-I/usr/netinclude"
7785 echo "Found Berkeley sockets interface in lib$net." >& 4
7786 if $contains setsockopt libc.list >/dev/null 2>&1; then
7789 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7796 if test "X$d_socket" != "X$define"; then
7797 echo "or anywhere else I see." >&4
7805 : see if socketpair exists
7806 set socketpair d_sockpair
7811 echo "Checking the availability of certain socket constants..." >& 4
7812 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7813 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7815 #include <sys/types.h>
7816 #include <sys/socket.h>
7822 set try; if eval $compile; then
7825 set d_${enum}; eval $setvar
7829 set sendmsg d_sendmsg
7832 set recvmsg d_recvmsg
7836 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7837 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7839 case "$d_msghdr_s" in
7840 "$define") echo "Yup, it does." >&4
7842 *) echo "Nope, it doesn't." >&4
7846 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7847 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7849 case "$d_cmsghdr_s" in
7850 "$define") echo "Yup, it does." >&4
7852 *) echo "Nope, it doesn't." >&4
7856 : check for const keyword
7858 echo 'Checking to see if your C compiler knows about "const"...' >&4
7859 $cat >const.c <<'EOCP'
7860 typedef struct spug { int drokk; } spug;
7867 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7869 echo "Yup, it does."
7872 echo "Nope, it doesn't."
7877 : see if crypt exists
7879 if set crypt val -f d_crypt; eval $csym; $val; then
7880 echo 'crypt() found.' >&4
7884 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7885 if $test -z "$cryptlib"; then
7886 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7890 if $test -z "$cryptlib"; then
7891 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7895 if $test -z "$cryptlib"; then
7896 cryptlib=`./loc libcrypt$_a "" $libpth`
7900 if $test -z "$cryptlib"; then
7901 echo 'crypt() NOT found.' >&4
7910 : get csh whereabouts
7912 'csh') val="$undef" ;;
7917 : Respect a hint or command line value for full_csh.
7919 '') full_csh=$csh ;;
7922 : see if cuserid exists
7923 set cuserid d_cuserid
7926 : see if this is a limits.h system
7927 set limits.h i_limits
7930 : see if this is a float.h system
7934 : See if number of significant digits in a double precision number is known
7936 $cat >dbl_dig.c <<EOM
7946 printf("Contains DBL_DIG");
7949 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7950 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7951 echo "DBL_DIG found." >&4
7954 echo "DBL_DIG NOT found." >&4
7961 : see if difftime exists
7962 set difftime d_difftime
7965 : see if this is a dirent system
7967 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7969 echo "<dirent.h> found." >&4
7972 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7973 echo "<sys/dir.h> found." >&4
7976 xinc=`./findhdr sys/ndir.h`
7978 echo "<dirent.h> NOT found." >&4
7983 : Look for type of directory structure.
7985 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7987 case "$direntrytype" in
7990 $define) guess1='struct dirent' ;;
7991 *) guess1='struct direct' ;;
7994 *) guess1="$direntrytype"
7999 'struct dirent') guess2='struct direct' ;;
8000 *) guess2='struct dirent' ;;
8003 if $contains "$guess1" try.c >/dev/null 2>&1; then
8004 direntrytype="$guess1"
8005 echo "Your directory entries are $direntrytype." >&4
8006 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8007 direntrytype="$guess2"
8008 echo "Your directory entries seem to be $direntrytype." >&4
8010 echo "I don't recognize your system's directory entries." >&4
8011 rp="What type is used for directory entries on this system?"
8019 : see if the directory entry stores field length
8021 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8022 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8023 echo "Good, your directory entry keeps length information in d_namlen." >&4
8026 echo "Your directory entry does not know about the d_namlen field." >&4
8033 : see if dlerror exists
8036 set dlerror d_dlerror
8040 : see if dlfcn is available
8048 On a few systems, the dynamically loaded modules that perl generates and uses
8049 will need a different extension than shared libs. The default will probably
8057 rp='What is the extension of dynamically loaded modules'
8066 : Check if dlsym need a leading underscore
8072 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8073 $cat >dyna.c <<'EOM'
8082 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8084 #include <sys/types.h>
8098 int mode = RTLD_LAZY ;
8100 handle = dlopen("./dyna.$dlext", mode) ;
8101 if (handle == NULL) {
8106 symbol = dlsym(handle, "fred") ;
8107 if (symbol == NULL) {
8108 /* try putting a leading underscore */
8109 symbol = dlsym(handle, "_fred") ;
8110 if (symbol == NULL) {
8123 : Call the object file tmp-dyna.o in case dlext=o.
8124 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8125 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8126 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8127 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8130 1) echo "Test program failed using dlopen." >&4
8131 echo "Perhaps you should not use dynamic loading." >&4;;
8132 2) echo "Test program failed using dlsym." >&4
8133 echo "Perhaps you should not use dynamic loading." >&4;;
8134 3) echo "dlsym needs a leading underscore" >&4
8136 4) echo "dlsym doesn't need a leading underscore." >&4;;
8139 echo "I can't compile and run the test program." >&4
8140 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8145 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8150 hasproto='varname=$1; func=$2; shift; shift;
8151 while $test $# -ge 2; do
8153 $define) echo "#include <$2>";;
8157 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8158 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8159 echo "$func() prototype found.";
8162 echo "$func() prototype NOT found.";
8167 $rm -f try.c tryout.c'
8169 : see if prototype for drand48 is available
8171 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8174 : see if dup2 exists
8178 : see if eaccess exists
8179 set eaccess d_eaccess
8182 : see if endgrent exists
8183 set endgrent d_endgrent
8186 : see if endhostent exists
8187 set endhostent d_endhent
8190 : see if endnetent exists
8191 set endnetent d_endnent
8194 : see if endprotoent exists
8195 set endprotoent d_endpent
8198 : see if endpwent exists
8199 set endpwent d_endpwent
8202 : see if endservent exists
8203 set endservent d_endsent
8206 : see if endspent exists
8207 set endspent d_endspent
8210 : Locate the flags for 'open()'
8212 $cat >open3.c <<'EOCP'
8213 #include <sys/types.h>
8218 #include <sys/file.h>
8229 : check sys/file.h first to get FREAD on Sun
8230 if $test `./findhdr sys/file.h` && \
8231 set open3 -DI_SYS_FILE && eval $compile; then
8233 echo "<sys/file.h> defines the O_* constants..." >&4
8235 echo "and you have the 3 argument form of open()." >&4
8238 echo "but not the 3 argument form of open(). Oh, well." >&4
8241 elif $test `./findhdr fcntl.h` && \
8242 set open3 -DI_FCNTL && eval $compile; then
8244 echo "<fcntl.h> defines the O_* constants..." >&4
8246 echo "and you have the 3 argument form of open()." >&4
8249 echo "but not the 3 argument form of open(). Oh, well." >&4
8254 echo "I can't find the O_* constant definitions! You got problems." >&4
8260 : check for non-blocking I/O stuff
8261 case "$h_sysfile" in
8262 true) echo "#include <sys/file.h>" > head.c;;
8265 true) echo "#include <fcntl.h>" > head.c;;
8266 *) echo "#include <sys/fcntl.h>" > head.c;;
8271 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8272 case "$o_nonblock" in
8275 $cat >>try.c <<'EOCP'
8278 printf("O_NONBLOCK\n");
8282 printf("O_NDELAY\n");
8286 printf("FNDELAY\n");
8293 if eval $compile_ok; then
8295 case "$o_nonblock" in
8296 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8297 *) echo "Seems like we can use $o_nonblock.";;
8300 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8303 *) echo "Using $hint value $o_nonblock.";;
8305 $rm -f try try.* .out core
8308 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8314 #include <sys/types.h>
8316 #define MY_O_NONBLOCK $o_nonblock
8317 #ifndef errno /* XXX need better Configure test */
8320 $signal_t blech(x) int x; { exit(3); }
8322 $cat >> try.c <<'EOCP'
8330 pipe(pd); /* Down: child -> parent */
8331 pipe(pu); /* Up: parent -> child */
8334 close(pd[1]); /* Parent reads from pd[0] */
8335 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8336 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8338 signal(SIGALRM, blech);
8340 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8342 sprintf(string, "%d\n", ret);
8343 write(2, string, strlen(string));
8346 if (errno == EAGAIN) {
8352 if (errno == EWOULDBLOCK)
8353 printf("EWOULDBLOCK\n");
8356 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8357 sleep(2); /* Give it time to close our pipe */
8359 ret = read(pd[0], buf, 1); /* Should read EOF */
8361 sprintf(string, "%d\n", ret);
8362 write(3, string, strlen(string));
8366 close(pd[0]); /* We write to pd[1] */
8367 close(pu[1]); /* We read from pu[0] */
8368 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8369 close(pd[1]); /* Pipe pd is now fully closed! */
8370 exit(0); /* Bye bye, thank you for playing! */
8374 if eval $compile_ok; then
8375 echo "$startsh" >mtry
8376 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8378 ./mtry >/dev/null 2>&1
8380 0) eagain=`$cat try.out`;;
8381 1) echo "Could not perform non-blocking setting!";;
8382 2) echo "I did a successful read() for something that was not there!";;
8383 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8384 *) echo "Something terribly wrong happened during testing.";;
8386 rd_nodata=`$cat try.ret`
8387 echo "A read() system call with no data present returns $rd_nodata."
8388 case "$rd_nodata" in
8391 echo "(That's peculiar, fixing that to be -1.)"
8397 echo "Forcing errno EAGAIN on read() with no data available."
8401 echo "Your read() sets errno to $eagain when no data is available."
8404 status=`$cat try.err`
8406 0) echo "And it correctly returns 0 to signal EOF.";;
8407 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8408 *) echo "However, your read() returns '$status' on EOF??";;
8411 if test "$status" = "$rd_nodata"; then
8412 echo "WARNING: you can't distinguish between EOF and no data!"
8416 echo "I can't compile the test program--assuming errno EAGAIN will do."
8423 echo "Using $hint value $eagain."
8424 echo "Your read() returns $rd_nodata when no data is present."
8425 case "$d_eofnblk" in
8426 "$define") echo "And you can see EOF because read() returns 0.";;
8427 "$undef") echo "But you can't see EOF status from read() returned value.";;
8429 echo "(Assuming you can't see EOF status from read anyway.)"
8435 $rm -f try try.* .out core head.c mtry
8437 : see if fchmod exists
8441 : see if fchown exists
8445 : see if this is an fcntl system
8449 : see if sys/select.h has to be included
8450 set sys/select.h i_sysselct
8453 : see if we should include time.h, sys/time.h, or both
8455 if test "X$timeincl" = X; then
8456 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8457 $echo $n "I'm now running the test program...$c"
8458 $cat >try.c <<'EOCP'
8459 #include <sys/types.h>
8464 #ifdef SYSTIMEKERNEL
8467 #include <sys/time.h>
8470 #include <sys/select.h>
8479 struct timezone tzp;
8481 if (foo.tm_sec == foo.tm_sec)
8484 if (bar.tv_sec == bar.tv_sec)
8491 for s_timezone in '-DS_TIMEZONE' ''; do
8493 for s_timeval in '-DS_TIMEVAL' ''; do
8494 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8495 for i_time in '' '-DI_TIME'; do
8496 for i_systime in '-DI_SYSTIME' ''; do
8499 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8500 if eval $compile; then
8501 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8505 $echo $n "Succeeded with $flags$c"
8517 *SYSTIMEKERNEL*) i_systimek="$define"
8518 timeincl=`./findhdr sys/time.h`
8519 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8520 *) i_systimek="$undef";;
8523 *I_TIME*) i_time="$define"
8524 timeincl=`./findhdr time.h`" $timeincl"
8525 echo "We'll include <time.h>." >&4;;
8526 *) i_time="$undef";;
8529 *I_SYSTIME*) i_systime="$define"
8530 timeincl=`./findhdr sys/time.h`" $timeincl"
8531 echo "We'll include <sys/time.h>." >&4;;
8532 *) i_systime="$undef";;
8537 : check for fd_set items
8540 Checking to see how well your C compiler handles fd_set and friends ...
8542 $cat >fd_set.c <<EOCP
8543 #$i_systime I_SYS_TIME
8544 #$i_sysselct I_SYS_SELECT
8545 #$d_socket HAS_SOCKET
8546 #include <sys/types.h>
8548 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8551 #include <sys/time.h>
8554 #include <sys/select.h>
8563 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8570 set fd_set -DTRYBITS
8571 if eval $compile; then
8572 d_fds_bits="$define"
8574 echo "Well, your system knows about the normal fd_set typedef..." >&4
8576 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8577 d_fd_macros="$define"
8580 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8582 d_fd_macros="$undef"
8586 Hmm, your compiler has some difficulty with fd_set. Checking further...
8589 if eval $compile; then
8592 echo "Well, your system has some sort of fd_set available..." >&4
8594 echo "and you have the normal fd_set macros." >&4
8595 d_fd_macros="$define"
8598 but not the normal fd_set macros! Gross! More work for me...
8600 d_fd_macros="$undef"
8603 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8606 d_fd_macros="$undef"
8611 : see if fgetpos exists
8612 set fgetpos d_fgetpos
8615 : see if flock exists
8619 : see if fork exists
8623 : see if pathconf exists
8624 set pathconf d_pathconf
8627 : see if fpathconf exists
8628 set fpathconf d_fpathconf
8632 : see if llseek exists
8638 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8640 #include <sys/types.h>
8642 off64_t foo() { off64_t x; x = 7; return x; }'
8644 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8646 echo " Yup, it does." >&4
8649 echo " Nope, it doesn't." >&4
8655 : check for fpos64_t
8657 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8659 #include <sys/stdio.h>
8660 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8662 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8664 echo " Yup, it does." >&4
8667 echo " Nope, it doesn't." >&4
8673 hasstruct='varname=$1; struct=$2; shift; shift;
8674 while $test $# -ge 2; do
8676 $define) echo "#include <$2>";;
8680 echo "int main () { struct $struct foo; }" >> try.c;
8682 if eval $compile; then
8691 : see if this is a sys/param system
8692 set sys/param.h i_sysparam
8695 : see if this is a sys/mount.h system
8696 set sys/mount.h i_sysmount
8699 : see if sys/types.h has to be included
8700 set sys/types.h i_systypes
8705 echo "Checking to see if your system supports struct fs_data..." >&4
8706 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8708 case "$d_fs_data_s" in
8709 "$define") echo "Yup, it does." >&4 ;;
8710 *) echo "Nope, it doesn't." >&4 ;;
8713 : see if fseeko exists
8717 : see if fsetpos exists
8718 set fsetpos d_fsetpos
8722 : see if fstatfs exists
8723 set fstatfs d_fstatfs
8727 : see if statvfs exists
8728 set statvfs d_statvfs
8731 : see if fstatvfs exists
8732 set fstatvfs d_fstatvfs
8736 : see if ftello exists
8740 : see if getgrent exists
8741 set getgrent d_getgrent
8744 : see if gethostbyaddr exists
8745 set gethostbyaddr d_gethbyaddr
8748 : see if gethostbyname exists
8749 set gethostbyname d_gethbyname
8752 : see if gethostent exists
8753 set gethostent d_gethent
8756 : see how we will look up host name
8759 if set gethostname val -f d_gethname; eval $csym; $val; then
8760 echo 'gethostname() found.' >&4
8761 d_gethname="$define"
8764 if set uname val -f d_uname; eval $csym; $val; then
8767 uname() was found, but you're running xenix, and older versions of xenix
8768 have a broken uname(). If you don't really know whether your xenix is old
8769 enough to have a broken system call, use the default answer.
8776 rp='Is your uname() broken?'
8779 n*) d_uname="$define"; call=uname;;
8782 echo 'uname() found.' >&4
8789 case "$d_gethname" in
8790 '') d_gethname="$undef";;
8793 '') d_uname="$undef";;
8795 case "$d_uname$d_gethname" in
8800 Every now and then someone has a $call() that lies about the hostname
8801 but can't be fixed for political or economic reasons. If you wish, I can
8802 pretend $call() isn't there and maybe compute hostname at run-time
8803 thanks to the '$phostname' command.
8806 rp="Shall I ignore $call() from now on?"
8809 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8812 case "$phostname" in
8814 *) case "$aphostname" in
8820 file=`./loc $file $file $pth`
8821 aphostname=`echo $file $*`
8826 case "$d_uname$d_gethname" in
8829 case "$phostname" in
8831 echo "There will be no way for $package to get your hostname." >&4;;
8833 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8837 case "$d_phostname" in
8838 '') d_phostname="$undef";;
8841 : see if this is a netdb.h system
8845 : see if prototypes for various gethostxxx netdb.h functions are available
8847 set d_gethostprotos gethostent $i_netdb netdb.h
8850 : see if getlogin exists
8851 set getlogin d_getlogin
8854 : see if getmnt exists
8858 : see if getmntent exists
8859 set getmntent d_getmntent
8862 : see if getnetbyaddr exists
8863 set getnetbyaddr d_getnbyaddr
8866 : see if getnetbyname exists
8867 set getnetbyname d_getnbyname
8870 : see if getnetent exists
8871 set getnetent d_getnent
8874 : see if prototypes for various getnetxxx netdb.h functions are available
8876 set d_getnetprotos getnetent $i_netdb netdb.h
8880 : see if getprotobyname exists
8881 set getprotobyname d_getpbyname
8884 : see if getprotobynumber exists
8885 set getprotobynumber d_getpbynumber
8888 : see if getprotoent exists
8889 set getprotoent d_getpent
8892 : see if getpgid exists
8893 set getpgid d_getpgid
8896 : see if getpgrp2 exists
8897 set getpgrp2 d_getpgrp2
8900 : see if getppid exists
8901 set getppid d_getppid
8904 : see if getpriority exists
8905 set getpriority d_getprior
8908 : see if prototypes for various getprotoxxx netdb.h functions are available
8910 set d_getprotoprotos getprotoent $i_netdb netdb.h
8913 : see if getpwent exists
8914 set getpwent d_getpwent
8918 : see if getservbyname exists
8919 set getservbyname d_getsbyname
8922 : see if getservbyport exists
8923 set getservbyport d_getsbyport
8926 : see if getservent exists
8927 set getservent d_getsent
8930 : see if prototypes for various getservxxx netdb.h functions are available
8932 set d_getservprotos getservent $i_netdb netdb.h
8935 : see if getspent exists
8936 set getspent d_getspent
8939 : see if getspnam exists
8940 set getspnam d_getspnam
8943 : see if gettimeofday or ftime exists
8944 set gettimeofday d_gettimeod
8946 case "$d_gettimeod" in
8952 val="$undef"; set d_ftime; eval $setvar
8955 case "$d_gettimeod$d_ftime" in
8958 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8962 : see if this is an grp system
8968 xxx=`./findhdr grp.h`
8969 $cppstdin $cppflags $cppminus < $xxx >$$.h
8971 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8983 set d_grpasswd; eval $setvar
8987 : see if hasmntopt exists
8988 set hasmntopt d_hasmntopt
8991 : see if this is a netinet/in.h or sys/in.h system
8992 set netinet/in.h i_niin sys/in.h i_sysin
8995 : see if arpa/inet.h has to be included
8996 set arpa/inet.h i_arpainet
8999 : see if htonl --and friends-- exists
9004 : Maybe they are macros.
9009 #include <sys/types.h>
9010 #$i_niin I_NETINET_IN
9012 #$i_arpainet I_ARPA_INET
9014 #include <netinet/in.h>
9020 #include <arpa/inet.h>
9023 printf("Defined as a macro.");
9026 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9027 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9029 echo "But it seems to be defined as a macro." >&4
9037 : see which of string.h or strings.h is needed
9039 strings=`./findhdr string.h`
9040 if $test "$strings" && $test -r "$strings"; then
9041 echo "Using <string.h> instead of <strings.h>." >&4
9045 strings=`./findhdr strings.h`
9046 if $test "$strings" && $test -r "$strings"; then
9047 echo "Using <strings.h> instead of <string.h>." >&4
9049 echo "No string header found -- You'll surely have problems." >&4
9055 "$undef") strings=`./findhdr strings.h`;;
9056 *) strings=`./findhdr string.h`;;
9061 if set index val -f; eval $csym; $val; then
9062 if set strchr val -f d_strchr; eval $csym; $val; then
9063 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9066 echo "strchr() found." >&4
9070 echo "index() found." >&4
9075 echo "index() found." >&4
9078 if set strchr val -f d_strchr; eval $csym; $val; then
9081 echo "strchr() found." >&4
9083 echo "No index() or strchr() found!" >&4
9088 set d_strchr; eval $setvar
9090 set d_index; eval $setvar
9092 : check whether inet_aton exists
9093 set inet_aton d_inetaton
9098 $cat >isascii.c <<'EOCP'
9110 if eval $compile; then
9111 echo "isascii() found." >&4
9114 echo "isascii() NOT found." >&4
9121 : see if killpg exists
9125 : see if lchown exists
9127 $cat > try.c <<'EOCP'
9128 /* System header to define __stub macros and hopefully few prototypes,
9129 which can conflict with char lchown(); below. */
9131 /* Override any gcc2 internal prototype to avoid an error. */
9132 /* We use char because int might match the return type of a gcc2
9133 builtin and then its argument prototype would still apply. */
9136 /* The GNU C library defines this for functions which it implements
9137 to always fail with ENOSYS. Some functions are actually named
9138 something starting with __ and the normal name is an alias. */
9139 #if defined (__stub_lchown) || defined (__stub___lchown)
9147 if eval $compile; then
9148 $echo "lchown() found." >&4
9151 $echo "lchown() NOT found." >&4
9157 : See if number of significant digits in a double precision number is known
9159 $cat >ldbl_dig.c <<EOM
9169 printf("Contains LDBL_DIG");
9172 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9173 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9174 echo "LDBL_DIG found." >&4
9177 echo "LDBL_DIG NOT found." >&4
9184 : see if link exists
9188 : see if localeconv exists
9189 set localeconv d_locconv
9192 : see if lockf exists
9196 : see if lstat exists
9200 : see if madvise exists
9201 set madvise d_madvise
9204 : see if mblen exists
9208 : see if mbstowcs exists
9209 set mbstowcs d_mbstowcs
9212 : see if mbtowc exists
9216 : see if memchr exists
9220 : see if memcmp exists
9224 : see if memcpy exists
9228 : see if memmove exists
9229 set memmove d_memmove
9232 : see if memset exists
9236 : see if mkdir exists
9240 : see if mkfifo exists
9244 : see if mktime exists
9248 : see if this is a sys/mman.h system
9249 set sys/mman.h i_sysmman
9252 : see if mmap exists
9255 : see what shmat returns
9256 : default to something harmless
9258 case "$i_sysmman$d_mmap" in
9260 $cat >mmap.c <<'END'
9261 #include <sys/mman.h>
9264 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9269 echo "and it returns ($mmaptype)." >&4
9275 : see if mprotect exists
9276 set mprotect d_mprotect
9279 : see if msgctl exists
9283 : see if msgget exists
9287 : see if msgsnd exists
9291 : see if msgrcv exists
9295 : see how much of the 'msg*(2)' library is present.
9298 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9299 *"$undef"*) h_msg=false;;
9303 case "`ipcs 2>&1`" in
9304 "SVID messages"*"not configured"*)
9305 echo "Your $osname does not have the msg*(2) configured." >&4
9320 : we could also check for sys/ipc.h ...
9321 if $h_msg && $test `./findhdr sys/msg.h`; then
9322 echo "You have the full msg*(2) library." >&4
9325 echo "You don't have the full msg*(2) library." >&4
9331 : see if msync exists
9335 : see if munmap exists
9339 : see if nice exists
9343 : see if POSIX threads are available
9344 set pthread.h i_pthread
9350 : how to create joinable pthreads
9351 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9353 echo "Checking what constant to use for creating joinable pthreads..." >&4
9354 $cat >try.c <<'EOCP'
9355 #include <pthread.h>
9357 int detachstate = JOINABLE;
9360 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9361 if eval $compile; then
9362 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9363 val="$undef" # Yes, undef.
9364 set d_old_pthread_create_joinable
9367 set old_pthread_create_joinable
9370 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9371 if eval $compile; then
9372 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9374 set d_old_pthread_create_joinable
9376 val=PTHREAD_CREATE_UNDETACHED
9377 set old_pthread_create_joinable
9380 set try -DJOINABLE=__UNDETACHED
9381 if eval $compile; then
9382 echo "You seem to use __UNDETACHED." >&4
9384 set d_old_pthread_create_joinable
9387 set old_pthread_create_joinable
9390 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9392 set d_old_pthread_create_joinable
9395 set old_pthread_create_joinable
9402 d_old_pthread_create_joinable="$undef"
9403 old_pthread_create_joinable=""
9406 : see if pause exists
9410 : see if pipe exists
9414 : see if poll exists
9419 : see whether the various POSIXish _yields exist
9421 #include <pthread.h>
9427 #ifdef PTHREAD_YIELD
9430 #ifdef PTHREAD_YIELD_NULL
9431 pthread_yield(NULL);
9437 : see if sched_yield exists
9438 set try -DSCHED_YIELD
9439 if eval $compile; then
9441 sched_yield='sched_yield()'
9445 case "$usethreads" in
9448 $define) echo 'sched_yield() found.' >&4 ;;
9449 *) echo 'sched_yield() NOT found.' >&4 ;;
9455 : see if pthread_yield exists
9456 set try -DPTHREAD_YIELD
9457 if eval $compile; then
9459 case "$sched_yield" in
9460 '') sched_yield='pthread_yield()' ;;
9463 set try -DPTHREAD_YIELD_NULL
9464 if eval $compile; then
9466 case "$sched_yield" in
9467 '') sched_yield='pthread_yield(NULL)' ;;
9473 case "$usethreads" in
9476 $define) echo 'pthread_yield() found.' >&4 ;;
9477 *) echo 'pthread_yield() NOT found.' >&4 ;;
9484 case "$sched_yield" in
9485 '') sched_yield=undef ;;
9490 : see if this is a pwd.h system
9496 xxx=`./findhdr pwd.h`
9497 $cppstdin $cppflags $cppminus < $xxx >$$.h
9499 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9507 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9515 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9523 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9531 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9539 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9547 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9555 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9567 set d_pwquota; eval $setvar
9568 set d_pwage; eval $setvar
9569 set d_pwchange; eval $setvar
9570 set d_pwclass; eval $setvar
9571 set d_pwexpire; eval $setvar
9572 set d_pwcomment; eval $setvar
9573 set d_pwgecos; eval $setvar
9574 set d_pwpasswd; eval $setvar
9578 : see if readdir and friends exist
9579 set readdir d_readdir
9581 set seekdir d_seekdir
9583 set telldir d_telldir
9585 set rewinddir d_rewinddir
9588 : see if readlink exists
9589 set readlink d_readlink
9592 : see if readv exists
9596 : see if rename exists
9600 : see if rmdir exists
9604 : see if memory.h is available.
9609 : See if it conflicts with string.h
9615 $cppstdin $cppflags $cppminus < $strings > mem.h
9616 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9618 echo "We won't be including <memory.h>."
9628 : can bcopy handle overlapping blocks?
9633 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9640 $cat >>try.c <<'EOCP'
9643 # include <memory.h>
9646 # include <stdlib.h>
9649 # include <string.h>
9651 # include <strings.h>
9654 # include <unistd.h> /* Needed for NetBSD */
9658 char buf[128], abc[128];
9664 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9666 for (align = 7; align >= 0; align--) {
9667 for (len = 36; len; len--) {
9670 for (off = 1; off <= len; off++) {
9671 bcopy(b, b+off, len);
9672 bcopy(b+off, b, len);
9673 if (bcmp(b, abc, len))
9682 if eval $compile_ok; then
9683 if ./try 2>/dev/null; then
9687 echo "It can't, sorry."
9688 case "$d_memmove" in
9689 "$define") echo "But that's Ok since you have memmove()." ;;
9693 echo "(I can't compile the test program, so we'll assume not...)"
9694 case "$d_memmove" in
9695 "$define") echo "But that's Ok since you have memmove()." ;;
9700 $rm -f try.* try core
9704 : can memcpy handle overlapping blocks?
9709 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9716 $cat >>try.c <<'EOCP'
9719 # include <memory.h>
9722 # include <stdlib.h>
9725 # include <string.h>
9727 # include <strings.h>
9730 # include <unistd.h> /* Needed for NetBSD */
9734 char buf[128], abc[128];
9740 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9741 try to store the string in read-only memory. */
9742 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9744 for (align = 7; align >= 0; align--) {
9745 for (len = 36; len; len--) {
9747 memcpy(b, abc, len);
9748 for (off = 1; off <= len; off++) {
9749 memcpy(b+off, b, len);
9750 memcpy(b, b+off, len);
9751 if (memcmp(b, abc, len))
9760 if eval $compile_ok; then
9761 if ./try 2>/dev/null; then
9765 echo "It can't, sorry."
9766 case "$d_memmove" in
9767 "$define") echo "But that's Ok since you have memmove()." ;;
9771 echo "(I can't compile the test program, so we'll assume not...)"
9772 case "$d_memmove" in
9773 "$define") echo "But that's Ok since you have memmove()." ;;
9778 $rm -f try.* try core
9782 : can memcmp be trusted to compare relative magnitude?
9787 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9794 $cat >>try.c <<'EOCP'
9797 # include <memory.h>
9800 # include <stdlib.h>
9803 # include <string.h>
9805 # include <strings.h>
9808 # include <unistd.h> /* Needed for NetBSD */
9814 if ((a < b) && memcmp(&a, &b, 1) < 0)
9820 if eval $compile_ok; then
9821 if ./try 2>/dev/null; then
9825 echo "No, it can't (it uses signed chars)."
9828 echo "(I can't compile the test program, so we'll assume not...)"
9832 $rm -f try.* try core
9836 : see if select exists
9840 : see if semctl exists
9844 : see if semget exists
9848 : see if semop exists
9852 : see how much of the 'sem*(2)' library is present.
9855 case "$d_semctl$d_semget$d_semop" in
9856 *"$undef"*) h_sem=false;;
9860 case "`ipcs 2>&1`" in
9861 "SVID messages"*"not configured"*)
9862 echo "Your $osname does not have the sem*(2) configured." >&4
9875 : we could also check for sys/ipc.h ...
9876 if $h_sem && $test `./findhdr sys/sem.h`; then
9877 echo "You have the full sem*(2) library." >&4
9880 echo "You don't have the full sem*(2) library." >&4
9886 : see whether sys/sem.h defines union semun
9888 $cat > try.c <<'END'
9889 #include <sys/types.h>
9890 #include <sys/ipc.h>
9891 #include <sys/sem.h>
9892 int main () { union semun semun; semun.buf = 0; }
9895 if eval $compile; then
9896 echo "You have union semun in <sys/sem.h>." >&4
9899 echo "You do not have union semun in <sys/sem.h>." >&4
9902 $rm -f try try.c try.h
9906 : see how to do semctl IPC_STAT
9909 : see whether semctl IPC_STAT can use union semun
9914 # define S_IRUSR S_IREAD
9915 # define S_IWUSR S_IWRITE
9916 # define S_IXUSR S_IEXEC
9918 # define S_IRUSR 0400
9919 # define S_IWUSR 0200
9920 # define S_IXUSR 0100
9922 # define S_IRGRP (S_IRUSR>>3)
9923 # define S_IWGRP (S_IWUSR>>3)
9924 # define S_IXGRP (S_IXUSR>>3)
9925 # define S_IROTH (S_IRUSR>>6)
9926 # define S_IWOTH (S_IWUSR>>6)
9927 # define S_IXOTH (S_IXUSR>>6)
9930 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9931 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9932 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9937 #include <sys/types.h>
9938 #include <sys/ipc.h>
9939 #include <sys/sem.h>
9940 #include <sys/stat.h>
9947 #$d_union_semun HAS_UNION_SEMUN
9950 #ifndef HAS_UNION_SEMUN
9953 struct semid_ds *buf;
9954 unsigned short *array;
9960 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9961 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9963 struct semid_ds argbuf;
9966 st = semctl(sem, 0, IPC_STAT, arg);
9970 # endif /* IPC_STAT */
9971 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9973 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9974 # endif /* IPC_RMID */
9975 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9977 #endif /* IPC_PRIVATE && ... */
9978 printf("semget failed: errno = %d\n", errno);
9984 if eval $compile; then
9987 semun) val="$define" ;;
9993 case "$d_semctl_semun" in
9995 echo "You can use union semun for semctl IPC_STAT." >&4
9998 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10003 : see whether semctl IPC_STAT can use struct semid_ds pointer
10004 $cat > try.c <<'END'
10005 #include <sys/types.h>
10006 #include <sys/ipc.h>
10007 #include <sys/sem.h>
10008 #include <sys/stat.h>
10016 struct semid_ds arg;
10019 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10020 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10023 st = semctl(sem, 0, IPC_STAT, &arg);
10025 printf("semid_ds\n");
10027 # endif /* IPC_STAT */
10028 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10030 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10031 # endif /* IPC_RMID */
10032 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10034 #endif /* IPC_PRIVATE && ... */
10035 printf("semget failed: errno = %d\n", errno);
10042 if eval $compile; then
10045 semid_ds) val="$define" ;;
10049 set d_semctl_semid_ds
10051 case "$d_semctl_semid_ds" in
10053 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10055 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10062 # We do not have the full sem*(2) library, so assume we can not
10068 set d_semctl_semid_ds
10073 : see if setegid exists
10074 set setegid d_setegid
10077 : see if seteuid exists
10078 set seteuid d_seteuid
10081 : see if setgrent exists
10082 set setgrent d_setgrent
10085 : see if sethostent exists
10086 set sethostent d_sethent
10089 : see if setlinebuf exists
10090 set setlinebuf d_setlinebuf
10093 : see if setlocale exists
10094 set setlocale d_setlocale
10097 : see if setnetent exists
10098 set setnetent d_setnent
10101 : see if setprotoent exists
10102 set setprotoent d_setpent
10105 : see if setpgid exists
10106 set setpgid d_setpgid
10109 : see if setpgrp2 exists
10110 set setpgrp2 d_setpgrp2
10113 : see if setpriority exists
10114 set setpriority d_setprior
10117 : see if setpwent exists
10118 set setpwent d_setpwent
10121 : see if setregid exists
10122 set setregid d_setregid
10124 set setresgid d_setresgid
10127 : see if setreuid exists
10128 set setreuid d_setreuid
10130 set setresuid d_setresuid
10133 : see if setrgid exists
10134 set setrgid d_setrgid
10137 : see if setruid exists
10138 set setruid d_setruid
10141 : see if setservent exists
10142 set setservent d_setsent
10145 : see if setsid exists
10146 set setsid d_setsid
10149 : see if setspent exists
10150 set setspent d_setspent
10153 : see if setvbuf exists
10154 set setvbuf d_setvbuf
10157 : see if sfio.h is available
10162 : see if sfio library is available
10173 : Ok, but do we want to use it.
10177 true|$define|[yY]*) dflt='y';;
10180 echo "$package can use the sfio library, but it is experimental."
10181 rp="You seem to have sfio available, do you want to try using it?"
10185 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10187 : Remove sfio from list of libraries to use
10188 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10191 echo "libs = $libs" >&4
10195 *) case "$usesfio" in
10196 true|$define|[yY]*)
10197 echo "Sorry, cannot find sfio on this machine" >&4
10198 echo "Ignoring your setting of usesfio=$usesfio" >&4
10206 $define) usesfio='true';;
10207 *) usesfio='false';;
10210 : see if shmctl exists
10211 set shmctl d_shmctl
10214 : see if shmget exists
10215 set shmget d_shmget
10218 : see if shmat exists
10221 : see what shmat returns
10224 $cat >shmat.c <<'END'
10225 #include <sys/shm.h>
10228 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10233 echo "and it returns ($shmattype)." >&4
10234 : see if a prototype for shmat is available
10235 xxx=`./findhdr sys/shm.h`
10236 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10237 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10248 set d_shmatprototype
10251 : see if shmdt exists
10255 : see how much of the 'shm*(2)' library is present.
10258 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10259 *"$undef"*) h_shm=false;;
10263 case "`ipcs 2>&1`" in
10264 "SVID shared memory"*"not configured"*)
10265 echo "Your $osname does not have the shm*(2) configured." >&4
10268 set shmctl d_shmctl
10270 set shmget d_shmget
10280 : we could also check for sys/ipc.h ...
10281 if $h_shm && $test `./findhdr sys/shm.h`; then
10282 echo "You have the full shm*(2) library." >&4
10285 echo "You don't have the full shm*(2) library." >&4
10292 : see if we have sigaction
10293 if set sigaction val -f d_sigaction; eval $csym; $val; then
10294 echo 'sigaction() found.' >&4
10295 $cat > try.c <<'EOP'
10297 #include <sys/types.h>
10298 #include <signal.h>
10301 struct sigaction act, oact;
10303 oact.sa_handler = 0;
10307 if eval $compile_ok; then
10310 echo "But you don't seem to have a useable struct sigaction." >&4
10314 echo 'sigaction NOT found.' >&4
10317 set d_sigaction; eval $setvar
10318 $rm -f try try$_o try.c
10320 : see if sigsetjmp exists
10322 case "$d_sigsetjmp" in
10324 $cat >try.c <<'EOP'
10325 #include <setjmp.h>
10330 if (sigsetjmp(env,1))
10333 siglongjmp(env, 1);
10338 if eval $compile; then
10339 if ./try >/dev/null 2>&1; then
10340 echo "POSIX sigsetjmp found." >&4
10344 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10350 echo "sigsetjmp not found." >&4
10354 *) val="$d_sigsetjmp"
10355 case "$d_sigsetjmp" in
10356 $define) echo "POSIX sigsetjmp found." >&4;;
10357 $undef) echo "sigsetjmp not found." >&4;;
10365 : see if sqrtl exists
10369 : see if sys/stat.h is available
10370 set sys/stat.h i_sysstat
10373 : see if stat knows about block sizes
10375 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10378 : see if this is a sys/vfs.h system
10379 set sys/vfs.h i_sysvfs
10382 : see if this is a sys/statfs.h system
10383 set sys/statfs.h i_sysstatfs
10388 echo "Checking to see if your system supports struct statfs..." >&4
10389 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10391 case "$d_statfs_s" in
10392 "$define") echo "Yup, it does." >&4 ;;
10393 *) echo "Nope, it doesn't." >&4 ;;
10398 : see if struct statfs knows about f_flags
10399 case "$d_statfs_s" in
10402 echo "Checking to see if your struct statfs has f_flags field..." >&4
10403 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10407 set d_statfs_f_flags
10411 case "$d_statfs_f_flags" in
10412 "$define") echo "Yup, it does." >&4 ;;
10413 *) echo "Nope, it doesn't." >&4 ;;
10416 : see if _ptr and _cnt from stdio act std
10418 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10419 echo "(Looks like you have stdio.h from Linux.)"
10420 case "$stdio_ptr" in
10421 '') stdio_ptr='((fp)->_IO_read_ptr)'
10424 *) ptr_lval=$d_stdio_ptr_lval;;
10426 case "$stdio_cnt" in
10427 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10430 *) cnt_lval=$d_stdio_cnt_lval;;
10432 case "$stdio_base" in
10433 '') stdio_base='((fp)->_IO_read_base)';;
10435 case "$stdio_bufsiz" in
10436 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10439 case "$stdio_ptr" in
10440 '') stdio_ptr='((fp)->_ptr)'
10443 *) ptr_lval=$d_stdio_ptr_lval;;
10445 case "$stdio_cnt" in
10446 '') stdio_cnt='((fp)->_cnt)'
10449 *) cnt_lval=$d_stdio_cnt_lval;;
10451 case "$stdio_base" in
10452 '') stdio_base='((fp)->_base)';;
10454 case "$stdio_bufsiz" in
10455 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10458 : test whether _ptr and _cnt really work
10459 echo "Checking how std your stdio is..." >&4
10462 #define FILE_ptr(fp) $stdio_ptr
10463 #define FILE_cnt(fp) $stdio_cnt
10465 FILE *fp = fopen("try.c", "r");
10468 18 <= FILE_cnt(fp) &&
10469 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10477 if eval $compile; then
10479 echo "Your stdio acts pretty std."
10482 echo "Your stdio isn't very std."
10485 echo "Your stdio doesn't appear very std."
10491 : Can _ptr be used as an lvalue?
10492 case "$d_stdstdio$ptr_lval" in
10493 $define$define) val=$define ;;
10496 set d_stdio_ptr_lval
10499 : Can _cnt be used as an lvalue?
10500 case "$d_stdstdio$cnt_lval" in
10501 $define$define) val=$define ;;
10504 set d_stdio_cnt_lval
10507 : see if _base is also standard
10509 case "$d_stdstdio" in
10513 #define FILE_base(fp) $stdio_base
10514 #define FILE_bufsiz(fp) $stdio_bufsiz
10516 FILE *fp = fopen("try.c", "r");
10519 19 <= FILE_bufsiz(fp) &&
10520 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10527 if eval $compile; then
10529 echo "And its _base field acts std."
10532 echo "But its _base field isn't std."
10535 echo "However, it seems to be lacking the _base field."
10544 Checking how to access stdio streams by file descriptor number...
10546 case "$stdio_stream_array" in
10547 '') $cat >try.c <<EOCP
10550 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10554 for s in _iob __iob __sF
10556 set try -DSTDIO_STREAM_ARRAY=$s
10557 if eval $compile; then
10558 case "`./try$exe_ext`" in
10559 yes) stdio_stream_array=$s; break ;;
10563 $rm -f try.* try$exe_ext
10565 case "$stdio_stream_array" in
10567 I can't figure out how to access stdio streams by file descriptor number.
10569 d_stdio_stream_array="$undef"
10572 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10574 d_stdio_stream_array="$define"
10578 : see if strcoll exists
10579 set strcoll d_strcoll
10582 : check for structure copying
10584 echo "Checking to see if your C compiler can copy structs..." >&4
10585 $cat >try.c <<'EOCP'
10595 if $cc -c try.c >/dev/null 2>&1 ; then
10597 echo "Yup, it can."
10600 echo "Nope, it can't."
10606 : see if strerror and/or sys_errlist[] exist
10608 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10609 if set strerror val -f d_strerror; eval $csym; $val; then
10610 echo 'strerror() found.' >&4
10611 d_strerror="$define"
10612 d_strerrm='strerror(e)'
10613 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10614 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10615 d_syserrlst="$define"
10617 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10618 d_syserrlst="$undef"
10620 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10621 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10622 echo 'strerror() found in string header.' >&4
10623 d_strerror="$define"
10624 d_strerrm='strerror(e)'
10625 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10626 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10627 d_syserrlst="$define"
10629 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10630 d_syserrlst="$undef"
10632 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10633 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10634 d_strerror="$undef"
10635 d_syserrlst="$define"
10636 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10638 echo 'strerror() and sys_errlist[] NOT found.' >&4
10639 d_strerror="$undef"
10640 d_syserrlst="$undef"
10641 d_strerrm='"unknown"'
10645 : see if strtod exists
10646 set strtod d_strtod
10649 : see if strtol exists
10650 set strtol d_strtol
10653 : see if strtoul exists
10654 set strtoul d_strtoul
10657 : see if strtoull exists
10658 set strtoull d_strtoull
10661 : see if strxfrm exists
10662 set strxfrm d_strxfrm
10665 : see if symlink exists
10666 set symlink d_symlink
10669 : see if syscall exists
10670 set syscall d_syscall
10673 : see if sysconf exists
10674 set sysconf d_sysconf
10677 : see if system exists
10678 set system d_system
10681 : see if tcgetpgrp exists
10682 set tcgetpgrp d_tcgetpgrp
10685 : see if tcsetpgrp exists
10686 set tcsetpgrp d_tcsetpgrp
10689 : see if prototype for telldir is available
10691 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10694 : define an is-a-typedef? function
10695 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10697 "") inclist="sys/types.h";;
10699 eval "varval=\$$var";
10703 for inc in $inclist; do
10704 echo "#include <$inc>" >>temp.c;
10706 echo "#ifdef $type" >> temp.c;
10707 echo "printf(\"We have $type\");" >> temp.c;
10708 echo "#endif" >> temp.c;
10709 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10710 if $contains $type temp.E >/dev/null 2>&1; then
10711 eval "$var=\$type";
10716 *) eval "$var=\$varval";;
10719 : define an is-a-typedef? function that prompts if the type is not available.
10720 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10722 "") inclist="sys/types.h";;
10724 eval "varval=\$$var";
10728 for inc in $inclist; do
10729 echo "#include <$inc>" >>temp.c;
10731 echo "#ifdef $type" >> temp.c;
10732 echo "printf(\"We have $type\");" >> temp.c;
10733 echo "#endif" >> temp.c;
10734 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10736 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10737 if $contains $type temp.E >/dev/null 2>&1; then
10738 echo "$type found." >&4;
10739 eval "$var=\$type";
10741 echo "$type NOT found." >&4;
10747 *) eval "$var=\$varval";;
10750 : see if this is a sys/times.h system
10751 set sys/times.h i_systimes
10754 : see if times exists
10756 if set times val -f d_times; eval $csym; $val; then
10757 echo 'times() found.' >&4
10760 case "$i_systimes" in
10761 "$define") inc='sys/times.h';;
10763 rp="What is the type returned by times() on this system?"
10764 set clock_t clocktype long stdio.h sys/types.h $inc
10767 echo 'times() NOT found, hope that will do.' >&4
10772 : see if truncate exists
10773 set truncate d_truncate
10776 : see if tzname[] exists
10778 if set tzname val -a d_tzname; eval $csym; $val; then
10780 echo 'tzname[] found.' >&4
10783 echo 'tzname[] NOT found.' >&4
10788 : see if umask exists
10792 : see if ustat exists
10796 : backward compatibility for d_hvfork
10797 if test X$d_hvfork != X; then
10798 d_vfork="$d_hvfork"
10801 : see if there is a vfork
10806 : Ok, but do we want to use it. vfork is reportedly unreliable in
10807 : perl on Solaris 2.x, and probably elsewhere.
10811 case "$usevfork" in
10817 Perl can only use a vfork() that doesn't suffer from strict
10818 restrictions on calling functions or modifying global data in
10819 the child. For example, glibc-2.1 contains such a vfork()
10820 that is unsuitable. If your system provides a proper fork()
10821 call, chances are that you do NOT want perl to use vfork().
10824 rp="Do you still want to use vfork()?"
10829 echo "Ok, we won't use vfork()."
10838 $define) usevfork='true';;
10839 *) usevfork='false';;
10842 : see if this is an sysdir system
10843 set sys/dir.h i_sysdir
10846 : see if this is an sysndir system
10847 set sys/ndir.h i_sysndir
10850 : see if closedir exists
10851 set closedir d_closedir
10854 case "$d_closedir" in
10857 echo "Checking whether closedir() returns a status..." >&4
10858 cat > closedir.c <<EOM
10859 #$i_dirent I_DIRENT /**/
10860 #$i_sysdir I_SYS_DIR /**/
10861 #$i_sysndir I_SYS_NDIR /**/
10862 #$i_systypes I_SYS_TYPES /**/
10864 #if defined(I_SYS_TYPES)
10865 #include <sys/types.h>
10867 #if defined(I_DIRENT)
10868 #include <dirent.h>
10869 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10870 #include <sys/dir.h>
10874 #include <sys/ndir.h>
10878 #include <ndir.h> /* may be wrong in the future */
10880 #include <sys/dir.h>
10885 int main() { return closedir(opendir(".")); }
10888 if eval $compile_ok; then
10889 if ./closedir > /dev/null 2>&1 ; then
10890 echo "Yes, it does."
10893 echo "No, it doesn't."
10897 echo "(I can't seem to compile the test program--assuming it doesn't)"
10905 set d_void_closedir
10908 : check for volatile keyword
10910 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10911 $cat >try.c <<'EOCP'
10914 typedef struct _goo_struct goo_struct;
10915 goo_struct * volatile goo = ((goo_struct *)0);
10916 struct _goo_struct {
10921 typedef unsigned short foo_t;
10922 char *volatile foo;
10924 volatile foo_t blech;
10928 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10930 echo "Yup, it does."
10933 echo "Nope, it doesn't."
10939 : see if there is a wait4
10943 : see if waitpid exists
10944 set waitpid d_waitpid
10947 : see if wcstombs exists
10948 set wcstombs d_wcstombs
10951 : see if wctomb exists
10952 set wctomb d_wctomb
10955 : see if writev exists
10956 set writev d_writev
10959 : preserve RCS keywords in files with variable substitution, grrr
10964 Revision='$Revision'
10966 case "$crosscompile" in
10967 ''|[nN]*) crosscompile="$undef" ;;
10971 next|rhapsody) multiarch="$define" ;;
10973 case "$multiarch" in
10974 ''|[nN]*) multiarch="$undef" ;;
10977 : check for alignment requirements
10979 case "$crosscompile$multiarch" in
10982 You seem to be either cross-compiling or doing a multiarchitecture build,
10983 skipping the memory alignment check.
10986 case "$alignbytes" in
10987 '') alignbytes=8 ;;
10991 case "$alignbytes" in
10992 '') echo "Checking alignment constraints..." >&4
10993 $cat >try.c <<'EOCP'
11000 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
11004 if eval $compile_ok; then
11008 echo "(I can't seem to compile the test program...)"
11011 *) dflt="$alignbytes"
11014 rp="Doubles must be aligned on a how-many-byte boundary?"
11022 : check for ordering of bytes in a long
11024 case "$crosscompile$multiarch" in
11027 You seem to be either cross-compiling or doing a multiarchitecture build,
11028 skipping the byteorder check.
11034 case "$byteorder" in
11037 In the following, larger digits indicate more significance. A big-endian
11038 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11039 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11040 machines may have weird orders like 3412. A Cray will report 87654321,
11041 an Alpha will report 12345678. If the test program works the default is
11043 I'm now running the test program...
11045 $cat >try.c <<'EOCP'
11052 char c[sizeof(long)];
11055 if (sizeof(long) > 4)
11056 u.l = (0x08070605L << 32) | 0x04030201L;
11059 for (i = 0; i < sizeof(long); i++)
11060 printf("%c", u.c[i]+'0');
11067 if eval $compile && ./try > /dev/null; then
11070 [1-4][1-4][1-4][1-4]|12345678|87654321)
11071 echo "(The test program ran ok.)"
11072 echo "byteorder=$dflt"
11075 ????|????????) echo "(The test program ran ok.)" ;;
11076 *) echo "(The test program didn't run right for some reason.)" ;;
11081 (I can't seem to compile the test program. Guessing big-endian...)
11084 case "$xxx_prompt" in
11086 rp="What is the order of bytes in a long?"
11100 : how do we catenate cpp tokens here?
11102 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11103 $cat >cpp_stuff.c <<'EOCP'
11104 #define RCAT(a,b)a/**/b
11105 #define ACAT(a,b)a ## b
11109 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11110 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11111 echo "Oh! Smells like ANSI's been here." >&4
11112 echo "We can catify or stringify, separately or together!"
11114 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11115 echo "Ah, yes! The good old days!" >&4
11116 echo "However, in the good old days we don't know how to stringify and"
11117 echo "catify at the same time."
11121 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11122 to have to edit the values of CAT[2-5] in config.h...
11124 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11128 : see if this is a db.h system
11134 : Check db version.
11136 echo "Checking Berkeley DB version ..." >&4
11142 #include <sys/types.h>
11147 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11148 int Major, Minor, Patch ;
11149 unsigned long Version ;
11150 (void)db_version(&Major, &Minor, &Patch) ;
11151 printf("You have Berkeley DB Version 2 or greater\n");
11153 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11154 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11155 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11156 Major, Minor, Patch) ;
11158 /* check that db.h & libdb are compatible */
11159 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11160 printf("db.h and libdb are incompatible\n") ;
11164 printf("db.h and libdb are compatible\n") ;
11166 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11167 + DB_VERSION_PATCH ;
11169 /* needs to be >= 2.3.4 */
11170 if (Version < 2003004) {
11171 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11172 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11178 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11179 printf("You have Berkeley DB Version 1\n");
11180 exit(0); /* DB version < 2: the coast is clear. */
11182 exit(1); /* <db.h> not Berkeley DB? */
11188 if eval $compile && ./try; then
11189 echo 'Looks OK.' >&4
11191 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11195 : Remove db from list of libraries to use
11196 echo "Removing unusable -ldb from library list" >&4
11197 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11200 echo "libs = $libs" >&4
11210 : Check the return type needed for hash
11212 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11218 #include <sys/types.h>
11221 #ifndef DB_VERSION_MAJOR
11222 u_int32_t hash_cb (ptr, size)
11230 info.hash = hash_cb;
11234 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11235 if $contains warning try.out >>/dev/null 2>&1 ; then
11238 db_hashtype='u_int32_t'
11241 : XXX Maybe we should just give up here.
11242 db_hashtype=u_int32_t
11244 echo "Help: I can't seem to compile the db test program." >&4
11245 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11248 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11250 *) db_hashtype=u_int32_t
11255 : Check the return type needed for prefix
11257 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11263 #include <sys/types.h>
11266 #ifndef DB_VERSION_MAJOR
11267 size_t prefix_cb (key1, key2)
11275 info.prefix = prefix_cb;
11279 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11280 if $contains warning try.out >>/dev/null 2>&1 ; then
11281 db_prefixtype='int'
11283 db_prefixtype='size_t'
11286 db_prefixtype='size_t'
11287 : XXX Maybe we should just give up here.
11289 echo "Help: I can't seem to compile the db test program." >&4
11290 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11293 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11295 *) db_prefixtype='size_t'
11299 : check for void type
11301 echo "Checking to see how well your C compiler groks the void type..." >&4
11302 case "$voidflags" in
11304 $cat >try.c <<'EOCP'
11310 extern void moo(); /* function returning void */
11311 void (*goo)(); /* ptr to func returning void */
11313 void *hue; /* generic ptr */
11326 int main() { sub(); }
11328 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11329 voidflags=$defvoidused
11330 echo "Good. It appears to support void to the level $package wants.">&4
11331 if $contains warning .out >/dev/null 2>&1; then
11332 echo "However, you might get some warnings that look like this:"
11336 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11337 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11338 echo "It supports 1..."
11339 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11340 echo "It also supports 2..."
11341 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11343 echo "And it supports 4 but not 8 definitely."
11345 echo "It doesn't support 4..."
11346 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11348 echo "But it supports 8."
11351 echo "Neither does it support 8."
11355 echo "It does not support 2..."
11356 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11358 echo "But it supports 4 and 8."
11360 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11362 echo "And it supports 4 but has not heard about 8."
11364 echo "However it supports 8 but not 4."
11369 echo "There is no support at all for void."
11374 case "$voidflags" in
11376 *) $cat >&4 <<'EOM'
11377 Support flag bits are:
11378 1: basic void declarations.
11379 2: arrays of pointers to functions returning void.
11380 4: operations between pointers to and addresses of void functions.
11381 8: generic void pointers.
11384 rp="Your void support flags add up to what?"
11392 : How can we generate normalized random numbers ?
11394 echo "Looking for a random number function..." >&4
11395 case "$randfunc" in
11397 if set drand48 val -f; eval $csym; $val; then
11399 echo "Good, found drand48()." >&4
11400 elif set random val -f; eval $csym; $val; then
11402 echo "OK, found random()." >&4
11405 echo "Yick, looks like I have to use rand()." >&4
11416 *-Dmy_rand=*|*-Dmy_srand=*)
11417 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11418 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11419 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11420 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11424 while $test "$cont"; do
11425 rp="Use which function to generate random numbers?"
11427 if $test "$ans" = "$dflt"; then
11433 if set $ans val -f; eval $csym; $val; then
11437 rp="I cannot find function $ans. Use that name anyway?"
11446 case "$randfunc" in
11448 drand01="drand48()"
11454 case "$randbits" in
11456 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11458 #$i_unistd I_UNISTD
11459 #$i_stdlib I_STDLIB
11462 # include <unistd.h>
11465 # include <stdlib.h>
11470 register unsigned long tmp;
11471 register unsigned long max = 0L;
11473 for (i = 1000; i; i--) {
11474 tmp = (unsigned long) $randfunc();
11475 if (tmp > max) max = tmp;
11477 for (i = 0; max; i++)
11483 if eval $compile_ok; then
11487 echo "(I can't seem to compile the test program...)"
11494 rp="How many bits does your $randfunc() function produce?"
11498 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11499 seedfunc="s$randfunc"
11500 randseedtype=unsigned
11504 rp="How many bits does your $randfunc() function produce?"
11507 seedfunc="s$randfunc"
11508 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11509 if set $seedfunc val -f; eval $csym; $val; then
11510 echo "(Using $seedfunc() to seed random generator)"
11512 echo "(Warning: no $seedfunc() to seed random generator)"
11515 randseedtype=unsigned
11523 echo "Determining whether or not we are on an EBCDIC system..." >&4
11524 $cat >tebcdic.c <<'EOM'
11527 if ('M'==0xd4) return 0;
11534 if eval $compile_ok; then
11536 echo "You have EBCDIC." >&4
11539 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11542 echo "I'm unable to compile the test program." >&4
11543 echo "I'll assume ASCII or some ISO Latin." >&4
11545 $rm -f tebcdic.c tebcdic
11551 Checking how to flush all pending stdio output...
11553 # I only know how to find the first 32 possibly open files on SunOS.
11554 # See also hints/sunos_4_1.sh and util.c --AD
11556 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11558 $cat >>try.c <<EOCP
11560 #$i_unistd I_UNISTD
11562 # include <unistd.h>
11564 #$d_sysconf HAS_SYSCONF
11565 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11566 #ifdef HAS_STDIO_STREAM_ARRAY
11567 # define STDIO_STREAM_ARRAY $stdio_stream_array
11570 FILE* p = fopen("try.out", "w");
11574 # ifdef TRY_FPRINTF
11578 #ifdef TRY_FFLUSH_NULL
11581 #ifdef TRY_FFLUSH_ALL
11583 long open_max = -1;
11584 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11585 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11587 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11588 open_max = sysconf(_SC_OPEN_MAX);
11591 open_max = FOPEN_MAX;
11594 open_max = OPEN_MAX;
11603 # ifdef HAS_STDIO_STREAM_ARRAY
11604 if (open_max > 0) {
11606 for (i = 0; i < open_max; i++)
11607 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11608 STDIO_STREAM_ARRAY[i]._file < open_max &&
11609 STDIO_STREAM_ARRAY[i]._flag)
11610 fflush(&STDIO_STREAM_ARRAY[i]);
11618 : first we have to find out how _not_ to flush
11619 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11621 set try -DTRY_FPUTC
11622 if eval $compile; then
11624 ./try$exe_ext 2>/dev/null
11625 if $test ! -s try.out -a "X$?" = X42; then
11631 set try -DTRY_FPRINTF
11633 if eval $compile; then
11635 ./try$exe_ext 2>/dev/null
11636 if $test ! -s try.out -a "X$?" = X42; then
11637 output=-DTRY_FPRINTF
11643 : check for fflush NULL behaviour
11644 case "$fflushNULL" in
11645 '') set try -DTRY_FFLUSH_NULL $output
11646 if eval $compile; then
11648 ./try$exe_ext 2>/dev/null
11650 if $test -s try.out -a "X$code" = X42; then
11651 fflushNULL="`$cat try.out`"
11653 if $test "X$code" != X42; then
11655 (If this test failed, don't worry, we'll try another method shortly.)
11660 $rm -f core try.core core.try.*
11661 case "$fflushNULL" in
11663 Your fflush(NULL) works okay.
11665 fflushNULL="$define"
11668 Your fflush(NULL) isn't working (contrary to ANSI C).
11670 fflushNULL="$undef"
11673 Cannot figure out whether your fflush(NULL) works or not.
11674 I'm assuming it doesn't (contrary to ANSI C).
11676 fflushNULL="$undef"
11680 $define|true|[yY]*)
11681 fflushNULL="$define"
11684 fflushNULL="$undef"
11687 : check explicit looping only if NULL did not work
11688 case "$fflushNULL" in
11690 : check for fflush all behaviour
11691 case "$fflushall" in
11692 '') set try -DTRY_FFLUSH_ALL $output
11693 if eval $compile; then
11695 (Now testing the other method--but note that also this may fail.)
11698 ./try$exe_ext 2>/dev/null
11699 if $test -s try.out -a "X$?" = X42; then
11700 fflushall="`$cat try.out`"
11703 $rm -f core try.core core.try.*
11704 case "$fflushall" in
11706 Whew. Flushing explicitly all the stdio streams works.
11708 fflushall="$define"
11711 Sigh. Flushing explicitly all the stdio streams doesn't work.
11716 Cannot figure out whether flushing stdio streams explicitly works or not.
11717 I'm assuming it doesn't.
11723 "$define"|true|[yY]*)
11724 fflushall="$define"
11731 *) fflushall="$undef"
11734 case "$fflushNULL$fflushall" in
11737 I cannot figure out how to flush pending stdio output.
11741 $rm -f try.* try$exe_ext
11743 : see what type file positions are declared as in the library
11744 rp="What is the type for file position used by fsetpos()?"
11745 set fpos_t fpostype long stdio.h sys/types.h
11748 : Store the full pathname to the ar program for use in the C program
11749 : Respect a hint or command line value for full_ar.
11754 : Store the full pathname to the sed program for use in the C program
11757 : see what type gids are declared as in the kernel
11759 echo "Looking for the type for group ids returned by getgid()."
11760 set gid_t gidtype xxx stdio.h sys/types.h
11764 xxx=`./findhdr sys/user.h`
11765 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11767 unsigned) dflt="$1 $2" ;;
11771 *) dflt="$gidtype";;
11774 gid_t) echo "gid_t found." ;;
11775 *) rp="What is the type for group ids returned by getgid()?"
11781 : see if getgroups exists
11782 set getgroups d_getgrps
11785 : see if setgroups exists
11786 set setgroups d_setgrps
11790 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11792 case "$d_getgrps$d_setgrps" in
11794 case "$groupstype" in
11795 '') dflt="$gidtype" ;;
11796 *) dflt="$groupstype" ;;
11799 What type of pointer is the second argument to getgroups() and setgroups()?
11800 Usually this is the same as group ids, $gidtype, but not always.
11803 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11807 *) groupstype="$gidtype";;
11810 : see what type lseek is declared as in the kernel
11811 rp="What is the type used for lseek's offset on this system?"
11812 set off_t lseektype long stdio.h sys/types.h
11816 $echo $n "Checking to see how big your file offsets are...$c" >&4
11818 #include <sys/types.h>
11822 printf("%d\n", sizeof($lseektype));
11826 if eval $compile_ok; then
11828 $echo " $lseeksize bytes." >&4
11832 echo "(I can't seem to compile the test program. Guessing...)"
11833 rp="What is the size of your file offsets (in bytes)?"
11840 echo "Checking if your $make program sets \$(MAKE)..." >&4
11841 case "$make_set_make" in
11843 $sed 's/^X //' > testmake.mak << 'EOF'
11845 X @echo 'maketemp="$(MAKE)"'
11847 case "`$make -f testmake.mak 2>/dev/null`" in
11848 *maketemp=*) make_set_make='#' ;;
11849 *) make_set_make="MAKE=$make" ;;
11851 $rm -f testmake.mak
11854 case "$make_set_make" in
11855 '#') echo "Yup, it does.";;
11856 *) echo "Nope, it doesn't.";;
11859 : see what type is used for mode_t
11860 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11861 set mode_t modetype int stdio.h sys/types.h
11864 : define a fucntion to check prototypes
11865 $cat > protochk <<EOSH
11868 optimize="$optimize"
11870 prototype="$prototype"
11875 $cat >> protochk <<'EOSH'
11880 while test $# -ge 2; do
11882 $define) echo "#include <$2>" >> try.c ;;
11883 literal) echo "$2" >> try.c ;;
11887 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11888 cat >> try.c <<'EOCP'
11889 #ifdef CAN_PROTOTYPE
11890 #define _(args) args
11895 echo "$foo" >> try.c
11896 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11897 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11903 $eunicefix protochk
11905 : see what type is used for size_t
11906 rp="What is the type used for the length parameter for string functions?"
11907 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11910 : check for type of arguments to gethostbyaddr.
11911 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11912 case "$d_gethbyaddr" in
11916 Checking to see what type of arguments are accepted by gethostbyaddr().
11918 hdrs="$define sys/types.h
11919 $d_socket sys/socket.h
11920 $i_niin netinet/in.h
11922 $i_unistd unistd.h"
11923 : The first arg can 'char *' or 'void *'
11924 : The second arg is some of integral type
11925 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11926 for yyy in size_t long int; do
11927 case "$netdb_host_type" in
11928 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11929 if ./protochk "$try" $hdrs; then
11930 echo "Your system accepts $xxx for the first arg."
11931 echo "...and $yyy for the second arg."
11932 netdb_host_type="$xxx"
11933 netdb_hlen_type="$yyy"
11939 : In case none of those worked, prompt the user.
11940 case "$netdb_host_type" in
11941 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11944 netdb_host_type=$ans
11945 rp='What is the type for the 2nd argument to gethostbyaddr?'
11948 netdb_hlen_type=$ans
11952 *) : no gethostbyaddr, so pick harmless defaults
11953 netdb_host_type='char *'
11954 netdb_hlen_type="$sizetype"
11957 # Remove the "const" if needed. -- but then we'll have a
11959 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11962 : check for type of argument to gethostbyname.
11963 if test "X$netdb_name_type" = X ; then
11964 case "$d_gethbyname" in
11968 Checking to see what type of argument is accepted by gethostbyname().
11970 hdrs="$define sys/types.h
11971 $d_socket sys/socket.h
11972 $i_niin netinet/in.h
11974 $i_unistd unistd.h"
11975 for xxx in "const char *" "char *"; do
11976 case "$netdb_name_type" in
11977 '') try="extern struct hostent *gethostbyname($xxx);"
11978 if ./protochk "$try" $hdrs; then
11979 echo "Your system accepts $xxx."
11980 netdb_name_type="$xxx"
11985 : In case none of those worked, prompt the user.
11986 case "$netdb_name_type" in
11987 '') rp='What is the type for the 1st argument to gethostbyname?'
11990 netdb_name_type=$ans
11994 *) : no gethostbyname, so pick harmless default
11995 netdb_name_type='char *'
12000 : check for type of 1st argument to getnetbyaddr.
12001 if test "X$netdb_net_type" = X ; then
12002 case "$d_getnbyaddr" in
12006 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12008 hdrs="$define sys/types.h
12009 $d_socket sys/socket.h
12010 $i_niin netinet/in.h
12012 $i_unistd unistd.h"
12013 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12014 case "$netdb_net_type" in
12015 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12016 if ./protochk "$try" $hdrs; then
12017 echo "Your system accepts $xxx."
12018 netdb_net_type="$xxx"
12023 : In case none of those worked, prompt the user.
12024 case "$netdb_net_type" in
12025 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12028 netdb_net_type=$ans
12032 *) : no getnetbyaddr, so pick harmless default
12033 netdb_net_type='long'
12037 : locate the preferred pager for this system
12051 '') dflt=/usr/ucb/more;;
12058 rp='What pager is used on your system?'
12062 : see what type pids are declared as in the kernel
12063 rp="What is the type of process ids on this system?"
12064 set pid_t pidtype int stdio.h sys/types.h
12067 : Find earliest binary compatible site_perl subdirectory perl can use.
12068 case "$bincompat5005" in
12069 "$define") xs_apiversion='5.005' ;;
12070 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12072 : Find earliest pure perl site_perl subdirectory perl can use.
12073 : The versioned directories started at 5.005.
12074 pm_apiversion='5.005'
12076 : check for length of pointer
12080 $echo $n "Checking to see how big your pointers are...$c" >&4
12081 if test "$voidflags" -gt 7; then
12082 echo '#define VOID_PTR char *' > try.c
12084 echo '#define VOID_PTR void *' > try.c
12086 $cat >>try.c <<'EOCP'
12090 printf("%d\n", sizeof(VOID_PTR));
12095 if eval $compile_ok; then
12097 $echo " $ptrsize bytes." >&4
12100 echo "(I can't seem to compile the test program. Guessing...)" >&4
12101 rp="What is the size of a pointer (in bytes)?"
12109 : see if ar generates random libraries by itself
12111 echo "Checking how to generate random libraries on your machine..." >&4
12112 echo 'int bar1() { return bar2(); }' > bar1.c
12113 echo 'int bar2() { return 2; }' > bar2.c
12114 $cat > foo.c <<'EOP'
12115 int main() { printf("%d\n", bar1()); exit(0); }
12117 $cc $ccflags -c bar1.c >/dev/null 2>&1
12118 $cc $ccflags -c bar2.c >/dev/null 2>&1
12119 $cc $ccflags -c foo.c >/dev/null 2>&1
12120 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12121 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12122 ./foobar >/dev/null 2>&1; then
12123 echo "$ar appears to generate random libraries itself."
12126 elif $ar ts bar$_a >/dev/null 2>&1 &&
12127 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12128 ./foobar >/dev/null 2>&1; then
12129 echo "a table of contents needs to be added with '$ar ts'."
12136 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12137 $test -f $ranlib || ranlib=''
12140 if $test -n "$ranlib"; then
12141 echo "your system has '$ranlib'; we'll use that."
12144 echo "your system doesn't seem to support random libraries"
12145 echo "so we'll use lorder and tsort to order the libraries."
12152 : check for type of arguments to select.
12153 case "$selecttype" in
12154 '') case "$d_select" in
12157 Checking to see what type of arguments are accepted by select().
12159 hdrs="$define sys/types.h
12160 $i_systime sys/time.h
12161 $i_sysselct sys/select.h
12162 $d_socket sys/socket.h"
12163 : The first arg can be int, unsigned, or size_t
12164 : The last arg may or may not be 'const'
12166 : void pointer has been seen but using that
12167 : breaks the selectminbits test
12168 for xxx in 'fd_set *' 'int *'; do
12169 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12170 for tmo in 'struct timeval *' 'const struct timeval *'; do
12172 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12173 if ./protochk "$try" $hdrs; then
12174 echo "Your system accepts $xxx."
12183 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12184 case "$d_fd_set" in
12185 $define) dflt="fd_set *" ;;
12194 *) : no select, so pick a harmless default
12201 : check for the select 'width'
12202 case "$selectminbits" in
12203 '') case "$d_select" in
12207 Checking to see on how many bits at a time your select() operates...
12210 #include <sys/types.h>
12212 #$i_systime I_SYS_TIME
12213 #$i_systimek I_SYS_TIME_KERNEL
12218 # ifdef I_SYS_TIME_KERNEL
12221 # include <sys/time.h>
12222 # ifdef I_SYS_TIME_KERNEL
12226 #$i_sysselct I_SYS_SELECT
12227 #ifdef I_SYS_SELECT
12228 #include <sys/select.h>
12230 #$d_socket HAS_SOCKET
12232 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12236 #define S sizeof(*(b))
12238 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12239 #define NBITS (NBYTES * 8)
12248 fp = fopen("try.c", "r");
12254 b = ($selecttype)s;
12255 for (i = 0; i < NBITS; i++)
12259 select(fd + 1, b, 0, 0, &t);
12260 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12261 printf("%d\n", i + 1);
12266 if eval $compile_ok; then
12267 selectminbits=`./try`
12268 case "$selectminbits" in
12270 Cannot figure out on how many bits at a time your select() operates.
12271 I'll play safe and guess it is 32 bits.
12277 *) bits="$selectminbits bits" ;;
12279 echo "Your select() operates on $bits at a time." >&4
12281 rp='What is the minimum number of bits your select() operates on?'
12282 case "$byteorder" in
12283 1234|12345678) dflt=32 ;;
12288 selectminbits="$val"
12292 *) : no select, so pick a harmless default
12299 : Trace out the files included by signal.h, then look for SIGxxx names.
12300 : Remove SIGARRAYSIZE used by HPUX.
12301 : Remove SIGSTKSIZE used by Linux.
12302 : Remove SIGSTKSZ used by Posix.
12303 : Remove SIGTYP void lines used by OS2.
12304 xxx=`echo '#include <signal.h>' |
12305 $cppstdin $cppminus $cppflags 2>/dev/null |
12306 $grep '^[ ]*#.*include' |
12307 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12308 : Check this list of files to be sure we have parsed the cpp output ok.
12309 : This will also avoid potentially non-existent files, such
12312 for xx in $xxx /dev/null ; do
12313 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12315 : If we have found no files, at least try signal.h
12316 case "$xxxfiles" in
12317 '') xxxfiles=`./findhdr signal.h` ;;
12320 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12321 print substr($2, 4, 20)
12323 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12324 print substr($3, 4, 20)
12326 : Append some common names just in case the awk scan failed.
12327 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12328 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12329 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12330 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12331 : generate a few handy files for later
12332 $cat > signal.c <<'EOCP'
12333 #include <sys/types.h>
12334 #include <signal.h>
12338 /* Strange style to avoid deeply-nested #if/#else/#endif */
12341 # define NSIG (_NSIG)
12347 # define NSIG (SIGMAX+1)
12353 # define NSIG (SIG_MAX+1)
12359 # define NSIG (MAXSIG+1)
12365 # define NSIG (MAX_SIG+1)
12370 # ifdef SIGARRAYSIZE
12371 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12377 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12381 /* Default to some arbitrary number that's big enough to get most
12382 of the common signals.
12388 printf("NSIG %d\n", NSIG);
12394 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12396 printf "#ifdef SIG"; printf $1; printf "\n"
12397 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12398 printf $1; printf ");\n"
12402 printf "#endif /* JUST_NSIG */\n";
12406 $cat >signal.awk <<'EOP'
12407 BEGIN { ndups = 0 }
12408 $1 ~ /^NSIG$/ { nsig = $2 }
12409 ($1 !~ /^NSIG$/) && (NF == 2) {
12410 if ($2 > maxsig) { maxsig = $2 }
12411 if (sig_name[$2]) {
12412 dup_name[ndups] = $1
12413 dup_num[ndups] = $2
12425 printf("NSIG %d\n", nsig);
12426 for (n = 1; n < nsig; n++) {
12428 printf("%s %d\n", sig_name[n], sig_num[n])
12431 printf("NUM%d %d\n", n, n)
12434 for (n = 0; n < ndups; n++) {
12435 printf("%s %d\n", dup_name[n], dup_num[n])
12439 $cat >signal_cmd <<EOS
12441 if $test -s signal.lst; then
12442 echo "Using your existing signal.lst file"
12447 $cat >>signal_cmd <<'EOS'
12450 if eval $compile_ok; then
12451 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12453 echo "(I can't seem be able to compile the whole test program)" >&4
12454 echo "(I'll try it in little pieces.)" >&4
12455 set signal -DJUST_NSIG
12456 if eval $compile_ok; then
12457 ./signal$_exe > signal.nsg
12460 echo "I can't seem to figure out how many signals you have." >&4
12461 echo "Guessing 50." >&4
12462 echo 'NSIG 50' > signal.nsg
12464 : Now look at all the signal names, one at a time.
12465 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12466 $cat > signal.c <<EOCP
12467 #include <sys/types.h>
12468 #include <signal.h>
12471 printf("$xx %d\n", SIG${xx});
12476 if eval $compile; then
12477 echo "SIG${xx} found."
12478 ./signal$_exe >> signal.ls1
12480 echo "SIG${xx} NOT found."
12483 if $test -s signal.ls1; then
12484 $cat signal.nsg signal.ls1 |
12485 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12489 if $test -s signal.lst; then
12492 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12493 echo 'kill -l' >signal
12494 set X `csh -f <signal`
12498 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12500 echo $@ | $tr ' ' $trnl | \
12501 $awk '{ printf "%s %d\n", $1, ++s; }
12502 END { printf "NSIG %d\n", ++s }' >signal.lst
12504 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12506 chmod a+x signal_cmd
12507 $eunicefix signal_cmd
12509 : generate list of signal names
12511 case "$sig_name_init" in
12513 *) case "$sig_num_init" in
12514 ''|*,*) doinit=yes ;;
12519 echo "Generating a list of signal names and numbers..." >&4
12521 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12522 sig_name=`$awk 'BEGIN { printf "ZERO " }
12523 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12524 sig_num=`$awk 'BEGIN { printf "0 " }
12525 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12526 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12527 !/^NSIG/ { printf "\"%s\", ", $1 }
12528 END { printf "0\n" }' signal.lst`
12529 sig_num_init=`$awk 'BEGIN { printf "0, " }
12530 !/^NSIG/ { printf "%d, ", $2}
12531 END { printf "0\n"}' signal.lst`
12534 echo "The following $sig_count signals are available:"
12536 echo $sig_name | $awk \
12537 'BEGIN { linelen = 0 }
12539 for (i = 1; i <= NF; i++) {
12540 name = "SIG" $i " "
12541 linelen = linelen + length(name)
12542 if (linelen > 70) {
12544 linelen = length(name)
12550 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12552 : see what type is used for signed size_t
12553 set ssize_t ssizetype int stdio.h sys/types.h
12556 $cat > ssize.c <<EOM
12558 #include <sys/types.h>
12559 #define Size_t $sizetype
12560 #define SSize_t $dflt
12563 if (sizeof(Size_t) == sizeof(SSize_t))
12565 else if (sizeof(Size_t) == sizeof(int))
12574 if eval $compile_ok && ./ssize > /dev/null; then
12575 ssizetype=`./ssize`
12576 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12579 Help! I can't compile and run the ssize_t test program: please enlighten me!
12580 (This is probably a misconfiguration in your system or libraries, and
12581 you really ought to fix it. Still, I'll try anyway.)
12583 I need a type that is the same size as $sizetype, but is guaranteed to
12584 be signed. Common values are ssize_t, int and long.
12587 rp="What signed type is the same size as $sizetype?"
12591 $rm -f ssize ssize.*
12593 : see what type of char stdio uses.
12595 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12596 echo "Your stdio uses unsigned chars." >&4
12597 stdchar="unsigned char"
12599 echo "Your stdio uses signed chars." >&4
12603 : see if time exists
12605 if test "X$d_time" = X -o X"$timetype" = X; then
12606 if set time val -f d_time; eval $csym; $val; then
12607 echo 'time() found.' >&4
12609 rp="What is the type returned by time() on this system?"
12610 set time_t timetype long stdio.h sys/types.h
12613 echo 'time() not found, hope that will do.' >&4
12621 : see what type uids are declared as in the kernel
12623 echo "Looking for the type for user ids returned by getuid()."
12624 set uid_t uidtype xxx stdio.h sys/types.h
12628 xxx=`./findhdr sys/user.h`
12629 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12631 unsigned) dflt="$1 $2" ;;
12635 *) dflt="$uidtype";;
12638 uid_t) echo "uid_t found." ;;
12639 *) rp="What is the type for user ids returned by getuid()?"
12647 *_t) zzz="$uidtype" ;;
12650 echo "Checking the sign of $zzz..." >&4
12652 #include <sys/types.h>
12663 if eval $compile; then
12667 echo "(I can't execute the test program--guessing unsigned.)" >&4
12671 1) echo "Your $zzz is unsigned." ;;
12672 -1) echo "Your $zzz is signed." ;;
12678 echo "(I can't compile the test program--guessing unsigned.)" >&4
12682 : see if dbm.h is available
12683 : see if dbmclose exists
12684 set dbmclose d_dbmclose
12687 case "$d_dbmclose" in
12697 *) set rpcsvc/dbm.h i_rpcsvcdbm
12702 *) echo "We won't be including <dbm.h>"
12712 : see if this is a sys/file.h system
12717 : do we need to include sys/file.h ?
12721 if $h_sysfile; then
12723 echo "We'll be including <sys/file.h>." >&4
12726 echo "We won't be including <sys/file.h>." >&4
12736 : see if fcntl.h is there
12741 : see if we can include fcntl.h
12747 echo "We'll be including <fcntl.h>." >&4
12750 if $h_sysfile; then
12751 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12753 echo "We won't be including <fcntl.h>." >&4
12765 : see if locale.h is available
12766 set locale.h i_locale
12769 : see if mach cthreads are available
12770 if test "X$usethreads" = "X$define"; then
12771 set mach/cthreads.h i_machcthr
12774 i_machcthr="$undef"
12779 : see if this is a math.h system
12783 : see if this is a mntent.h system
12784 set mntent.h i_mntent
12787 : see if ndbm.h is available
12792 : see if dbm_open exists
12793 set dbm_open d_dbm_open
12795 case "$d_dbm_open" in
12798 echo "We won't be including <ndbm.h>"
12807 : see if net/errno.h is available
12809 set net/errno.h val
12812 : Unfortunately, it causes problems on some systems. Arrgh.
12815 cat > try.c <<'EOM'
12818 #include <net/errno.h>
12824 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12825 echo "We'll be including <net/errno.h>." >&4
12827 echo "We won't be including <net/errno.h>." >&4
12836 : see if netinet/tcp.h is available
12837 set netinet/tcp.h i_netinettcp
12840 : see if this is a poll.h system
12844 : get C preprocessor symbols handy
12846 $echo $n "Hmm... $c"
12847 echo $al | $tr ' ' $trnl >Cppsym.know
12848 $cat <<EOSS >Cppsym
12856 case "\$list\$#" in
12859 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12861 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12864 unknown="\$unknown \$sym"
12874 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12876 exit 0; _ _ _ _\1\\ \1\\
12879 echo "exit 1; _ _ _" >>Cppsym\$\$
12880 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12882 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12888 $rm -f Cppsym\$\$ Cppsym2\$\$
12893 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12895 : now check the C compiler for additional symbols
12896 postprocess_cc_v=''
12898 aix) postprocess_cc_v="|$tr , ' '" ;;
12905 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12908 -D*) echo "\$i" | $sed 's/^-D//';;
12909 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12914 postprocess_cc_v=''
12917 ./ccsym > ccsym1.raw
12918 if $test -s ccsym1.raw; then
12919 $sort ccsym1.raw | $uniq >ccsym.raw
12921 mv ccsym1.raw ccsym.raw
12924 $awk '/\=/ { print $0; next }
12925 { print $0"=1" }' ccsym.raw >ccsym.list
12926 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12927 $comm -13 ccsym.true ccsym.list >ccsym.own
12928 $comm -12 ccsym.true ccsym.list >ccsym.com
12929 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12931 if $test -z ccsym.raw; then
12932 echo "Your C compiler doesn't seem to define any symbols!" >&4
12934 echo "However, your C preprocessor defines the following symbols:"
12937 cppsymbols=`$cat Cppsym.true`
12938 cppsymbols=`echo $cppsymbols`
12939 cppccsymbols="$cppsymbols"
12941 if $test -s ccsym.com; then
12942 echo "Your C compiler and pre-processor define these symbols:"
12943 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12946 cppccsymbols=`$cat ccsym.com`
12947 cppccsymbols=`echo $cppccsymbols`
12948 $test "$silent" || sleep 1
12950 if $test -s ccsym.cpp; then
12951 $test "$also" && echo " "
12952 echo "Your C pre-processor ${also}defines the following symbols:"
12953 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12955 cppsymbols=`$cat ccsym.cpp`
12956 cppsymbols=`echo $cppsymbols`
12957 $test "$silent" || sleep 1
12959 if $test -s ccsym.own; then
12960 $test "$also" && echo " "
12961 echo "Your C compiler ${also}defines the following cpp symbols:"
12962 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12963 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12964 ccsymbols=`$cat ccsym.own`
12965 ccsymbols=`echo $ccsymbols`
12966 $test "$silent" || sleep 1
12971 : see if this is a termio system
12975 if $test `./findhdr termios.h`; then
12976 set tcsetattr i_termios
12982 "$define") echo "You have POSIX termios.h... good!" >&4;;
12983 *) if ./Cppsym pyr; then
12984 case "`/bin/universe`" in
12985 ucb) if $test `./findhdr sgtty.h`; then
12987 echo "<sgtty.h> found." >&4
12989 echo "System is pyramid with BSD universe."
12990 echo "<sgtty.h> not found--you could have problems." >&4
12992 *) if $test `./findhdr termio.h`; then
12994 echo "<termio.h> found." >&4
12996 echo "System is pyramid with USG universe."
12997 echo "<termio.h> not found--you could have problems." >&4
13001 if $test `./findhdr termio.h`; then
13002 echo "<termio.h> found." >&4
13004 elif $test `./findhdr sgtty.h`; then
13005 echo "<sgtty.h> found." >&4
13008 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13011 if $test `./findhdr sgtty.h`; then
13012 echo "<sgtty.h> found." >&4
13014 elif $test `./findhdr termio.h`; then
13015 echo "<termio.h> found." >&4
13018 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13022 set i_termio; eval $setvar
13023 val=$val2; set i_sgtty; eval $setvar
13024 val=$val3; set i_termios; eval $setvar
13026 : see if this is a shadow.h system
13027 set shadow.h i_shadow
13030 : see if this is a socks.h system
13031 set socks.h i_socks
13034 : see if stdarg is available
13036 if $test `./findhdr stdarg.h`; then
13037 echo "<stdarg.h> found." >&4
13040 echo "<stdarg.h> NOT found." >&4
13044 : see if varags is available
13046 if $test `./findhdr varargs.h`; then
13047 echo "<varargs.h> found." >&4
13049 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13052 : set up the varargs testing programs
13053 $cat > varargs.c <<EOP
13055 #include <stdarg.h>
13058 #include <varargs.h>
13062 int f(char *p, ...)
13076 p = va_arg(ap, char *);
13081 $cat > varargs <<EOP
13083 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13092 : now check which varargs header should be included
13097 if `./varargs I_STDARG`; then
13099 elif `./varargs I_VARARGS`; then
13104 if `./varargs I_VARARGS`; then
13111 echo "I could not find the definition for va_dcl... You have problems..." >&4
13112 val="$undef"; set i_stdarg; eval $setvar
13113 val="$undef"; set i_varargs; eval $setvar
13118 case "$i_varhdr" in
13120 val="$define"; set i_stdarg; eval $setvar
13121 val="$undef"; set i_varargs; eval $setvar
13124 val="$undef"; set i_stdarg; eval $setvar
13125 val="$define"; set i_varargs; eval $setvar
13128 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13132 : see if stddef is available
13133 set stddef.h i_stddef
13136 : see if sys/access.h is available
13137 set sys/access.h i_sysaccess
13140 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13141 set sys/filio.h i_sysfilio
13144 if $test `./findhdr sys/ioctl.h`; then
13146 echo '<sys/ioctl.h> found.' >&4
13149 if $test $i_sysfilio = "$define"; then
13150 echo '<sys/ioctl.h> NOT found.' >&4
13152 $test $i_sgtty = "$define" && xxx="sgtty.h"
13153 $test $i_termio = "$define" && xxx="termio.h"
13154 $test $i_termios = "$define" && xxx="termios.h"
13155 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13161 : see if sys/resource.h has to be included
13162 set sys/resource.h i_sysresrc
13165 : see if sys/security.h is available
13166 set sys/security.h i_syssecrt
13169 : see if this is a sys/statvfs.h system
13170 set sys/statvfs.h i_sysstatvfs
13173 : see if this is a sys/un.h system
13174 set sys/un.h i_sysun
13177 : see if this is a syswait system
13178 set sys/wait.h i_syswait
13181 : see if this is a ustat.h system
13182 set ustat.h i_ustat
13185 : see if this is an utime system
13186 set utime.h i_utime
13189 : see if this is a values.h system
13190 set values.h i_values
13193 : see if this is a vfork system
13196 set vfork.h i_vfork
13204 : see if gdbm.h is available
13209 : see if gdbm_open exists
13210 set gdbm_open d_gdbm_open
13212 case "$d_gdbm_open" in
13215 echo "We won't be including <gdbm.h>"
13225 echo "Looking for extensions..." >&4
13226 : If we are using the old config.sh, known_extensions may contain
13227 : old or inaccurate or duplicate values.
13228 known_extensions=''
13229 nonxs_extensions=''
13230 : We do not use find because it might not be available.
13231 : We do not just use MANIFEST because the user may have dropped
13232 : some additional extensions into the source tree and expect them
13235 : Function to recursively find available extensions, ignoring DynaLoader
13236 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13240 DynaLoader|dynaload) ;;
13242 if $test -f $xxx/$xxx.xs; then
13243 known_extensions="$known_extensions $1$xxx";
13244 elif $test -f $xxx/Makefile.PL; then
13245 nonxs_extensions="$nonxs_extensions $1$xxx";
13247 if $test -d $xxx -a $# -lt 10; then
13250 eval $find_extensions;
13262 eval $find_extensions
13263 set X $nonxs_extensions
13265 nonxs_extensions="$*"
13266 set X $known_extensions
13268 known_extensions="$*"
13271 : Now see which are supported on this system.
13273 for xxx in $known_extensions ; do
13277 $define) avail_ext="$avail_ext $xxx" ;;
13280 GDBM_File|gdbm_fil)
13282 $define) avail_ext="$avail_ext $xxx" ;;
13285 NDBM_File|ndbm_fil)
13287 $define) avail_ext="$avail_ext $xxx" ;;
13290 ODBM_File|odbm_fil)
13291 case "${i_dbm}${i_rpcsvcdbm}" in
13292 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13296 case "$useposix" in
13297 true|define|y) avail_ext="$avail_ext $xxx" ;;
13301 case "$useopcode" in
13302 true|define|y) avail_ext="$avail_ext $xxx" ;;
13306 case "$d_socket" in
13307 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13311 case "$usethreads" in
13312 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13316 : XXX Do we need a useipcsysv variable here
13317 case "${d_msg}${d_sem}${d_shm}" in
13318 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13321 *) avail_ext="$avail_ext $xxx"
13330 : Now see which nonxs extensions are supported on this system.
13331 : For now assume all are.
13333 for xxx in $nonxs_extensions ; do
13335 *) nonxs_ext="$nonxs_ext $xxx"
13347 A number of extensions are supplied with $package. You may choose to
13348 compile these extensions for dynamic loading (the default), compile
13349 them into the $package executable (static loading), or not include
13350 them at all. Answer "none" to include no extensions.
13351 Note that DynaLoader is always built and need not be mentioned here.
13354 case "$dynamic_ext" in
13355 '') dflt="$avail_ext" ;;
13356 *) dflt="$dynamic_ext"
13357 # Perhaps we are reusing an old out-of-date config.sh.
13360 if test X"$dynamic_ext" != X"$avail_ext"; then
13362 NOTICE: Your previous config.sh list may be incorrect.
13363 The extensions now available to you are
13365 but the default list from your previous config.sh is
13377 rp="What extensions do you wish to load dynamically?"
13380 none) dynamic_ext=' ' ;;
13381 *) dynamic_ext="$ans" ;;
13384 case "$static_ext" in
13386 : Exclude those already listed in dynamic linking
13388 for xxx in $avail_ext; do
13389 case " $dynamic_ext " in
13391 *) dflt="$dflt $xxx" ;;
13398 *) dflt="$static_ext"
13405 rp="What extensions do you wish to load statically?"
13408 none) static_ext=' ' ;;
13409 *) static_ext="$ans" ;;
13414 A number of extensions are supplied with $package. Answer "none"
13415 to include no extensions.
13416 Note that DynaLoader is always built and need not be mentioned here.
13419 case "$static_ext" in
13420 '') dflt="$avail_ext" ;;
13421 *) dflt="$static_ext"
13422 # Perhaps we are reusing an old out-of-date config.sh.
13425 if test X"$static_ext" != X"$avail_ext"; then
13427 NOTICE: Your previous config.sh list may be incorrect.
13428 The extensions now available to you are
13430 but the default list from your previous config.sh is
13439 : Exclude those that are not xs extensions
13443 rp="What extensions do you wish to include?"
13446 none) static_ext=' ' ;;
13447 *) static_ext="$ans" ;;
13452 set X $dynamic_ext $static_ext $nonxs_ext
13456 : Remove build directory name from cppstdin so it can be used from
13457 : either the present location or the final installed location.
13459 : Get out of the UU directory to get correct path name.
13461 case "$cppstdin" in
13463 echo "Stripping down cppstdin path name"
13469 : end of configuration questions
13471 echo "End of configuration questions."
13474 : back to where it started
13475 if test -d ../UU; then
13479 : configuration may be patched via a 'config.over' file
13480 if $test -f config.over; then
13483 rp='I see a config.over file. Do you wish to load it?'
13486 n*) echo "OK, I'll ignore it.";;
13488 echo "Configuration override changes have been loaded."
13493 : in case they want portability, strip down executable paths
13494 case "$d_portable" in
13497 echo "Stripping down executable paths..." >&4
13498 for file in $loclist $trylist; do
13500 eval $file=`basename $temp`
13505 : create config.sh file
13507 echo "Creating config.sh..." >&4
13508 $spitshell <<EOT >config.sh
13511 # This file was produced by running the Configure script. It holds all the
13512 # definitions figured out by Configure. Should you modify one of these values,
13513 # do not forget to propagate your changes by running "Configure -der". You may
13514 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13517 # Package name : $package
13518 # Source directory : $src
13519 # Configuration time: $cf_time
13520 # Configured by : $cf_by
13521 # Target system : $myuname
13531 Revision='$Revision'
13538 alignbytes='$alignbytes'
13539 ansi2knr='$ansi2knr'
13540 aphostname='$aphostname'
13541 apiversion='$apiversion'
13544 archlibexp='$archlibexp'
13545 archname64='$archname64'
13546 archname='$archname'
13547 archobjs='$archobjs'
13552 bincompat5005='$bincompat5005'
13556 byteorder='$byteorder'
13558 castflags='$castflags'
13561 cccdlflags='$cccdlflags'
13562 ccdlflags='$ccdlflags'
13564 ccsymbols='$ccsymbols'
13566 cf_email='$cf_email'
13571 clocktype='$clocktype'
13573 compress='$compress'
13574 contains='$contains'
13578 cpp_stuff='$cpp_stuff'
13579 cppccsymbols='$cppccsymbols'
13580 cppflags='$cppflags'
13582 cppminus='$cppminus'
13584 cppstdin='$cppstdin'
13585 cppsymbols='$cppsymbols'
13586 crosscompile='$crosscompile'
13587 cryptlib='$cryptlib'
13589 d_Gconvert='$d_Gconvert'
13590 d_PRIEldbl='$d_PRIEldbl'
13591 d_PRIFldbl='$d_PRIFldbl'
13592 d_PRIGldbl='$d_PRIGldbl'
13593 d_PRIX64='$d_PRIX64'
13594 d_PRId64='$d_PRId64'
13595 d_PRIeldbl='$d_PRIeldbl'
13596 d_PRIfldbl='$d_PRIfldbl'
13597 d_PRIgldbl='$d_PRIgldbl'
13598 d_PRIi64='$d_PRIi64'
13599 d_PRIo64='$d_PRIo64'
13600 d_PRIu64='$d_PRIu64'
13601 d_PRIx64='$d_PRIx64'
13602 d_access='$d_access'
13603 d_accessx='$d_accessx'
13605 d_archlib='$d_archlib'
13608 d_attribut='$d_attribut'
13611 d_bincompat5005='$d_bincompat5005'
13613 d_bsdgetpgrp='$d_bsdgetpgrp'
13614 d_bsdsetpgrp='$d_bsdsetpgrp'
13616 d_casti32='$d_casti32'
13617 d_castneg='$d_castneg'
13618 d_charvspr='$d_charvspr'
13620 d_chroot='$d_chroot'
13621 d_chsize='$d_chsize'
13622 d_closedir='$d_closedir'
13623 d_cmsghdr_s='$d_cmsghdr_s'
13627 d_cuserid='$d_cuserid'
13628 d_dbl_dig='$d_dbl_dig'
13629 d_difftime='$d_difftime'
13630 d_dirnamlen='$d_dirnamlen'
13631 d_dlerror='$d_dlerror'
13632 d_dlopen='$d_dlopen'
13633 d_dlsymun='$d_dlsymun'
13634 d_dosuid='$d_dosuid'
13635 d_drand48proto='$d_drand48proto'
13637 d_eaccess='$d_eaccess'
13638 d_endgrent='$d_endgrent'
13639 d_endhent='$d_endhent'
13640 d_endnent='$d_endnent'
13641 d_endpent='$d_endpent'
13642 d_endpwent='$d_endpwent'
13643 d_endsent='$d_endsent'
13644 d_endspent='$d_endspent'
13645 d_eofnblk='$d_eofnblk'
13646 d_eunice='$d_eunice'
13647 d_fchmod='$d_fchmod'
13648 d_fchown='$d_fchown'
13650 d_fd_macros='$d_fd_macros'
13651 d_fd_set='$d_fd_set'
13652 d_fds_bits='$d_fds_bits'
13653 d_fgetpos='$d_fgetpos'
13654 d_flexfnam='$d_flexfnam'
13657 d_fpathconf='$d_fpathconf'
13658 d_fpos64_t='$d_fpos64_t'
13659 d_fs_data_s='$d_fs_data_s'
13660 d_fseeko='$d_fseeko'
13661 d_fsetpos='$d_fsetpos'
13662 d_fstatfs='$d_fstatfs'
13663 d_fstatvfs='$d_fstatvfs'
13664 d_ftello='$d_ftello'
13666 d_getgrent='$d_getgrent'
13667 d_getgrps='$d_getgrps'
13668 d_gethbyaddr='$d_gethbyaddr'
13669 d_gethbyname='$d_gethbyname'
13670 d_gethent='$d_gethent'
13671 d_gethname='$d_gethname'
13672 d_gethostprotos='$d_gethostprotos'
13673 d_getlogin='$d_getlogin'
13674 d_getmnt='$d_getmnt'
13675 d_getmntent='$d_getmntent'
13676 d_getnbyaddr='$d_getnbyaddr'
13677 d_getnbyname='$d_getnbyname'
13678 d_getnent='$d_getnent'
13679 d_getnetprotos='$d_getnetprotos'
13680 d_getpbyname='$d_getpbyname'
13681 d_getpbynumber='$d_getpbynumber'
13682 d_getpent='$d_getpent'
13683 d_getpgid='$d_getpgid'
13684 d_getpgrp2='$d_getpgrp2'
13685 d_getpgrp='$d_getpgrp'
13686 d_getppid='$d_getppid'
13687 d_getprior='$d_getprior'
13688 d_getprotoprotos='$d_getprotoprotos'
13689 d_getpwent='$d_getpwent'
13690 d_getsbyname='$d_getsbyname'
13691 d_getsbyport='$d_getsbyport'
13692 d_getsent='$d_getsent'
13693 d_getservprotos='$d_getservprotos'
13694 d_getspent='$d_getspent'
13695 d_getspnam='$d_getspnam'
13696 d_gettimeod='$d_gettimeod'
13697 d_gnulibc='$d_gnulibc'
13698 d_grpasswd='$d_grpasswd'
13699 d_hasmntopt='$d_hasmntopt'
13702 d_inetaton='$d_inetaton'
13703 d_int64t='$d_int64t'
13704 d_iovec_s='$d_iovec_s'
13705 d_isascii='$d_isascii'
13706 d_killpg='$d_killpg'
13707 d_lchown='$d_lchown'
13708 d_ldbl_dig='$d_ldbl_dig'
13710 d_llseek='$d_llseek'
13711 d_locconv='$d_locconv'
13713 d_longdbl='$d_longdbl'
13714 d_longlong='$d_longlong'
13716 d_madvise='$d_madvise'
13718 d_mbstowcs='$d_mbstowcs'
13719 d_mbtowc='$d_mbtowc'
13720 d_memchr='$d_memchr'
13721 d_memcmp='$d_memcmp'
13722 d_memcpy='$d_memcpy'
13723 d_memmove='$d_memmove'
13724 d_memset='$d_memset'
13726 d_mkfifo='$d_mkfifo'
13727 d_mktime='$d_mktime'
13729 d_mprotect='$d_mprotect'
13731 d_msg_ctrunc='$d_msg_ctrunc'
13732 d_msg_dontroute='$d_msg_dontroute'
13733 d_msg_oob='$d_msg_oob'
13734 d_msg_peek='$d_msg_peek'
13735 d_msg_proxy='$d_msg_proxy'
13736 d_msgctl='$d_msgctl'
13737 d_msgget='$d_msgget'
13738 d_msghdr_s='$d_msghdr_s'
13739 d_msgrcv='$d_msgrcv'
13740 d_msgsnd='$d_msgsnd'
13742 d_munmap='$d_munmap'
13743 d_mymalloc='$d_mymalloc'
13745 d_off64_t='$d_off64_t'
13746 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13747 d_oldpthreads='$d_oldpthreads'
13748 d_oldsock='$d_oldsock'
13750 d_pathconf='$d_pathconf'
13752 d_phostname='$d_phostname'
13755 d_portable='$d_portable'
13756 d_pthread_yield='$d_pthread_yield'
13758 d_pwchange='$d_pwchange'
13759 d_pwclass='$d_pwclass'
13760 d_pwcomment='$d_pwcomment'
13761 d_pwexpire='$d_pwexpire'
13762 d_pwgecos='$d_pwgecos'
13763 d_pwpasswd='$d_pwpasswd'
13764 d_pwquota='$d_pwquota'
13765 d_readdir='$d_readdir'
13766 d_readlink='$d_readlink'
13768 d_recvmsg='$d_recvmsg'
13769 d_rename='$d_rename'
13770 d_rewinddir='$d_rewinddir'
13772 d_safebcpy='$d_safebcpy'
13773 d_safemcpy='$d_safemcpy'
13774 d_sanemcmp='$d_sanemcmp'
13775 d_sched_yield='$d_sched_yield'
13776 d_scm_rights='$d_scm_rights'
13777 d_seekdir='$d_seekdir'
13778 d_select='$d_select'
13780 d_semctl='$d_semctl'
13781 d_semctl_semid_ds='$d_semctl_semid_ds'
13782 d_semctl_semun='$d_semctl_semun'
13783 d_semget='$d_semget'
13785 d_sendmsg='$d_sendmsg'
13786 d_setegid='$d_setegid'
13787 d_seteuid='$d_seteuid'
13788 d_setgrent='$d_setgrent'
13789 d_setgrps='$d_setgrps'
13790 d_sethent='$d_sethent'
13791 d_setlinebuf='$d_setlinebuf'
13792 d_setlocale='$d_setlocale'
13793 d_setnent='$d_setnent'
13794 d_setpent='$d_setpent'
13795 d_setpgid='$d_setpgid'
13796 d_setpgrp2='$d_setpgrp2'
13797 d_setpgrp='$d_setpgrp'
13798 d_setprior='$d_setprior'
13799 d_setpwent='$d_setpwent'
13800 d_setregid='$d_setregid'
13801 d_setresgid='$d_setresgid'
13802 d_setresuid='$d_setresuid'
13803 d_setreuid='$d_setreuid'
13804 d_setrgid='$d_setrgid'
13805 d_setruid='$d_setruid'
13806 d_setsent='$d_setsent'
13807 d_setsid='$d_setsid'
13808 d_setspent='$d_setspent'
13809 d_setvbuf='$d_setvbuf'
13813 d_shmatprototype='$d_shmatprototype'
13814 d_shmctl='$d_shmctl'
13816 d_shmget='$d_shmget'
13817 d_sigaction='$d_sigaction'
13818 d_sigsetjmp='$d_sigsetjmp'
13819 d_socket='$d_socket'
13820 d_sockpair='$d_sockpair'
13822 d_statblks='$d_statblks'
13823 d_statfs_f_flags='$d_statfs_f_flags'
13824 d_statfs_s='$d_statfs_s'
13825 d_statvfs='$d_statvfs'
13826 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13827 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13828 d_stdio_stream_array='$d_stdio_stream_array'
13829 d_stdiobase='$d_stdiobase'
13830 d_stdstdio='$d_stdstdio'
13831 d_strchr='$d_strchr'
13832 d_strcoll='$d_strcoll'
13833 d_strctcpy='$d_strctcpy'
13834 d_strerrm='$d_strerrm'
13835 d_strerror='$d_strerror'
13836 d_strtod='$d_strtod'
13837 d_strtol='$d_strtol'
13838 d_strtoul='$d_strtoul'
13839 d_strtoull='$d_strtoull'
13840 d_strxfrm='$d_strxfrm'
13841 d_suidsafe='$d_suidsafe'
13842 d_symlink='$d_symlink'
13843 d_syscall='$d_syscall'
13844 d_sysconf='$d_sysconf'
13845 d_sysernlst='$d_sysernlst'
13846 d_syserrlst='$d_syserrlst'
13847 d_system='$d_system'
13848 d_tcgetpgrp='$d_tcgetpgrp'
13849 d_tcsetpgrp='$d_tcsetpgrp'
13850 d_telldir='$d_telldir'
13851 d_telldirproto='$d_telldirproto'
13854 d_truncate='$d_truncate'
13855 d_tzname='$d_tzname'
13858 d_union_semun='$d_union_semun'
13860 d_vendorbin='$d_vendorbin'
13861 d_vendorlib='$d_vendorlib'
13863 d_void_closedir='$d_void_closedir'
13864 d_voidsig='$d_voidsig'
13865 d_voidtty='$d_voidtty'
13866 d_volatile='$d_volatile'
13867 d_vprintf='$d_vprintf'
13869 d_waitpid='$d_waitpid'
13870 d_wcstombs='$d_wcstombs'
13871 d_wctomb='$d_wctomb'
13872 d_writev='$d_writev'
13875 db_hashtype='$db_hashtype'
13876 db_prefixtype='$db_prefixtype'
13877 defvoidused='$defvoidused'
13878 direntrytype='$direntrytype'
13881 doublesize='$doublesize'
13883 dynamic_ext='$dynamic_ext'
13889 eunicefix='$eunicefix'
13892 extensions='$extensions'
13893 fflushNULL='$fflushNULL'
13894 fflushall='$fflushall'
13896 firstmakefile='$firstmakefile'
13898 fpostype='$fpostype'
13899 freetype='$freetype'
13901 full_csh='$full_csh'
13902 full_sed='$full_sed'
13903 gccversion='$gccversion'
13907 groupcat='$groupcat'
13908 groupstype='$groupstype'
13911 h_sysfile='$h_sysfile'
13915 i_arpainet='$i_arpainet'
13916 i_bsdioctl='$i_bsdioctl'
13919 i_dirent='$i_dirent'
13926 i_inttypes='$i_inttypes'
13927 i_limits='$i_limits'
13928 i_locale='$i_locale'
13929 i_machcthr='$i_machcthr'
13930 i_malloc='$i_malloc'
13932 i_memory='$i_memory'
13933 i_mntent='$i_mntent'
13936 i_neterrno='$i_neterrno'
13937 i_netinettcp='$i_netinettcp'
13940 i_pthread='$i_pthread'
13942 i_rpcsvcdbm='$i_rpcsvcdbm'
13945 i_shadow='$i_shadow'
13947 i_stdarg='$i_stdarg'
13948 i_stddef='$i_stddef'
13949 i_stdlib='$i_stdlib'
13950 i_string='$i_string'
13951 i_sysaccess='$i_sysaccess'
13952 i_sysdir='$i_sysdir'
13953 i_sysfile='$i_sysfile'
13954 i_sysfilio='$i_sysfilio'
13956 i_sysioctl='$i_sysioctl'
13957 i_sysmman='$i_sysmman'
13958 i_sysmount='$i_sysmount'
13959 i_sysndir='$i_sysndir'
13960 i_sysparam='$i_sysparam'
13961 i_sysresrc='$i_sysresrc'
13962 i_syssecrt='$i_syssecrt'
13963 i_sysselct='$i_sysselct'
13964 i_syssockio='$i_syssockio'
13965 i_sysstat='$i_sysstat'
13966 i_sysstatfs='$i_sysstatfs'
13967 i_sysstatvfs='$i_sysstatvfs'
13968 i_systime='$i_systime'
13969 i_systimek='$i_systimek'
13970 i_systimes='$i_systimes'
13971 i_systypes='$i_systypes'
13972 i_sysuio='$i_sysuio'
13974 i_sysvfs='$i_sysvfs'
13975 i_syswait='$i_syswait'
13976 i_termio='$i_termio'
13977 i_termios='$i_termios'
13979 i_unistd='$i_unistd'
13982 i_values='$i_values'
13983 i_varargs='$i_varargs'
13984 i_varhdr='$i_varhdr'
13986 ignore_versioned_solibs='$ignore_versioned_solibs'
13989 installarchlib='$installarchlib'
13990 installbin='$installbin'
13991 installman1dir='$installman1dir'
13992 installman3dir='$installman3dir'
13993 installprefix='$installprefix'
13994 installprefixexp='$installprefixexp'
13995 installprivlib='$installprivlib'
13996 installscript='$installscript'
13997 installsitearch='$installsitearch'
13998 installsitebin='$installsitebin'
13999 installsitelib='$installsitelib'
14000 installstyle='$installstyle'
14001 installusrbinperl='$installusrbinperl'
14002 installvendorbin='$installvendorbin'
14003 installvendorlib='$installvendorlib'
14005 known_extensions='$known_extensions'
14009 lddlflags='$lddlflags'
14011 ldlibpthname='$ldlibpthname'
14018 libswanted='$libswanted'
14024 locincpth='$locincpth'
14025 loclibpth='$loclibpth'
14026 longdblsize='$longdblsize'
14027 longlongsize='$longlongsize'
14028 longsize='$longsize'
14032 lseeksize='$lseeksize'
14033 lseektype='$lseektype'
14037 make_set_make='$make_set_make'
14038 mallocobj='$mallocobj'
14039 mallocsrc='$mallocsrc'
14040 malloctype='$malloctype'
14042 man1direxp='$man1direxp'
14045 man3direxp='$man3direxp'
14048 mips_type='$mips_type'
14050 mmaptype='$mmaptype'
14052 modetype='$modetype'
14054 multiarch='$multiarch'
14056 myarchname='$myarchname'
14057 mydomain='$mydomain'
14058 myhostname='$myhostname'
14061 netdb_hlen_type='$netdb_hlen_type'
14062 netdb_host_type='$netdb_host_type'
14063 netdb_name_type='$netdb_name_type'
14064 netdb_net_type='$netdb_net_type'
14067 nm_so_opt='$nm_so_opt'
14068 nonxs_ext='$nonxs_ext'
14070 o_nonblock='$o_nonblock'
14072 old_pthread_create_joinable='$old_pthread_create_joinable'
14073 optimize='$optimize'
14074 orderlib='$orderlib'
14080 patchlevel='$patchlevel'
14081 path_sep='$path_sep'
14083 perladmin='$perladmin'
14084 perlpath='$perlpath'
14086 phostname='$phostname'
14089 pm_apiversion='$pm_apiversion'
14093 prefixexp='$prefixexp'
14095 privlibexp='$privlibexp'
14096 prototype='$prototype'
14098 randbits='$randbits'
14099 randfunc='$randfunc'
14100 randseedtype='$randseedtype'
14102 rd_nodata='$rd_nodata'
14106 sPRIEldbl='$sPRIEldbl'
14107 sPRIFldbl='$sPRIFldbl'
14108 sPRIGldbl='$sPRIGldbl'
14111 sPRIeldbl='$sPRIeldbl'
14112 sPRIfldbl='$sPRIfldbl'
14113 sPRIgldbl='$sPRIgldbl'
14118 sched_yield='$sched_yield'
14119 scriptdir='$scriptdir'
14120 scriptdirexp='$scriptdirexp'
14122 seedfunc='$seedfunc'
14123 selectminbits='$selectminbits'
14124 selecttype='$selecttype'
14125 sendmail='$sendmail'
14128 sharpbang='$sharpbang'
14129 shmattype='$shmattype'
14130 shortsize='$shortsize'
14133 sig_count='$sig_count'
14134 sig_name='$sig_name'
14135 sig_name_init='$sig_name_init'
14137 sig_num_init='$sig_num_init'
14138 signal_t='$signal_t'
14139 sitearch='$sitearch'
14140 sitearchexp='$sitearchexp'
14142 sitebinexp='$sitebinexp'
14144 sitelibexp='$sitelibexp'
14145 siteprefix='$siteprefix'
14146 siteprefixexp='$siteprefixexp'
14147 sizetype='$sizetype'
14152 sockethdr='$sockethdr'
14153 socketlib='$socketlib'
14155 spackage='$spackage'
14156 spitshell='$spitshell'
14159 ssizetype='$ssizetype'
14160 startperl='$startperl'
14162 static_ext='$static_ext'
14164 stdio_base='$stdio_base'
14165 stdio_bufsiz='$stdio_bufsiz'
14166 stdio_cnt='$stdio_cnt'
14167 stdio_filbuf='$stdio_filbuf'
14168 stdio_ptr='$stdio_ptr'
14169 stdio_stream_array='$stdio_stream_array'
14172 subversion='$subversion'
14179 timeincl='$timeincl'
14180 timetype='$timetype'
14189 use64bits='$use64bits'
14191 uselargefiles='$uselargefiles'
14192 uselongdouble='$uselongdouble'
14193 usemorebits='$usemorebits'
14194 usemultiplicity='$usemultiplicity'
14195 usemymalloc='$usemymalloc'
14197 useopcode='$useopcode'
14198 useperlio='$useperlio'
14199 useposix='$useposix'
14201 useshrplib='$useshrplib'
14202 usesocks='$usesocks'
14203 usethreads='$usethreads'
14204 usevendorprefix='$usevendorprefix'
14205 usevfork='$usevfork'
14208 vendorbin='$vendorbin'
14209 vendorbinexp='$vendorbinexp'
14210 vendorlib='$vendorlib'
14211 vendorlibexp='$vendorlibexp'
14212 vendorprefix='$vendorprefix'
14213 vendorprefixexp='$vendorprefixexp'
14216 voidflags='$voidflags'
14218 xs_apiversion='$xs_apiversion'
14223 : Add in command line options if available
14224 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14226 : add special variables
14227 $test -f $src/patchlevel.h && \
14228 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14229 echo "CONFIGDOTSH=true" >>config.sh
14231 : propagate old symbols
14232 if $test -f UU/config.sh; then
14233 <UU/config.sh sort | uniq >UU/oldconfig.sh
14234 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14235 sort | uniq -u >UU/oldsyms
14236 set X `cat UU/oldsyms`
14242 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14244 echo "# Variables propagated from previous config.sh file." >>config.sh
14245 for sym in `cat UU/oldsyms`; do
14246 echo " Propagating $hint variable "'$'"$sym..."
14247 eval 'tmp="$'"${sym}"'"'
14249 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14255 : Finish up by extracting the .SH files
14269 If you'd like to make any changes to the config.sh file before I begin
14270 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14273 rp="Press return or use a shell escape to edit config.sh:"
14278 *) : in case they cannot read
14279 sh 1>&4 -c "$ans";;
14284 : if this fails, just run all the .SH files by hand
14291 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14298 Now you need to generate make dependencies by running "$make depend".
14299 You might prefer to run it in background: "$make depend > makedepend.out &"
14300 It can take a while, so you might not want to run it right now.
14305 rp="Run $make depend now?"
14309 $make depend && echo "Now you must run a $make."
14312 echo "You must run '$make depend' then '$make'."
14315 elif test -f [Mm]akefile; then
14317 echo "Now you must run a $make."
14322 if $test -f Policy.sh; then
14325 If you compile $package on a different machine or from a different object
14326 directory, copy the Policy.sh file from this object directory to the
14327 new one before you run Configure -- this will help you with most of
14328 the policy defaults.
14332 if $test -f config.msg; then
14333 echo "Hmm. I also noted the following information while running:"
14335 $cat config.msg >&4
14338 $rm -f kit*isdone ark*isdone